summaryrefslogtreecommitdiff
path: root/muse
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2019-02-26 14:07:58 -0800
committerOri Bernstein <ori@markovcorp.com>2019-02-26 14:07:58 -0800
commitd87c0959d85b40fcf60b9c6dd0a2f2111f888b55 (patch)
tree3d9ee97668eda3d4e2656ac069f8575250edc7e2 /muse
parent02201160614e5f25a7a73d86ed26a1f90fa4f5bb (diff)
downloadmc-d87c0959d85b40fcf60b9c6dd0a2f2111f888b55.tar.gz
Accept that `file` isn't a node.
Shrink node sizes, simplify code a bit.
Diffstat (limited to 'muse')
-rw-r--r--muse/muse.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/muse/muse.c b/muse/muse.c
index 967801c..6ed5450 100644
--- a/muse/muse.c
+++ b/muse/muse.c
@@ -16,7 +16,7 @@
#include "../config.h"
/* FIXME: move into one place...? */
-Node *file;
+File file;
char *outfile;
char *objdir;
char *pkgname;
@@ -45,7 +45,7 @@ mergeuse(char *path)
FILE *f;
Stab *st;
- st = file->file.globls;
+ st = file.globls;
f = fopen(path, "r");
if (!f) {
fprintf(stderr, "couldn't open %s\n", path);
@@ -100,10 +100,11 @@ main(int argc, char **argv)
}
/* read and parse the file */
- file = mkfile("internal");
- file->file.globls = mkstab(0);
- updatens(file->file.globls, pkgname);
- tyinit(file->file.globls);
+ file.ns = mkht(strhash, streq);
+ file.globls = mkstab(0);
+ lappend(&file.files, &file.nfiles, "internal");
+ updatens(file.globls, pkgname);
+ tyinit(file.globls);
for (i = 0; i < ctx.nargs; i++)
mergeuse(ctx.args[i]);
loaduses();
@@ -113,7 +114,7 @@ main(int argc, char **argv)
/* generate the usefile */
f = fopen(outfile, "w");
- writeuse(f, file);
+ writeuse(f);
fclose(f);
return 0;
}