Go to the source code of this file.
◆ fePutChar
#define fePutChar |
( |
|
c | ) |
fputc((unsigned char)(c),stdout) |
◆ MAX_FILE_BUFFER
#define MAX_FILE_BUFFER 4*4096 |
◆ STDIN_FILENO
◆ contBuffer()
Definition at line 302 of file fevoices.cc.
303{
304
305
307 {
308
311 {
314 {
316 {
318 {
320 }
324 }
326 }
327 if (
p->prev==
NULL)
break;
329 }
330 }
332}
◆ exitBuffer()
Definition at line 234 of file fevoices.cc.
235{
236
237
238
239
240
241
242
243
244
245
246
248 {
249
252 {
255 {
257 {
259 {
261 }
264 }
266 }
267 if (
p->prev==
NULL)
break;
269 }
270
273 }
274
277 {
280 {
283 {
285 {
287 }
290 }
291 if (
p->prev==
NULL)
break;
293 }
294 }
295
297}
◆ exitVoice()
Definition at line 339 of file fevoices.cc.
340{
341
342
343
344
345
346
347
348
349
350
351
352
353
355 {
357 {
360 }
362 {
365 }
367 {
370 }
374 {
376 }
378 {
379
380
382 {
384 }
385 else
386 {
388 }
391 {
393 }
396 }
400 }
402}
Voice * feInitStdin(Voice *pp)
void myyoldbuffer(void *oldb)
◆ feInitStdin()
Definition at line 670 of file fevoices.cc.
671{
676 {
677 p->files=freopen(
"/dev/tty",
"r",stdin);
678
680 {
683 }
684 else
686 }
692}
void omMarkAsStaticAddr(void *addr)
◆ fePrintEcho()
static int fePrintEcho |
( |
char * |
anf, |
|
|
char * |
|
|
) |
| |
|
static |
Definition at line 416 of file fevoices.cc.
417{
418 char *ss=strrchr(anf,'\n');
419 int len_s;
421 {
422 len_s=strlen(anf);
423 }
424 else
425 {
426 len_s=ss-anf+1;
427 }
428
429 int mrc=
si_min(len_s,79)-1;
432 mrc--;
433
439 )
440 && (strncmp(anf,";return();",10)!=0)
441 )
444 {
446 {
449 else
451 }
452 {
453 fwrite(anf,1,len_s,stdout);
455 }
457 {
458 char c;
459 do
460 {
461 c=fgetc(stdin);
463 }
464 while(c!='\n');
465 }
466 }
468 {
471 }
473 {
478 else
479 {
482 else
484 }
485 }
486#ifdef HAVE_SDB
490 {
492 }
493#endif
495 return len_s;
496}
static int si_min(const int a, const int b)
VAR char my_yylinebuf[80]
EXTERN_VAR char prompt_char
VAR FILE * File_Profiling
#define TRACE_SHOW_LINENO
EXTERN_VAR int traceit_stop
void sdb(Voice *currentVoice, const char *currLine, int len)
◆ feReadLine()
int feReadLine |
( |
char * |
b, |
|
|
int |
l |
|
) |
| |
Definition at line 498 of file fevoices.cc.
499{
502
504 {
507 {
508 NewBuff:
514 {
519 {
521 else if (c=='}') break;
522 }
523 else
524 {
525 if ((c<' ') ||
526 (c==';') ||
527 (c==')')
528 )
529 break;
530 }
532 tmp_ptr++;
534 }
538 {
540 char *anf;
541 long len;
542 if (startfptr==0)
543 {
545 const char *ss=strchr(anf,'\n');
546 if (ss==
NULL) len=strlen(anf);
547 else len=ss-anf;
549 }
550 else if (
552 {
554 const char *ss=strchr(anf,'\n');
555 if (ss==
NULL) len=strlen(anf);
556 else len=ss-anf;
559 }
560 if (show_echo)
561 {
563 strncpy(
s,anf,len+2);
567 }
568 }
571 }
572
574 {
577 {
581 }
582 }
584 NewRead:
587 {
592
593
594
595 }
597 {
602 {
604
607 }
608 }
609
610
611 }
613 {
614
616 {
618 }
620
622
623 rc-=3; if (rc<0) rc=0;
625 {
628 if (offset<currentVoice->buff_size) goto NewRead;
629 }
630 goto NewBuff;
631 }
632
633 {
634 const char *err;
636 {
639 err="{...}";
640 break;
642 err="till `.`";
643 break;
645 err="string";
646 break;
648 err="(...)";
649 break;
651 err="proc";
652 break;
654 err="/*...*/";
655 break;
656 default:
657 return 0;
658 }
659 Werror(
"premature end of file while reading %s",err);
660 return 0;
661 }
662}
const CanonicalForm int s
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
static int fePrintEcho(char *anf, char *)
static void feShowPrompt(void)
void Werror(const char *fmt,...)
◆ feShowPrompt()
static void feShowPrompt |
( |
void |
| ) |
|
|
static |
◆ newBuffer()
Definition at line 164 of file fevoices.cc.
165{
167
168
170 {
171 long l=strlen(
pi->procname);
172 if (
pi->libname!=
NULL)
l+=strlen(
pi->libname);
179 }
180 else
181 {
183 {
186 }
187 else
188 {
191 }
192 }
196 switch (t)
197 {
200 break;
205 break;
210 break;
211
212 default:
214 break;
215 }
216
218
219
220
221
222
223
224
225
226
227
228}
◆ newFile()
Definition at line 127 of file fevoices.cc.
128{
130
131
134 if (strcmp(fname,"STDIN") == 0)
135 {
139 }
140 else
141 {
145 {
148 }
150 }
152
153
154
155
156
157
158
159
160
162}
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
◆ VoiceBackTrack()
Definition at line 75 of file fevoices.cc.
76{
79 {
83 PrintS(
"-- called from ? --\n");
84 else
85 Print(
"-- called from %s --\n",
s);
86 }
87}
void PrintS(const char *s)
◆ VoiceLine()
◆ VoiceName()
const char * VoiceName |
( |
| ) |
|
◆ blocknest
◆ currentVoice
◆ fe_promptstr
VAR char fe_promptstr[] =" " |
◆ File_Profiling
◆ sNoName_fe
const char sNoName_fe[] ="_" |
◆ yy_blocklineno
◆ yy_noeof