source: git/Singular/misc.cc @ 93266c5

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