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 "misc/mylimits.h"
#include <unistd.h>

Go to the source code of this file.

Macros

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

Functions

const char * VoiceName ()
 
void VoiceBackTrack ()
 
BOOLEAN newFile (char *fname)
 
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
 
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 27 of file fevoices.cc.

◆ MAX_FILE_BUFFER

#define MAX_FILE_BUFFER   4*4096

Definition at line 37 of file fevoices.cc.

◆ STDIN_FILENO

#define STDIN_FILENO   0

Definition at line 653 of file fevoices.cc.

Function Documentation

◆ contBuffer()

BOOLEAN contBuffer ( feBufferTypes  typ)

Definition at line 294 of file fevoices.cc.

295 {
296  //printf("contBuffer: %d(%s),(%x)\n",
297  // typ,BT_name[typ], currentVoice);
298  if (typ == BT_break) // valid inside for, while. may skip if, else
299  {
300  // first check for valid buffer type
302  loop
303  {
304  if ((p->typ != BT_if)
305  &&(p->typ != BT_else))
306  {
307  if (p->typ == BT_break /*typ*/)
308  {
309  while (p != currentVoice)
310  {
311  exitVoice();
312  }
314  currentVoice->fptr=0;
315  return FALSE;
316  }
317  else return TRUE;
318  }
319  if (p->prev==NULL) break;
320  p=p->prev;
321  }
322  }
323  return TRUE;
324 }
long fptr
Definition: fevoices.h:70
int yylineno
Definition: febase.cc:40
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
Definition: fevoices.h:58
#define loop
Definition: structs.h:80
int start_lineno
Definition: fevoices.h:74
Definition: fevoices.h:24
BOOLEAN exitVoice()
Definition: fevoices.cc:331
feBufferTypes typ
Definition: fevoices.h:84
Voice * prev
Definition: fevoices.h:62
#define NULL
Definition: omList.c:12
Voice * currentVoice
Definition: fevoices.cc:47
int p
Definition: cfModGcd.cc:4019

◆ exitBuffer()

BOOLEAN exitBuffer ( feBufferTypes  typ)

Definition at line 226 of file fevoices.cc.

227 {
228  //printf("exitBuffer: %d(%s),(%x)\n",
229  // typ,BT_name[typ], currentVoice);
230  //Voice *p=currentVoice;
231  //PrintS("-----------------\ncurr:");
232  //do
233  //{
234  //Print("voice fn:%s\n",p->filename);
235  //p=p->prev;
236  //}
237  //while (p!=NULL);
238  //PrintS("----------------\n");
239  if (typ == BT_break) // valid inside for, while. may skip if, else
240  {
241  /*4 first check for valid buffer type, skip if/else*/
243  loop
244  {
245  if ((p->typ != BT_if)
246  &&(p->typ != BT_else))
247  {
248  if (p->typ == BT_break /*typ*/)
249  {
250  while (p != currentVoice)
251  {
252  exitVoice();
253  }
254  exitVoice();
255  return FALSE;
256  }
257  else return TRUE;
258  }
259  if (p->prev==NULL) break;
260  p=p->prev;
261  }
262  /*4 break not inside a for/while: return an error*/
263  if (/*typ*/ BT_break != currentVoice->typ) return 1;
264  return exitVoice();
265  }
266 
267  if ((typ == BT_proc)
268  || (typ == BT_example))
269  {
270  Voice *p=currentVoice;
271  loop
272  {
273  if ((p->typ == BT_proc)
274  || (p->typ == BT_example))
275  {
276  while (p != currentVoice)
277  {
278  exitVoice();
279  }
280  exitVoice();
281  return FALSE;
282  }
283  if (p->prev==NULL) break;
284  p=p->prev;
285  }
286  }
287  /*4 return not inside a proc: return an error*/
288  return TRUE;
289 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
Definition: fevoices.h:58
#define loop
Definition: structs.h:80
Definition: fevoices.h:24
BOOLEAN exitVoice()
Definition: fevoices.cc:331
feBufferTypes typ
Definition: fevoices.h:84
Voice * prev
Definition: fevoices.h:62
#define NULL
Definition: omList.c:12
Voice * currentVoice
Definition: fevoices.cc:47
int p
Definition: cfModGcd.cc:4019

◆ exitVoice()

BOOLEAN exitVoice ( )

Definition at line 331 of file fevoices.cc.

332 {
333  //printf("exitVoice: %d(%s),(%x)\n",
334  // currentVoice->typ,BT_name[currentVoice->typ], currentVoice);
335  //{
336  //Voice *p=currentVoice;
337  //PrintS("-----------------\ncurr:");
338  //do
339  //{
340  //Print("voice fn:%s\n",p->filename);
341  //p=p->prev;
342  //}
343  //while (p!=NULL);
344  //PrintS("----------------\n");
345  //}
346  if (currentVoice!=NULL)
347  {
348  if (currentVoice->oldb!=NULL)
349  {
352  }
353  if (currentVoice->filename!=NULL)
354  {
357  }
358  if (currentVoice->buffer!=NULL)
359  {
362  }
363  if ((currentVoice->prev==NULL)
364  &&(currentVoice->sw==BI_file)
365  &&(currentVoice->files!=stdin))
366  {
368  }
369  if (currentVoice->prev!=NULL)
370  {
371  //printf("exitVoice typ %d(%s)\n",
372  // currentVoice->typ,BT_name[currentVoice->typ]);
373  if (currentVoice->typ==BT_if)
374  {
375  currentVoice->prev->ifsw=2;
376  }
377  else
378  {
379  currentVoice->prev->ifsw=0;
380  }
381  if ((currentVoice->sw == BI_file)
382  && (currentVoice->files!=NULL))
383  {
384  fclose(currentVoice->files);
385  }
388  }
390  delete currentVoice;
391  currentVoice=p;
392  }
393  return currentVoice==NULL;
394 }
int yylineno
Definition: febase.cc:40
char * buffer
Definition: fevoices.h:69
char * filename
Definition: fevoices.h:63
void * ADDRESS
Definition: auxiliary.h:133
Definition: fevoices.h:58
Voice * next
Definition: fevoices.h:61
int curr_lineno
Definition: fevoices.h:75
char ifsw
Definition: fevoices.h:79
Definition: fevoices.h:24
Voice * feInitStdin(Voice *pp)
Definition: fevoices.cc:655
#define omFree(addr)
Definition: omAllocDecl.h:261
feBufferTypes typ
Definition: fevoices.h:84
Voice * prev
Definition: fevoices.h:62
void * oldb
Definition: fevoices.h:65
void myyoldbuffer(void *oldb)
Definition: scanner.cc:2323
#define NULL
Definition: omList.c:12
Voice * currentVoice
Definition: fevoices.cc:47
FILE * files
Definition: fevoices.h:67
int p
Definition: cfModGcd.cc:4019
feBufferInputs sw
Definition: fevoices.h:76

◆ feInitStdin()

Voice* feInitStdin ( Voice pp)

Definition at line 655 of file fevoices.cc.

656 {
657  Voice *p = new Voice;
658  p->files = stdin;
659  p->sw = (isatty(STDIN_FILENO)) ? BI_stdin : BI_file;
660  if ((pp!=NULL) && (pp->sw==BI_stdin) && (pp->files==stdin))
661  {
662  p->files=freopen("/dev/tty","r",stdin);
663  //stdin=p->files;
664  if (p->files==NULL)
665  {
666  p->files = stdin;
667  p->sw = BI_file;
668  }
669  else
670  p->sw = BI_stdin;
671  }
672  p->filename = omStrDup("STDIN");
673  p->start_lineno = 1;
676  return p;
677 }
char * filename
Definition: fevoices.h:63
Definition: fevoices.h:58
int start_lineno
Definition: fevoices.h:74
#define STDIN_FILENO
Definition: fevoices.cc:653
#define NULL
Definition: omList.c:12
FILE * files
Definition: fevoices.h:67
void omMarkAsStaticAddr(void *addr)
int p
Definition: cfModGcd.cc:4019
feBufferInputs sw
Definition: fevoices.h:76
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ fePrintEcho()

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

Definition at line 408 of file fevoices.cc.

409 {
410  char *ss=strrchr(anf,'\n');
411  int len_s;
412  if (ss==NULL)
413  {
414  len_s=strlen(anf);
415  }
416  else
417  {
418  len_s=ss-anf+1;
419  }
420  // my_yylinebuf:
421  int mrc=si_min(len_s,79)-1;
422  strcpy(my_yylinebuf,anf+(len_s-1)-mrc);
423  if (my_yylinebuf[mrc] == '\n') my_yylinebuf[mrc] = '\0';
424  mrc--;
425  // handle echo:
426  if (((si_echo>myynest)
427  && ((currentVoice->typ==BT_proc)
429  || (currentVoice->typ==BT_file)
430  || (currentVoice->typ==BT_none)
431  )
432  && (strncmp(anf,";return();",10)!=0)
433  )
436  {
438  {
439  if (currentVoice->filename==NULL)
440  Print("(none) %3d%c ",yylineno,prompt_char);
441  else
443  }
444  {
445  fwrite(anf,1,len_s,stdout);
446  mflush();
447  }
448  if (traceit&TRACE_SHOW_LINE)
449  {
450  while(fgetc(stdin)!='\n');
451  }
452  }
453  else if (traceit&TRACE_SHOW_LINENO)
454  {
455  Print("{%d}",yylineno);
456  mflush();
457  }
458  else if (traceit&TRACE_PROFILING)
459  {
460  if (File_Profiling==NULL)
461  File_Profiling=fopen("smon.out","a");
462  if (File_Profiling==NULL)
463  traceit &= (~TRACE_PROFILING);
464  else
465  {
466  if (currentVoice->filename==NULL)
467  fprintf(File_Profiling,"(none) %d\n",yylineno);
468  else
469  fprintf(File_Profiling,"%s %d\n",currentVoice->filename,yylineno);
470  }
471  }
472 #ifdef HAVE_SDB
473  if ((blocknest==0)
474  && (currentVoice->pi!=NULL)
475  && (currentVoice->pi->trace_flag!=0))
476  {
477  sdb(currentVoice, anf, len_s);
478  }
479 #endif
480  prompt_char = '.';
481  return len_s;
482 }
#define TRACE_SHOW_LINENO
Definition: reporter.h:30
int yylineno
Definition: febase.cc:40
#define Print
Definition: emacs.cc:80
static int si_min(const int a, const int b)
Definition: auxiliary.h:139
char * filename
Definition: fevoices.h:63
char prompt_char
Definition: febase.cc:39
int blocknest
Definition: scanner.cc:581
FILE * File_Profiling
Definition: fevoices.cc:32
int traceit
Definition: febase.cc:42
void sdb(Voice *currentVoice, const char *currLine, int len)
Definition: sdb.cc:200
#define mflush()
Definition: reporter.h:57
int myynest
Definition: febase.cc:41
char my_yylinebuf[80]
Definition: febase.cc:43
#define TRACE_SHOW_LINE
Definition: reporter.h:32
procinfo * pi
Definition: fevoices.h:64
feBufferTypes typ
Definition: fevoices.h:84
#define TRACE_SHOW_LINE1
Definition: reporter.h:37
#define NULL
Definition: omList.c:12
Voice * currentVoice
Definition: fevoices.cc:47
#define TRACE_PROFILING
Definition: reporter.h:49
char trace_flag
Definition: subexpr.h:62
int si_echo
Definition: febase.cc:35

◆ feReadLine()

int feReadLine ( char *  b,
int  l 
)

Definition at line 484 of file fevoices.cc.

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

◆ feShowPrompt()

static void feShowPrompt ( void  )
static

Definition at line 400 of file fevoices.cc.

401 {
403 }
char fe_promptstr[]
Definition: fevoices.cc:31
char prompt_char
Definition: febase.cc:39

◆ newBuffer()

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

Definition at line 156 of file fevoices.cc.

157 {
158  currentVoice->Next();
159  //Print(":Buffer%d(%s):%s(%x)\n",
160  // t,BT_name[t],pname,currentVoice);
161  if (pi!=NULL)
162  {
163  long l=strlen(pi->procname);
164  if (pi->libname!=NULL) l+=strlen(pi->libname);
165  currentVoice->filename = (char *)omAlloc(l+3);
166  *currentVoice->filename='\0';
167  if (pi->libname!=NULL) strcat(currentVoice->filename,pi->libname);
168  strcat(currentVoice->filename,"::");
169  strcat(currentVoice->filename,pi->procname);
170  currentVoice->pi = pi;
171  }
172  else
173  {
174  if(currentVoice->prev!=NULL)
175  {
178  }
179  else
180  {
182  currentVoice->pi = pi;
183  }
184  }
185  currentVoice->buffer = s;
187  currentVoice->typ = t;
188  switch (t)
189  {
190  case BT_execute:
191  yylineno-=2;
192  break;
193  case BT_proc:
194  case BT_example:
196  yylineno = lineno+1;
197  break;
198  case BT_if:
199  case BT_else:
200  case BT_break:
202  break;
203  //case BT_file:
204  default:
205  yylineno = 1;
206  break;
207  }
208  //Print("start body (%s) at line %d\n",BT_name[t],yylineno);
210  //printf("start buffer typ %d\n",t);
211  //Voice *p=currentVoice;
212  //PrintS("-----------------\ncurr:");
213  //do
214  //{
215  //Print("voice fn:%s\n",p->filename);
216  //p=p->prev;
217  //}
218  //while (p!=NULL);
219  //PrintS("----------------\n");
220 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
int yylineno
Definition: febase.cc:40
char * buffer
Definition: fevoices.h:69
void Next()
Definition: fevoices.cc:84
char * filename
Definition: fevoices.h:63
void * myynewbuffer()
Definition: scanner.cc:2316
#define omAlloc(size)
Definition: omAllocDecl.h:210
int start_lineno
Definition: fevoices.h:74
char * procname
Definition: subexpr.h:57
Definition: fevoices.h:24
char * libname
Definition: subexpr.h:56
procinfo * pi
Definition: fevoices.h:64
feBufferTypes typ
Definition: fevoices.h:84
Voice * prev
Definition: fevoices.h:62
#define pi
Definition: libparse.cc:1143
void * oldb
Definition: fevoices.h:65
int yy_blocklineno
Definition: fevoices.cc:46
#define NULL
Definition: omList.c:12
Voice * currentVoice
Definition: fevoices.cc:47
feBufferInputs sw
Definition: fevoices.h:76
int l
Definition: cfEzgcd.cc:93
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ newFile()

BOOLEAN newFile ( char *  fname)

Definition at line 119 of file fevoices.cc.

120 {
121  currentVoice->Next();
122  //Print(":File%d(%s):%s(%x)\n",
123  // currentVoice->typ,BT_name[currentVoice->typ],fname,currentVoice);
124  currentVoice->filename = omStrDup(fname);
126  if (strcmp(fname,"STDIN") == 0)
127  {
128  currentVoice->files = stdin;
131  }
132  else
133  {
134  currentVoice->sw = BI_file; /* needed by exitVoice below */
135  currentVoice->files = feFopen(fname,"r",NULL,TRUE);
136  if (currentVoice->files==NULL)
137  {
138  exitVoice();
139  return TRUE;
140  }
142  }
144  //Voice *p=currentVoice;
145  //PrintS("-----------------\ncurr:");
146  //do
147  //{
148  //Print("voice fn:%s\n",p->filename);
149  //p=p->prev;
150  //}
151  //while (p!=NULL);
152  //PrintS("----------------\n");
153  return FALSE;
154 }
int yylineno
Definition: febase.cc:40
void Next()
Definition: fevoices.cc:84
#define FALSE
Definition: auxiliary.h:94
char * filename
Definition: fevoices.h:63
#define TRUE
Definition: auxiliary.h:98
int start_lineno
Definition: fevoices.h:74
BOOLEAN exitVoice()
Definition: fevoices.cc:331
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
Definition: feFopen.cc:47
#define NULL
Definition: omList.c:12
Voice * currentVoice
Definition: fevoices.cc:47
FILE * files
Definition: fevoices.h:67
void omMarkAsStaticAddr(void *addr)
feBufferInputs sw
Definition: fevoices.h:76
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ VoiceBackTrack()

void VoiceBackTrack ( )

Definition at line 67 of file fevoices.cc.

68 {
70  while (p->prev!=NULL)
71  {
72  p=p->prev;
73  char *s=p->filename;
74  if (s==NULL)
75  PrintS("-- called from ? --\n");
76  else
77  Print("-- called from %s --\n",s);
78  }
79 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define Print
Definition: emacs.cc:80
char * filename
Definition: fevoices.h:63
Definition: fevoices.h:58
void PrintS(const char *s)
Definition: reporter.cc:284
Voice * prev
Definition: fevoices.h:62
#define NULL
Definition: omList.c:12
Voice * currentVoice
Definition: fevoices.cc:47
int p
Definition: cfModGcd.cc:4019

◆ VoiceName()

const char* VoiceName ( )

Definition at line 56 of file fevoices.cc.

57 {
58  if ((currentVoice!=NULL)
59  && (currentVoice->filename!=NULL))
60  return currentVoice->filename;
61  return sNoName_fe;
62 }
const char sNoName_fe[]
Definition: fevoices.cc:55
char * filename
Definition: fevoices.h:63
#define NULL
Definition: omList.c:12
Voice * currentVoice
Definition: fevoices.cc:47

Variable Documentation

◆ blocknest

int blocknest

Definition at line 581 of file scanner.cc.

◆ currentVoice

Voice* currentVoice = NULL

Definition at line 47 of file fevoices.cc.

◆ fe_promptstr

char fe_promptstr[] =" "

Definition at line 31 of file fevoices.cc.

◆ File_Profiling

FILE* File_Profiling =NULL

Definition at line 32 of file fevoices.cc.

◆ sNoName_fe

const char sNoName_fe[] ="_"

Definition at line 55 of file fevoices.cc.

◆ yy_blocklineno

int yy_blocklineno

Definition at line 46 of file fevoices.cc.

◆ yy_noeof

int yy_noeof =0

Definition at line 45 of file fevoices.cc.