X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=src%2Fstruct.c;h=f0f705b8bbf601ff91591391b4cea8deb4d5cc1e;hp=981409abac882756651159f25ed76a70b6c3ee34;hb=b8b0bb2a7b5ef20cdbee5f555c5846dfc1c7f981;hpb=03e322484530da78d796401413d9f5f493d95345 diff --git a/src/struct.c b/src/struct.c index 981409a..f0f705b 100644 --- a/src/struct.c +++ b/src/struct.c @@ -209,10 +209,27 @@ const void (*getcmdptr(WORD code)) return ptr; } +/** + * 命令コードから命令のタイプを返す + */ +CMDTYPE getcmdtype(WORD code) +{ + CMDTAB *t; + CMDTYPE type = 0; + + for(t = code_cmdtype[hash_code(code)]; t != NULL; t = t->next) { + if(code == t->cmd->code) { + type = t->cmd->type; + break; + } + } + return type; +} + /** * 命令コードから命令の名前を返す */ -char (*getcmdname(WORD code)) +char *getcmdname(WORD code) { CMDTAB *t; char *cmd = NULL;