summaryrefslogtreecommitdiff
path: root/src/runtime/imain.r
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/imain.r')
-rw-r--r--src/runtime/imain.r113
1 files changed, 4 insertions, 109 deletions
diff --git a/src/runtime/imain.r b/src/runtime/imain.r
index 424a4f6..7286666 100644
--- a/src/runtime/imain.r
+++ b/src/runtime/imain.r
@@ -1,4 +1,3 @@
-#if !COMPILER
/*
* File: imain.r
* Interpreter main program, argument handling, and such.
@@ -28,36 +27,6 @@ int iconx(int argc, char *argv[]) {
static word istart[4];
static int mterm = Op_Quit;
- #ifdef MultiThread
- /*
- * Look for MultiThread programming environment in which to execute
- * this program, specified by MTENV environment variable.
- */
- {
- char *p;
- char **new_argv;
- int i, j = 1, k = 1;
- if ((p = getenv("MTENV")) != NULL) {
- for(i=0;p[i];i++)
- if (p[i] == ' ')
- j++;
- new_argv = malloc((argc + j) * sizeof(char *));
- new_argv[0] = argv[0];
- for (i=0; p[i]; ) {
- new_argv[k++] = p+i;
- while (p[i] && (p[i] != ' '))
- i++;
- if (p[i] == ' ')
- p[i++] = '\0';
- }
- for(i=1;i<argc;i++)
- new_argv[k++] = argv[i];
- argc += j;
- argv = new_argv;
- }
- }
- #endif /* MultiThread */
-
ipc.opnd = NULL;
#ifdef LoadFunc
@@ -69,7 +38,7 @@ int iconx(int argc, char *argv[]) {
p = getenv("FPATH");
q = relfile(argv[0], "/..");
sprintf(buf, "FPATH=%s %s", (p ? p : "."), (q ? q : "."));
- putenv(buf);
+ putenv(salloc(buf));
}
#endif /* LoadFunc */
@@ -191,54 +160,8 @@ int argc;
char **argv;
int *ip;
{
-
- #ifdef TallyOpt
- extern int tallyopt;
- #endif /* TallyOpt */
-
*ip = 0; /* number of arguments processed */
- #if MSWIN
- /*
- * if we didn't start with iconx.exe, backup one
- * so that our icode filename is argv[1].
- */
- {
- char tmp[256], *t2, *basename, *ext;
- int len = 0;
- strcpy(tmp, argv[0]);
- for (t2 = tmp; *t2; t2++) {
- switch (*t2) {
- case ':':
- case '/':
- case '\\':
- basename = t2 + 1;
- ext = NULL;
- break;
- case '.':
- ext = t2;
- break;
- default:
- *t2 = tolower(*t2);
- break;
- }
- }
- /* If present, cut the ".exe" extension. */
- if (ext != NULL && !strcmp(ext, ".exe"))
- *ext = 0;
-
- /*
- * if argv[0] is not a reference to our interpreter, take it as the
- * name of the icode file, and back up for it.
- */
- if (strcmp(basename, "iconx")) {
- argv--;
- argc++;
- (*ip)--;
- }
- }
- #endif /* MSWIN */
-
/*
* Handle command line options.
*/
@@ -246,20 +169,12 @@ int *ip;
switch ( *(argv[1]+1) ) {
- #ifdef TallyOpt
- /*
- * Set tallying flag if -T option given
- */
- case 'T':
- tallyopt = 1;
- break;
- #endif /* TallyOpt */
-
/*
* Announce version on stderr if -V is given.
*/
case 'V':
- fprintf(stderr, "%s (%s, %s)\n", Version, Config, __DATE__);
+ fprintf(stderr, "%s (%s %d/%d, %s)\n",
+ Version, Config, IntBits, WordBits, __DATE__);
if (!argv[2])
exit(0);
break;
@@ -276,26 +191,13 @@ int *ip;
* resolve - perform various fix-ups on the data read from the icode
* file.
*/
-#ifdef MultiThread
- void resolve(pstate)
- struct progstate *pstate;
-#else /* MultiThread */
- void resolve()
-#endif /* MultiThread */
+void resolve()
{
register word i, j;
register struct b_proc *pp;
register dptr dp;
extern int Omkrec();
- #ifdef MultiThread
- register struct progstate *savedstate;
- #endif /* MultiThread */
-
- #ifdef MultiThread
- savedstate = curpstate;
- if (pstate) curpstate = pstate;
- #endif /* MultiThread */
/*
* Relocate the names of the global variables.
@@ -372,13 +274,6 @@ int *ip;
/*
* Relocate the names of the fields.
*/
-
for (dp = fnames; dp < efnames; dp++)
StrLoc(*dp) = strcons + (uword)StrLoc(*dp);
-
- #ifdef MultiThread
- curpstate = savedstate;
- #endif /* MultiThread */
}
-
-#endif /* !COMPILER */