X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fcerr.h;h=a4d12462f8560e8261c1936799d8543d3780400d;hb=2b714046a6f26036d03ae2d5e8b410cf83b4526c;hp=878fd859ddff64eab2e0413e396af008bd2b9d2b;hpb=2f889a87ef4e11467f71ea3c03676a8d88cccd7b;p=YACASL2.git diff --git a/include/cerr.h b/include/cerr.h index 878fd85..a4d1246 100644 --- a/include/cerr.h +++ b/include/cerr.h @@ -1,9 +1,11 @@ #ifndef YACASL2_CERR_H_INCLUDED #define YACASL2_CERR_H_INCLUDED +#include #include #include #include +#include #ifndef ARRAYSIZE #define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0])) @@ -15,21 +17,31 @@ extern int cerrno; /* エラーメッセージ */ extern char *cerrmsg; -/* エラーコードリスト */ +/* エラーコード配列 */ typedef struct { int num; char *msg; } CERRARRAY; +/* エラーコードリスト */ +typedef struct _CERRLIST { + struct _CERRLIST *next; + CERRARRAY *err; +} CERRLIST; + /* エラーメッセージ */ -extern CERRARRAY cerr[]; +extern CERRLIST *cerr; enum { - MSGSIZE = 60, + CERRSTRSIZE = 10, /* エラーメッセージ中に挿入できる文字列のサイズ */ + CERRMSGSIZE = 70, /* エラーメッセージのサイズ */ }; +/* エラーを追加する */ +bool addcerrlist(int cerrc, CERRARRAY cerrv[]); + /* エラー番号とエラーメッセージを設定 */ -void setcerr(int num, const char *val); +void setcerr(int num, const char *str); /* エラー番号からメッセージを返す */ char *getcerrmsg(int num);