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) {
62 if (
ctp == (
char*) 0 || *
ctp ==
'\0') {
67 if (
ctp == (
char*) 0) {
88 diag(
"internal error in unGetc",
"");
98 while ((
c =
Getc()) != EOF &&
c !=
'\n') {
105 }
else if (
c == EOF) {
108 diag(
"internal error in Gets()",
"");
114 void diag(
char* s1,
char* s2) {
137 for (
q = q1->
next;
q != q2;
q =
q->next) {
138 switch (
q->itemtype) {
171 #if MAC && TARGET_API_MAC_CARBON
172 SIOUXSettings.autocloseonquit =
true;
173 RunApplicationEventLoop();
182 return (
Symbol*) ((
q)->element);
189 return (
char*) ((
q)->element);
193 if (!
q ||
q->itemtype !=
ITEM) {
196 return (
Item*) ((
q)->element);
203 return (
Item**) ((
q)->element);
207 if (!
q ||
q->itemtype !=
LIST) {
210 return (
List*) ((
q)->element);
214 Fprintf(stderr,
"Internal error in file \"%s\", line %d\n", file,
line);
215 Fprintf(stderr,
"The offending item has the structure:\n");
240 return (
prefix[0] !=
'\0');
248 if (
fname[0] ==
'/') {
275 dirs =
getenv(
"MODL_INCLUDE");
280 for (dirs = colon; *dirs; dirs = colon) {
281 for (; *colon; ++colon) {
291 f =
fopen(buf2,
"r");
297 fprintf(stderr,
"Couldn't open: %s\n", buf2);
sprintf(buf, " if (secondorder) {\n" " int _i;\n" " for (_i = 0; _i < %d; ++_i) {\n" " _p[_slist%d[_i]] += dt*_p[_dlist%d[_i]];\n" " }}\n", numeqn, listnum, listnum)
char finname[NRN_BUFSIZE]
static char line[MAXLINE]
char * getenv(const char *s)
List * _LST(Item *q, char *file, int line)
void internal_error(Item *q, char *file, int line)
static int getprefix(char *prefix, char *s)
struct FileStackItem FileStackItem
static char inlinebuf[600]
Item * _ITM(Item *q, char *file, int line)
Symbol * _SYM(Item *q, char *file, int line)
static FILE * include_open(char *fname, int err)
char * Fgets(char *buf, int size, FILE *f)
void diag(char *s1, char *s2)
char * _STR(Item *q, char *file, int line)
Item ** _ITMA(Item *q, char *file, int line)
static int file_stack_empty()
void include_file(Item *q)
char * emalloc(unsigned n)
Item * lappendsym(List *list, Symbol *sym)
static struct prefix prefix[]
static double remove(void *v)
char finname[NRN_BUFSIZE]
static const char * fname(const char *name)