-/* エラー番号とエラーメッセージを設定する */
-void setcerr(int num, const char *str)
+/**
+ * 現在のエラー
+ */
+CERR *cerr;
+
+/**
+ * エラーリスト
+ */
+CERRLIST *cerrlist;
+
+/**
+ * エラーリストを作成または追加する
+ */
+bool addcerrlist(int newerrc, CERR newerrv[])
+{
+ int i;
+ CERRLIST *p, *q;
+
+ assert(newerrc > 0 && newerrv != NULL);
+ if(cerrlist == NULL) {
+ p = cerrlist = malloc_chk(sizeof(CERRLIST), "cerrlist");
+ } else {
+ for(p = cerrlist; p != NULL; p = p->next) {
+ q = p;
+ }
+ p = q->next = malloc_chk(sizeof(CERRLIST), "cerrlist.next");
+ }
+ for(i = 0; i < newerrc; i++) {
+ p->cerr = &newerrv[i];
+ q = p;
+ p = p->next = malloc_chk(sizeof(CERRLIST), "cerrlist.next");
+ }
+ q->next = NULL;
+ return true;
+}
+
+/**
+ * エラーリストを表示する
+ */
+void printcerrlist()