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