1 #ifndef YACASL2_CERR_H_INCLUDED
2 #define YACASL2_CERR_H_INCLUDED
3
4 #include <stdbool.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <assert.h>
9 #include <stdbool.h>
10 #include "cmem.h"
11
12
13
14
15 typedef struct _CERR {
16 int num;
17 char *msg;
18 } CERR;
19
20
21
22
23 extern CERR *cerr;
24
25
26
27
28 typedef struct _CERRLIST {
29 struct _CERRLIST *next;
30 CERR *cerr;
31 } CERRLIST;
32
33
34
35
36 extern CERRLIST *cerrlist;
37
38 enum {
39 CERRSTRSIZE = 10,
40 CERRMSGSIZE = 70,
41 };
42
43
44
45
46
47
48 void cerr_init();
49
50
51
52
53
54
55
56
57
58 void addcerrlist(int cerrc, CERR cerrv[]);
59
60
61
62
63
64
65 void printcerrlist();
66
67
68
69
70
71
72
73
74
75 void setcerr(int num, const char *str);
76
77
78
79
80
81
82
83
84 char *getcerrmsg(int num);
85
86
87
88
89
90
91 void freecerr();
92 #endif