X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=test%2Funit%2Fprint_code_type_hash%2Fprint_code_type.c;fp=test%2Funit%2Fprint_code_type_hash%2Fprint_code_type.c;h=c081888b81aa35e359948b4210354022f645505f;hb=00d4ba02d732a0ff14c402bddc14c713c9b392d8;hp=0000000000000000000000000000000000000000;hpb=bc0df14951032b54c9da8b21068aac4a6a834289;p=YACASL2.git diff --git a/test/unit/print_code_type_hash/print_code_type.c b/test/unit/print_code_type_hash/print_code_type.c new file mode 100644 index 0000000..c081888 --- /dev/null +++ b/test/unit/print_code_type_hash/print_code_type.c @@ -0,0 +1,27 @@ +#include "casl2.h" +#include "cerr.h" + +/* 命令コードがキーのハッシュ表を表示する */ +void print_code_type() +{ + int i; + CMDCODETAB *np; + for(i = 0; i < cmdcodesize; i++){ + for(np = code_type[i]; np != NULL; np = np->next) { + fprintf(stdout, "(%2d) - #%04X\t0%02o\t%s\n", i, np->cca->code, np->cca->type, np->cca->cmd); + } + } +} + +int main() +{ + create_code_type(); + print_code_type(); + free_code_type(); + if(cerrno != 0) { + printf("\terror - %d: %s\n", cerrno, cerrmsg); + freecerr(); + exit(-1); + } + return 0; +}