| #include <stdlib.h> |
#include <stdlib.h> |
| #include "forth.h" |
#include "forth.h" |
| #include "io.h" |
#include "io.h" |
| #ifdef USE_GETOPT |
|
| # include "getopt.h" |
# include "getopt.h" |
| #else |
|
| extern int getopt (int , char * const [], const char *); |
|
| |
|
| extern char *optarg; |
|
| extern int optind, opterr; |
|
| #endif |
|
| |
|
| #ifndef DEFAULTPATH |
#ifndef DEFAULTPATH |
| # define DEFAULTPATH "/usr/local/lib/gforth:." |
# define DEFAULTPATH "/usr/local/lib/gforth:." |
| 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'}, |
| }; |
}; |
| |
|
| c = getopt_long(argc, argv, "+i:m:d:r:f:l:p:", opts, &option_index); |
c = getopt_long(argc, argv, "+i:m:d:r:f:l:p:", opts, &option_index); |
| #else |
|
| c = getopt(argc, argv, "+i:m:d:r:f:l:p:"); |
|
| #endif |
|
| |
|
| if (c==EOF) |
if (c==EOF) |
| break; |
break; |