ブランチ「label-local」をマージ
[YACASL2.git] / include / cerr.h
1 #ifndef YACASL2_CERR_H_INCLUDED
2 #define YACASL2_CERR_H_INCLUDED
3
4 #include <malloc.h>
5 #include <string.h>
6 #include <assert.h>
7
8 #ifndef ARRAYSIZE
9 #define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
10 #endif
11
12 /* エラー番号 */
13 extern int cerrno;
14
15 /* エラーメッセージ */
16 extern char *cerrmsg;
17
18 /* エラーコードリスト */
19 typedef struct {
20     int num;
21     char *msg;
22 } CERRARRAY;
23
24 /* エラー番号とエラーメッセージを設定 */
25 void setcerr(int num, const char *val);
26
27 /* エラー番号からメッセージを返す */
28 char *getcerrmsg(int num);
29
30 /* エラーを解放する */
31 void freecerr();
32 #endif