- CMDCODETAB *np;
- unsigned hashval;
- int i;
-
- for(i = 0; i < cmdcodesize; i++) {
- np = (CMDCODETAB *) malloc(sizeof(*np));
- if(np == NULL) {
- setcerr(122, NULL); /* cannot create hash table */
- return false;
- }
- /* ハッシュ値の生成 */
- hashval = hash_cmdtype((&cmdcodearray[i])->cmd, (&cmdcodearray[i])->type);
- /* ハッシュ表に値を追加 */
- np->next = cmdtype_code[hashval];
- cmdtype_code[hashval] = np;
- np->cca = &(cmdcodearray[i]);
- }
- return true;
-}
-
-/* 命令と命令タイプからハッシュ値を生成する */
-unsigned hash_cmdtype(const char *cmd, CMDTYPE type) {