forked from rsta2/circle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathp9error.cpp
More file actions
49 lines (38 loc) · 792 Bytes
/
p9error.cpp
File metadata and controls
49 lines (38 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "p9error.h"
#include "p9proc.h"
#include "p9util.h"
#include <assert.h>
void error (const char *str)
{
print ("%s\n", str);
up->errstr = str;
error_stack_t *s = get_error_stack ();
assert (s != 0);
assert (s->stackptr < ERROR_STACK_SIZE);
s->stackptr++;
longjmp (s->stack[s->stackptr-1], 1);
}
jmp_buf *pusherror (void)
{
error_stack_t *s = get_error_stack ();
assert (s != 0);
return &s->stack[--s->stackptr];
}
void nexterror (void)
{
error_stack_t *s = get_error_stack ();
assert (s != 0);
assert (s->stackptr < ERROR_STACK_SIZE);
s->stackptr++;
longjmp (s->stack[s->stackptr-1], 1);
}
void poperror (void)
{
error_stack_t *s = get_error_stack ();
assert (s != 0);
assert (s->stackptr < ERROR_STACK_SIZE);
s->stackptr++;
}
void okay (int status)
{
}