10 #ifndef STANDALONE_PARSER
33 #define fePutChar(c) fputc((unsigned char)(c),stdout)
41 #define INITIAL_PRINT_BUFFER 24*1024L
45 #define MAX_FILE_BUFFER 4*4096
68 if ((currentVoice!=
NULL)
85 PrintS(
"-- called from ? --\n");
87 Print(
"-- called from %s --\n",s);
101 if (currentVoice !=
NULL)
104 currentVoice->
next=
p;
131 currentVoice->
Next();
136 if (strcmp(fname,
"STDIN") == 0)
138 currentVoice->
files = stdin;
173 currentVoice->
Next();
183 strcat(currentVoice->
filename,
"::");
185 currentVoice->
pi =
pi;
190 currentVoice->
pi = currentVoice->
prev->
pi;
194 currentVoice->
typ = t;
257 while (p != currentVoice)
283 while (p != currentVoice)
316 while (p != currentVoice)
321 currentVoice->
fptr=0;
353 if (currentVoice!=
NULL)
379 fclose(currentVoice->
files);
398 return currentVoice==
NULL;
415 char *ss=strrchr(anf,
'\n');
426 int mrc=
si_min(len_s,79)-1;
437 && (strncmp(anf,
";return();",10)!=0)
450 fwrite(anf,1,len_s,stdout);
455 while(fgetc(stdin)!=
'\n');
479 && (currentVoice->
pi!=
NULL)
482 sdb(currentVoice, anf, len_s);
494 if (currentVoice!=
NULL)
497 && (currentVoice->
buffer[currentVoice->
fptr]!=
'\0'))
501 long startfptr=currentVoice->
fptr;
502 long tmp_ptr=currentVoice->
fptr;
507 b[
i]=currentVoice->
buffer[tmp_ptr];
512 else if (c==
'}')
break;
524 if(currentVoice->
buffer[tmp_ptr]==
'\0')
break;
526 currentVoice->
fptr=tmp_ptr;
532 char *anf=currentVoice->
buffer;
533 const char *ss=strchr(anf,
'\n');
535 if (ss==
NULL) len=strlen(anf);
537 char *s=(
char *)
omAlloc(len+2);
538 strncpy(s,anf,len+2);
544 (currentVoice->
buffer[startfptr-1]==
'\n'))
546 char *anf=currentVoice->
buffer+startfptr;
547 const char *ss=strchr(anf,
'\n');
549 if (ss==
NULL) len=strlen(anf);
551 char *s=(
char *)
omAlloc(len+2);
552 strncpy(s,anf,len+2);
559 currentVoice->
fptr++;
565 currentVoice->
fptr=0;
579 &(currentVoice->
buffer[offset]),
588 currentVoice->
files);
640 Werror(
"premature end of file while reading %s",err);
649 #define STDIN_FILENO 0
658 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)