Changeset 483400 in git


Ignore:
Timestamp:
Sep 8, 1998, 9:51:38 AM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
Children:
e25d2506636b3594dcac635aaedc2d79526a2bce
Parents:
22a6c7f06481695868b5e29ea6c97befee635701
Message:
* hannes: minor optimization


git-svn-id: file:///usr/local/Singular/svn/trunk@2504 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    r22a6c7 r483400  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: extra.cc,v 1.66 1998-07-23 15:44:38 Singular Exp $ */
     4/* $Id: extra.cc,v 1.67 1998-09-08 07:51:38 Singular Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
     
    9393*  the "system" command
    9494*/
    95 BOOLEAN jjSYSTEM(leftv res, leftv h)
     95BOOLEAN jjSYSTEM(leftv res, leftv args)
    9696{
    97   if(h->Typ() == STRING_CMD)
     97  if(args->Typ() == STRING_CMD)
    9898  {
     99    const char *sys_cmd=(char *)(args->Data());
     100    leftv h=args->next;
    99101// ONLY documented system calls go here
    100102// Undocumented system calls go down into #ifdef HAVE_EXTENDED_SYSTEM
    101103/*==================== nblocks ==================================*/
    102     if (strcmp((char*)(h->Data()), "nblocks") == 0)
     104    if (strcmp(sys_cmd, "nblocks") == 0)
    103105    {
    104106      ring r;
    105       if (h->next == NULL)
     107      if (h == NULL)
    106108      {
    107109        if (currRingHdl != NULL)
     
    117119      else
    118120      {
    119         if (h->next->Typ() != RING_CMD)
     121        if (h->Typ() != RING_CMD)
    120122        {
    121123          WerrorS("ring expected");
    122124          return TRUE;
    123125        }
    124         r = (ring) h->next->Data();
     126        r = (ring) h->Data();
    125127      }
    126128      res->rtyp = INT_CMD;
     
    129131    }
    130132/*==================== version ==================================*/
    131     if(strcmp((char*)(h->Data()),"version")==0)
     133    if(strcmp(sys_cmd,"version")==0)
    132134    {
    133135      res->rtyp=INT_CMD;
     
    137139    else
    138140/*==================== gen ==================================*/
    139     if(strcmp((char*)(h->Data()),"gen")==0)
     141    if(strcmp(sys_cmd,"gen")==0)
    140142    {
    141143      res->rtyp=INT_CMD;
     
    145147    else
    146148/*==================== sh ==================================*/
    147     #ifndef __MWERKS__
    148     if(strcmp((char*)(h->Data()),"sh")==0)
    149     {
     149    if(strcmp(sys_cmd,"sh")==0)
     150    {
     151      #ifndef __MWERKS__
    150152      #ifndef MSDOS
    151153      #ifdef HAVE_FEREAD
     
    153155      #endif
    154156      #endif
     157      #endif
    155158      res->rtyp=INT_CMD;
    156       if (h->next==NULL) res->data = (void *)system("sh");
    157       else res->data = (void*) system((char*)(h->next->Data()));
     159      #ifndef __MWERKS__
     160      if (h==NULL) res->data = (void *)system("sh");
     161      else if (h->Typ()==STRING_CMD)
     162        res->data = (void*) system((char*)(h->Data()));
     163      else
     164        WerrorS("string expected");
     165      #else
     166      res->data=(void *)0;
     167      #endif
     168      #ifndef __MWERKS__
    158169      #ifndef MSDOS
    159170      #ifdef HAVE_FEREAD
     
    161172      #endif
    162173      #endif
    163       return FALSE;
    164     }
    165     else
    166     #endif
     174      #endif
     175      return FALSE;
     176    }
     177    else
    167178/*==================== with ==================================*/
    168     if(strcmp((char*)(h->Data()),"with")==0)
    169     {
    170       if (h->next==NULL)
     179    if(strcmp(sys_cmd,"with")==0)
     180    {
     181      if (h==NULL)
    171182      {
    172183        res->rtyp=STRING_CMD;
     
    174185        return FALSE;
    175186      }
    176       else if (h->next->Typ()==STRING_CMD)
     187      else if (h->Typ()==STRING_CMD)
    177188      {
    178189        #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
    179         char *s=(char *)h->next->Data();
     190        char *s=(char *)h->Data();
    180191        res->rtyp=INT_CMD;
    181192        #ifdef DRING
     
    223234    else
    224235/*==================== pid ==================================*/
     236    if (strcmp(sys_cmd,"pid")==0)
     237    {
     238      res->rtyp=INT_CMD;
    225239    #ifndef MSDOS
    226240    #ifndef __MWERKS__
    227     if (strcmp((char*)(h->Data()),"pid")==0)
    228     {
    229       res->rtyp=INT_CMD;
    230241      res->data=(void *)getpid();
    231       return FALSE;
    232     }
    233     else
     242    #else
     243      res->data=(void *)1;
    234244    #endif
     245    #else
     246      res->data=(void *)1;
    235247    #endif
     248      return FALSE;
     249    }
     250    else
    236251/*==================== getenv ==================================*/
    237     if (strcmp((char*)(h->Data()),"getenv")==0)
    238     {
    239       if ((h->next!=NULL) && (h->next->Typ()==STRING_CMD))
     252    if (strcmp(sys_cmd,"getenv")==0)
     253    {
     254      if ((h!=NULL) && (h->Typ()==STRING_CMD))
    240255      {
    241256        res->rtyp=STRING_CMD;
    242         char *r=getenv((char *)h->next->Data());
     257        char *r=getenv((char *)h->Data());
    243258        if (r==NULL) r="";
    244259        res->data=(void *)mstrdup(r);
     
    255270    #ifndef MSDOS
    256271    #if defined(HAVE_FEREAD) || defined(HAVE_READLINE)
    257     if (strcmp((char*)(h->Data()),"tty")==0)
     272    if (strcmp(sys_cmd,"tty")==0)
    258273    {
    259274      #ifdef HAVE_FEREAD
     
    266281      system("stty sane");
    267282      #endif
    268       if ((h->next!=NULL)&&(h->next->Typ()==INT_CMD))
    269       {
    270         fe_use_fgets=(int)h->next->Data();
     283      if ((h!=NULL)&&(h->Typ()==INT_CMD))
     284      {
     285        fe_use_fgets=(int)h->Data();
    271286        fe_set_input_mode();
    272287      }
     
    279294/*==================== Singular ==================================*/
    280295#ifndef __MWERKS__
    281     if (strcmp((char*)(h->data), "Singular") == 0)
     296    if (strcmp(sys_cmd, "Singular") == 0)
    282297    {
    283298      res->rtyp=STRING_CMD;
     
    292307#endif
    293308/*==================== options ==================================*/
    294     if (strstr((char*)(h->data), "--") == (char*)(h->data))
     309    if (strstr(sys_cmd, "--") == sys_cmd)
    295310    {
    296311      BOOLEAN mainGetSingOptionValue(const char* name, char** result);
    297312      char* val;
    298313
    299       if (mainGetSingOptionValue(&((char*)(h->data))[2], &val))
     314      if (mainGetSingOptionValue(&(sys_cmd)[2], &val))
    300315      {
    301316        if ((unsigned int) val > 1)
     
    313328      else
    314329      {
    315         Werror("Unknown option %s\n", (char*)(h->data));
     330        Werror("Unknown option %s\n", sys_cmd);
    316331        return TRUE;
    317332      }
     
    319334    else
    320335/*==================== HC ==================================*/
    321     if (strcmp((char*)(h->data),"HC")==0)
     336    if (strcmp(sys_cmd,"HC")==0)
    322337    {
    323338      res->rtyp=INT_CMD;
     
    327342    else
    328343/*==================== random ==================================*/
    329     if(strcmp((char*)(h->Data()),"random")==0)
    330     {
    331       if ((h->next!=NULL) &&(h->next->Typ()==INT_CMD))
    332       {
    333         siRandomStart=(int)h->next->Data();
     344    if(strcmp(sys_cmd,"random")==0)
     345    {
     346      if ((h!=NULL) &&(h->Typ()==INT_CMD))
     347      {
     348        siRandomStart=(int)h->Data();
    334349#ifdef buildin_rand
    335350        siSeed=siRandomStart;
     
    339354        return FALSE;
    340355      }
    341       else if (h->next != NULL)
     356      else if (h != NULL)
    342357      {
    343358        WerrorS("int expected");
     
    351366// should go below
    352367#ifdef HAVE_LIBFAC_P
    353     if(strcmp((char*)(h->Data()),"neworder")==0)
    354     {
    355       if ((h->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))
     368    if(strcmp(sys_cmd,"neworder")==0)
     369    {
     370      if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
    356371      {
    357372        res->rtyp=STRING_CMD;
    358         res->data=(void *)singclap_neworder((ideal)h->next->Data());
     373        res->data=(void *)singclap_neworder((ideal)h->Data());
    359374        return FALSE;
    360375      }
     
    365380#endif
    366381/*==================== contributors =============================*/
    367    if(strcmp((char*)(h->Data()),"contributors") == 0)
     382   if(strcmp(sys_cmd,"contributors") == 0)
    368383   {
    369384     res->rtyp=STRING_CMD;
     
    376391/*================= Extended system call ========================*/
    377392#ifdef HAVE_EXTENDED_SYSTEM
    378      return(jjEXTENDED_SYSTEM(res, h));
     393     return(jjEXTENDED_SYSTEM(res, args));
    379394#else
    380      WerrorS( feNotImplemented );
     395     Werror( "system(\"%s\",...) %s", sys_cmd, feNotImplemented );
    381396#endif
    382397   }
     
    398413  if(h->Typ() == STRING_CMD)
    399414  {
     415    char *sys_cmd=(char *)(h->Data());
     416    h=h->next;
    400417/*==================== latest ==================================*/
    401     if(strcmp((char*)(h->Data()),"la")==0)
    402     {
    403       if (h->next!=NULL)
     418    if(strcmp(sys_cmd,"la")==0)
     419    {
     420      if (h!=NULL)
    404421      {
    405422        int i0=-1, i1=-1;
    406         leftv hh=h->next->next;
     423        leftv hh=h->next;
    407424        if ((hh!=NULL)&&(hh->Typ()==INT_CMD))
    408425        {
     
    411428            i1=(int)hh->next->Data();
    412429        }
    413         if(h->next->Typ()==IDEAL_CMD)
     430        if(h->Typ()==IDEAL_CMD)
    414431        {
    415432        // "la",<ideal>[,<int d0>[,<int d1>]]:
     
    420437            if (i0==(-1)) i0=0;
    421438          }
    422           ideal I=(ideal)(h->next->Data());
     439          ideal I=(ideal)(h->Data());
    423440          laSet();
    424441          ideal m=laI2Mo(I,i0,i1);
     
    429446        }
    430447        else
    431         if(h->next->Typ()==MODUL_CMD)
     448        if(h->Typ()==MODUL_CMD)
    432449        {
    433450        // "la",<module>[,<int c0>[,<int c1>]]:
     
    438455            if (i0==(-1)) i0=1;
    439456          }
    440           ideal M=(ideal)(h->next->Data());
     457          ideal M=(ideal)(h->Data());
    441458          laSet();
    442459          ideal I=laMo2I(M,i0,i1);
     
    452469    else
    453470/*==================== naIdeal ==================================*/
    454     if(strcmp((char*)(h->Data()),"naIdeal")==0)
    455     {
    456       if ((h->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))
    457       {
    458         naSetIdeal((ideal)h->next->Data());
     471    if(strcmp(sys_cmd,"naIdeal")==0)
     472    {
     473      if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
     474      {
     475        naSetIdeal((ideal)h->Data());
    459476        return FALSE;
    460477      }
     
    465482/*==================== isSqrFree =============================*/
    466483#ifdef HAVE_FACTORY
    467     if(strcmp((char*)(h->Data()),"isSqrFree")==0)
    468     {
    469       if ((h->next!=NULL) &&(h->next->Typ()==POLY_CMD))
     484    if(strcmp(sys_cmd,"isSqrFree")==0)
     485    {
     486      if ((h!=NULL) &&(h->Typ()==POLY_CMD))
    470487      {
    471488        res->rtyp=INT_CMD;
    472         res->data=(void *)singclap_isSqrFree((poly)h->next->Data());
     489        res->data=(void *)singclap_isSqrFree((poly)h->Data());
    473490        return FALSE;
    474491      }
     
    483500#ifndef atarist
    484501#ifdef unix
    485     if(strcmp((char*)(h->Data()),"alarm")==0)
    486     {
    487       if ((h->next!=NULL) &&(h->next->Typ()==INT_CMD))
     502    if(strcmp(sys_cmd,"alarm")==0)
     503    {
     504      if ((h!=NULL) &&(h->Typ()==INT_CMD))
    488505      {
    489506        // standard variant -> SIGALARM (standard: abort)
     
    492509        struct itimerval t,o;
    493510        memset(&t,0,sizeof(t));
    494         t.it_value.tv_sec     =(unsigned)h->next->Data();
     511        t.it_value.tv_sec     =(unsigned)h->Data();
    495512        setitimer(ITIMER_VIRTUAL,&t,&o);
    496513        return FALSE;
     
    506523/*==================== red =============================*/
    507524#if 0
    508     if(strcmp((char*)(h->Data()),"red")==0)
    509     {
    510      if ((h->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))
     525    if(strcmp(sys_cmd,"red")==0)
     526    {
     527      if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
    511528      {
    512529        res->rtyp=IDEAL_CMD;
    513         res->data=(void *)kStdred((ideal)h->next->Data(),NULL,testHomog,NULL);
     530        res->data=(void *)kStdred((ideal)h->Data(),NULL,testHomog,NULL);
    514531        setFlag(res,FLAG_STD);
    515532        return FALSE;
     
    521538#endif
    522539/*==================== algfetch =====================*/
    523     if (strcmp((char*)(h->Data()),"algfetch")==0)
     540    if (strcmp(sys_cmd,"algfetch")==0)
    524541    {
    525542      int k;
    526543      idhdl w;
    527544      ideal i0, i1;
    528       leftv v=h->next;
    529       ring r0=(ring)v->Data();
    530       v = v->next;
     545      ring r0=(ring)h->Data();
     546      leftv v = h->next;
    531547      w = r0->idroot->get(v->Name(),myynest);
    532548      i0 = IDIDEAL(w);
     
    542558    else
    543559/*==================== algmap =======================*/
    544     if (strcmp((char*)(h->Data()),"algmap")==0)
     560    if (strcmp(sys_cmd,"algmap")==0)
    545561    {
    546562      int k;
    547563      idhdl w;
    548564      ideal i0, i1, i, j;
    549       leftv v=h->next;
    550       ring r0=(ring)v->Data();
    551       v = v->next;
     565      ring r0=(ring)h->Data();
     566      leftv v = h->next;
    552567      w = r0->idroot->get(v->Name(),myynest);
    553568      i0 = IDIDEAL(w);
     
    569584#ifdef STDTRACE
    570585    /* Parameter : Ideal, Liste mit Links. */
    571     if(strcmp((char*)(h->Data()),"stdtrace")==0)
    572     {
    573       if ((h->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))
     586    if(strcmp(sys_cmd,"stdtrace")==0)
     587    {
     588      if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
    574589      {
    575590        leftv root  = NULL,
     
    577592              lv    = NULL;
    578593        lists l     = NULL;
    579         ideal I     = (ideal)(h->next->Data());
    580         lists links = (lists)(h->next->next->Data());
     594        ideal I     = (ideal)(h->Data());
     595        lists links = (lists)(h->next->Data());
    581596        tHomog hom  = testHomog;
    582         int rw      = (int)(h->next->next->next->Data());
     597        int rw      = (int)(h->next->next->Data());
    583598
    584599        if(I==NULL)
     
    618633#ifdef HAVE_FACTORY
    619634/*==================== fastcomb =============================*/
    620     if(strcmp((char*)(h->Data()),"fastcomb")==0)
    621     {
    622       if ((h->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))
     635    if(strcmp(sys_cmd,"fastcomb")==0)
     636    {
     637      if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
    623638      {
    624639        int i=0;
    625         if (h->next->next!=NULL)
    626         {
    627           if (h->next->next->Typ()!=POLY_CMD)
     640        if (h->next!=NULL)
     641        {
     642          if (h->next->Typ()!=POLY_CMD)
     643          {
     644            Warn("Wrong types for poly= comb(ideal,poly)");
     645          }
     646        }
     647        res->rtyp=POLY_CMD;
     648        res->data=(void *) fglmLinearCombination(
     649                           (ideal)h->Data(),(poly)h->next->Data());
     650        return FALSE;
     651      }
     652      else
     653        WerrorS("ideal expected");
     654    }
     655    else
     656/*==================== comb =============================*/
     657    if(strcmp(sys_cmd,"comb")==0)
     658    {
     659      if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
     660      {
     661        int i=0;
     662        if (h->next!=NULL)
     663        {
     664          if (h->next->Typ()!=POLY_CMD)
    628665          {
    629666              Warn("Wrong types for poly= comb(ideal,poly)");
     
    631668        }
    632669        res->rtyp=POLY_CMD;
    633         res->data=(void *) fglmLinearCombination(
    634                            (ideal)h->next->Data(),(poly)h->next->next->Data());
     670        res->data=(void *)fglmNewLinearCombination(
     671                            (ideal)h->Data(),(poly)h->next->Data());
    635672        return FALSE;
    636673      }
     
    639676    }
    640677    else
    641 /*==================== comb =============================*/
    642     if(strcmp((char*)(h->Data()),"comb")==0)
    643     {
    644       if ((h->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))
    645       {
    646         int i=0;
    647         if (h->next->next!=NULL)
    648         {
    649           if (h->next->next->Typ()!=POLY_CMD)
    650           {
    651               Warn("Wrong types for poly= comb(ideal,poly)");
    652           }
    653         }
    654         res->rtyp=POLY_CMD;
    655         res->data=(void *)fglmNewLinearCombination(
    656                             (ideal)h->next->Data(),(poly)h->next->next->Data());
    657         return FALSE;
    658       }
    659       else
    660         WerrorS("ideal expected");
    661     }
    662     else
    663678#endif
    664679/*==================== barstep =============================*/
    665     if(strcmp((char*)(h->Data()),"barstep")==0)
    666     {
    667       if ((h->next!=NULL) &&(h->next->Typ()==MATRIX_CMD))
    668       {
    669         if (h->next->next!=NULL)
    670         {
    671           if (h->next->next->Typ()!=POLY_CMD)
     680    if(strcmp(sys_cmd,"barstep")==0)
     681    {
     682      if ((h!=NULL) &&(h->Typ()==MATRIX_CMD))
     683      {
     684        if (h->next!=NULL)
     685        {
     686          if (h->next->Typ()!=POLY_CMD)
    672687          {
    673688            Warn("Wrong types for barstep(matrix,poly)");
     
    675690        }
    676691        int r,c;
    677         poly div=(poly)h->next->next->Data();
     692        poly div=(poly)h->next->Data();
    678693        res->rtyp=MATRIX_CMD;
    679         res->data=(void *)mpOneStepBareiss((matrix)h->next->Data(),
     694        res->data=(void *)mpOneStepBareiss((matrix)h->Data(),
    680695                                           &div,&r,&c);
    681696        Print("div: ");pWrite(div);
     
    690705#ifdef FACTORY_GCD_TEST
    691706/*=======================gcd Testerei ================================*/
    692     if ( ! strcmp( (char*)(h->Data()), "setgcd" ) ) {
    693         if ( (h->next != NULL) && (h->next->Typ() == INT_CMD) ) {
    694             CFPrimitiveGcdUtil::setAlgorithm( (int)h->next->Data() );
     707    if ( ! strcmp( sys_cmd, "setgcd" ) ) {
     708        if ( (h != NULL) && (h->Typ() == INT_CMD) ) {
     709            CFPrimitiveGcdUtil::setAlgorithm( (int)h->Data() );
    695710            return FALSE;
    696711        } else
     
    701716
    702717#ifdef FACTORY_GCD_TIMING
    703     if ( ! strcmp( (char*)(h->Data()), "gcdtime" ) ) {
     718    if ( ! strcmp( sys_cmd, "gcdtime" ) ) {
    704719        TIMING_PRINT( contentTimer, "time used for content: " );
    705720        TIMING_PRINT( algContentTimer, "time used for algContent: " );
     
    714729
    715730#ifdef FACTORY_GCD_STAT
    716     if ( ! strcmp( (char*)(h->Data()), "gcdstat" ) ) {
     731    if ( ! strcmp( sys_cmd, "gcdstat" ) ) {
    717732        printGcdTotal();
    718733        printContTotal();
     
    724739#endif
    725740/*==================== lib ==================================*/
    726     if(strcmp((char*)(h->Data()),"LIB")==0)
     741    if(strcmp(sys_cmd,"LIB")==0)
    727742    {
    728743#ifdef HAVE_NAMESPACES
    729       idhdl hh=namespaceroot->get((char*)h->next->Data(),0);
     744      idhdl hh=namespaceroot->get((char*)h->Data(),0);
    730745#else /* HAVE_NAMESPACES */
    731       idhdl hh=idroot->get((char*)h->next->Data(),0);
     746      idhdl hh=idroot->get((char*)h->Data(),0);
    732747#endif /* HAVE_NAMESPACES */
    733748      if ((hh!=NULL)&&(IDTYP(hh)==PROC_CMD))
     
    740755      }
    741756      else
    742         Warn("`%s` not found",(char*)h->next->Data());
     757        Warn("`%s` not found",(char*)h->Data());
    743758    }
    744759    else
    745760#ifdef HAVE_NAMESPACES
    746761/*==================== nspush ===================================*/
    747     if(strcmp((char*)(h->Data()),"nspush")==0)
    748     {
    749       idhdl hh=namespaceroot->get((char*)h->next->Data(),0, TRUE);
     762    if(strcmp(sys_cmd,"nspush")==0)
     763    {
     764      idhdl hh=namespaceroot->get((char*)h->Data(),0, TRUE);
    750765      if ((hh!=NULL)&&(IDTYP(hh)==PACKAGE_CMD))
    751766      {
     
    754769      }
    755770      else
    756         Warn("package `%s` not found",(char*)h->next->Data());
     771        Warn("package `%s` not found",(char*)h->Data());
    757772    }
    758773    else
    759774/*==================== nspop ====================================*/
    760     if(strcmp((char*)(h->Data()),"nspop")==0)
     775    if(strcmp(sys_cmd,"nspop")==0)
    761776    {
    762777      namespaceroot->pop();
     
    765780    else
    766781/*==================== nsstack ===================================*/
    767     if(strcmp((char*)(h->Data()),"nsstack")==0)
     782    if(strcmp(sys_cmd,"nsstack")==0)
    768783    {
    769784      namehdl nshdl = namespaceroot;
     
    777792#endif /* HAVE_NAMESPACES */
    778793/*==================== proclist =================================*/
    779     if(strcmp((char*)(h->Data()),"proclist")==0)
     794    if(strcmp(sys_cmd,"proclist")==0)
    780795    {
    781796      piShowProcList();
     
    785800#ifdef HAVE_DYNAMIC_LOADING
    786801/*==================== load ==================================*/
    787     if(strcmp((char*)(h->Data()),"load")==0)
    788     {
    789       if ((h->next!=NULL) && (h->next->Typ()==STRING_CMD)) {
     802    if(strcmp(sys_cmd,"load")==0)
     803    {
     804      if ((h!=NULL) && (h->Typ()==STRING_CMD)) {
    790805        int iiAddCproc(char *libname, char *procname, BOOLEAN pstatic,
    791806                       BOOLEAN(*func)(leftv res, leftv v));
     
    796811        res->rtyp=STRING_CMD;
    797812
    798         fprintf(stderr, "Loading %s\n", h->next->Data());
     813        fprintf(stderr, "Loading %s\n", h->Data());
    799814        res->data=(void *)mstrdup("");
    800815        if((vp=dlopen(h->next->Data(),RTLD_LAZY))==(void *)NULL)
    801816        {
    802817          WerrorS("dlopen failed");
    803           Werror("%s not found", h->next->Data());
     818          Werror("%s not found", h->Data());
    804819        }
    805820        else
     
    818833/* ==================== newton ================================*/
    819834#ifdef HAVE_NEWTON
    820     if(strcmp((char*)(h->Data()),"newton")==0)
    821     {
    822       if ((h->next->Typ()!=POLY_CMD)
    823       || (h->next->next->Typ()!=INT_CMD)
    824       || (h->next->next->next->Typ()!=INT_CMD))
     835    if(strcmp(sys_cmd,"newton")==0)
     836    {
     837      if ((h->Typ()!=POLY_CMD)
     838      || (h->next->Typ()!=INT_CMD)
     839      || (h->next->next->Typ()!=INT_CMD))
    825840      {
    826841        WerrorS("system(\"newton\",<poly>,<int>,<int>) expected");
    827842        return TRUE;
    828843      }
    829       poly  p=(poly)(h->next->Data());
     844      poly  p=(poly)(h->Data());
    830845      int l=pLength(p);
    831846      short *points=(short *)Alloc(currRing->N*l*sizeof(short));
     
    846861                (short*) points,   // points: x_1, y_1,z_1, x_2,y_2,z2,...
    847862                currRing->OrdSgn==-1,
    848                 (int) (h->next->next->Data()),      // 1: Milnor, 0: Newton
    849                 (int) (h->next->next->next->Data()) // debug
     863                (int) (h->next->Data()),      // 1: Milnor, 0: Newton
     864                (int) (h->next->next->Data()) // debug
    850865               );
    851866      //----<>---Output-----------------------
     
    909924/*==================== print all option values =================*/
    910925#ifndef NDEBUG
    911     if (strcmp((char*)(h->data), "options") == 0)
     926    if (strcmp(sys_cmd, "options") == 0)
    912927    {
    913928      void mainOptionValues();
     
    917932    else
    918933#endif
    919       WerrorS( feNotImplemented );
     934      Werror( "system(\"%s\",...) %s", sys_cmd, feNotImplemented );
    920935  }
    921936  return TRUE;
Note: See TracChangeset for help on using the changeset viewer.