source: git/Singular/misc.cc @ 0e760d0

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