summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmacros.pl46
-rw-r--r--preproc.c6
-rw-r--r--tables.h2
3 files changed, 27 insertions, 27 deletions
diff --git a/macros.pl b/macros.pl
index b3084fc..cfddb6a 100755
--- a/macros.pl
+++ b/macros.pl
@@ -31,11 +31,11 @@ print OUT "#include \"hashtbl.h\"\n";
print OUT "\n";
print OUT "const char * const nasm_stdmac[] = {";
-my $nmodule = 0;
-my @module_list = ();
-my %module_number = ();
-my %module_index = ();
-my $module;
+my $npkg = 0;
+my @pkg_list = ();
+my %pkg_number = ();
+my %pkg_index = ();
+my $pkg;
foreach $fname ( @ARGV ) {
open(INPUT,$fname) or die "unable to open $fname\n";
@@ -47,15 +47,15 @@ foreach $fname ( @ARGV ) {
$tasm_count = $index;
print OUT " /* End of TASM macros */\n";
} elsif (m/^USE:\s*(\S+)\s*$/) {
- $module = $1;
- if (defined($module_number{$module})) {
- die "$0: $fname: duplicate module: $module\n";
+ $pkg = $1;
+ if (defined($pkg_number{$pkg})) {
+ die "$0: $fname: duplicate package: $pkg\n";
}
printf OUT " /* %4d */ NULL,\n", $index++;
- print OUT " /* %use $module */\n";
- push(@module_list, $module);
- $module_number{$module} = $nmodule++;
- $module_index{$module} = $index;
+ print OUT " /* %use $pkg */\n";
+ push(@pkg_list, $pkg);
+ $pkg_number{$pkg} = $npkg++;
+ $pkg_index{$pkg} = $index;
} elsif (m/^\s*((\s*([^\"\';\s]+|\"[^\"]*\"|\'[^\']*\'))*)\s*(;.*)?$/) {
my $s1, $s2, $pd, $ws;
$s1 = $1;
@@ -89,24 +89,24 @@ printf OUT " /* %4d */ NULL\n};\n\n", $index++;
print OUT "const char * const * const nasm_stdmac_after_tasm = ",
"&nasm_stdmac[$tasm_count];\n\n";
-my @hashinfo = gen_perfect_hash(\%module_number);
+my @hashinfo = gen_perfect_hash(\%pkg_number);
if (!@hashinfo) {
die "$0: no hash found\n";
}
# Paranoia...
-verify_hash_table(\%module_number, \@hashinfo);
+verify_hash_table(\%pkg_number, \@hashinfo);
my ($n, $sv, $g) = @hashinfo;
die if ($n & ($n-1));
-print OUT "const char * const *nasm_stdmac_find_module(const char *module)\n";
+print OUT "const char * const *nasm_stdmac_find_package(const char *package)\n";
print OUT "{\n";
print OUT " static const struct {\n";
-print OUT " const char *module;\n";
+print OUT " const char *package;\n";
print OUT " const char * const *macros;\n";
-print OUT " } modules[$nmodule] = {\n";
-foreach $module (@module_list) {
+print OUT " } packages[$npkg] = {\n";
+foreach $pkg (@pkg_list) {
printf OUT " { \"%s\", nasm_stdmac+%d },\n",
- $module, $module_index{$module};
+ $pkg, $pkg_index{$pkg};
}
print OUT " };\n";
@@ -136,19 +136,19 @@ print OUT " uint64_t crc;\n";
print OUT " uint16_t ix;\n";
print OUT "\n";
-printf OUT " crc = crc64i(UINT64_C(0x%08x%08x), module);\n",
+printf OUT " crc = crc64i(UINT64_C(0x%08x%08x), package);\n",
$$sv[0], $$sv[1];
print OUT " k1 = (uint32_t)crc;\n";
print OUT " k2 = (uint32_t)(crc >> 32);\n";
print OUT "\n";
printf OUT " ix = hash1[k1 & 0x%x] + hash2[k2 & 0x%x];\n", $n-1, $n-1;
-printf OUT " if (ix >= %d)\n", scalar(@module_list);
+printf OUT " if (ix >= %d)\n", scalar(@pkg_list);
print OUT " return NULL;\n";
print OUT "\n";
-print OUT " if (nasm_stricmp(modules[ix].module, module))\n";
+print OUT " if (nasm_stricmp(packages[ix].package, package))\n";
print OUT " return NULL;\n";
print OUT "\n";
-print OUT " return modules[ix].macros;\n";
+print OUT " return packages[ix].macros;\n";
print OUT "}\n";
close(OUT);
diff --git a/preproc.c b/preproc.c
index ed1c324..7ea031e 100644
--- a/preproc.c
+++ b/preproc.c
@@ -2158,7 +2158,7 @@ static int do_directive(Token * tline)
if (!t || (t->type != TOK_STRING &&
t->type != TOK_INTERNAL_STRING &&
t->type != TOK_ID)) {
- error(ERR_NONFATAL, "`%%use' expects a module name");
+ error(ERR_NONFATAL, "`%%use' expects a package name");
free_tlist(origline);
return DIRECTIVE_FOUND; /* but we did _something_ */
}
@@ -2168,9 +2168,9 @@ static int do_directive(Token * tline)
p = t->text;
if (t->type == TOK_STRING)
nasm_unquote(p, NULL);
- stdmacpos = nasm_stdmac_find_module(p);
+ stdmacpos = nasm_stdmac_find_package(p);
if (!stdmacpos)
- error(ERR_NONFATAL, "unknown `%%use' module: %s", p);
+ error(ERR_NONFATAL, "unknown `%%use' package: %s", p);
free_tlist(origline);
return DIRECTIVE_FOUND;
diff --git a/tables.h b/tables.h
index f4d9a77..c9a4c72 100644
--- a/tables.h
+++ b/tables.h
@@ -16,7 +16,7 @@
/* macros.c */
extern const char * const nasm_stdmac[];
extern const char * const * const nasm_stdmac_after_tasm;
-const char * const *nasm_stdmac_find_module(const char *);
+const char * const *nasm_stdmac_find_package(const char *);
/* --- From insns.dat via insns.pl: --- */