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;
192 currentVoice->
pi = currentVoice->
prev->
pi;
197 currentVoice->
pi =
pi;
202 currentVoice->
typ = t;
265 while (p != currentVoice)
291 while (p != currentVoice)
324 while (p != currentVoice)
329 currentVoice->
fptr=0;
361 if (currentVoice!=
NULL)
397 fclose(currentVoice->
files);
406 return currentVoice==
NULL;
423 char *ss=strrchr(anf,
'\n');
434 int mrc=
si_min(len_s,79)-1;
445 && (strncmp(anf,
";return();",10)!=0)
458 fwrite(anf,1,len_s,stdout);
463 while(fgetc(stdin)!=
'\n');
487 && (currentVoice->
pi!=
NULL)
490 sdb(currentVoice, anf, len_s);
502 if (currentVoice!=
NULL)
505 && (currentVoice->
buffer[currentVoice->
fptr]!=
'\0'))
509 long startfptr=currentVoice->
fptr;
510 long tmp_ptr=currentVoice->
fptr;
515 b[
i]=currentVoice->
buffer[tmp_ptr];
520 else if (c==
'}')
break;
532 if(currentVoice->
buffer[tmp_ptr]==
'\0')
break;
534 currentVoice->
fptr=tmp_ptr;
540 char *anf=currentVoice->
buffer;
541 const char *ss=strchr(anf,
'\n');
543 if (ss==
NULL) len=strlen(anf);
545 char *s=(
char *)
omAlloc(len+2);
546 strncpy(s,anf,len+2);
552 (currentVoice->
buffer[startfptr-1]==
'\n'))
554 char *anf=currentVoice->
buffer+startfptr;
555 const char *ss=strchr(anf,
'\n');
557 if (ss==
NULL) len=strlen(anf);
559 char *s=(
char *)
omAlloc(len+2);
560 strncpy(s,anf,len+2);
567 currentVoice->
fptr++;
573 currentVoice->
fptr=0;
587 &(currentVoice->
buffer[offset]),
597 currentVoice->
files);
650 Werror(
"premature end of file while reading %s",err);
659 #define STDIN_FILENO 0 668 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)