-/* エラー番号とエラーメッセージを設定する */
-void setcerr(int num, const char *str)
+CERR *cerr = NULL;
+
+CERRLIST *cerrlist = NULL;
+
+void addcerrlist(int cerrc, CERR cerrv[])
+{
+ CERRLIST *stat = NULL;
+ CERRLIST *p = NULL;
+
+ assert(cerrc > 0 && cerrv != NULL);
+ for(int i = 0; i < cerrc; i++) {
+ if(p == NULL) {
+ stat = p = malloc_chk(sizeof(CERRLIST), "cerrlist");
+ } else {
+ p = p->next = malloc_chk(sizeof(CERRLIST), "cerrlist->next");
+ }
+ p->cerr = &cerrv[i];
+ p->next = NULL;
+ }
+ p->next = cerrlist;
+ cerrlist = stat;
+}
+
+void printcerrlist()