1 #ifndef YACASL2_CERR_H_INCLUDED
2 #define YACASL2_CERR_H_INCLUDED
11 #define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
14 /* mallocを実行し、メモリを確保できない場合は */
16 void *malloc_chk(size_t size, char *tag);
18 /* malloc_chkを実行してメモリを確保してから、 */
20 char *strdup_chk(const char *s, char *tag);
25 char *msg; /* エラーメッセージ */
32 typedef struct _CERRLIST {
33 struct _CERRLIST *next;
37 extern CERRLIST *cerrlist;
40 CERRSTRSIZE = 10, /* エラーメッセージ中に挿入できる文字列のサイズ */
41 CERRMSGSIZE = 70, /* エラーメッセージのサイズ */
45 bool addcerrlist(int cerrc, CERR cerrv[]);
47 /* エラー番号とエラーメッセージを設定 */
48 void setcerr(int num, const char *str);
51 char *getcerrmsg(int num);