print H "\n";
print H "enum directives {\n";
- print H " D_NONE";
+ print H " D_none,\n";
+ print H " D_unknown";
foreach $d (@directives) {
print H ",\n D_\U$d";
}
print H "\n};\n\n";
printf H "extern const char * const directives[%d];\n",
- scalar(@directives)+1;
+ scalar(@directives)+2;
print H "enum directives find_directive(const char *token);\n\n";
print H "#endif /* NASM_DIRECTIVES_H */\n";
} elsif ($output eq 'c') {
print C "\n";
printf C "const char * const directives[%d] = {\n",
- scalar(@directives)+1;
+ scalar(@directives)+2;
+ print C " NULL,\n";
print C " NULL";
foreach $d (@directives) {
print C ",\n \"$d\"";
print C "\n";
printf C " ix = hash1[k1 & 0x%x] + hash2[k2 & 0x%x];\n", $n-1, $n-1;
printf C " if (ix >= %d)\n", scalar(@directives);
- print C " return D_NONE;\n";
+ print C " return D_unknown;\n";
print C "\n";
print C " ix++;\n"; # Account for D_NONE
print C " if (nasm_stricmp(token, directives[ix]))\n";
- print C " return D_NONE;\n";
+ print C " return D_unknown;\n";
print C "\n";
print C " return ix;\n";
print C "}\n";
/* it should be enclosed in [ ] */
if (*buf != '[')
- return D_NONE;
+ return D_none;
q = strchr(buf, ']');
if (!q)
- return D_NONE;
+ return D_none;
/* stip off the comments */
p = strchr(buf, ';');
if (p) {
if (p < q) /* ouch! somwhere inside */
- return D_NONE;
+ return D_none;
*p = '\0';
}
p = nasm_skip_spaces(++buf);
q = nasm_skip_word(p);
if (!q)
- return D_NONE; /* sigh... no value there */
+ return D_none; /* sigh... no value there */
*q = '\0';
*directive = p;