[BACK]Return to option.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan

Diff for /OpenXM/src/kan96xx/Kan/option.c between version 1.1 and 1.4

version 1.1, 1999/10/08 02:12:01 version 1.4, 2000/02/24 12:33:47
Line 1 
Line 1 
   /* $OpenXM: OpenXM/src/kan96xx/Kan/option.c,v 1.3 2000/02/24 00:27:12 takayama Exp $ */
 #include <stdio.h>  #include <stdio.h>
 #include "datatype.h"  #include "datatype.h"
 #include "stackm.h"  #include "stackm.h"
Line 11  extern void ctrlC();
Line 12  extern void ctrlC();
   
   
 struct object KsystemVariable(ob)  struct object KsystemVariable(ob)
 struct object ob; /* Sarray */           struct object ob; /* Sarray */
 {  {
   /* Don't forget to write the keys in usage.c */    /* Don't forget to write the keys in usage.c */
   extern int PrintDollar;    extern int PrintDollar;
Line 24  struct object ob; /* Sarray */
Line 25  struct object ob; /* Sarray */
   extern int CheckHomogenization;    extern int CheckHomogenization;
   extern int Homogenize;    extern int Homogenize;
   extern int Statistics;    extern int Statistics;
     extern int AutoReduce;
   extern int Osp;    extern int Osp;
   extern struct operandStack StandardStack;    extern struct operandStack StandardStack;
   extern struct operandStack ErrorStack;    extern struct operandStack ErrorStack;
Line 45  struct object ob; /* Sarray */
Line 47  struct object ob; /* Sarray */
   extern int DebugReductionRed; /* hidden option */    extern int DebugReductionRed; /* hidden option */
   extern char *VersionString;    extern char *VersionString;
   extern int AvoidTheSameRing;    extern int AvoidTheSameRing;
     extern char *LeftBracket;
     extern char *RightBracket;
     extern int SecureMode;
   
   int n,i;    int n,i;
   struct object ob1,ob2,ob3,ob4;    struct object ob1,ob2,ob3,ob4;
Line 55  struct object ob; /* Sarray */
Line 60  struct object ob; /* Sarray */
     switch(ob1.tag) {      switch(ob1.tag) {
     case Sdollar:      case Sdollar:
       if (strcmp(ob1.lc.str,"PrintDollar") == 0) {        if (strcmp(ob1.lc.str,"PrintDollar") == 0) {
         rob = KpoInteger(PrintDollar);                  rob = KpoInteger(PrintDollar);
       }else if (strcmp(ob1.lc.str,"Wrap") == 0) {        }else if (strcmp(ob1.lc.str,"Wrap") == 0) {
         rob = KpoInteger(Wrap);                  rob = KpoInteger(Wrap);
       }else if (strcmp(ob1.lc.str,"P") == 0) {        }else if (strcmp(ob1.lc.str,"P") == 0) {
         rob = KpoInteger(CurrentRingp->p);                  rob = KpoInteger(CurrentRingp->p);
       }else if (strcmp(ob1.lc.str,"N") == 0) {        }else if (strcmp(ob1.lc.str,"N") == 0) {
         rob = KpoInteger(CurrentRingp->n);                  rob = KpoInteger(CurrentRingp->n);
       }else if (strcmp(ob1.lc.str,"NN") == 0) {        }else if (strcmp(ob1.lc.str,"NN") == 0) {
         rob = KpoInteger(CurrentRingp->nn);                  rob = KpoInteger(CurrentRingp->nn);
       }else if (strcmp(ob1.lc.str,"M") == 0) {        }else if (strcmp(ob1.lc.str,"M") == 0) {
         rob = KpoInteger(CurrentRingp->m);                  rob = KpoInteger(CurrentRingp->m);
       }else if (strcmp(ob1.lc.str,"MM") == 0) {        }else if (strcmp(ob1.lc.str,"MM") == 0) {
         rob = KpoInteger(CurrentRingp->mm);                  rob = KpoInteger(CurrentRingp->mm);
       }else if (strcmp(ob1.lc.str,"L") == 0) {        }else if (strcmp(ob1.lc.str,"L") == 0) {
         rob = KpoInteger(CurrentRingp->l);                  rob = KpoInteger(CurrentRingp->l);
       }else if (strcmp(ob1.lc.str,"LL") == 0) {        }else if (strcmp(ob1.lc.str,"LL") == 0) {
         rob = KpoInteger(CurrentRingp->ll);                  rob = KpoInteger(CurrentRingp->ll);
       }else if (strcmp(ob1.lc.str,"C") == 0) {        }else if (strcmp(ob1.lc.str,"C") == 0) {
         rob = KpoInteger(CurrentRingp->c);                  rob = KpoInteger(CurrentRingp->c);
       }else if (strcmp(ob1.lc.str,"CC") == 0) {        }else if (strcmp(ob1.lc.str,"CC") == 0) {
         rob = KpoInteger(CurrentRingp->cc);                  rob = KpoInteger(CurrentRingp->cc);
       }else if (strcmp(ob1.lc.str,"CurrentRingp") == 0) {        }else if (strcmp(ob1.lc.str,"CurrentRingp") == 0) {
         rob = KpoRingp(CurrentRingp);                  rob = KpoRingp(CurrentRingp);
       }else if (strcmp(ob1.lc.str,"Verbose") == 0) {        }else if (strcmp(ob1.lc.str,"Verbose") == 0) {
         rob = KpoInteger(Verbose);                  rob = KpoInteger(Verbose);
       }else if (strcmp(ob1.lc.str,"UseCriterion1") == 0) {        }else if (strcmp(ob1.lc.str,"UseCriterion1") == 0) {
         rob = KpoInteger(UseCriterion1);                  rob = KpoInteger(UseCriterion1);
       }else if (strcmp(ob1.lc.str,"UseCriterion2B") == 0) {        }else if (strcmp(ob1.lc.str,"UseCriterion2B") == 0) {
         rob = KpoInteger(UseCriterion2B);                  rob = KpoInteger(UseCriterion2B);
       }else if (strcmp(ob1.lc.str,"ReduceLowerTerms") == 0) {        }else if (strcmp(ob1.lc.str,"ReduceLowerTerms") == 0) {
         rob = KpoInteger(ReduceLowerTerms);                  rob = KpoInteger(ReduceLowerTerms);
       }else if (strcmp(ob1.lc.str,"CheckHomogenization") == 0) {        }else if (strcmp(ob1.lc.str,"CheckHomogenization") == 0) {
         rob = KpoInteger(CheckHomogenization);                  rob = KpoInteger(CheckHomogenization);
       }else if (strcmp(ob1.lc.str,"Homogenize") == 0) {        }else if (strcmp(ob1.lc.str,"Homogenize") == 0) {
         rob = KpoInteger(Homogenize);                  rob = KpoInteger(Homogenize);
       }else if (strcmp(ob1.lc.str,"Statistics") == 0) {        }else if (strcmp(ob1.lc.str,"Statistics") == 0) {
         rob = KpoInteger(Statistics);                  rob = KpoInteger(Statistics);
         }else if (strcmp(ob1.lc.str,"AutoReduce") == 0) {
                   rob = KpoInteger(AutoReduce);
       }else if (strcmp(ob1.lc.str,"StackPointer") == 0) {        }else if (strcmp(ob1.lc.str,"StackPointer") == 0) {
         rob = KpoInteger(Osp);                  rob = KpoInteger(Osp);
       }else if (strcmp(ob1.lc.str,"StandardOperandStack") == 0) {        }else if (strcmp(ob1.lc.str,"StandardOperandStack") == 0) {
         rob.tag = Sclass;                  rob.tag = Sclass;
         rob.lc.ival = CLASSNAME_OPERANDSTACK;                  rob.lc.ival = CLASSNAME_OPERANDSTACK;
         rob.rc.voidp = &StandardStack;                  rob.rc.voidp = &StandardStack;
       }else if (strcmp(ob1.lc.str,"ErrorStack") == 0) {        }else if (strcmp(ob1.lc.str,"ErrorStack") == 0) {
         rob.tag = Sclass;                  rob.tag = Sclass;
         rob.lc.ival = CLASSNAME_OPERANDSTACK;                  rob.lc.ival = CLASSNAME_OPERANDSTACK;
         rob.rc.voidp = &ErrorStack;                  rob.rc.voidp = &ErrorStack;
       }else if (strcmp(ob1.lc.str,"ErrorMessageMode") == 0) {        }else if (strcmp(ob1.lc.str,"ErrorMessageMode") == 0) {
         rob = KpoInteger(ErrorMessageMode);                  rob = KpoInteger(ErrorMessageMode);
       }else if (strcmp(ob1.lc.str,"WarningMessageMode") == 0) {        }else if (strcmp(ob1.lc.str,"WarningMessageMode") == 0) {
         rob = KpoInteger(WarningMessageMode);                  rob = KpoInteger(WarningMessageMode);
       }else if (strcmp(ob1.lc.str,"CatchCtrlC") == 0) {        }else if (strcmp(ob1.lc.str,"CatchCtrlC") == 0) {
         rob = KpoInteger(CatchCtrlC);                  rob = KpoInteger(CatchCtrlC);
         /* If you catch ctrlc in KSexecuteString. */                  /* If you catch ctrlc in KSexecuteString. */
       }else if (strcmp(ob1.lc.str,"Strict") == 0) {        }else if (strcmp(ob1.lc.str,"Strict") == 0) {
         rob = KpoInteger(Strict);                  rob = KpoInteger(Strict);
       }else if (strcmp(ob1.lc.str,"CurrentContextp") == 0) {        }else if (strcmp(ob1.lc.str,"CurrentContextp") == 0) {
         rob.tag = Sclass;                  rob.tag = Sclass;
         rob.lc.ival = CLASSNAME_CONTEXT;                  rob.lc.ival = CLASSNAME_CONTEXT;
         rob.rc.voidp = CurrentContextp;                  rob.rc.voidp = CurrentContextp;
       }else if (strcmp(ob1.lc.str,"PrimitiveContextp") == 0) {        }else if (strcmp(ob1.lc.str,"PrimitiveContextp") == 0) {
         rob.tag = Sclass;                  rob.tag = Sclass;
         rob.lc.ival = CLASSNAME_CONTEXT;                  rob.lc.ival = CLASSNAME_CONTEXT;
         rob.rc.voidp = PrimitiveContextp;                  rob.rc.voidp = PrimitiveContextp;
       }else if (strcmp(ob1.lc.str,"NullContextp") == 0) {        }else if (strcmp(ob1.lc.str,"NullContextp") == 0) {
         rob.tag = Sclass;                  rob.tag = Sclass;
         rob.lc.ival = CLASSNAME_CONTEXT;                  rob.lc.ival = CLASSNAME_CONTEXT;
         rob.rc.voidp = (struct context *)NULL;                  rob.rc.voidp = (struct context *)NULL;
       }else if (strcmp(ob1.lc.str,"Strict2") == 0) {        }else if (strcmp(ob1.lc.str,"Strict2") == 0) {
         rob = KpoInteger(Strict2);                  rob = KpoInteger(Strict2);
       }else if (strcmp(ob1.lc.str,"SigIgn") == 0) {        }else if (strcmp(ob1.lc.str,"SigIgn") == 0) {
         rob = KpoInteger(SigIgn);                  rob = KpoInteger(SigIgn);
       }else if (strcmp(ob1.lc.str,"KSPushEnvMode") == 0) {        }else if (strcmp(ob1.lc.str,"KSPushEnvMode") == 0) {
         rob = KpoInteger(KSPushEnvMode);                  rob = KpoInteger(KSPushEnvMode);
       }else if (strcmp(ob1.lc.str,"KanGBmessage") == 0) {        }else if (strcmp(ob1.lc.str,"KanGBmessage") == 0) {
         rob = KpoInteger(KanGBmessage);                  rob = KpoInteger(KanGBmessage);
       }else if (strcmp(ob1.lc.str,"TimerOn") == 0) {        }else if (strcmp(ob1.lc.str,"TimerOn") == 0) {
         rob = KpoInteger(TimerOn);                  rob = KpoInteger(TimerOn);
       }else if (strcmp(ob1.lc.str,"orderMatrix") == 0) {        }else if (strcmp(ob1.lc.str,"orderMatrix") == 0) {
         rob = KgetOrderMatrixOfCurrentRing();                  rob = KgetOrderMatrixOfCurrentRing();
       }else if (strcmp(ob1.lc.str,"gbListTower") == 0) {        }else if (strcmp(ob1.lc.str,"gbListTower") == 0) {
         if (CurrentRingp->gbListTower == NULL) rob = NullObject;                  if (CurrentRingp->gbListTower == NULL) rob = NullObject;
         else rob = *((struct object *)(CurrentRingp->gbListTower));                  else rob = *((struct object *)(CurrentRingp->gbListTower));
       }else if (strcmp(ob1.lc.str,"outputOrder") == 0) {        }else if (strcmp(ob1.lc.str,"outputOrder") == 0) {
         n = CurrentRingp->n;                  n = CurrentRingp->n;
         ob1 = newObjectArray(n*2);                  ob1 = newObjectArray(n*2);
         for (i=0; i<2*n; i++) {                  for (i=0; i<2*n; i++) {
           putoa(ob1,i,KpoInteger(CurrentRingp->outputOrder[i]));                    putoa(ob1,i,KpoInteger(CurrentRingp->outputOrder[i]));
         }                  }
         rob = ob1;                  rob = ob1;
       }else if (strcmp(ob1.lc.str,"multSymbol") == 0) {        }else if (strcmp(ob1.lc.str,"multSymbol") == 0) {
         rob = KpoInteger(OutputStyle);                  rob = KpoInteger(OutputStyle);
       }else if (strcmp(ob1.lc.str,"Sugar") == 0) {        }else if (strcmp(ob1.lc.str,"Sugar") == 0) {
         rob = KpoInteger(Sugar);                  rob = KpoInteger(Sugar);
       }else if (strcmp(ob1.lc.str,"Homogenize_vec") == 0) {        }else if (strcmp(ob1.lc.str,"Homogenize_vec") == 0) {
         rob = KpoInteger(Homogenize_vec);                  rob = KpoInteger(Homogenize_vec);
       }else if (strcmp(ob1.lc.str,"Schreyer")==0) {        }else if (strcmp(ob1.lc.str,"Schreyer")==0) {
         rob = KpoInteger( CurrentRingp->schreyer );                  rob = KpoInteger( CurrentRingp->schreyer );
       }else if (strcmp(ob1.lc.str,"ringName")==0) {        }else if (strcmp(ob1.lc.str,"ringName")==0) {
         rob = KpoString( CurrentRingp->name );                  rob = KpoString( CurrentRingp->name );
       }else if (strcmp(ob1.lc.str,"CmoDMSOutputOption")==0) {        }else if (strcmp(ob1.lc.str,"CmoDMSOutputOption")==0) {
         rob = KpoInteger( CmoDMSOutputOption );                  rob = KpoInteger( CmoDMSOutputOption );
       }else if (strcmp(ob1.lc.str,"Version")==0) {        }else if (strcmp(ob1.lc.str,"Version")==0) {
         rob = KpoString(VersionString);                  rob = KpoString(VersionString);
       }else if (strcmp(ob1.lc.str,"RingStack")==0) {        }else if (strcmp(ob1.lc.str,"RingStack")==0) {
         KsetUpRing(NullObject,NullObject,NullObject,NullObject,NullObject);                  KsetUpRing(NullObject,NullObject,NullObject,NullObject,NullObject);
         rob = KSpop(); /* This is exceptional style */                  rob = KSpop(); /* This is exceptional style */
       }else if (strcmp(ob1.lc.str,"AvoidTheSameRing")==0) {        }else if (strcmp(ob1.lc.str,"AvoidTheSameRing")==0) {
         rob = KpoInteger(AvoidTheSameRing);                  rob = KpoInteger(AvoidTheSameRing);
         }else if (strcmp(ob1.lc.str,"LeftBracket")==0) {
                   rob = KpoString(LeftBracket);
         }else if (strcmp(ob1.lc.str,"RightBracket")==0) {
                   rob = KpoString(RightBracket);
         }else if (strcmp(ob1.lc.str,"SecureMode")==0) {
                   rob = KpoInteger(SecureMode);
       }else{        }else{
         warningKan("KsystemVariable():Unknown key word.\n");                  warningKan("KsystemVariable():Unknown key word.\n");
       }        }
       break;        break;
     default:      default:
Line 179  struct object ob; /* Sarray */
Line 192  struct object ob; /* Sarray */
     switch (Lookup[ob1.tag][ob2.tag]) {      switch (Lookup[ob1.tag][ob2.tag]) {
     case SdollarSinteger:      case SdollarSinteger:
       if (strcmp(ob1.lc.str,"PrintDollar") == 0) {        if (strcmp(ob1.lc.str,"PrintDollar") == 0) {
         PrintDollar = ob2.lc.ival;                  PrintDollar = ob2.lc.ival;
         rob = KpoInteger(PrintDollar);                  rob = KpoInteger(PrintDollar);
       }else if (strcmp(ob1.lc.str,"Wrap") == 0) {        }else if (strcmp(ob1.lc.str,"Wrap") == 0) {
         Wrap = ob2.lc.ival;                  Wrap = ob2.lc.ival;
         rob = KpoInteger(Wrap);                  rob = KpoInteger(Wrap);
       /*}else if (strcmp(ob1.lc.str,"P") == 0) {                  /*}else if (strcmp(ob1.lc.str,"P") == 0) {
         P = ob2.lc.ival;  Q should be set here too.                    P = ob2.lc.ival;  Q should be set here too.
         CurrentRingp->p = P;                    CurrentRingp->p = P;
         rob = KpoInteger(P); */                    rob = KpoInteger(P); */
       }else if (strcmp(ob1.lc.str,"NN") == 0) {        }else if (strcmp(ob1.lc.str,"NN") == 0) {
         if (ob2.lc.ival <= CurrentRingp->n && ob2.lc.ival >= CurrentRingp->m) {                  if (ob2.lc.ival <= CurrentRingp->n && ob2.lc.ival >= CurrentRingp->m) {
           CurrentRingp->nn = ob2.lc.ival;                    CurrentRingp->nn = ob2.lc.ival;
         }else{                  }else{
           warningKan("New value of NN is out of bound.");                    warningKan("New value of NN is out of bound.");
         }                  }
         rob = KpoInteger(ob1.lc.ival);                  rob = KpoInteger(ob1.lc.ival);
       }else if (strcmp(ob1.lc.str,"Verbose") == 0) {        }else if (strcmp(ob1.lc.str,"Verbose") == 0) {
         Verbose = ob2.lc.ival;                  Verbose = ob2.lc.ival;
         rob = KpoInteger(Verbose);                  rob = KpoInteger(Verbose);
       }else if (strcmp(ob1.lc.str,"UseCriterion1") == 0) {        }else if (strcmp(ob1.lc.str,"UseCriterion1") == 0) {
         UseCriterion1 = ob2.lc.ival;                  UseCriterion1 = ob2.lc.ival;
         rob = KpoInteger(UseCriterion1);                  rob = KpoInteger(UseCriterion1);
       }else if (strcmp(ob1.lc.str,"UseCriterion2B") == 0) {        }else if (strcmp(ob1.lc.str,"UseCriterion2B") == 0) {
         UseCriterion2B = ob2.lc.ival;                  UseCriterion2B = ob2.lc.ival;
         rob = KpoInteger(UseCriterion2B);                  rob = KpoInteger(UseCriterion2B);
       }else if (strcmp(ob1.lc.str,"ReduceLowerTerms") == 0) {        }else if (strcmp(ob1.lc.str,"ReduceLowerTerms") == 0) {
         ReduceLowerTerms = ob2.lc.ival;                  ReduceLowerTerms = ob2.lc.ival;
         rob = KpoInteger(ReduceLowerTerms);                  rob = KpoInteger(ReduceLowerTerms);
       }else if (strcmp(ob1.lc.str,"CheckHomogenization") == 0) {        }else if (strcmp(ob1.lc.str,"CheckHomogenization") == 0) {
         CheckHomogenization = ob2.lc.ival;                  CheckHomogenization = ob2.lc.ival;
         rob = KpoInteger(CheckHomogenization);                  rob = KpoInteger(CheckHomogenization);
       }else if (strcmp(ob1.lc.str,"Homogenize") == 0) {        }else if (strcmp(ob1.lc.str,"Homogenize") == 0) {
         Homogenize = ob2.lc.ival;                  Homogenize = ob2.lc.ival;
         rob = KpoInteger(Homogenize);                  rob = KpoInteger(Homogenize);
       }else if (strcmp(ob1.lc.str,"Statistics") == 0) {        }else if (strcmp(ob1.lc.str,"Statistics") == 0) {
         Statistics = ob2.lc.ival;                  Statistics = ob2.lc.ival;
         rob = KpoInteger(Statistics);                  rob = KpoInteger(Statistics);
         }else if (strcmp(ob1.lc.str,"AutoReduce") == 0) {
                   AutoReduce = ob2.lc.ival;
                   rob = KpoInteger(AutoReduce);
       }else if (strcmp(ob1.lc.str,"ErrorMessageMode") == 0) {        }else if (strcmp(ob1.lc.str,"ErrorMessageMode") == 0) {
         ErrorMessageMode = ob2.lc.ival;                  ErrorMessageMode = ob2.lc.ival;
         rob = KpoInteger(ErrorMessageMode);                  rob = KpoInteger(ErrorMessageMode);
       }else if (strcmp(ob1.lc.str,"WarningMessageMode") == 0) {        }else if (strcmp(ob1.lc.str,"WarningMessageMode") == 0) {
         WarningMessageMode = ob2.lc.ival;                  WarningMessageMode = ob2.lc.ival;
         rob = KpoInteger(WarningMessageMode);                  rob = KpoInteger(WarningMessageMode);
       }else if (strcmp(ob1.lc.str,"CatchCtrlC") == 0) {        }else if (strcmp(ob1.lc.str,"CatchCtrlC") == 0) {
         CatchCtrlC = ob2.lc.ival;                  CatchCtrlC = ob2.lc.ival;
         rob = KpoInteger(CatchCtrlC);                  rob = KpoInteger(CatchCtrlC);
       }else if (strcmp(ob1.lc.str,"Strict") == 0) {        }else if (strcmp(ob1.lc.str,"Strict") == 0) {
         Strict = ob2.lc.ival;                  Strict = ob2.lc.ival;
         rob = KpoInteger(Strict);                  rob = KpoInteger(Strict);
       }else if (strcmp(ob1.lc.str,"Strict2") == 0) {        }else if (strcmp(ob1.lc.str,"Strict2") == 0) {
         Strict2 = ob2.lc.ival;                  Strict2 = ob2.lc.ival;
         rob = KpoInteger(Strict2);                  rob = KpoInteger(Strict2);
       }else if (strcmp(ob1.lc.str,"SigIgn") == 0) {        }else if (strcmp(ob1.lc.str,"SigIgn") == 0) {
         SigIgn = ob2.lc.ival;                  SigIgn = ob2.lc.ival;
         if (SigIgn) signal(SIGINT,SIG_IGN);                  if (SigIgn) signal(SIGINT,SIG_IGN);
         else signal(SIGINT,ctrlC);                  else signal(SIGINT,ctrlC);
         rob = KpoInteger(SigIgn);                  rob = KpoInteger(SigIgn);
       }else if (strcmp(ob1.lc.str,"KSPushEnvMode") == 0) {        }else if (strcmp(ob1.lc.str,"KSPushEnvMode") == 0) {
         KSPushEnvMode = ob2.lc.ival;                  KSPushEnvMode = ob2.lc.ival;
         rob = KpoInteger(KSPushEnvMode);                  rob = KpoInteger(KSPushEnvMode);
       }else if (strcmp(ob1.lc.str,"KanGBmessage") == 0) {        }else if (strcmp(ob1.lc.str,"KanGBmessage") == 0) {
         KanGBmessage = ob2.lc.ival;                  KanGBmessage = ob2.lc.ival;
         rob = KpoInteger(KanGBmessage);                  rob = KpoInteger(KanGBmessage);
       }else if (strcmp(ob1.lc.str,"TimerOn") == 0) {        }else if (strcmp(ob1.lc.str,"TimerOn") == 0) {
         TimerOn = ob2.lc.ival;                  TimerOn = ob2.lc.ival;
         rob = KpoInteger(TimerOn);                  rob = KpoInteger(TimerOn);
       }else if (strcmp(ob1.lc.str,"multSymbol") == 0) {        }else if (strcmp(ob1.lc.str,"multSymbol") == 0) {
         OutputStyle = KopInteger(ob2);                  OutputStyle = KopInteger(ob2);
         rob = KpoInteger(OutputStyle);                  rob = KpoInteger(OutputStyle);
       }else if (strcmp(ob1.lc.str,"Sugar") == 0) {        }else if (strcmp(ob1.lc.str,"Sugar") == 0) {
         Sugar = KopInteger(ob2);                  Sugar = KopInteger(ob2);
         if (Sugar && ReduceLowerTerms) {                  if (Sugar && ReduceLowerTerms) {
           ReduceLowerTerms = 0;                    ReduceLowerTerms = 0;
           warningKan("ReduceLowerTerms is automatically set to 0, because Sugar = 1.");                    warningKan("ReduceLowerTerms is automatically set to 0, because Sugar = 1.");
           /* You cannot use both ReduceLowerTerms and sugar.                    /* You cannot use both ReduceLowerTerms and sugar.
              See gb.c, reduction_sugar. */                           See gb.c, reduction_sugar. */
         }                  }
         rob = KpoInteger(Sugar);                  rob = KpoInteger(Sugar);
       }else if (strcmp(ob1.lc.str,"Homogenize_vec") == 0) {        }else if (strcmp(ob1.lc.str,"Homogenize_vec") == 0) {
         Homogenize_vec = KopInteger(ob2);                  Homogenize_vec = KopInteger(ob2);
         rob = KpoInteger(Homogenize_vec);                  rob = KpoInteger(Homogenize_vec);
       }else if (strcmp(ob1.lc.str,"CmoDMSOutputOption") == 0) {        }else if (strcmp(ob1.lc.str,"CmoDMSOutputOption") == 0) {
         CmoDMSOutputOption = KopInteger(ob2);                  CmoDMSOutputOption = KopInteger(ob2);
         rob = KpoInteger(CmoDMSOutputOption);                  rob = KpoInteger(CmoDMSOutputOption);
       }else if (strcmp(ob1.lc.str,"DebugReductionRed") == 0) {        }else if (strcmp(ob1.lc.str,"DebugReductionRed") == 0) {
         DebugReductionRed = KopInteger(ob2);                  DebugReductionRed = KopInteger(ob2);
         rob = KpoInteger(DebugReductionRed);                  rob = KpoInteger(DebugReductionRed);
       }else if (strcmp(ob1.lc.str,"AvoidTheSameRing") == 0) {        }else if (strcmp(ob1.lc.str,"AvoidTheSameRing") == 0) {
         AvoidTheSameRing = KopInteger(ob2);                  AvoidTheSameRing = KopInteger(ob2);
         rob = KpoInteger(AvoidTheSameRing);                  rob = KpoInteger(AvoidTheSameRing);
         }else if (strcmp(ob1.lc.str,"SecureMode") == 0) {
                   if (KopInteger(ob2) >= SecureMode) {
                     SecureMode = KopInteger(ob2);
                   }else{
                     errorKan1("%s\n","You cannot weaken the security level.");
                   }
                   rob = KpoInteger(SecureMode);
       }else{        }else{
         warningKan("KsystemVariable():Unknown key word.\n");                  warningKan("KsystemVariable():Unknown key word.\n");
       }        }
       break;        break;
     case SdollarSdollar:      case SdollarSdollar:
       if (strcmp(ob1.lc.str,"ringName") == 0) {        if (strcmp(ob1.lc.str,"ringName") == 0) {
         CurrentRingp->name = KopString(ob2);                  CurrentRingp->name = KopString(ob2);
         rob = KpoString(CurrentRingp->name);                  rob = KpoString(CurrentRingp->name);
         }else if (strcmp(ob1.lc.str,"LeftBracket") == 0) {
                   LeftBracket = KopString(ob2);
                   rob = KpoString(LeftBracket);
         }else if (strcmp(ob1.lc.str,"RightBracket") == 0) {
                   RightBracket = KopString(ob2);
                   rob = KpoString(RightBracket);
       }else{        }else{
         warningKan("KsystemVariable():Unknown key word.\n");                  warningKan("KsystemVariable():Unknown key word.\n");
       }        }
       break;        break;
     case SdollarSring:      case SdollarSring:
       if (strcmp(ob1.lc.str,"CurrentRingp") == 0) {        if (strcmp(ob1.lc.str,"CurrentRingp") == 0) {
         CurrentRingp = ob2.lc.ringp;                  CurrentRingp = ob2.lc.ringp;
         rob = KpoRingp(CurrentRingp);                  rob = KpoRingp(CurrentRingp);
       }else{        }else{
         warningKan("KsystemVariable():Unknown key word.\n");                  warningKan("KsystemVariable():Unknown key word.\n");
       }        }
       break;        break;
     case SdollarSclass:      case SdollarSclass:
       if (strcmp(ob1.lc.str,"PrimitiveContextp") == 0) {        if (strcmp(ob1.lc.str,"PrimitiveContextp") == 0) {
         if (ectag(ob2) == CLASSNAME_CONTEXT) {                  if (ectag(ob2) == CLASSNAME_CONTEXT) {
           PrimitiveContextp = (struct context *)ob2.rc.voidp;                    PrimitiveContextp = (struct context *)ob2.rc.voidp;
           rob = ob2;                    rob = ob2;
         }else{                  }else{
           warningKan("The second argument must be class.context.\n");                    warningKan("The second argument must be class.context.\n");
           rob = NullObject;                    rob = NullObject;
         }                  }
       }else {        }else {
         warningKan("KsystemVariable():Unknown key word.\n");                  warningKan("KsystemVariable():Unknown key word.\n");
       }        }
       break;        break;
     case SdollarSlist:      case SdollarSlist:
       if (strcmp(ob1.lc.str,"gbListTower") == 0) {        if (strcmp(ob1.lc.str,"gbListTower") == 0) {
         if (AvoidTheSameRing)                  if (AvoidTheSameRing)
           warningKan("Changing gbListTower may cause a trouble under AvoidTheSameRing == 1.");                    warningKan("Changing gbListTower may cause a trouble under AvoidTheSameRing == 1.");
         CurrentRingp->gbListTower = newObject();                  CurrentRingp->gbListTower = newObject();
         *((struct object *)(CurrentRingp->gbListTower)) = ob2;                  *((struct object *)(CurrentRingp->gbListTower)) = ob2;
         rob = *((struct object *)(CurrentRingp->gbListTower));                  rob = *((struct object *)(CurrentRingp->gbListTower));
       }else {        }else {
         warningKan("KsystemVariable(): Unknown key word to set value.\n");                  warningKan("KsystemVariable(): Unknown key word to set value.\n");
       }        }
       break;        break;
     case SdollarSarray:      case SdollarSarray:
       if (strcmp(ob1.lc.str,"outputOrder") == 0) {        if (strcmp(ob1.lc.str,"outputOrder") == 0) {
         rob = KsetOutputOrder(ob2,CurrentRingp);                  rob = KsetOutputOrder(ob2,CurrentRingp);
       }else if (strcmp(ob1.lc.str,"variableNames") == 0) {        }else if (strcmp(ob1.lc.str,"variableNames") == 0) {
         rob = KsetVariableNames(ob2,CurrentRingp);                  rob = KsetVariableNames(ob2,CurrentRingp);
       }else {        }else {
         warningKan("KsystemVariable(): Unknown key word to set value.\n");                  warningKan("KsystemVariable(): Unknown key word to set value.\n");
       }        }
       break;        break;
     default:      default:
Line 331  struct object ob; /* Sarray */
Line 360  struct object ob; /* Sarray */
     switch(Lookup[ob1.tag][ob2.tag]) {      switch(Lookup[ob1.tag][ob2.tag]) {
     case SdollarSdollar:      case SdollarSdollar:
       if (strcmp(ob2.lc.str,"var") == 0) {        if (strcmp(ob2.lc.str,"var") == 0) {
         if (strcmp(ob1.lc.str,"x")==0) {                  if (strcmp(ob1.lc.str,"x")==0) {
           if (ob3.tag != Sinteger) {                    if (ob3.tag != Sinteger) {
             warningKan("[$x$ $var$ ? ] The 3rd argument must be integer.");                          warningKan("[$x$ $var$ ? ] The 3rd argument must be integer.");
             break;                          break;
           }                    }
           if (ob3.lc.ival >= 0 && ob3.lc.ival < CurrentRingp->n) {                    if (ob3.lc.ival >= 0 && ob3.lc.ival < CurrentRingp->n) {
             rob = KpoString(CurrentRingp->x[ob3.lc.ival]);                          rob = KpoString(CurrentRingp->x[ob3.lc.ival]);
           }else{                    }else{
             warningKan("[$x$ $var$ ? ] The 3rd argument is out of range.");                          warningKan("[$x$ $var$ ? ] The 3rd argument is out of range.");
             break;                          break;
           }                    }
         }else if (strcmp(ob1.lc.str,"D")==0) {                  }else if (strcmp(ob1.lc.str,"D")==0) {
           if (ob3.tag != Sinteger) {                    if (ob3.tag != Sinteger) {
             warningKan("[$D$ $var$ ? ] The 3rd argument must be integer.");                          warningKan("[$D$ $var$ ? ] The 3rd argument must be integer.");
             break;                          break;
           }                    }
           if (ob3.lc.ival >= 0 && ob3.lc.ival < CurrentRingp->n) {                    if (ob3.lc.ival >= 0 && ob3.lc.ival < CurrentRingp->n) {
             rob = KpoString(CurrentRingp->D[ob3.lc.ival]);                          rob = KpoString(CurrentRingp->D[ob3.lc.ival]);
           }else{                    }else{
             warningKan("[$D$ $var$ ? ] The 3rd argument is out of range.");                          warningKan("[$D$ $var$ ? ] The 3rd argument is out of range.");
             break;                          break;
           }                    }
         }                  }
       }else{        }else{
         warningKan("KsystemVariable(): Invalid argument.\n");                  warningKan("KsystemVariable(): Invalid argument.\n");
       }        }
       break;        break;
     default:      default:
Line 371  struct object ob; /* Sarray */
Line 400  struct object ob; /* Sarray */
 }  }
   
 warningOption(str)  warningOption(str)
 char *str;           char *str;
 {  {
   fprintf(stderr,"Warning(option.c): %s\n",str);    fprintf(stderr,"Warning(option.c): %s\n",str);
 }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>