From 13dbef06b132937b11de3d7e7ce852c7ea77932d Mon Sep 17 00:00:00 2001 From: bdc Date: Mon, 9 Jun 1997 01:47:19 +0000 Subject: [PATCH] factored out arg parsing --- Makefile.in | 2 +- main.c | 82 +-------------------------------------------- process_args.c | 80 +++++++++++++++++++++++++++++++++++++++++++ scsh/process_args.c | 6 ++++ 4 files changed, 88 insertions(+), 82 deletions(-) create mode 100644 process_args.c create mode 100644 scsh/process_args.c diff --git a/Makefile.in b/Makefile.in index 9583cf0..336a4e6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -128,7 +128,7 @@ SCSHOBJS = \ # scsh/dbm.o scsh/dbm1.o OBJS = unix.o dynload.o prescheme.o extension.o scheme48vm.o \ - $(CIGOBJS) $(SCSHVMHACKS) $(SCSHOBJS) + process_args.o $(CIGOBJS) $(SCSHVMHACKS) $(SCSHOBJS) # Sources: diff --git a/main.c b/main.c index bf1e1e7..9edb6d6 100644 --- a/main.c +++ b/main.c @@ -35,29 +35,11 @@ #endif /* STATIC_AREAS */ -#define streq(a,b) (strcmp((a),(b))==0) - char *object_file; /* specified via a command line argument */ char *reloc_file; /* dynamic loading will set this */ -static char *prog_name; +char *prog_name; -static void usage(void) -{ - fprintf(stderr, "Usage: %s [meta-arg] [vm-option+] [end-option scheme-args]\n" - "meta-arg: \\