X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcerr.c;h=6ab5e566dbfdad13c93559b48efc745c6643fb18;hb=b7b124bade56862ddc6e61bae0a16051f46c7f36;hp=36b33a4dce81b1db45ca5a34bf4867e431d16547;hpb=d1f82970bf7d41db2fea11b08cd8e308f6cb8138;p=YACASL2.git diff --git a/src/cerr.c b/src/cerr.c index 36b33a4..6ab5e56 100644 --- a/src/cerr.c +++ b/src/cerr.c @@ -25,7 +25,7 @@ CERR *cerr; CERRLIST *cerrlist; /** - * エラーリストを作成・追加する + * エラーリストを作成または追加する */ bool addcerrlist(int newerrc, CERR newerrv[]) { @@ -51,6 +51,22 @@ bool addcerrlist(int newerrc, CERR newerrv[]) return true; } +/** + * エラーリストを表示する + */ +void printcerrlist() +{ + CERRLIST *p; + + if(cerrlist == NULL) { + puts("error list is null."); + } else { + for(p = cerrlist; p != NULL; p = p->next) { + printf("%d: %s\n", p->cerr->num, p->cerr->msg); + } + } +} + /** * 現在のエラーを設定する */