1 #include <../../nmodlconf.h> 8 #if MAC && TARGET_API_MAC_CARBON 29 for(i=0; i < size; ++
i) {
31 if (c == EOF || c == 26 || c == 4) {
55 diag(
"Line too long:", buf);
64 if (
ctp == (
char *) 0 || *
ctp ==
'\0') {
69 if (
ctp == (
char *) 0) {
91 diag(
"internal error in unGetc",
"");
103 while ((c =
Getc()) != EOF && c !=
'\n') {
110 }
else if (c == EOF) {
113 diag(
"internal error in Gets()",
"");
143 for (q = q1->
next; q != q2; q = q->
next) {
177 #if MAC && TARGET_API_MAC_CARBON 178 SIOUXSettings.autocloseonquit =
true;
179 RunApplicationEventLoop();
188 return (
Symbol *)((
q)->element);
195 return (
char *)((
q)->element);
202 return (
Item *)((
q)->element);
209 return (
Item **)((
q)->element);
216 return (
List *)((
q)->element);
221 Fprintf(stderr,
"Internal error in file \"%s\", line %d\n", file, line);
222 Fprintf(stderr,
"The offending item has the structure:\n");
242 for (cp = prefix + strlen(prefix); cp+1 !=
prefix; --cp) {
248 return (prefix[0] !=
'\0');
257 if(fname[0] ==
'/') {
258 return fopen(fname,
"r");
269 if (err)
fprintf(stderr,
"Couldn't open: %s\n",
buf);
271 f =
fopen(fname,
"r");
279 if (err)
fprintf(stderr,
"Couldn't open: %s\n", fname);
282 dirs =
getenv(
"MODL_INCLUDE");
287 for (dirs = colon; *dirs; dirs = colon){
288 for(; *colon; ++colon) {
298 f =
fopen(buf2,
"r");
303 if (err)
fprintf(stderr,
"Couldn't open: %s\n", buf2);
316 strcpy(fname,
STR(q) + 1);
317 fname[strlen(fname)-1] =
'\0';
329 diag(
"Couldn't open ", fname);
331 fprintf(stderr,
"INCLUDEing %s\n", fname);
340 remove(filestack->
prev);
353 return (filestack->
next == filestack);
char finname[NRN_BUFSIZE]
char * Fgets(char *buf, int size, FILE *f)
Item * _ITM(Item *q, char *file, int line)
char finname[NRN_BUFSIZE]
static FILE * include_open(char *fname, int err)
static char inlinebuf[600]
Item * lappendsym(List *list, Symbol *sym)
sprintf(buf," if (secondorder) {\ " int _i;\" " for(_i=0;_i< %d;++_i) {\" " _p[_slist%d[_i]]+=dt *_p[_dlist%d[_i]];\" " }}\", numeqn, listnum, listnum)
List * _LST(Item *q, char *file, int line)
char * _STR(Item *q, char *file, int line)
static int getprefix(char *prefix, char *s)
static struct prefix prefix[]
static int file_stack_empty()
static const char * fname(const char *name)
Symbol * _SYM(Item *q, char *file, int line)
char * getenv(const char *s)
void internal_error(Item *q, char *file, int line)
fprintf(stderr, "Don't know the location of params at %p\, pp)
char * emalloc(unsigned n)
struct FileStackItem FileStackItem
void diag(char *s1, char *s2)
Item ** _ITMA(Item *q, char *file, int line)
static char line[MAXLINE]
void include_file(Item *q)