diff options
author | dos-reis <gdr@axiomatics.org> | 2010-11-28 23:57:59 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2010-11-28 23:57:59 +0000 |
commit | dea4d75caba3466cdc8595d333c31a5393912c69 (patch) | |
tree | afd0a96708651f2d6b483705f85c80588e7906c0 /src/driver/utils.h | |
parent | a53a740a2a1cb6cbfa58cc79caedd4e947ff1ca0 (diff) | |
download | open-axiom-dea4d75caba3466cdc8595d333c31a5393912c69.tar.gz |
(all-lisp): Require all-driver.
* driver/utils.c: Tidy.
* driver/utils.h: Likewise.
* sman/sman.c: Likewise.
Diffstat (limited to 'src/driver/utils.h')
-rw-r--r-- | src/driver/utils.h | 93 |
1 files changed, 53 insertions, 40 deletions
diff --git a/src/driver/utils.h b/src/driver/utils.h index 4f973973..70b5bb85 100644 --- a/src/driver/utils.h +++ b/src/driver/utils.h @@ -42,47 +42,60 @@ # include <windows.h> #endif -namespace OpenAxiom { - -/* A list of drivers for OpenAxiom. */ -enum Driver { - unknown_driver, /* unknown driver */ - null_driver, /* do nothing */ - config_driver, /* print out configuration information */ - sman_driver, /* start Superman as master process */ - core_driver, /* start the core system as master process */ - script_driver, /* start the core system in script mode. */ - compiler_driver, /* start the core system in compiler mode. */ - execute_driver /* Execute a command. */ -}; - -/* A list of runtime support systems for OpenAxiom. */ -enum Runtime { - unknown_runtime, - gcl_runtime, /* GCL-based runtime */ - sbcl_runtime, /* SBCL-based runtime */ - clisp_runtime, /* CLISP-based runtime */ - ecl_runtime, /* ECL-based runtime */ - clozure_runtime, /* Clozure CL-based runtime */ - bemol_runtime /* Bemol-based runtime */ -}; - -/* A description of external command to be executed. */ -struct Command { - Process core; /* arguments for actual executable. */ - char** rt_argv; /* arguments to the base RT, if any. */ - int rt_argc; /* number of such arguments. */ - const char* root_dir; /* path to the OpenAxiom system. */ -}; - -const char* get_systemdir(int argc, char*[]); -const char* make_path_for(const char*, Driver); - -int execute_core(const Command*, Driver); -void build_rts_options(Command*, Driver); - -Driver preprocess_arguments(Command*, int, char**); +#include <vector> +namespace OpenAxiom { + // A list of drivers for OpenAxiom. + enum Driver { + unknown_driver, // unknown driver + null_driver, // do nothing + config_driver, // print out configuration information + sman_driver, // start Superman as master process + core_driver, // start the core system as master process + script_driver, // start the core system in script mode. + compiler_driver, // start the core system in compiler mode. + execute_driver, // Execute a command. + alien_driver // Alien driver. + }; + + // A list of runtime support systems for OpenAxiom. + enum Runtime { + unknown_runtime, + gcl_runtime, // GCL-based runtime + sbcl_runtime, // SBCL-based runtime + clisp_runtime, // CLISP-based runtime + ecl_runtime, // ECL-based runtime + clozure_runtime, // Clozure CL-based runtime + bemol_runtime // Bemol-based runtime + }; + + // Command line arguments. + // When non empty, this vector really is of length one more than + // what size() reports, as it is always null-terminated, to comply + // with POSIX-style operating system requirements. + struct Arguments : std::vector<char*> { + explicit Arguments(int n = 0); + int size() const; + void allocate(int); + char* const* data() const; + }; + + // A description of external command to be executed. + struct Command { + Process core; // arguments for actual executable. + Arguments rt_args; // arguments to the base RT, if any. + const char* root_dir; // path to the OpenAxiom system. + const char* exec_path; // path to the program to execute. + Command(); + }; + + const char* get_systemdir(int argc, char*[]); + const char* make_path_for(const char*, Driver); + + int execute_core(const Command*, Driver); + void build_rts_options(Command*, Driver); + + Driver preprocess_arguments(Command*, int, char**); } #endif /* OPENAXIOM_UTILS_INCLUDED */ |