ユニットテストで、コマンド表の内容をハッシュ表のまま出力するものと、ソートして出力するものに分離
[YACASL2.git] / test / unit / print_code_type_hash / print_code_type.c
1 #include "casl2.h"
2 #include "cerr.h"
3
4 /* 命令コードがキーのハッシュ表を表示する */
5 void print_code_type()
6 {
7     int i;
8     CMDCODETAB *np;
9     for(i = 0; i < cmdcodesize; i++){
10         for(np = code_type[i]; np != NULL; np = np->next) {
11             fprintf(stdout, "(%2d) - #%04X\t0%02o\t%s\n", i, np->cca->code, np->cca->type, np->cca->cmd);
12         }
13     }
14 }
15
16 int main()
17 {
18     create_code_type();
19     print_code_type();
20     free_code_type();
21     if(cerrno != 0) {
22         printf("\terror - %d: %s\n", cerrno, cerrmsg);
23         freecerr();
24         exit(-1);
25     }
26     return 0;
27 }