5 int compare_code(const void *a, const void *b)
7 const CMDCODEARRAY ca = **(const CMDCODEARRAY **)a;
8 const CMDCODEARRAY cb = **(const CMDCODEARRAY **)b;
10 if((diff = strcmp(ca.cmd, cb.cmd)) == 0) {
11 return ca.type - cb.type;
17 /* 命令と命令タイプがキーのハッシュ表を表示する */
18 void print_cmdtype_code()
23 ar = malloc(sizeof(*ar) * cmdcodesize);
24 for(i = 0; i < cmdtabsize; i++) {
31 qsort(ar, cmdcodesize, sizeof(*ar), (int (*)(const void*, const void*))compare_code);
32 for(i = 0; i < cmdcodesize; i++) {
33 fprintf(stdout, "%s\t0%02o\t#%04X\n", ar[i]->cmd, ar[i]->type, ar[i]->code);
39 create_cmdtype_code();
43 printf("\terror - %d: %s\n", cerrno, cerrmsg);