41#include "EST_cmd_line.h"
42#include "EST_cutils.h"
43#include "EST_Pathname.h"
46static void siod_lisp_vars(
void);
47static void siod_load_default_files(
void);
89 int heap_size = DEFAULT_HEAP_SIZE;
94 "Summary: Scheme in one Defun interpreter, file arguments are loaded\n"+
95 "-b Run in batch mode (no interaction)\n"+
96 "--batch Run in batch mode (no interaction)\n"+
97 "-i Run in interactive mode (default)\n"+
99 " Run in interactive mode (default)\n"+
100 "--pipe Run in pipe mode, reading commands from\n"+
101 " stdin, but no prompt or return values\n"+
102 " are printed (default if stdin not a tty)\n"+
103 "-heap <int> {512000}\n"+
104 " Initial size of heap\n",
107 if (
al.present(
"-heap"))
108 heap_size =
al.ival(
"-heap");
111 if ((
al.present(
"-i")) || (
al.present(
"--interactive")))
116 else if ((
al.present(
"--pipe")))
121 else if ((
al.present(
"-b")) || (
al.present(
"--batch")))
137 siod_init(heap_size);
142 siod_prog_name =
"siod";
147 siod_load_default_files();
149 for (p=
files.head(); p != 0; p=p->next())
153 else if (
files(p).matches(make_regex(
"^(.*")))
156 l = read_from_string(
files(p));
166 siod_print_welcome(
EST_String::cat(
"Modified for ", est_name,
" v", est_tools_version));
173static void siod_load_default_files(
void)
185 if (access((
const char *)
initfile,R_OK) == 0)
191static void siod_lisp_vars(
void)
200 siod_set_lval(
"libdir",strintern(
lib));
204 siod_set_lval(
"datadir",strintern(
lib));
206 if (!
strcmp(est_ostype,
""))
207 siod_set_lval(
"*ostype*",rintern(est_ostype));
208 siod_set_lval(
"est_version",
209 strcons(
strlen(est_tools_version),est_tools_version));
213 int nbits = split(est_tools_version, bits, 4,
sep);
216 major = bits[0].Int();
218 minor = bits[1].Int();
222 siod_set_lval(
"est_version_number",
232 putenv(wstrdup(
"PATH=" + path));
234 siod_set_lval(
"*modules*",NIL);
static EST_String cat(const EST_String s1, const EST_String s2=Empty, const EST_String s3=Empty, const EST_String s4=Empty, const EST_String s5=Empty, const EST_String s6=Empty, const EST_String s7=Empty, const EST_String s8=Empty, const EST_String s9=Empty)