version 1.11, 1994/09/08 17:20:09
|
version 1.12, 1994/09/12 19:00:34
|
Line 14
|
Line 14
|
#include <stdlib.h> |
#include <stdlib.h> |
#include "forth.h" |
#include "forth.h" |
#include "io.h" |
#include "io.h" |
#include "getopt.h" |
#ifdef USE_GETOPT |
|
# include "getopt.h" |
|
#else |
|
extern int getopt (argc, argv, optstring); |
|
|
|
extern char *optarg; |
|
extern int optind, opterr; |
|
#endif |
|
|
#ifndef DEFAULTPATH |
#ifndef DEFAULTPATH |
# define DEFAULTPATH "/usr/local/lib/gforth:." |
# define DEFAULTPATH "/usr/local/lib/gforth:." |
Line 184 int main(int argc, char **argv, char **e
|
Line 191 int main(int argc, char **argv, char **e
|
char *path, *path1; |
char *path, *path1; |
char *imagename="gforth.fi"; |
char *imagename="gforth.fi"; |
FILE *image_file; |
FILE *image_file; |
int c; |
int c, retvalue; |
|
|
#if defined(i386) && defined(ALIGNMENT_CHECK) |
#if defined(i386) && defined(ALIGNMENT_CHECK) |
/* turn on alignment checks on the 486. |
/* turn on alignment checks on the 486. |
Line 198 int main(int argc, char **argv, char **e
|
Line 205 int main(int argc, char **argv, char **e
|
opterr=0; |
opterr=0; |
while (1) { |
while (1) { |
int option_index=0; |
int option_index=0; |
|
#ifdef USE_GETOPT |
static struct option opts[] = { |
static struct option opts[] = { |
{"image-file", required_argument, NULL, 'i'}, |
{"image-file", required_argument, NULL, 'i'}, |
{"dictionary-size", required_argument, NULL, 'm'}, |
{"dictionary-size", required_argument, NULL, 'm'}, |
Line 211 int main(int argc, char **argv, char **e
|
Line 219 int main(int argc, char **argv, char **e
|
}; |
}; |
|
|
c = getopt_long(argc, argv, "+drfl", opts, &option_index); |
c = getopt_long(argc, argv, "+drfl", opts, &option_index); |
|
#else |
|
c = getopt(argc, argv, "imdrflp"); |
|
#endif |
|
|
if (c==EOF) |
if (c==EOF) |
break; |
break; |
if (c=='?') { |
if (c=='?') { |
Line 255 int main(int argc, char **argv, char **e
|
Line 267 int main(int argc, char **argv, char **e
|
for (i=0; i<environ[0]; i++) |
for (i=0; i<environ[0]; i++) |
printf("%s\n", ((char **)(environ[1]))[i]); |
printf("%s\n", ((char **)(environ[1]))[i]); |
*/ |
*/ |
exit(go_forth(loader(image_file),3, environ)); |
retvalue=go_forth(loader(image_file),3,environ); |
|
deprep_terminal(); |
|
exit(retvalue); |
} |
} |
} |
} |