projects
/
YACASL2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shutdown関数の追加
[YACASL2.git]
/
include
/
cerr.h
diff --git
a/include/cerr.h
b/include/cerr.h
index
586ab4d
..
a4d1246
100644
(file)
--- a/
include/cerr.h
+++ b/
include/cerr.h
@@
-1,9
+1,11
@@
#ifndef YACASL2_CERR_H_INCLUDED
#define YACASL2_CERR_H_INCLUDED
#ifndef YACASL2_CERR_H_INCLUDED
#define YACASL2_CERR_H_INCLUDED
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#include <stdbool.h>
#ifndef ARRAYSIZE
#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
#ifndef ARRAYSIZE
#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
@@
-15,18
+17,31
@@
extern int cerrno;
/* エラーメッセージ */
extern char *cerrmsg;
/* エラーメッセージ */
extern char *cerrmsg;
-/* エラーコード
リスト
*/
+/* エラーコード
配列
*/
typedef struct {
int num;
char *msg;
} CERRARRAY;
typedef struct {
int num;
char *msg;
} CERRARRAY;
+/* エラーコードリスト */
+typedef struct _CERRLIST {
+ struct _CERRLIST *next;
+ CERRARRAY *err;
+} CERRLIST;
+
+/* エラーメッセージ */
+extern CERRLIST *cerr;
+
enum {
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);
/* エラー番号からメッセージを返す */
char *getcerrmsg(int num);