From 505e209e5bc209a9ee7518da0f70124d25572789 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Wed, 30 Sep 2009 04:40:18 +0000 Subject: * sman/sman.c (fix_env): Simplify. (exec_command_env): Lose second parameter. (fork_Axiom): Take a new parameter. (start_the_Axiom): Adjust. (main): Likewise. * interp/int-top.boot (printFirstPrompt?): New. (SpadInterpretStream): Use it. * driver/utils.h (openaxiom_allocate_command_argv): Declare. * driver/utils.c (openaxiom_allocate_command_argv): Define. * driver/Makefile.in (open-axiom$(EXEEXT)): Link statically. --- src/driver/Makefile.in | 2 +- src/driver/main.c | 1 + src/driver/utils.c | 10 ++++++++++ src/driver/utils.h | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/driver') diff --git a/src/driver/Makefile.in b/src/driver/Makefile.in index 0141482e..4859c829 100644 --- a/src/driver/Makefile.in +++ b/src/driver/Makefile.in @@ -61,7 +61,7 @@ utils.lo: utils.h main.lo: utils.h open-axiom$(EXEEXT): $(open_axiom_objects) - $(LINK) -o $@ $(open_axiom_objects) $(open_axiom_LDADD) + $(LINK) -all-static -o $@ $(open_axiom_objects) $(open_axiom_LDADD) mostlyclean-local: @rm -f $(axiom_objects) diff --git a/src/driver/main.c b/src/driver/main.c index 14762979..a943a95f 100644 --- a/src/driver/main.c +++ b/src/driver/main.c @@ -43,6 +43,7 @@ #include #include +#include "cfuns.h" #include "utils.h" #define OPENAXIOM_GLOBAL_ENV "AXIOM" diff --git a/src/driver/utils.c b/src/driver/utils.c index 1bf2eccc..1653641f 100644 --- a/src/driver/utils.c +++ b/src/driver/utils.c @@ -403,3 +403,13 @@ openaxiom_execute_core(const openaxiom_command* command, return -1; #endif /* __WIN32__ */ } + + +/* Allocate a vector for ARGC command line arguments. */ +void +openaxiom_allocate_command_argv(openaxiom_command* cmd, int argc) +{ + cmd->core_argc = argc; + cmd->core_argv = (char**) malloc((1 + argc) * sizeof (char*)); + cmd->core_argv[argc] = NULL; +} diff --git a/src/driver/utils.h b/src/driver/utils.h index 30f94912..3f706a88 100644 --- a/src/driver/utils.h +++ b/src/driver/utils.h @@ -80,4 +80,6 @@ void openaxiom_build_rts_options(openaxiom_command*, openaxiom_driver); openaxiom_driver openaxiom_preprocess_arguments(openaxiom_command*, int, char**); +void openaxiom_allocate_command_argv(openaxiom_command*, int); + #endif /* OPENAXIOM_UTILS_INCLUDED */ -- cgit v1.2.3