Macros | Functions | Variables
fevoices.cc File Reference
#include <kernel/mod2.h>
#include <omalloc/omalloc.h>
#include <misc/options.h>
#include <reporter/reporter.h>
#include <kernel/oswrapper/feread.h>
#include <Singular/fevoices.h>
#include <Singular/subexpr.h>
#include <Singular/ipshell.h>
#include <Singular/sdb.h>
#include <stdlib.h>
#include <stdio.h>
#include <misc/mylimits.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <ctype.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define fePutChar(c)   fputc((unsigned char)(c),stdout)
 
#define INITIAL_PRINT_BUFFER   24*1024L
 
#define MAX_FILE_BUFFER   4*4096
 
#define STDIN_FILENO   0
 

Functions

const char * VoiceName ()
 
void VoiceBackTrack ()
 
BOOLEAN newFile (char *fname, FILE *f)
 
void newBuffer (char *s, feBufferTypes t, procinfo *pi, int lineno)
 
BOOLEAN exitBuffer (feBufferTypes typ)
 
BOOLEAN contBuffer (feBufferTypes typ)
 
BOOLEAN exitVoice ()
 
static void feShowPrompt (void)
 
static int fePrintEcho (char *anf, char *)
 
int feReadLine (char *b, int l)
 
VoicefeInitStdin (Voice *pp)
 

Variables

char fe_promptstr [] =" "
 
FILE * File_Profiling =NULL
 
static char * feBuffer =(char *)omAlloc(INITIAL_PRINT_BUFFER)
 
int blocknest
 
int yy_noeof =0
 
int yy_blocklineno
 
VoicecurrentVoice = NULL
 
const char * sNoName_fe ="_"
 

Macro Definition Documentation

§ fePutChar

#define fePutChar (   c)    fputc((unsigned char)(c),stdout)

Definition at line 33 of file fevoices.cc.

§ INITIAL_PRINT_BUFFER

#define INITIAL_PRINT_BUFFER   24*1024L

Definition at line 41 of file fevoices.cc.

§ MAX_FILE_BUFFER

#define MAX_FILE_BUFFER   4*4096

Definition at line 45 of file fevoices.cc.

§ STDIN_FILENO

#define STDIN_FILENO   0

Definition at line 659 of file fevoices.cc.

Function Documentation

§ contBuffer()

BOOLEAN contBuffer ( feBufferTypes  typ)

Definition at line 309 of file fevoices.cc.

310 {
311  //printf("contBuffer: %d(%s),(%x)\n",
312  // typ,BT_name[typ], currentVoice);
313  if (typ == BT_break) // valid inside for, while. may skip if, else
314  {
315  // first check for valid buffer type
317  loop
318  {
319  if ((p->typ != BT_if)
320  &&(p->typ != BT_else))
321  {
322  if (p->typ == BT_break /*typ*/)
323  {
324  while (p != currentVoice)
325  {
326  exitVoice();
327  }
329  currentVoice->fptr=0;
330  return FALSE;
331  }
332  else return TRUE;
333  }
334  if (p->prev==NULL) break;
335  p=p->prev;
336  }
337  }
338  return TRUE;
339 }
long fptr
Definition: fevoices.h:69
int yylineno
Definition: febase.cc:45
loop
Definition: myNF.cc:98
#define FALSE
Definition: auxiliary.h:95
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:99
Definition: fevoices.h:57
int start_lineno
Definition: fevoices.h:73
Definition: fevoices.h:24
BOOLEAN exitVoice()
Definition: fevoices.cc:346
feBufferTypes typ
Definition: fevoices.h:83
Voice * prev
Definition: fevoices.h:61
#define NULL
Definition: omList.c:10
Voice * currentVoice
Definition: fevoices.cc:57

§ exitBuffer()

BOOLEAN exitBuffer ( feBufferTypes  typ)

Definition at line 241 of file fevoices.cc.

242 {
243  //printf("exitBuffer: %d(%s),(%x)\n",
244  // typ,BT_name[typ], currentVoice);
245  //Voice *p=currentVoice;
246  //PrintS("-----------------\ncurr:");
247  //do
248  //{
249  //Print("voice fn:%s\n",p->filename);
250  //p=p->prev;
251  //}
252  //while (p!=NULL);
253  //PrintS("----------------\n");
254  if (typ == BT_break) // valid inside for, while. may skip if, else
255  {
256  /*4 first check for valid buffer type, skip if/else*/
258  loop
259  {
260  if ((p->typ != BT_if)
261  &&(p->typ != BT_else))
262  {
263  if (p->typ == BT_break /*typ*/)
264  {
265  while (p != currentVoice)
266  {
267  exitVoice();
268  }
269  exitVoice();
270  return FALSE;
271  }
272  else return TRUE;
273  }
274  if (p->prev==NULL) break;
275  p=p->prev;
276  }
277  /*4 break not inside a for/while: return an error*/
278  if (/*typ*/ BT_break != currentVoice->typ) return 1;
279  return exitVoice();
280  }
281 
282  if ((typ == BT_proc)
283  || (typ == BT_example))
284  {
285  Voice *p=currentVoice;
286  loop
287  {
288  if ((p->typ == BT_proc)
289  || (p->typ == BT_example))
290  {
291  while (p != currentVoice)
292  {
293  exitVoice();
294  }
295  exitVoice();
296  return FALSE;
297  }
298  if (p->prev==NULL) break;
299  p=p->prev;
300  }
301  }
302  /*4 return not inside a proc: return an error*/
303  return TRUE;
304 }
loop
Definition: myNF.cc:98
#define FALSE
Definition: auxiliary.h:95
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:99
Definition: fevoices.h:57
Definition: fevoices.h:24
BOOLEAN exitVoice()
Definition: fevoices.cc:346
feBufferTypes typ
Definition: fevoices.h:83
Voice * prev
Definition: fevoices.h:61
#define NULL
Definition: omList.c:10
Voice * currentVoice
Definition: fevoices.cc:57

§ exitVoice()

BOOLEAN exitVoice ( )

Definition at line 346 of file fevoices.cc.

347 {
348  //printf("exitVoice: %d(%s),(%x)\n",
349  // currentVoice->typ,BT_name[currentVoice->typ], currentVoice);
350  //{
351  //Voice *p=currentVoice;
352  //PrintS("-----------------\ncurr:");
353  //do
354  //{
355  //Print("voice fn:%s\n",p->filename);
356  //p=p->prev;
357  //}
358  //while (p!=NULL);
359  //PrintS("----------------\n");
360  //}
361  if (currentVoice!=NULL)
362  {
363  if (currentVoice->oldb!=NULL)
364  {
367  }
368  if (currentVoice->filename!=NULL)
369  {
372  }
373  if (currentVoice->buffer!=NULL)
374  {
377  }
379  {
381  }
382  if (currentVoice->prev!=NULL)
383  {
384  //printf("exitVoice typ %d(%s)\n",
385  // currentVoice->typ,BT_name[currentVoice->typ]);
386  if (currentVoice->typ==BT_if)
387  {
388  currentVoice->prev->ifsw=2;
389  }
390  else
391  {
392  currentVoice->prev->ifsw=0;
393  }
394  if ((currentVoice->sw == BI_file)
395  && (currentVoice->files!=NULL))
396  {
397  fclose(currentVoice->files);
398  }
401  }
403  delete currentVoice;
404  currentVoice=p;
405  }
406  return currentVoice==NULL;
407 }
int yylineno
Definition: febase.cc:45
char * buffer
Definition: fevoices.h:68
return P p
Definition: myNF.cc:203
char * filename
Definition: fevoices.h:62
void * ADDRESS
Definition: auxiliary.h:116
Definition: fevoices.h:57
Voice * next
Definition: fevoices.h:60
int curr_lineno
Definition: fevoices.h:74
char ifsw
Definition: fevoices.h:78
Definition: fevoices.h:24
Voice * feInitStdin(Voice *pp)
Definition: fevoices.cc:661
#define omFree(addr)
Definition: omAllocDecl.h:261
feBufferTypes typ
Definition: fevoices.h:83
Voice * prev
Definition: fevoices.h:61
void * oldb
Definition: fevoices.h:64
void myyoldbuffer(void *oldb)
Definition: scanner.cc:2326
#define NULL
Definition: omList.c:10
Voice * currentVoice
Definition: fevoices.cc:57
FILE * files
Definition: fevoices.h:66
feBufferInputs sw
Definition: fevoices.h:75

§ feInitStdin()

Voice* feInitStdin ( Voice pp)

Definition at line 661 of file fevoices.cc.

662 {
663  Voice *p = new Voice;
664  p->files = stdin;
665  p->sw = (isatty(STDIN_FILENO)) ? BI_stdin : BI_file;
666  if ((pp!=NULL) && (pp->files==stdin))
667  {
668  p->files=freopen("/dev/tty","r",stdin);
669  //stdin=p->files;
670  if (p->files==NULL)
671  {
672  p->files = stdin;
673  p->sw = BI_file;
674  }
675  else
676  p->sw = BI_stdin;
677  }
678  p->filename = omStrDup("STDIN");
679  p->start_lineno = 1;
682  return p;
683 }
return P p
Definition: myNF.cc:203
char * filename
Definition: fevoices.h:62
Definition: fevoices.h:57
int start_lineno
Definition: fevoices.h:73
#define STDIN_FILENO
Definition: fevoices.cc:659
#define NULL
Definition: omList.c:10
FILE * files
Definition: fevoices.h:66
void omMarkAsStaticAddr(void *addr)
feBufferInputs sw
Definition: fevoices.h:75
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ fePrintEcho()

static int fePrintEcho ( char *  anf,
char *   
)
static

Definition at line 421 of file fevoices.cc.

422 {
423  char *ss=strrchr(anf,'\n');
424  int len_s;
425  if (ss==NULL)
426  {
427  len_s=strlen(anf);
428  }
429  else
430  {
431  len_s=ss-anf+1;
432  }
433  // my_yylinebuf:
434  int mrc=si_min(len_s,79)-1;
435  strcpy(my_yylinebuf,anf+(len_s-1)-mrc);
436  if (my_yylinebuf[mrc] == '\n') my_yylinebuf[mrc] = '\0';
437  mrc--;
438  // handle echo:
439  if (((si_echo>myynest)
440  && ((currentVoice->typ==BT_proc)
442  || (currentVoice->typ==BT_file)
443  || (currentVoice->typ==BT_none)
444  )
445  && (strncmp(anf,";return();",10)!=0)
446  )
449  {
451  {
452  if (currentVoice->filename==NULL)
453  Print("(none) %3d%c ",yylineno,prompt_char);
454  else
456  }
457  {
458  fwrite(anf,1,len_s,stdout);
459  mflush();
460  }
461  if (traceit&TRACE_SHOW_LINE)
462  {
463  while(fgetc(stdin)!='\n');
464  }
465  }
466  else if (traceit&TRACE_SHOW_LINENO)
467  {
468  Print("{%d}",yylineno);
469  mflush();
470  }
471  else if (traceit&TRACE_PROFILING)
472  {
473  if (File_Profiling==NULL)
474  File_Profiling=fopen("smon.out","a");
475  if (File_Profiling==NULL)
476  traceit &= (~TRACE_PROFILING);
477  else
478  {
479  if (currentVoice->filename==NULL)
480  fprintf(File_Profiling,"(none) %d\n",yylineno);
481  else
482  fprintf(File_Profiling,"%s %d\n",currentVoice->filename,yylineno);
483  }
484  }
485 #ifdef HAVE_SDB
486  if ((blocknest==0)
487  && (currentVoice->pi!=NULL)
488  && (currentVoice->pi->trace_flag!=0))
489  {
490  sdb(currentVoice, anf, len_s);
491  }
492 #endif
493  prompt_char = '.';
494  return len_s;
495 }
#define TRACE_SHOW_LINENO
Definition: reporter.h:30
int yylineno
Definition: febase.cc:45
#define Print
Definition: emacs.cc:83
static int si_min(const int a, const int b)
Definition: auxiliary.h:122
char * filename
Definition: fevoices.h:62
char prompt_char
Definition: febase.cc:44
int blocknest
Definition: scanner.cc:581
FILE * File_Profiling
Definition: fevoices.cc:38
int traceit
Definition: febase.cc:47
void sdb(Voice *currentVoice, const char *currLine, int len)
Definition: sdb.cc:201
#define mflush()
Definition: reporter.h:57
int myynest
Definition: febase.cc:46
char my_yylinebuf[80]
Definition: febase.cc:48
#define TRACE_SHOW_LINE
Definition: reporter.h:32
procinfo * pi
Definition: fevoices.h:63
feBufferTypes typ
Definition: fevoices.h:83
#define TRACE_SHOW_LINE1
Definition: reporter.h:37
#define NULL
Definition: omList.c:10
Voice * currentVoice
Definition: fevoices.cc:57
#define TRACE_PROFILING
Definition: reporter.h:49
char trace_flag
Definition: subexpr.h:61
int si_echo
Definition: febase.cc:41

§ feReadLine()

int feReadLine ( char *  b,
int  l 
)

Definition at line 497 of file fevoices.cc.

498 {
499  char *s=NULL;
500  int offset = 0; /* will not be used if s==NULL*/
501  // try to read from the buffer into b, max l chars
502  if (currentVoice!=NULL)
503  {
504  if((currentVoice->buffer!=NULL)
505  && (currentVoice->buffer[currentVoice->fptr]!='\0'))
506  {
507  NewBuff:
508  register int i=0;
509  long startfptr=currentVoice->fptr;
510  long tmp_ptr=currentVoice->fptr;
511  l--;
512  loop
513  {
514  register char c=
515  b[i]=currentVoice->buffer[tmp_ptr/*currentVoice->fptr*/];
516  i++;
517  if (yy_noeof==noeof_block)
518  {
519  if (c<' ') yylineno++;
520  else if (c=='}') break;
521  }
522  else
523  {
524  if ((c<' ') ||
525  (c==';') ||
526  (c==')')
527  )
528  break;
529  }
530  if (i>=l) break;
531  tmp_ptr++;/*currentVoice->fptr++;*/
532  if(currentVoice->buffer[tmp_ptr/*currentVoice->fptr*/]=='\0') break;
533  }
534  currentVoice->fptr=tmp_ptr;
535  b[i]='\0';
536  if (currentVoice->sw==BI_buffer)
537  {
538  if (startfptr==0)
539  {
540  char *anf=currentVoice->buffer;
541  const char *ss=strchr(anf,'\n');
542  long len;
543  if (ss==NULL) len=strlen(anf);
544  else len=ss-anf;
545  char *s=(char *)omAlloc(len+2);
546  strncpy(s,anf,len+2);
547  s[len+1]='\0';
548  fePrintEcho(s,b);
549  omFree((ADDRESS)s);
550  }
551  else if (/*(startfptr>0) &&*/
552  (currentVoice->buffer[startfptr-1]=='\n'))
553  {
554  char *anf=currentVoice->buffer+startfptr;
555  const char *ss=strchr(anf,'\n');
556  long len;
557  if (ss==NULL) len=strlen(anf);
558  else len=ss-anf;
559  char *s=(char *)omAlloc(len+2);
560  strncpy(s,anf,len+2);
561  s[len+1]='\0';
562  yylineno++;
563  fePrintEcho(s,b);
564  omFree((ADDRESS)s);
565  }
566  }
567  currentVoice->fptr++;
568  return i;
569  }
570  // no buffer there or e-o-buffer or eoln:
571  if (currentVoice->sw!=BI_buffer)
572  {
573  currentVoice->fptr=0;
574  if (currentVoice->buffer==NULL)
575  {
578  }
579  }
580  offset=0;
581  NewRead:
582  yylineno++;
583  if (currentVoice->sw==BI_stdin)
584  {
585  feShowPrompt();
587  &(currentVoice->buffer[offset]),
588  omSizeOfAddr(currentVoice->buffer)-1-offset);
589  //int i=0;
590  //if (s!=NULL)
591  // while((s[i]!='\0') /*&& (i<MAX_FILE_BUFFER)*/) {s[i] &= (char)127;i++;}
592  }
593  else if (currentVoice->sw==BI_file)
594  {
596  s=fgets(currentVoice->buffer+offset,(MAX_FILE_BUFFER-1-sizeof(ADDRESS))-offset,
598  if (s!=NULL) currentVoice->ftellptr=ftell(currentVoice->files);
599  }
600  //else /* BI_buffer */ s==NULL => return 0
601  // done by the default return
602  }
603  if (s!=NULL)
604  {
605  // handle prot:
606  if (feProt&SI_PROT_I)
607  {
608  fputs(s,feProtFile);
609  }
610  int rc=fePrintEcho(s,b)+1;
611  //s[strlen(s)+1]='\0'; add an second \0 at the end of the string
612  s[rc]='\0';
613  // handel \\ :
614  rc-=3;
615  if ((s[rc]=='\\')&&(currentVoice->sw!=BI_buffer))
616  {
617  s[rc]='\0';
618  offset+=rc;
619  if (offset<(int)omSizeOfAddr(currentVoice->buffer)) goto NewRead;
620  }
621  goto NewBuff;
622  }
623  /* else if (s==NULL) */
624  {
625  const char *err;
626  switch(yy_noeof)
627  {
628  case noeof_brace:
629  case noeof_block:
630  err="{...}";
631  break;
632  case noeof_asstring:
633  err="till `.`";
634  break;
635  case noeof_string:
636  err="string";
637  break;
638  case noeof_bracket:
639  err="(...)";
640  break;
641  case noeof_procname:
642  err="proc";
643  break;
644  case noeof_comment:
645  err="/*...*/";
646  break;
647  default:
648  return 0;
649  }
650  Werror("premature end of file while reading %s",err);
651  return 0;
652  }
653 }
char fe_promptstr[]
Definition: fevoices.cc:37
long fptr
Definition: fevoices.h:69
FILE * feProtFile
Definition: reporter.cc:57
int yy_noeof
Definition: fevoices.cc:55
const CanonicalForm int s
Definition: facAbsFact.cc:55
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
Definition: feread.cc:33
int yylineno
Definition: febase.cc:45
char * buffer
Definition: fevoices.h:68
static void feShowPrompt(void)
Definition: fevoices.cc:413
loop
Definition: myNF.cc:98
size_t omSizeOfAddr(const void *addr)
Definition: omAllocSystem.c:97
void * ADDRESS
Definition: auxiliary.h:116
#define omAlloc(size)
Definition: omAllocDecl.h:210
int feProt
Definition: reporter.cc:56
#define SI_PROT_I
Definition: reporter.h:52
#define omFree(addr)
Definition: omAllocDecl.h:261
static int fePrintEcho(char *anf, char *)
Definition: fevoices.cc:421
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
#define MAX_FILE_BUFFER
Definition: fevoices.cc:45
Voice * currentVoice
Definition: fevoices.cc:57
FILE * files
Definition: fevoices.h:66
void omMarkAsStaticAddr(void *addr)
#define SEEK_SET
Definition: mod2.h:123
feBufferInputs sw
Definition: fevoices.h:75
long ftellptr
Definition: fevoices.h:70
int offset
Definition: libparse.cc:1091
const poly b
Definition: syzextra.cc:213
void Werror(const char *fmt,...)
Definition: reporter.cc:189
int l
Definition: cfEzgcd.cc:94

§ feShowPrompt()

static void feShowPrompt ( void  )
static

Definition at line 413 of file fevoices.cc.

414 {
416 }
char fe_promptstr[]
Definition: fevoices.cc:37
char prompt_char
Definition: febase.cc:44

§ newBuffer()

void newBuffer ( char *  s,
feBufferTypes  t,
procinfo pi,
int  lineno 
)

Definition at line 171 of file fevoices.cc.

172 {
173  currentVoice->Next();
174  //Print(":Buffer%d(%s):%s(%x)\n",
175  // t,BT_name[t],pname,currentVoice);
176  if (pi!=NULL)
177  {
178  long l=strlen(pi->procname);
179  if (pi->libname!=NULL) l+=strlen(pi->libname);
180  currentVoice->filename = (char *)omAlloc(l+3);
181  *currentVoice->filename='\0';
182  if (pi->libname!=NULL) strcat(currentVoice->filename,pi->libname);
183  strcat(currentVoice->filename,"::");
184  strcat(currentVoice->filename,pi->procname);
185  currentVoice->pi = pi;
186  }
187  else
188  {
189  if(currentVoice->prev!=NULL)
190  {
193  }
194  else
195  {
197  currentVoice->pi = pi;
198  }
199  }
200  currentVoice->buffer = s;
202  currentVoice->typ = t;
203  switch (t)
204  {
205  case BT_execute:
206  yylineno-=2;
207  break;
208  case BT_proc:
209  case BT_example:
211  yylineno = lineno+1;
212  break;
213  case BT_if:
214  case BT_else:
215  case BT_break:
217  break;
218  //case BT_file:
219  default:
220  yylineno = 1;
221  break;
222  }
223  //Print("start body (%s) at line %d\n",BT_name[t],yylineno);
225  //printf("start buffer typ %d\n",t);
226  //Voice *p=currentVoice;
227  //PrintS("-----------------\ncurr:");
228  //do
229  //{
230  //Print("voice fn:%s\n",p->filename);
231  //p=p->prev;
232  //}
233  //while (p!=NULL);
234  //PrintS("----------------\n");
235 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
int yylineno
Definition: febase.cc:45
char * buffer
Definition: fevoices.h:68
void Next()
Definition: fevoices.cc:94
char * filename
Definition: fevoices.h:62
void * myynewbuffer()
Definition: scanner.cc:2319
#define omAlloc(size)
Definition: omAllocDecl.h:210
int start_lineno
Definition: fevoices.h:73
char * procname
Definition: subexpr.h:56
Definition: fevoices.h:24
char * libname
Definition: subexpr.h:55
procinfo * pi
Definition: fevoices.h:63
feBufferTypes typ
Definition: fevoices.h:83
Voice * prev
Definition: fevoices.h:61
#define pi
Definition: libparse.cc:1143
void * oldb
Definition: fevoices.h:64
int yy_blocklineno
Definition: fevoices.cc:56
#define NULL
Definition: omList.c:10
Voice * currentVoice
Definition: fevoices.cc:57
feBufferInputs sw
Definition: fevoices.h:75
int l
Definition: cfEzgcd.cc:94
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ newFile()

BOOLEAN newFile ( char *  fname,
FILE *  f 
)

Definition at line 129 of file fevoices.cc.

130 {
131  currentVoice->Next();
132  //Print(":File%d(%s):%s(%x)\n",
133  // currentVoice->typ,BT_name[currentVoice->typ],fname,currentVoice);
134  currentVoice->filename = omStrDup(fname);
136  if (strcmp(fname,"STDIN") == 0)
137  {
138  currentVoice->files = stdin;
141  }
142  else
143  {
144  currentVoice->sw = BI_file; /* needed by exitVoice below */
145  if (f!=NULL)
146  currentVoice->files = f;
147  else
148  {
149  currentVoice->files = feFopen(fname,"r",NULL,TRUE);
150  if (currentVoice->files==NULL)
151  {
152  exitVoice();
153  return TRUE;
154  }
155  }
157  }
159  //Voice *p=currentVoice;
160  //PrintS("-----------------\ncurr:");
161  //do
162  //{
163  //Print("voice fn:%s\n",p->filename);
164  //p=p->prev;
165  //}
166  //while (p!=NULL);
167  //PrintS("----------------\n");
168  return FALSE;
169 }
int yylineno
Definition: febase.cc:45
void Next()
Definition: fevoices.cc:94
#define FALSE
Definition: auxiliary.h:95
char * filename
Definition: fevoices.h:62
#define TRUE
Definition: auxiliary.h:99
int start_lineno
Definition: fevoices.h:73
BOOLEAN exitVoice()
Definition: fevoices.cc:346
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
Definition: feFopen.cc:47
FILE * f
Definition: checklibs.c:7
#define NULL
Definition: omList.c:10
Voice * currentVoice
Definition: fevoices.cc:57
FILE * files
Definition: fevoices.h:66
void omMarkAsStaticAddr(void *addr)
feBufferInputs sw
Definition: fevoices.h:75
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ VoiceBackTrack()

void VoiceBackTrack ( )

Definition at line 77 of file fevoices.cc.

78 {
80  while (p->prev!=NULL)
81  {
82  p=p->prev;
83  char *s=p->filename;
84  if (s==NULL)
85  PrintS("-- called from ? --\n");
86  else
87  Print("-- called from %s --\n",s);
88  }
89 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define Print
Definition: emacs.cc:83
return P p
Definition: myNF.cc:203
char * filename
Definition: fevoices.h:62
Definition: fevoices.h:57
void PrintS(const char *s)
Definition: reporter.cc:284
Voice * prev
Definition: fevoices.h:61
#define NULL
Definition: omList.c:10
Voice * currentVoice
Definition: fevoices.cc:57

§ VoiceName()

const char* VoiceName ( )

Definition at line 66 of file fevoices.cc.

67 {
68  if ((currentVoice!=NULL)
69  && (currentVoice->filename!=NULL))
70  return currentVoice->filename;
71  return sNoName_fe;
72 }
char * filename
Definition: fevoices.h:62
#define NULL
Definition: omList.c:10
Voice * currentVoice
Definition: fevoices.cc:57
const char * sNoName_fe
Definition: fevoices.cc:65

Variable Documentation

§ blocknest

int blocknest

Definition at line 581 of file scanner.cc.

§ currentVoice

Voice* currentVoice = NULL

Definition at line 57 of file fevoices.cc.

§ fe_promptstr

char fe_promptstr[] =" "

Definition at line 37 of file fevoices.cc.

§ feBuffer

char* feBuffer =(char *)omAlloc(INITIAL_PRINT_BUFFER)
static

Definition at line 47 of file fevoices.cc.

§ File_Profiling

FILE* File_Profiling =NULL

Definition at line 38 of file fevoices.cc.

§ sNoName_fe

const char* sNoName_fe ="_"

Definition at line 65 of file fevoices.cc.

§ yy_blocklineno

int yy_blocklineno

Definition at line 56 of file fevoices.cc.

§ yy_noeof

int yy_noeof =0

Definition at line 55 of file fevoices.cc.