7 /* エラー番号とエラーメッセージを設定する */
8 void setcerr(int num, const char *str)
10 assert(cerr != NULL && num > 0);
13 cerrmsg = malloc(CERRMSGSIZE + 1);
14 if(str != NULL && strlen(str) < 10) {
15 sprintf(cerrmsg, "%s: %s", str, getcerrmsg(cerrno));
17 strcpy(cerrmsg, getcerrmsg(cerrno));
22 char *getcerrmsg(int num)
24 assert(cerr != NULL && num > 0);
29 if((ptr = &cerr[i++])->num == num) {
32 } while(ptr->num > 0);
33 return "unkown error";
41 if(strlen(cerrmsg) > 0) {