Changeset 58b151c in git


Ignore:
Timestamp:
Apr 28, 1997, 11:57:56 AM (27 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c0d3de967ae65902159cbfdc8db9a2fd0ca46287
Parents:
1cb558b9e3a25bad17969f3fb3d94440b04a1d51
Message:
* hannes: added chmod +x testgh (to be sure..)
          changed verbose ->option (misc.cc, iparith.cc, ipshell.h)


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

Legend:

Unmodified
Added
Removed
  • Singular/Makefile.in

    r1cb558 r58b151c  
    118118.y.cc:
    119119        ${BISON} -d -t -o grammar.cc $<
     120        chmod +x testgh
    120121        ./testgh
    121122
  • Singular/iparith.cc

    r1cb558 r58b151c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.23 1997-04-25 15:03:58 obachman Exp $ */
     4/* $Id: iparith.cc,v 1.24 1997-04-28 09:57:54 Singular Exp $ */
    55/*
    66* ABSTRACT: table driven kernel interface, used by interpreter
     
    274274  { "vdim",        0, VDIM_CMD ,          CMD_1},
    275275  { "vector",      0, VECTOR_CMD ,        RING_DECL},
    276   { "verbose",     0, VERBOSE_CMD ,       CMD_M},
    277276  { "wedge",       0, WEDGE_CMD ,         CMD_2},
    278277  { "weight",      0, WEIGHT_CMD ,        CMD_1},
     
    283282  { "NF",          1, REDUCE_CMD ,        CMD_23},
    284283  { "multiplicity",1, MULTIPLICITY_CMD ,  CMD_1},
     284  { "verbose",     1, OPTION_CMD ,        CMD_M},
    285285//  { "rank",        1, ROWS_CMD ,          CMD_1},
    286286
     
    39873987  if(v==NULL)
    39883988  {
    3989     showOption(iiOp);
     3989    showOption();
    39903990    return FALSE;
    39913991  }
     
    40914091,{jjSYSTEM,    SYSTEM_CMD,      NONE/*or set by p*/,-2 }
    40924092,{jjTEST,      TEST_CMD,        NONE,               -2 }
    4093 ,{jjOPTION_PL, VERBOSE_CMD,     NONE/*or set by p*/,-1 }
    40944093,{iiWRITE,     WRITE_CMD,       NONE,               -2 }
    40954094,{NULL,        0,               0,                  0  }
  • Singular/ipshell.h

    r1cb558 r58b151c  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ipshell.h,v 1.3 1997-04-09 12:19:51 Singular Exp $ */
     6/* $Id: ipshell.h,v 1.4 1997-04-28 09:57:55 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    141141sleftv * iiMake_proc(idhdl pn, sleftv* sl);
    142142// from misc.cc:
    143 void   showOption(int cmd);
     143void   showOption();
    144144BOOLEAN setOption(leftv res, leftv v);
    145145/* ================================================================== */
  • Singular/misc.cc

    r1cb558 r58b151c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: misc.cc,v 1.7 1997-04-25 15:04:03 obachman Exp $ */
     4/* $Id: misc.cc,v 1.8 1997-04-28 09:57:56 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    3131#include "subexpr.h"
    3232#include "timer.h"
     33#include "intvec.h"
    3334
    3435/*0 implementation*/
     
    453454    int i;
    454455
    455     if (iiOp==OPTION_CMD)
    456     {
    457       if(strcmp(n,"get")==0)
    458       {
    459         res->rtyp=INT_CMD;
    460         res->data=(void *)test;
     456    if(strcmp(n,"get")==0)
     457    {
     458      intvec *w=new intvec(2);
     459      (*w)[0]=test;
     460      (*w)[1]=verbose;
     461      res->rtyp=INTVEC_CMD;
     462      res->data=(void *)w;
     463      goto okay;
     464    }
     465    if(strcmp(n,"set")==0)
     466    {
     467      if((v->next!=NULL)
     468      &&(v->next->Typ()==INTVEC_CMD))
     469      {
     470        v=v->next;
     471        intvec *w=(intvec*)v->Data(); 
     472        test=(*w)[0];
     473        verbose=(*w)[1];
     474       
     475        if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) && (currRing->ch>=2))
     476        {
     477          test &=~Sy_bit(OPT_INTSTRATEGY);
     478        }
    461479        goto okay;
    462       }
    463       if(strcmp(n,"set")==0)
    464       {
    465         if((v->next!=NULL)
    466         &&(v->next->Typ()==INT_CMD))
    467         {
    468           v=v->next;
    469           test=(int)v->Data();
    470           if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) && (currRing->ch>=2))
    471           {
    472             test &=~Sy_bit(OPT_INTSTRATEGY);
    473           }
    474           goto okay;
    475         } 
    476       }
    477       for (i=0; (i==0) || (optionStruct[i-1].setval!=0); i++)
    478       {
    479         if (strcmp(n,optionStruct[i].name)==0)
    480         {
    481           if (optionStruct[i].setval & validOpts)
    482             test |= optionStruct[i].setval;
    483           else
    484             Warn("cannot set option");
    485           if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) && (currRing->ch>=2))
    486           {
    487             test &=~Sy_bit(OPT_INTSTRATEGY);
    488           }
    489           goto okay;
    490         }
    491         else if ((strncmp(n,"no",2)==0)
    492         && (strcmp(n+2,optionStruct[i].name)==0))
    493         {
    494           if ((optionStruct[i].setval & validOpts)
    495           || (strcmp(n+2,"ne")==0))
    496           {
    497             test &= optionStruct[i].resetval;
    498           }
    499           else
    500             Warn("cannot clear option");
    501           goto okay;
    502         }
    503       }
    504       if(v->Typ()==INT_CMD)
    505       {
    506         test=(int)v->Data();
    507         return FALSE;
    508       }
    509     }
    510     else
    511     {
    512       if(strcmp(n,"get")==0)
    513       {
    514         res->rtyp=INT_CMD;
    515         res->data=(void *)verbose;
     480      } 
     481    }
     482    for (i=0; (i==0) || (optionStruct[i-1].setval!=0); i++)
     483    {
     484      if (strcmp(n,optionStruct[i].name)==0)
     485      {
     486        if (optionStruct[i].setval & validOpts)
     487          test |= optionStruct[i].setval;
     488        else
     489          Warn("cannot set option");
     490        if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) && (currRing->ch>=2))
     491        {
     492          test &=~Sy_bit(OPT_INTSTRATEGY);
     493        }
    516494        goto okay;
    517495      }
    518       if(strcmp(n,"set")==0)
    519       {
    520         if((v->next!=NULL)
    521         &&(v->next->Typ()==INT_CMD))
    522         {
    523           v=v->next;
    524           verbose=(int)v->Data();
    525           goto okay;
    526         } 
    527       }
    528       for (i=0; (i==0) || (verboseStruct[i-1].setval!=0); i++)
    529       {
    530         if (strcmp(n,verboseStruct[i].name)==0)
    531         {
    532           verbose |= verboseStruct[i].setval;
    533 #ifdef YYDEBUG
    534 #if YYDEBUG
    535           if (BVERBOSE(V_YACC)) yydebug=1;
    536           else                  yydebug=0;
    537 #endif
    538 #endif
    539           goto okay;
    540         }
    541         else if ((strncmp(n,"no",2)==0)
    542         && (strcmp(n+2,verboseStruct[i].name)==0))
    543         {
    544           verbose &= verboseStruct[i].resetval;
    545 #ifdef YYDEBUG
    546 #if YYDEBUG
    547           if (BVERBOSE(V_YACC)) yydebug=1;
    548           else                  yydebug=0;
    549 #endif
    550 #endif
    551           goto okay;
    552        }
    553      }
    554    }
    555    Werror("unknown option `%s`",n);
     496      else if ((strncmp(n,"no",2)==0)
     497      && (strcmp(n+2,optionStruct[i].name)==0))
     498      {
     499        if ((optionStruct[i].setval & validOpts)
     500        || (strcmp(n+2,"ne")==0))
     501        {
     502          test &= optionStruct[i].resetval;
     503        }
     504        else
     505          Warn("cannot clear option");
     506        goto okay;
     507      }
     508    }
     509    for (i=0; (i==0) || (verboseStruct[i-1].setval!=0); i++)
     510    {
     511      if (strcmp(n,verboseStruct[i].name)==0)
     512      {
     513        verbose |= verboseStruct[i].setval;
     514        #ifdef YYDEBUG
     515        #if YYDEBUG
     516        if (BVERBOSE(V_YACC)) yydebug=1;
     517        else                  yydebug=0;
     518        #endif
     519        #endif
     520        goto okay;
     521      }
     522      else if ((strncmp(n,"no",2)==0)
     523      && (strcmp(n+2,verboseStruct[i].name)==0))
     524      {
     525        verbose &= verboseStruct[i].resetval;
     526        #ifdef YYDEBUG
     527        #if YYDEBUG
     528        if (BVERBOSE(V_YACC)) yydebug=1;
     529        else                  yydebug=0;
     530        #endif
     531        #endif
     532        goto okay;
     533      }
     534    }
     535    Werror("unknown option `%s`",n);
    556536  okay:
    557537    FreeL((ADDRESS)n);
     
    561541}
    562542
    563 void showOption(int cmd)
     543void showOption()
    564544{
    565545  int i;
    566546  BITSET tmp;
    567547
    568   if (cmd==OPTION_CMD)
     548  PrintS("//options:");
     549  if ((test!=0)||(verbose!=0))
    569550  {
    570551    tmp=test;
    571     PrintS("//options for 'std'-command:");
    572     if (tmp)
     552    if(tmp)
    573553    {
    574554      for (i=0; optionStruct[i].setval!=0; i++)
     
    584564        if (tmp & Sy_bit(i)) Print(" %d",i);
    585565      }
    586       PrintLn();
    587     }
    588     else
    589       PrintS(" none\n");
    590   }
    591   else
    592   {
     566    }
    593567    tmp=verbose;
    594     PrintS("//verbose:");
    595568    if (tmp)
    596569    {
     
    605578      for (i=1; i<32; i++)
    606579      {
    607         if (tmp & Sy_bit(i)) Print(" %d",i);
    608       }
    609       PrintLn();
    610     }
    611     else
    612       PrintS(" minimum\n");
    613   }
     580        if (tmp & Sy_bit(i)) Print(" %d",i+32);
     581      }
     582    }
     583    PrintLn();
     584  }
     585  else
     586    PrintS(" none\n");
    614587}
    615588
Note: See TracChangeset for help on using the changeset viewer.