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)
380 &&(currentVoice->
files!=stdin))
399 fclose(currentVoice->
files);
408 return currentVoice==
NULL;
425 char *ss=strrchr(anf,
'\n');
436 int mrc=
si_min(len_s,79)-1;
447 && (strncmp(anf,
";return();",10)!=0)
460 fwrite(anf,1,len_s,stdout);
465 while(fgetc(stdin)!=
'\n');
489 && (currentVoice->
pi!=
NULL)
492 sdb(currentVoice, anf, len_s);
504 if (currentVoice!=
NULL)
507 && (currentVoice->
buffer[currentVoice->
fptr]!=
'\0'))
511 long startfptr=currentVoice->
fptr;
512 long tmp_ptr=currentVoice->
fptr;
517 b[
i]=currentVoice->
buffer[tmp_ptr];
522 else if (c==
'}')
break;
534 if(currentVoice->
buffer[tmp_ptr]==
'\0')
break;
536 currentVoice->
fptr=tmp_ptr;
542 char *anf=currentVoice->
buffer;
543 const char *ss=strchr(anf,
'\n');
545 if (ss==
NULL) len=strlen(anf);
547 char *s=(
char *)
omAlloc(len+2);
548 strncpy(s,anf,len+2);
554 (currentVoice->
buffer[startfptr-1]==
'\n'))
556 char *anf=currentVoice->
buffer+startfptr;
557 const char *ss=strchr(anf,
'\n');
559 if (ss==
NULL) len=strlen(anf);
561 char *s=(
char *)
omAlloc(len+2);
562 strncpy(s,anf,len+2);
569 currentVoice->
fptr++;
575 currentVoice->
fptr=0;
589 &(currentVoice->
buffer[offset]),
599 currentVoice->
files);
658 Werror(
"premature end of file while reading %s",err);
667 #define STDIN_FILENO 0 676 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)
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)