Changeset 9ea9c6 in git


Ignore:
Timestamp:
Jul 11, 1997, 4:27:57 PM (27 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
78e2fd353351fad2ced81920069a197077b3eef3
Parents:
f2b175c3ca843efa6cb54c3b7d3e27e9a8a9f39b
Message:
* hannes: loading of "standard.lib" unless -n is given
    merged system("with") and Singular -v
    (extra.cc iparith.cc ipshell.h misc.cc tesths.cc)


git-svn-id: file:///usr/local/Singular/svn/trunk@510 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    rf2b175c r9ea9c6  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: extra.cc,v 1.15 1997-07-10 13:02:35 Singular Exp $ */
     4/* $Id: extra.cc,v 1.16 1997-07-11 14:27:52 Singular Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
     
    123123      if (h->next==NULL)
    124124      {
    125         char with_str[]=""
    126         #ifdef DRING
    127           "DRING "
    128         #endif
    129         #ifdef HAVE_DBM
    130           "DBM "
    131         #endif
    132         #ifdef HAVE_DLD
    133           "DLD "
    134         #endif
    135         #ifdef HAVE_GMP
    136           "gmp "
    137         #endif
    138         #ifdef HAVE_FACTORY
    139           "factory "
    140         #endif
    141         #ifdef HAVE_LIBFAC_P
    142           "libfac "
    143         #endif
    144         #ifdef HAVE_MPSR
    145           "MP "
    146         #endif
    147         #ifdef HAVE_READLINE
    148           "readline "
    149         #endif
    150         #ifdef HAVE_TCL
    151           "tcl "
    152         #endif
    153         #ifdef SRING
    154           "SRING "
    155         #endif
    156         ;
    157125        res->rtyp=STRING_CMD;
    158         char *s=mstrdup(with_str);
    159         s[strlen(s)-1]='\0';
    160         res->data=(void *)s;
     126        res->data=(void *)mstrdup(versionString());
    161127        return FALSE;
    162128      }
  • Singular/iparith.cc

    rf2b175c r9ea9c6  
    11651165        pDelete1(&p);
    11661166        if (p==NULL) break;
    1167       } 
     1167      }
    11681168    }
    11691169    pDelete1(&r);
     
    20042004,{fglmProc,    FGLM_CMD,       IDEAL_CMD,      RING_CMD,   DEF_CMD PROFILER}
    20052005,{fglmProc,    FGLM_CMD,       IDEAL_CMD,      QRING_CMD,  DEF_CMD PROFILER}
    2006 #else 
     2006#else
    20072007,{jjWRONG2,    FGLM_CMD,       IDEAL_CMD,      RING_CMD,   DEF_CMD PROFILER}
    20082008,{jjWRONG2,    FGLM_CMD,       IDEAL_CMD,      QRING_CMD,  DEF_CMD PROFILER}
     
    22982298  if(i==j)
    22992299    res->data = (char *)singclap_det_i(m);
    2300   else 
     2300  else
    23012301  {
    23022302    Werror("det of %d x %d intmat",i,j);
    23032303    return TRUE;
    2304   } 
     2304  }
    23052305  return FALSE;
    23062306}
     
    24752475  res->data=(char *)syConvList((lists)v->Data());
    24762476  return FALSE;
    2477 } 
     2477}
    24782478static BOOLEAN jjLEADCOEF(leftv res, leftv v)
    24792479{
     
    33843384  memcpy(v->next,w,sizeof(sleftv));
    33853385  BOOLEAN r=iiExprArith2(res,u,'(',v);
    3386   v->rtyp=0; v->data=NULL; 
     3386  v->rtyp=0; v->data=NULL;
    33873387  w->rtyp=0; w->data=NULL;
    33883388  return r;
     
    40094009    int i;
    40104010    int rt;
    4011  
     4011
    40124012    L->Init(sl);
    40134013    for (i=0;i<sl;i++)
     
    40384038        L->m[i].Copy(h);
    40394039    }
    4040   } 
     4040  }
    40414041  res->data=(char *)L;
    40424042  return FALSE;
     
    40634063    Print("%-20s",cmds[i].name);
    40644064    i++;
    4065     if(cmds[i].name==NULL) 
     4065    if(cmds[i].name==NULL)
    40664066      break;
    40674067    if ((i%3)==1) PrintLn();
  • Singular/ipshell.h

    rf2b175c r9ea9c6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ipshell.h,v 1.8 1997-07-09 15:54:02 Singular Exp $ */
     6/* $Id: ipshell.h,v 1.9 1997-07-11 14:27:55 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    149149BOOLEAN setOption(leftv res, leftv v);
    150150/* ================================================================== */
     151char * versionString();
    151152#endif
    152153
  • Singular/misc.cc

    rf2b175c r9ea9c6  
    3333#endif
    3434
     35/* version strings */
     36#ifdef HAVE_LIBFAC_P
     37  extern const char * libfac_version;
     38  extern const char * libfac_date;
     39#endif
     40#ifdef HAVE_GMP
     41extern "C" {
     42#include <gmp.h>
     43}
     44#endif
     45#ifdef HAVE_MPSR
     46#include <MP_Config.h>
     47#endif
     48
    3549/*0 implementation*/
    3650
     
    5771#ifdef HAVE_FACTORY
    5872  factoryseed(t);
    59 #endif 
     73#endif
    6074/*4 private data of other modules*/
    6175  I_FEbase();
     
    382396         strstr[0]='\0';
    383397       else
    384          sprintf(strstr," Index \"%s\"",str); 
     398         sprintf(strstr," Index \"%s\"",str);
    385399      if (!access(tmp, R_OK))
    386400      {
     
    493507      {
    494508        v=v->next;
    495         intvec *w=(intvec*)v->Data(); 
     509        intvec *w=(intvec*)v->Data();
    496510        test=(*w)[0];
    497511        verbose=(*w)[1];
    498        
     512
    499513        if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) && (currRing->ch>=2))
    500514        {
     
    502516        }
    503517        goto okay;
    504       } 
     518      }
    505519    }
    506520    if(strcmp(n,"none")==0)
     
    509523      verbose=0;
    510524      goto okay;
    511     } 
     525    }
    512526    for (i=0; (i==0) || (optionStruct[i-1].setval!=0); i++)
    513527    {
     
    566580    FreeL((ADDRESS)n);
    567581    v=v->next;
    568   } while (v!=NULL);   
     582  } while (v!=NULL);
    569583  return FALSE;
    570584}
     
    630644}
    631645#endif
     646
     647char * versionString()
     648{
     649  StringSet("");
     650#ifdef HAVE_FACTORY
     651              StringAppend("\tfactory (%s),\n", factoryVersion);
     652#endif
     653#ifdef HAVE_LIBFAC_P
     654              StringAppend("\tlibfac(%s,%s),\n",libfac_version,libfac_date);
     655#endif
     656#ifdef SRING
     657              StringAppend("\tsuper algebra,\n");
     658#endif
     659#ifdef DRING
     660              StringAppend("\tWeyl algebra,\n");
     661#endif
     662#ifdef HAVE_GMP
     663#if defined (__GNU_MP_VERSION) && defined (__GNU_MP_VERSION_MINOR)
     664              StringAppend("\tGMP(%d.%d),\n",__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR);
     665#elif defined (HAVE_SMALLGMP)
     666              StringAppend("\tSmallGMP(2.0.2.0),\n");
     667#else
     668              StringAppend("\tGMP(1.3),\n");
     669#endif
     670#endif
     671#ifdef HAVE_DBM
     672              StringAppend("\tDBM,\n");
     673#endif
     674#ifdef HAVE_MPSR
     675              StringAppend("\tMP(%s),\n",MP_VERSION);
     676#endif
     677#if defined(HAVE_READLINE) && !defined(FEREAD)
     678              StringAppend("\tlibreadline,\n");
     679#endif
     680#ifdef HAVE_FEREAD
     681              StringAppend("\temulated libreadline,\n");
     682#endif
     683#ifdef HAVE_INFO
     684              StringAppend("\tinfo,\n");
     685#else
     686              StringAppend("\twithout info,\n");
     687#endif
     688#ifdef TEST
     689              StringAppend("\tTESTs,\n");
     690#endif
     691#if YYDEBUG
     692              StringAppend("\tYYDEBUG=1,\n");
     693#endif
     694#ifdef MDEBUG
     695              StringAppend("\tMDEBUG=%d,\n",MDEBUG);
     696#endif
     697#ifndef __OPTIMIZE__
     698              StringAppend("\t-g,\n");
     699#endif
     700              StringAppend("\trandom=%d\n",siRandomStart);
     701#ifdef MSDOS
     702              char *p=getenv("SPATH");
     703#else
     704              char *p=getenv("SINGULARPATH");
     705#endif
     706              if (p!=NULL)
     707                return StringAppend("search path:%s:%s",p,SINGULAR_DATADIR);
     708              else
     709                return StringAppend("search path:%s", SINGULAR_DATADIR);
     710}
  • Singular/tesths.cc

    rf2b175c r9ea9c6  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: tesths.cc,v 1.24 1997-07-11 11:10:12 obachman Exp $ */
     4/* $Id: tesths.cc,v 1.25 1997-07-11 14:27:57 Singular Exp $ */
    55
    66/*
     
    2727#include "silink.h"
    2828#include "timer.h"
    29 
    30 /* version strings */
    3129#ifdef HAVE_FACTORY
    3230#define SI_DONT_HAVE_GLOBAL_VARS
    3331#include <factory.h>
    3432#endif
    35 #ifdef HAVE_LIBFAC_P
    36   extern const char * libfac_version;
    37   extern const char * libfac_date;
    38 #endif
    39 #ifdef HAVE_GMP
    40 extern "C" {
    41 #include <gmp.h>
    42 }
    43 #endif
    44 #ifdef HAVE_MPSR
    45 #include <MP_Config.h>
    46 #endif
     33
    4734
    4835/*0 implementation*/
     
    6956  int i;
    7057  thisfile = argv[0];
     58  BOOLEAN load_std_lib=TRUE;
    7159  /*. process parameters */
    7260  for (;(argc > 1) && (!feBatch); --argc, ++argv)
     
    7866        {
    7967          char* ptr = NULL;
    80 #ifdef HAVE_STRTOD         
     68#ifdef HAVE_STRTOD
    8169          double mintime = strtod(argv[2], &ptr);
    8270          if (errno != ERANGE && ptr != argv[2])
     
    10290    else
    10391    {
    104    
     92
    10593      if ((argv[1][0] != '-') ||(argv[1][1] == '-'))
    10694        break;
     
    115103                     SINGULAR_VERSION_ID,__DATE__,__TIME__);
    116104              printf("with\n");
    117 #ifdef HAVE_FACTORY
    118               printf("\tfactory (%s),\n", factoryVersion);
    119 #endif
    120 #ifdef HAVE_LIBFAC_P
    121               printf("\tlibfac(%s,%s),\n",libfac_version,libfac_date);
    122 #endif
    123 #ifdef SRING
    124               printf("\tsuper algebra,\n");
    125 #endif
    126 #ifdef DRING
    127               printf("\tWeyl algebra,\n");
    128 #endif
    129 #ifdef HAVE_GMP
    130 #if defined (__GNU_MP_VERSION) && defined (__GNU_MP_VERSION_MINOR)
    131               printf("\tGMP(%d.%d),\n",__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR);
    132 #elif defined (HAVE_SMALLGMP)
    133               printf("\tSmallGMP(2.0.2.0),\n");
    134 #else               
    135               printf("\tGMP(1.3),\n");
    136 #endif             
    137 #endif
    138 #ifdef HAVE_DBM
    139               printf("\tDBM,\n");
    140 #endif
    141 #ifdef HAVE_MPSR
    142               printf("\tMP(%s),\n",MP_VERSION);
    143 #endif
    144 #if defined(HAVE_READLINE) && !defined(FEREAD)
    145               printf("\tlibreadline,\n");
    146 #endif
    147 #ifdef HAVE_FEREAD
    148               printf("\temulated libreadline,\n");
    149 #endif
    150 #ifdef HAVE_INFO
    151               printf("\tinfo,\n");
    152 #else             
    153               printf("\twithout info,\n");
    154 #endif
    155 #ifdef TEST
    156               printf("\tTESTs,\n");
    157 #endif
    158 #if YYDEBUG
    159               printf("\tYYDEBUG=1,\n");
    160 #endif
    161 #ifdef MDEBUG
    162               printf("\tMDEBUG=%d,\n",MDEBUG);
    163 #endif
    164 #ifndef __OPTIMIZE__
    165               printf("\t-g,\n");
    166 #endif
    167               printf("\trandom=%d\n",siRandomStart);
    168 #ifdef MSDOS
    169               char *p=getenv("SPATH");
    170 #else
    171               char *p=getenv("SINGULARPATH");
    172 #endif
    173               if (p!=NULL)
    174                 printf("search path:%s:%s\n\n",p,SINGULAR_DATADIR);
    175               else
    176                 printf("search path:%s\n\n", SINGULAR_DATADIR);
     105              printf(versionString());
     106              printf("\n\n");
    177107              break;
    178108            }
     
    182112              {
    183113                char* ptr = NULL;
    184 #ifdef HAVE_STRTOL       
     114#ifdef HAVE_STRTOL
    185115                long res = strtol(argv[2], &ptr, 10);
    186116                if (errno != ERANGE && ptr != argv[2] && res > 0)
     
    189119                sscanf(argv[2],"%d", &res);
    190120                if (res > 0)
    191 #endif         
     121#endif
    192122                {
    193123                  argc--;
     
    224154              #ifdef HAVE_FACTORY
    225155                factoryseed(siRandomStart);
    226               #endif 
     156              #endif
    227157              break;
    228158            case 'x': tclmode=TRUE;
     
    237167              fe_use_fgets=TRUE;
    238168#endif
     169              break;
     170            case 'n':
     171              load_std_lib=FALSE;
    239172              break;
    240173            default : printf("Unknown option -%c\n",argv[1][i]);
     
    245178    }
    246179  }
    247  
     180
    248181
    249182  /*. say hello */
     
    275208  dlInit(thisfile);
    276209  myynest=0;
    277   iiLibCmd(mstrdup("standard.lib"),TRUE);
     210  if (load_std_lib)
     211    iiLibCmd(mstrdup("standard.lib"),TRUE);
     212  errorreported = 0;
    278213#ifndef macintosh
    279214#if defined(HAVE_FEREAD) || defined(HAVE_READLINE)
Note: See TracChangeset for help on using the changeset viewer.