10 #ifndef STANDALONE_PARSER 28 #define fePutChar(c) fputc((unsigned char)(c),stdout) 38 #define MAX_FILE_BUFFER 4*4096 59 if ((currentVoice!=
NULL)
76 PrintS(
"-- called from ? --\n");
78 Print(
"-- called from %s --\n",s);
92 if (currentVoice !=
NULL)
122 currentVoice->
Next();
127 if (strcmp(fname,
"STDIN") == 0)
129 currentVoice->
files = stdin;
159 currentVoice->
Next();
169 strcat(currentVoice->
filename,
"::");
171 currentVoice->
pi =
pi;
178 currentVoice->
pi = currentVoice->
prev->
pi;
183 currentVoice->
pi =
pi;
188 currentVoice->
typ = t;
251 while (p != currentVoice)
277 while (p != currentVoice)
310 while (p != currentVoice)
315 currentVoice->
fptr=0;
347 if (currentVoice!=
NULL)
366 &&(currentVoice->
files!=stdin))
385 fclose(currentVoice->
files);
394 return currentVoice==
NULL;
411 char *ss=strrchr(anf,
'\n');
422 int mrc=
si_min(len_s,79)-1;
433 && (strncmp(anf,
";return();",10)!=0)
446 fwrite(anf,1,len_s,stdout);
451 while(fgetc(stdin)!=
'\n');
475 && (currentVoice->
pi!=
NULL)
478 sdb(currentVoice, anf, len_s);
490 if (currentVoice!=
NULL)
493 && (currentVoice->
buffer[currentVoice->
fptr]!=
'\0'))
497 long startfptr=currentVoice->
fptr;
498 long tmp_ptr=currentVoice->
fptr;
503 b[
i]=currentVoice->
buffer[tmp_ptr];
508 else if (c==
'}')
break;
520 if(currentVoice->
buffer[tmp_ptr]==
'\0')
break;
522 currentVoice->
fptr=tmp_ptr;
532 const char *ss=strchr(anf,
'\n');
533 if (ss==
NULL) len=strlen(anf);
538 (currentVoice->
buffer[startfptr-1]==
'\n'))
540 anf=currentVoice->
buffer+startfptr;
541 const char *ss=strchr(anf,
'\n');
542 if (ss==
NULL) len=strlen(anf);
549 char *s=(
char *)
omAlloc(len+2);
550 strncpy(s,anf,len+2);
556 currentVoice->
fptr++;
562 currentVoice->
fptr=0;
576 &(currentVoice->
buffer[offset]),
586 currentVoice->
files);
609 rc-=3;
if (rc<0) rc=0;
645 Werror(
"premature end of file while reading %s",err);
654 #define STDIN_FILENO 0 663 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 newFile(char *fname)
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)
void omMarkAsStaticAddr(void *addr)
int feReadLine(char *b, int l)
void Werror(const char *fmt,...)
BOOLEAN contBuffer(feBufferTypes typ)