summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-07-25 11:24:32 -0400
committerOri Bernstein <ori@eigenstate.org>2012-07-25 11:24:32 -0400
commit62f197bc9c8a7d3493596e55462d7eb9bbe21ae1 (patch)
tree762e80dcf75aa7c8b3b5ea4fc6c1fa40ced3ac8e /util
parente27b298f60cf74d25179ceb09326735b724e8d6e (diff)
downloadmc-62f197bc9c8a7d3493596e55462d7eb9bbe21ae1.tar.gz
Load the stab into the exports file.
Diffstat (limited to 'util')
-rw-r--r--util/muse.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/util/muse.c b/util/muse.c
index 3ae823c..ecb6e9b 100644
--- a/util/muse.c
+++ b/util/muse.c
@@ -27,7 +27,7 @@ static void usage(char *prog)
printf("\t-m\ttreat the inputs as usefiles and merge them\n");
printf("\t-I path\tAdd 'path' to use search path\n");
printf("\t-d\tPrint debug dumps\n");
- printf("\t-o\tOutput to outfile\n");
+ printf("\t-o out\tOutput to outfile\n");
printf("\t-s\tShow the contents of usefiles `inputs`\n");
}
@@ -37,7 +37,7 @@ static void dumpuse(char *path)
FILE *f;
globls = file->file.globls;
- readuse(file, globls);
+ loaduse(f, globls);
f = fopen(path, "r");
dumpstab(globls, stdout);
fclose(f);
@@ -57,16 +57,19 @@ static void genuse(char *path)
if (!outfile)
die("need output file name right now. FIX THIS.");
f = fopen(outfile, "w");
- writeuse(file, f);
+ writeuse(f, file);
fclose(f);
}
static void mergeuse(char *path)
{
- Stab *globls;
+ FILE *f;
+ Stab *st;
- globls = file->file.globls;
- readuse(file, globls);
+ st = file->file.exports;
+ f = fopen(path, "r");
+ loaduse(f, st);
+ fclose(f);
}
int main(int argc, char **argv)
@@ -75,7 +78,7 @@ int main(int argc, char **argv)
int opt;
int i;
- while ((opt = getopt(argc, argv, "d::ho:I:")) != -1) {
+ while ((opt = getopt(argc, argv, "d::hmo:I:")) != -1) {
switch (opt) {
case 'h':
usage(argv[0]);
@@ -115,7 +118,7 @@ int main(int argc, char **argv)
}
if (merge) {
f = fopen(outfile, "w");
- writeuse(file, f);
+ writeuse(f, file);
fclose(f);
}