コマンドごとに異なるエラー表を設定するよう内部仕様変更
[YACASL2.git] / include / cerr.h
1 #ifndef YACASL2_CERR_H_INCLUDED
2 #define YACASL2_CERR_H_INCLUDED
3
4 #include <stdlib.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 extern CERRARRAY cerr[];
26
27 enum {
28     MSGSIZE = 60,
29 };
30
31 /* エラー番号とエラーメッセージを設定 */
32 void setcerr(int num, const char *val);
33
34 /* エラー番号からメッセージを返す */
35 char *getcerrmsg(int num);
36
37 /* エラーを解放する */
38 void freecerr();
39 #endif