X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=include%2Fcerr.h;h=a4d12462f8560e8261c1936799d8543d3780400d;hp=586ab4d5b3502a2d7ca7a74fc2aa331ad0cec2da;hb=755c5127855b776d1a4260f05afc95640045f29d;hpb=d2638d2dd5f2437cabbf752c89042ca49347a248 diff --git a/include/cerr.h b/include/cerr.h index 586ab4d..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,18 +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 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);