10 #ifndef STANDALONE_PARSER
32 #define fePutChar(c) fputc((unsigned char)(c),stdout)
39 #define INITIAL_PRINT_BUFFER 24*1024L
43 #define MAX_FILE_BUFFER 4*4096
66 if ((currentVoice!=
NULL)
83 PrintS(
"-- called from ? --\n");
85 Print(
"-- called from %s --\n",s);
99 if (currentVoice !=
NULL)
102 currentVoice->
next=
p;
129 currentVoice->
Next();
134 if (strcmp(fname,
"STDIN") == 0)
136 currentVoice->
files = stdin;
171 currentVoice->
Next();
181 strcat(currentVoice->
filename,
"::");
183 currentVoice->
pi =
pi;
188 currentVoice->
pi = currentVoice->
prev->
pi;
192 currentVoice->
typ = t;
255 while (p != currentVoice)
281 while (p != currentVoice)
314 while (p != currentVoice)
319 currentVoice->
fptr=0;
351 if (currentVoice!=
NULL)
377 fclose(currentVoice->
files);
396 return currentVoice==
NULL;
413 char *ss=strrchr(anf,
'\n');
424 int mrc=
si_min(len_s,79)-1;
435 && (strncmp(anf,
";return();",10)!=0)
448 fwrite(anf,1,len_s,stdout);
453 while(fgetc(stdin)!=
'\n');
463 && (currentVoice->
pi!=
NULL)
466 sdb(currentVoice, anf, len_s);
478 if (currentVoice!=
NULL)
481 && (currentVoice->
buffer[currentVoice->
fptr]!=
'\0'))
485 long startfptr=currentVoice->
fptr;
486 long tmp_ptr=currentVoice->
fptr;
491 b[
i]=currentVoice->
buffer[tmp_ptr];
496 else if (c==
'}')
break;
508 if(currentVoice->
buffer[tmp_ptr]==
'\0')
break;
510 currentVoice->
fptr=tmp_ptr;
516 char *anf=currentVoice->
buffer;
517 const char *ss=strchr(anf,
'\n');
519 if (ss==
NULL) len=strlen(anf);
521 char *s=(
char *)
omAlloc(len+2);
522 strncpy(s,anf,len+2);
528 (currentVoice->
buffer[startfptr-1]==
'\n'))
530 char *anf=currentVoice->
buffer+startfptr;
531 const char *ss=strchr(anf,
'\n');
533 if (ss==
NULL) len=strlen(anf);
535 char *s=(
char *)
omAlloc(len+2);
536 strncpy(s,anf,len+2);
543 currentVoice->
fptr++;
549 currentVoice->
fptr=0;
563 &(currentVoice->
buffer[offset]),
572 currentVoice->
files);
624 Werror(
"premature end of file while reading %s",err);
633 #define STDIN_FILENO 0
642 p->
files=freopen(
"/dev/tty",
"r",stdin);
const CanonicalForm int s
#define TRACE_SHOW_LINENO
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
static void feShowPrompt(void)
static int si_min(const int a, const int b)
size_t omSizeOfAddr(const void *addr)
BOOLEAN exitBuffer(feBufferTypes typ)
void sdb(Voice *currentVoice, const char *currLine, int len)
Voice * feInitStdin(Voice *pp)
static int fePrintEcho(char *anf, char *)
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
void PrintS(const char *s)
#define INITIAL_PRINT_BUFFER
void myyoldbuffer(void *oldb)
void newBuffer(char *s, feBufferTypes t, procinfo *pi, int lineno)
BOOLEAN newFile(char *fname, FILE *f)
void omMarkAsStaticAddr(void *addr)
int feReadLine(char *b, int l)
void Werror(const char *fmt,...)
BOOLEAN contBuffer(feBufferTypes typ)