変数名の整理
[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 < cmdtabsize; i++){
9         np = cmdtype_code[i];
10         while(np != NULL) {
11             fprintf(stdout, "(%2d) - %s\t0%02o\t#%04X\n",
12                     i, np->cmdtypecode->cmd, np->cmdtypecode->type, np->cmdtypecode->code);
13             np = np->next;
14         }
15     }
16 }
17
18 int main(){
19     /* エラーの初期化 */
20     cerr = malloc_chk(sizeof(CERR), "cerr");
21     /* ハッシュ表作成 */
22     create_cmdtype_code();
23     /* ハッシュ表表示 */
24     print_cmdtype_code();
25     /* ハッシュ表解放 */
26     free_cmdtype_code();
27     /* エラーの表示 */
28     if(cerr->num != 0) {
29         printf("\terror - %d: %s\n", cerr->num, cerr->msg);
30         freecerr();
31         exit(-1);
32     }
33     return 0;
34 }