コマンドハッシュ表を複数回作成していた構造バグを修正
[YACASL2.git] / include / cerr.h
1 #ifndef YACASL2_CERR_H_INCLUDED
2 #define YACASL2_CERR_H_INCLUDED
3
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <string.h>
7 #include <assert.h>
8
9 #ifndef ARRAYSIZE
10 #define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
11 #endif
12
13 /* エラー番号 */
14 extern int cerrno;
15
16 /* エラーメッセージ */
17 extern char *cerrmsg;
18
19 /* エラーコードリスト */
20 typedef struct {
21     int num;
22     char *msg;
23 } CERRARRAY;
24
25 /* エラーメッセージ */
26 extern CERRARRAY cerr[];
27
28 enum {
29     CERRSTRSIZE = 10,    /* エラーメッセージ中に挿入できる文字列のサイズ */
30     CERRMSGSIZE = 70,    /* エラーメッセージのサイズ */
31 };
32
33 /* エラー番号とエラーメッセージを設定 */
34 void setcerr(int num, const char *str);
35
36 /* エラー番号からメッセージを返す */
37 char *getcerrmsg(int num);
38
39 /* エラーを解放する */
40 void freecerr();
41 #endif