YACAL2: CASL2処理系
[YACASL2.git] / test / utest / getcmdtype / getcmdtype.c
1 #include <stdio.h>
2 #include "casl2.h"
3
4 int main(){
5     int i;
6     CMDTYPE type;
7     WORD codelist[] = {
8         0xFFFF, 0x0001,
9         0x0, 0x1000, 0x1100, 0x1200, 0x1400,
10         0x2000, 0x2100, 0x2200, 0x2300, 0x2400,
11         0x2500, 0x2600, 0x2700, 0x3000, 0x3100,
12         0x3200, 0x3400, 0x3500, 0x3600, 0x4000,
13         0x4100, 0x4400, 0x4500, 0x5000, 0x5100,
14         0x5200, 0x5300, 0x6100, 0x6200, 0x6300,
15         0x6400, 0x6500, 0x6600, 0x7000, 0x7100,
16         0x8000, 0xF000, 0x8100
17     };
18     create_code_type();
19     for(i = 0; i < sizeof(codelist)/sizeof(codelist[0]); i++) {
20         type = getcmdtype(codelist[i]);
21         printf("0x%04x ---> 0%02o\n", codelist[i], type);
22         if(cerrno != 0) {
23             printf("\t%s", cerrmsg);
24             freecerr();
25         }
26     }
27     free_code_type();
28     return 0;
29 }