7 /* エラー番号とエラーメッセージを設定する */
8 void setcerr(int num, const char *val)
10 assert(cerr != NULL && num > 0);
13 cerrmsg = malloc(MSGSIZE + 1);
16 strcat(cerrmsg, ": ");
17 strcat(cerrmsg, getcerrmsg(cerrno));
19 strcpy(cerrmsg, getcerrmsg(cerrno));
24 char *getcerrmsg(int num)
26 assert(cerr != NULL && num > 0);
31 if((ptr = &cerr[i++])->num == num) {
34 } while(ptr->num > 0);
35 return "unkown error";
43 if(strlen(cerrmsg) > 0) {