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 /* callocを実行し、メモリを確保できない場合は */
20 void *calloc_chk(size_t nmemb, size_t size, char *tag);
22 /* malloc_chkを実行してメモリを確保してから、 */
24 char *strdup_chk(const char *s, char *tag);
29 char *msg; /* エラーメッセージ */
36 typedef struct _CERRLIST {
37 struct _CERRLIST *next;
41 extern CERRLIST *cerrlist;
44 CERRSTRSIZE = 10, /* エラーメッセージ中に挿入できる文字列のサイズ */
45 CERRMSGSIZE = 70, /* エラーメッセージのサイズ */
52 bool addcerrlist(int cerrc, CERR cerrv[]);
54 /* エラー番号とエラーメッセージを設定 */
55 void setcerr(int num, const char *str);
58 char *getcerrmsg(int num);