source: git/Singular/misc.cc @ a4f36b9

fieker-DuValspielwiese
Last change on this file since a4f36b9 was a4f36b9, checked in by Hans Schönemann <hannes@…>, 26 years ago
* hannes: fixed: help ~; (use help \~;) (misc.cc) git-svn-id: file:///usr/local/Singular/svn/trunk@2406 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 18.1 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/*
5* ABSTRACT:
6*/
7
8#include <string.h>
9#include <unistd.h>
10#include <stdio.h>
11#include <stddef.h>
12#include <stdlib.h>
13#include <time.h>
14#include <limits.h>
15
16#include "mod2.h"
17#include "tok.h"
18#include "febase.h"
19#include "cntrlc.h"
20#include "mmemory.h"
21#include "ipid.h"
22#include "ipshell.h"
23#include "kstd1.h"
24#include "subexpr.h"
25#include "timer.h"
26#include "intvec.h"
27#define SI_DONT_HAVE_GLOBAL_VARS
28
29#ifdef HAVE_LIBPARSER
30#  include "libparse.h"
31#endif /* HAVE_LIBPARSER */
32
33#ifdef HAVE_FACTORY
34#include <factory.h>
35#endif
36
37/* version strings */
38#ifdef HAVE_LIBFAC_P
39  extern const char * libfac_version;
40  extern const char * libfac_date;
41#endif
42extern "C" {
43#include <gmp.h>
44}
45#ifdef HAVE_MPSR
46#include <MP_Config.h>
47#endif
48
49/*0 implementation*/
50
51/*2
52* initialize components of Singular
53*/
54int inits(void)
55{
56  int t;
57/*4 signal handler:*/
58  init_signals();
59/*4 randomize: */
60  t=initTimer();
61  /*t=(int)time(NULL);*/
62  if (t==0) t=1;
63#ifdef HAVE_RTIMER
64  initRTimer();
65#endif
66#ifdef buildin_rand
67  siSeed=t;
68#else
69  srand((unsigned int)t);
70#endif
71#ifdef HAVE_FACTORY
72  factoryseed(t);
73#endif
74/*4 private data of other modules*/
75  memset(&sLastPrinted,0,sizeof(sleftv));
76  sLastPrinted.rtyp=NONE;
77#ifdef HAVE_MPSR
78  extern void mpsr_Init();
79  mpsr_Init();
80#endif
81  return t;
82}
83
84/*2
85* the global exit routine of Singular
86*/
87extern "C" {
88void m2_end(short i)
89{
90  #ifdef HAVE_TCL
91  if (tclmode)
92  {
93    PrintTCL('Q',0,NULL);
94  }
95  #endif
96  if (i<=0)
97  {
98    #ifdef HAVE_TCL
99    if (!tclmode)
100    #endif
101      if (BVERBOSE(0))
102      {
103        if (i==0)
104          printf("Auf Wiedersehen.\n");
105        else
106          printf("\n$Bye.\n");
107      }
108    #ifndef macintosh
109      #ifdef HAVE_FEREAD
110        #ifdef HAVE_ATEXIT
111          fe_reset_input_mode();
112        #else
113          fe_reset_input_mode(0,NULL);
114        #endif
115      #else
116        #ifdef HAVE_READLINE
117          fe_reset_input_mode();
118        #endif
119      #endif
120    #endif
121    #ifdef sun
122      #ifndef __svr4__
123        _cleanup();
124        _exit(0);
125      #endif
126    #endif
127    exit(0);
128  }
129  else
130  {
131    #ifdef HAVE_TCL
132    if (!tclmode)
133    #endif
134      printf("\nhalt %d\n",i);
135  }
136  exit(i);
137}
138}
139
140/*2
141* the renice routine for very large jobs
142* works only on unix machines,
143* testet on : linux, HP 9.0
144*
145*#ifndef MSDOS
146*#ifndef macintosh
147*#include <sys/times.h>
148*#include <sys/resource.h>
149*extern "C" int setpriority(int,int,int);
150*void very_nice()
151*{
152*#ifndef NO_SETPRIORITY
153*  setpriority(PRIO_PROCESS,0,19);
154*#endif
155*  sleep(10);
156*}
157*#else
158*void very_nice(){}
159*#endif
160*#else
161*void very_nice(){}
162*#endif
163*/
164
165/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
166#ifdef buildin_rand
167/*
168 *
169 *  A prime modulus multiplicative linear congruential
170 *  generator (PMMLCG), or "Lehmer generator".
171 *  Implementation directly derived from the article:
172 *
173 *        S. K. Park and K. W. Miller
174 *        Random Number Generators: Good Ones are Hard to Find
175 *        CACM vol 31, #10. Oct. 1988. pp 1192-1201.
176 *
177 *  Using the following multiplier and modulus, we obtain a
178 *  generator which:
179 *
180 *        1)  Has a full period: 1 to 2^31 - 2.
181 *        2)  Is testably "random" (see the article).
182 *        3)  Has a known implementation by E. L. Schrage.
183 */
184
185
186#define  A        16807L        /*  A "good" multiplier          */
187#define  M   2147483647L        /*  Modulus: 2^31 - 1          */
188#define  Q       127773L        /*  M / A                  */
189#define  R         2836L        /*  M % A                  */
190
191
192int siSeed = 1L;
193
194
195int siRand()
196{
197  siSeed = A * (siSeed % Q) - R * (siSeed / Q);
198
199  if ( siSeed < 0 )
200    siSeed += M;
201
202  return( siSeed );
203}
204#endif
205
206/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
207#define HELP_OK        0
208
209#ifdef buildin_help
210
211#define FIN_INDEX    '\037'
212#define not  !
213#define HELP_NOT_OPEN  1
214#define HELP_NOT_FOUND 2
215#ifndef macintosh
216#define Index_File     SINGULAR_INFODIR "/singular.hlp"
217#define Help_File      SINGULAR_INFODIR "/singular.hlp"
218#else
219#define Index_File     SINGULAR_INFODIR "singular.hlp"
220#define Help_File      SINGULAR_INFODIR "singular.hlp"
221#endif
222#define BUF_LEN        128
223#define IDX_LEN        64
224#define MAX_LINES      21
225
226static int compare(char *s1,char *s2)
227{
228  for(;*s1==*s2;s1++,s2++)
229     if(*s2=='\0') return(0);
230  return(*s2);
231}
232
233#ifdef macintosh
234static char tolow(char p)
235#else
236static inline char tolow(char p)
237#endif
238{
239  if (('A'<=p)&&(p<='Z')) return p | 040;
240  return p;
241}
242
243/*************************************************/
244static int show(unsigned long offset,FILE *help, char *close)
245{ char buffer[BUF_LEN+1];
246  int  lines = 0;
247
248  if( help== NULL)
249    if( (help = feFopen(Help_File, "r")) == NULL)
250      return HELP_NOT_OPEN;
251
252  fseek(help,  (long)(offset+1), (int)0);
253  while( !feof(help)
254        && *fgets(buffer, BUF_LEN, help) != EOF
255        && buffer[0] != FIN_INDEX)
256  {
257    printf("%s", buffer);
258    if(lines++> MAX_LINES)
259    {
260#ifdef macintosh
261      printf("\n Press <RETURN> to continue or x and <RETURN> to exit help.\n");
262#else
263      printf("\n Press <RETURN> to continue or x to exit help.\n");
264#endif
265      fflush(stdout);
266      *close = (char)getchar();
267      if(*close=='x')
268      {
269        getchar();
270        break;
271      }
272      lines=0;
273    }
274  }
275  if(*close!='x')
276  {
277#ifdef macintosh
278    printf("\nEnd of part. Press <RETURN> to continue or x and <RETURN> to exit help.\n");
279#else
280    printf("\nEnd of part. Press <RETURN> to continue or x to exit help.\n");
281#endif
282    fflush(stdout);
283    *close = (char)getchar();
284    if(*close=='x')
285      getchar();
286  }
287  return HELP_OK;
288}
289
290/*************************************************/
291int singular_manual(char *str)
292{ FILE *index=NULL,*help=NULL;
293  unsigned long offset;
294  char *p,close;
295  int done = 0;
296  char buffer[BUF_LEN+1],
297       Index[IDX_LEN+1],
298       String[IDX_LEN+1];
299
300  if( (index = feFopen(Index_File, "r",NULL,TRUE)) == NULL)
301  {
302    return HELP_NOT_OPEN;
303  }
304
305  for(p=str; *p; p++) *p = tolow(*p);/* */
306  do
307  {
308    p--;
309  }
310  while ((p != str) && (*p<=' '));
311  p++;
312  *p='\0';
313  (void)sprintf(String, " %s ", str);
314
315  while(!feof(index)
316        && *fgets(buffer, BUF_LEN, index) != EOF
317        && buffer[0] != FIN_INDEX);
318
319  while(!feof(index))
320  {
321    (void)fgets(buffer, BUF_LEN, index); /* */
322    (void)sscanf(buffer, "Node:%[^\177]\177%ld\n", Index, &offset);
323    for(p=Index; *p; p++) *p = tolow(*p);/* */
324    (void)strcat(Index, " ");
325    if( strstr(Index, String)!=NULL)
326    {
327      done++; (void)show(offset, help, &close);
328    }
329    Index[0]='\0';
330    if(close=='x')
331    break;
332  }
333  (void)fclose(index);
334  (void)fclose(help);
335  if(not done)
336  {
337    Warn("`%s` not found",String);
338    return HELP_NOT_FOUND;
339  }
340  return HELP_OK;
341}
342#endif // buildin_help
343/*************************************************/
344
345void singular_help(char *str,BOOLEAN example)
346{
347  char *s=str;
348  while (*s==' ') s++;
349  char *ss=s;
350  while (*ss!='\0') ss++;
351  while (*ss<=' ')
352  {
353    *ss='\0';
354    ss--;
355  }
356#ifdef HAVE_NAMESPACES
357  char *p1 = AllocL(strlen(s)), *p2 = AllocL(strlen(s));
358  *p1='\0';
359  *p2='\0';
360  sscanf(s, "%[^:]::%s", p1, p2);
361  idhdl h, ns;
362  if(*p2) {
363    printf("singular_help:(%s, %s)\n", p1, p2);
364    ns = namespaceroot->get(p1,0);
365    namespaceroot->push(IDPACKAGE(ns), IDID(ns));
366    h=namespaceroot->get(p2,myynest);
367    namespaceroot->pop();
368  } else {
369    h=namespaceroot->get(p1,myynest);
370  }
371  FreeL(p1);
372  FreeL(p2);
373#else /* HAVE_NAMESPACES */
374  /* --------- is it a proc ? --------------------------------*/
375  idhdl h=idroot->get(s,myynest);
376#endif /* HAVE_NAMESPACES */
377  if ((h!=NULL) && (IDTYP(h)==PROC_CMD)
378  && (example ||(strcmp(IDPROC(h)->libname, "standard.lib")!=0)))
379  {
380    char *lib=iiGetLibName(IDPROC(h));
381    Print("// proc %s ",s);
382    if((lib==NULL)||(*lib=='\0'))
383    {
384      PrintLn();
385    }
386    else
387    {
388      Print("from lib %s\n",lib);
389      s=iiGetLibProcBuffer(IDPROC(h), example ? 2 : 0);
390      if (!example)
391      {
392        PrintS(s);
393        FreeL((ADDRESS)s);
394      }
395      else
396      {
397        if (s!=NULL)
398        {
399          if (strlen(s)>5) iiEStart(s,IDPROC(h));
400          else FreeL((ADDRESS)s);
401        }
402      }
403    }
404  }
405  else if (example)
406  {
407    Werror("%s not found",s);
408  }
409  else
410  {
411  /* --------- is it a library ? --------------------------------*/
412    char libnamebuf[128];
413    FILE *fp=NULL;
414    if ((str[1]!='\0')
415    && ((fp=feFopen(str,"rb", libnamebuf))!=NULL))
416    {
417#ifdef HAVE_LIBPARSER
418      extern FILE *yylpin;
419      lib_style_types lib_style; // = OLD_LIBSTYLE;
420
421      yylpin = fp;
422#  ifdef HAVE_NAMESPACES
423      yylplex(str, libnamebuf, &lib_style, IDROOT, GET_INFO);
424#  else /* HAVE_NAMESPACES */
425      yylplex(str, libnamebuf, &lib_style, GET_INFO);
426#  endif /* HAVE_NAMESPACES */
427      reinit_yylp();
428      if(lib_style == OLD_LIBSTYLE)
429      {
430        char buf[256];
431        fseek(fp, 0, SEEK_SET);
432#else /* HAVE_LIBPARSER */
433        { char buf[256];
434#endif /* HAVE_LIBPARSER */
435        Warn( "library %s has an old format. Please fix it for the next time",
436              str);
437        BOOLEAN found=FALSE;
438        while (fgets( buf, sizeof(buf), fp))
439        {
440          if (strncmp(buf,"//",2)==0)
441          {
442            if (found) return;
443          }
444          else if ((strncmp(buf,"proc ",5)==0)||(strncmp(buf,"LIB ",4)==0))
445          {
446            if (!found) Warn("no help part in library found");
447            return;
448          }
449          else
450          {
451            found=TRUE;
452            PrintS(buf);
453          }
454        }
455      }
456#ifdef HAVE_LIBPARSER
457      else
458      {
459        fclose( yylpin );
460        PrintS(text_buffer);
461        FreeL(text_buffer);
462      }
463#endif /* HAVE_LIBPARSER */
464    }
465  /* --------- everything else is for the manual ----------------*/
466    else
467    {
468#ifdef HAVE_TCL
469      if(!tclmode)
470#endif
471     #ifdef buildin_help
472        singular_manual(str);
473     #else
474        system(feGetInfoCall(str));
475     #ifndef MSDOS
476      //sprintf(tmp,"clear");
477      //system(tmp);
478     #endif
479#endif
480    }
481  }
482}
483
484
485struct soptionStruct
486{
487  char * name;
488  int   setval;
489  int   resetval;
490};
491
492struct soptionStruct optionStruct[]=
493{
494  {"prot",         Sy_bit(OPT_PROT),           ~Sy_bit(OPT_PROT)   },
495  {"redSB",        Sy_bit(OPT_REDSB),          ~Sy_bit(OPT_REDSB)   },
496  /* 2 Gebauer/Moeller */
497  {"notSugar",     Sy_bit(OPT_NOT_SUGAR),      ~Sy_bit(OPT_NOT_SUGAR)   },
498  {"interrupt",    Sy_bit(OPT_INTERRUPT),      ~Sy_bit(OPT_INTERRUPT)   },
499  {"sugarCrit",    Sy_bit(OPT_SUGARCRIT),      ~Sy_bit(OPT_SUGARCRIT)   },
500  {"teach",     Sy_bit(OPT_DEBUG),          ~Sy_bit(OPT_DEBUG)  },
501  /* 7 cancel unit */
502  {"morePairs",    Sy_bit(OPT_MOREPAIRS),      ~Sy_bit(OPT_MOREPAIRS)   },
503  /* 9 return SB in syz, quotient, intersect */
504  {"returnSB",     Sy_bit(OPT_RETURN_SB),      ~Sy_bit(OPT_RETURN_SB)  },
505  {"fastHC",       Sy_bit(OPT_FASTHC),         ~Sy_bit(OPT_FASTHC)  },
506  /* 11-19 sort in L/T */
507  /* 20 redBest */
508  {"keepvars",     Sy_bit(OPT_KEEPVARS),       ~Sy_bit(OPT_KEEPVARS) },
509  {"staircaseBound",Sy_bit(OPT_STAIRCASEBOUND),~Sy_bit(OPT_STAIRCASEBOUND)  },
510  {"multBound",    Sy_bit(OPT_MULTBOUND),      ~Sy_bit(OPT_MULTBOUND)  },
511  {"degBound",     Sy_bit(OPT_DEGBOUND),       ~Sy_bit(OPT_DEGBOUND)  },
512  /* 25 no redTail(p)/redTail(s) */
513  {"redTail",      Sy_bit(OPT_REDTAIL),        ~Sy_bit(OPT_REDTAIL)  },
514  {"intStrategy",  Sy_bit(OPT_INTSTRATEGY),    ~Sy_bit(OPT_INTSTRATEGY)  },
515  /* 27 stop at HC (finiteDeterminacyTest) */
516  {"minRes",       Sy_bit(OPT_MINRES),         ~Sy_bit(OPT_MINRES)  },
517  /* 30: use not regularity for syz */
518  {"notRegularity",Sy_bit(OPT_NOTREGULARITY),  ~Sy_bit(OPT_NOTREGULARITY)  },
519  {"weightM",      Sy_bit(OPT_WEIGHTM),        ~Sy_bit(OPT_WEIGHTM)  },
520/*special for "none" and also end marker for showOption:*/
521  {"ne",           0,                          0 }
522};
523
524struct soptionStruct verboseStruct[]=
525{
526  {"mem",      Sy_bit(V_SHOW_MEM),  ~Sy_bit(V_SHOW_MEM)   },
527  {"yacc",     Sy_bit(V_YACC),      ~Sy_bit(V_YACC)       },
528  {"redefine", Sy_bit(V_REDEFINE),  ~Sy_bit(V_REDEFINE)   },
529  {"reading",  Sy_bit(V_READING),   ~Sy_bit(V_READING)    },
530  {"loadLib",  Sy_bit(V_LOAD_LIB),  ~Sy_bit(V_LOAD_LIB)   },
531  {"debugLib", Sy_bit(V_DEBUG_LIB), ~Sy_bit(V_DEBUG_LIB)  },
532  {"loadProc", Sy_bit(V_LOAD_PROC), ~Sy_bit(V_LOAD_PROC)  },
533  {"defRes",   Sy_bit(V_DEF_RES),   ~Sy_bit(V_DEF_RES)    },
534  {"debugMem", Sy_bit(V_DEBUG_MEM), ~Sy_bit(V_DEBUG_MEM)  },
535  {"usage",    Sy_bit(V_SHOW_USE),  ~Sy_bit(V_SHOW_USE)   },
536  {"Imap",     Sy_bit(V_IMAP),      ~Sy_bit(V_IMAP)       },
537  {"prompt",   Sy_bit(V_PROMPT),    ~Sy_bit(V_PROMPT)     },
538  {"notWarnSB",Sy_bit(V_NSB),       ~Sy_bit(V_NSB)        },
539/*special for "none" and also end marker for showOption:*/
540  {"ne",         0,          0 }
541};
542
543BOOLEAN setOption(leftv res, leftv v)
544{
545  char *n;
546  do
547  {
548    n=v->name;
549    if (n==NULL) return TRUE;
550    v->name=NULL;
551
552    int i;
553
554    if(strcmp(n,"get")==0)
555    {
556      intvec *w=new intvec(2);
557      (*w)[0]=test;
558      (*w)[1]=verbose;
559      res->rtyp=INTVEC_CMD;
560      res->data=(void *)w;
561      goto okay;
562    }
563    if(strcmp(n,"set")==0)
564    {
565      if((v->next!=NULL)
566      &&(v->next->Typ()==INTVEC_CMD))
567      {
568        v=v->next;
569        intvec *w=(intvec*)v->Data();
570        test=(*w)[0];
571        verbose=(*w)[1];
572
573        if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) && (currRing->ch>=2))
574        {
575          test &=~Sy_bit(OPT_INTSTRATEGY);
576        }
577        goto okay;
578      }
579    }
580    if(strcmp(n,"none")==0)
581    {
582      #ifdef HAVE_TCL
583      if (tclmode)
584        PrintTCLS('O',"none");
585      #endif
586      test=0;
587      verbose=0;
588      goto okay;
589    }
590    for (i=0; (i==0) || (optionStruct[i-1].setval!=0); i++)
591    {
592      if (strcmp(n,optionStruct[i].name)==0)
593      {
594        if (optionStruct[i].setval & validOpts)
595        {
596          test |= optionStruct[i].setval;
597          #ifdef HAVE_TCL
598          if (tclmode)
599            PrintTCLS('O',n);
600          #endif
601        }
602        else
603          Warn("cannot set option");
604        if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) && (currRing->ch>=2))
605        {
606          test &=~Sy_bit(OPT_INTSTRATEGY);
607        }
608        goto okay;
609      }
610      else if ((strncmp(n,"no",2)==0)
611      && (strcmp(n+2,optionStruct[i].name)==0))
612      {
613        if (optionStruct[i].setval & validOpts)
614        {
615          test &= optionStruct[i].resetval;
616          #ifdef HAVE_TCL
617          if (tclmode)
618            PrintTCLS('O',n);
619          #endif
620        }
621        else
622          Warn("cannot clear option");
623        goto okay;
624      }
625    }
626    for (i=0; (i==0) || (verboseStruct[i-1].setval!=0); i++)
627    {
628      if (strcmp(n,verboseStruct[i].name)==0)
629      {
630        verbose |= verboseStruct[i].setval;
631        #ifdef YYDEBUG
632        #if YYDEBUG
633        if (BVERBOSE(V_YACC)) yydebug=1;
634        else                  yydebug=0;
635        #endif
636        #endif
637        #ifdef HAVE_TCL
638        if (tclmode)
639          PrintTCLS('O',n);
640        #endif
641        goto okay;
642      }
643      else if ((strncmp(n,"no",2)==0)
644      && (strcmp(n+2,verboseStruct[i].name)==0))
645      {
646        verbose &= verboseStruct[i].resetval;
647        #ifdef YYDEBUG
648        #if YYDEBUG
649        if (BVERBOSE(V_YACC)) yydebug=1;
650        else                  yydebug=0;
651        #endif
652        #endif
653        #ifdef HAVE_TCL
654        if (tclmode)
655          PrintTCLS('O',n);
656        #endif
657        goto okay;
658      }
659    }
660    Werror("unknown option `%s`",n);
661  okay:
662    FreeL((ADDRESS)n);
663    v=v->next;
664  } while (v!=NULL);
665  return FALSE;
666}
667
668char * showOption()
669{
670  int i;
671  BITSET tmp;
672
673  StringSet("//options:");
674  if ((test!=0)||(verbose!=0))
675  {
676    tmp=test;
677    if(tmp)
678    {
679      for (i=0; optionStruct[i].setval!=0; i++)
680      {
681        if (optionStruct[i].setval & test)
682        {
683          StringAppend(" %s",optionStruct[i].name);
684          tmp &=optionStruct[i].resetval;
685        }
686      }
687      for (i=0; i<32; i++)
688      {
689        if (tmp & Sy_bit(i)) StringAppend(" %d",i);
690      }
691    }
692    tmp=verbose;
693    if (tmp)
694    {
695      for (i=0; verboseStruct[i].setval!=0; i++)
696      {
697        if (verboseStruct[i].setval & tmp)
698        {
699          StringAppend(" %s",verboseStruct[i].name);
700          tmp &=verboseStruct[i].resetval;
701        }
702      }
703      for (i=1; i<32; i++)
704      {
705        if (tmp & Sy_bit(i)) StringAppend(" %d",i+32);
706      }
707    }
708    return mstrdup(StringAppend(""));
709  }
710  else
711    return mstrdup(StringAppend(" none"));
712}
713
714char * versionString()
715{
716  StringSet("\t");
717#ifdef HAVE_FACTORY
718              StringAppend("factory(%s),", factoryVersion);
719#endif
720#ifdef HAVE_LIBFAC_P
721              StringAppend("libfac(%s,%s),\n\t",libfac_version,libfac_date);
722#endif
723#if defined (__GNU_MP_VERSION) && defined (__GNU_MP_VERSION_MINOR)
724              StringAppend("GMP(%d.%d),",__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR);
725#elif defined (HAVE_SMALLGMP)
726              StringAppendS("SmallGMP(2.0.2.0),");
727#else
728              StringAppendS("GMP(1.3),");
729#endif
730#ifdef HAVE_MPSR
731              StringAppend("MP(%s),",MP_VERSION);
732#endif
733#if defined(HAVE_READLINE) && !defined(FEREAD)
734              StringAppendS("libreadline,\n\t");
735#else
736#ifdef HAVE_FEREAD
737              StringAppendS("emulated libreadline,\n\t");
738#else
739              StringAppendS("\n\t");
740#endif
741#endif
742#ifdef SRING
743              StringAppendS("super algebra,");
744#endif
745#ifdef DRING
746              StringAppendS("Weyl algebra,");
747#endif
748#ifdef HAVE_DBM
749              StringAppendS("DBM,");
750#endif
751#ifdef HAVE_INFO
752              StringAppendS("info,");
753#endif
754#ifdef TEST
755              StringAppendS("TESTs,");
756#endif
757#if YYDEBUG
758              StringAppendS("YYDEBUG=1,");
759#endif
760#ifdef MDEBUG
761              StringAppend("MDEBUG=%d,",MDEBUG);
762#endif
763#ifdef PDEBUG
764              StringAppend("PDEBUG,");
765#endif
766#ifdef KDEBUG
767              StringAppend("KDEBUG,");
768#endif
769#ifdef TEST_MAC_ORDER
770              StringAppendS("mac_order,");
771#endif
772#ifndef __OPTIMIZE__
773              StringAppend("-g,");
774#endif
775              StringAppend("random=%d\n",siRandomStart);
776#ifndef __MWERKS__
777#ifdef HAVE_INFO
778              StringAppend("InfoFile   : %s\n", feGetInfoFile());
779              StringAppend("InfoProgram: %s\n", feGetInfoProgram());
780#endif
781              StringAppend("Singular   : %s\n",feGetExpandedExecutable());
782              return StringAppend("SearchPath : %s", feGetSearchPath());
783#endif
784}
Note: See TracBrowser for help on using the repository browser.