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

Annotation of OpenXM/src/kan96xx/Kan/option.c, Revision 1.12

1.12    ! takayama    1: /* $OpenXM: OpenXM/src/kan96xx/Kan/option.c,v 1.11 2003/08/19 08:02:10 takayama Exp $ */
1.1       maekawa     2: #include <stdio.h>
                      3: #include "datatype.h"
                      4: #include "stackm.h"
                      5: #include "extern.h"
                      6: #include "gradedset.h"
                      7: #include "kclass.h"
                      8: #include "lookup.h"
                      9: #include <signal.h>
                     10:
                     11: extern void ctrlC();
                     12:
                     13:
                     14: struct object KsystemVariable(ob)
1.5       takayama   15:      struct object ob; /* Sarray */
1.1       maekawa    16: {
                     17:   /* Don't forget to write the keys in usage.c */
                     18:   extern int PrintDollar;
                     19:   extern int Wrap;
                     20:   extern struct ring *CurrentRingp;
                     21:   extern int Verbose;
                     22:   extern int UseCriterion1;
                     23:   extern int UseCriterion2B;
                     24:   extern int ReduceLowerTerms;
                     25:   extern int CheckHomogenization;
                     26:   extern int Homogenize;
                     27:   extern int Statistics;
1.3       takayama   28:   extern int AutoReduce;
1.1       maekawa    29:   extern int Osp;
                     30:   extern struct operandStack StandardStack;
                     31:   extern struct operandStack ErrorStack;
                     32:   extern int ErrorMessageMode;
                     33:   extern int WarningMessageMode;
                     34:   extern int CatchCtrlC;
                     35:   extern int Strict;
                     36:   extern struct context *CurrentContextp;
                     37:   extern struct context *PrimitiveContextp;
                     38:   extern int Strict2;
                     39:   extern int SigIgn;
                     40:   extern int KSPushEnvMode;
                     41:   extern int KanGBmessage;
                     42:   extern int TimerOn;
                     43:   extern int OutputStyle;
                     44:   extern int Sugar;
                     45:   extern int Homogenize_vec;
                     46:   extern int CmoDMSOutputOption;
                     47:   extern int DebugReductionRed; /* hidden option */
1.9       takayama   48:   extern int DebugReductionEcart;
1.1       maekawa    49:   extern char *VersionString;
                     50:   extern int AvoidTheSameRing;
1.2       takayama   51:   extern char *LeftBracket;
                     52:   extern char *RightBracket;
1.4       takayama   53:   extern int SecureMode;
1.7       takayama   54:   extern int Ecart;
1.8       takayama   55:   extern int EcartAutomaticHomogenization;
1.11      takayama   56:   extern int TraceLift;
1.12    ! takayama   57:   extern int DoCancel;
1.1       maekawa    58:
                     59:   int n,i;
                     60:   struct object ob1,ob2,ob3,ob4;
                     61:   struct object rob = NullObject;
                     62:   switch (getoaSize(ob)) {
                     63:   case 1:   /* get the value */
                     64:     ob1 = getoa(ob,0);
                     65:     switch(ob1.tag) {
                     66:     case Sdollar:
                     67:       if (strcmp(ob1.lc.str,"PrintDollar") == 0) {
1.5       takayama   68:         rob = KpoInteger(PrintDollar);
1.1       maekawa    69:       }else if (strcmp(ob1.lc.str,"Wrap") == 0) {
1.5       takayama   70:         rob = KpoInteger(Wrap);
1.1       maekawa    71:       }else if (strcmp(ob1.lc.str,"P") == 0) {
1.5       takayama   72:         rob = KpoInteger(CurrentRingp->p);
1.1       maekawa    73:       }else if (strcmp(ob1.lc.str,"N") == 0) {
1.5       takayama   74:         rob = KpoInteger(CurrentRingp->n);
1.1       maekawa    75:       }else if (strcmp(ob1.lc.str,"NN") == 0) {
1.5       takayama   76:         rob = KpoInteger(CurrentRingp->nn);
1.1       maekawa    77:       }else if (strcmp(ob1.lc.str,"M") == 0) {
1.5       takayama   78:         rob = KpoInteger(CurrentRingp->m);
1.1       maekawa    79:       }else if (strcmp(ob1.lc.str,"MM") == 0) {
1.5       takayama   80:         rob = KpoInteger(CurrentRingp->mm);
1.1       maekawa    81:       }else if (strcmp(ob1.lc.str,"L") == 0) {
1.5       takayama   82:         rob = KpoInteger(CurrentRingp->l);
1.1       maekawa    83:       }else if (strcmp(ob1.lc.str,"LL") == 0) {
1.5       takayama   84:         rob = KpoInteger(CurrentRingp->ll);
1.1       maekawa    85:       }else if (strcmp(ob1.lc.str,"C") == 0) {
1.5       takayama   86:         rob = KpoInteger(CurrentRingp->c);
1.1       maekawa    87:       }else if (strcmp(ob1.lc.str,"CC") == 0) {
1.5       takayama   88:         rob = KpoInteger(CurrentRingp->cc);
1.1       maekawa    89:       }else if (strcmp(ob1.lc.str,"CurrentRingp") == 0) {
1.5       takayama   90:         rob = KpoRingp(CurrentRingp);
1.1       maekawa    91:       }else if (strcmp(ob1.lc.str,"Verbose") == 0) {
1.5       takayama   92:         rob = KpoInteger(Verbose);
1.1       maekawa    93:       }else if (strcmp(ob1.lc.str,"UseCriterion1") == 0) {
1.5       takayama   94:         rob = KpoInteger(UseCriterion1);
1.1       maekawa    95:       }else if (strcmp(ob1.lc.str,"UseCriterion2B") == 0) {
1.5       takayama   96:         rob = KpoInteger(UseCriterion2B);
1.1       maekawa    97:       }else if (strcmp(ob1.lc.str,"ReduceLowerTerms") == 0) {
1.5       takayama   98:         rob = KpoInteger(ReduceLowerTerms);
1.1       maekawa    99:       }else if (strcmp(ob1.lc.str,"CheckHomogenization") == 0) {
1.5       takayama  100:         rob = KpoInteger(CheckHomogenization);
1.1       maekawa   101:       }else if (strcmp(ob1.lc.str,"Homogenize") == 0) {
1.5       takayama  102:         rob = KpoInteger(Homogenize);
1.1       maekawa   103:       }else if (strcmp(ob1.lc.str,"Statistics") == 0) {
1.5       takayama  104:         rob = KpoInteger(Statistics);
1.3       takayama  105:       }else if (strcmp(ob1.lc.str,"AutoReduce") == 0) {
1.5       takayama  106:         rob = KpoInteger(AutoReduce);
1.1       maekawa   107:       }else if (strcmp(ob1.lc.str,"StackPointer") == 0) {
1.5       takayama  108:         rob = KpoInteger(Osp);
1.1       maekawa   109:       }else if (strcmp(ob1.lc.str,"StandardOperandStack") == 0) {
1.5       takayama  110:         rob.tag = Sclass;
                    111:         rob.lc.ival = CLASSNAME_OPERANDSTACK;
                    112:         rob.rc.voidp = &StandardStack;
1.1       maekawa   113:       }else if (strcmp(ob1.lc.str,"ErrorStack") == 0) {
1.5       takayama  114:         rob.tag = Sclass;
                    115:         rob.lc.ival = CLASSNAME_OPERANDSTACK;
                    116:         rob.rc.voidp = &ErrorStack;
1.1       maekawa   117:       }else if (strcmp(ob1.lc.str,"ErrorMessageMode") == 0) {
1.5       takayama  118:         rob = KpoInteger(ErrorMessageMode);
1.1       maekawa   119:       }else if (strcmp(ob1.lc.str,"WarningMessageMode") == 0) {
1.5       takayama  120:         rob = KpoInteger(WarningMessageMode);
1.1       maekawa   121:       }else if (strcmp(ob1.lc.str,"CatchCtrlC") == 0) {
1.5       takayama  122:         rob = KpoInteger(CatchCtrlC);
                    123:         /* If you catch ctrlc in KSexecuteString. */
1.1       maekawa   124:       }else if (strcmp(ob1.lc.str,"Strict") == 0) {
1.5       takayama  125:         rob = KpoInteger(Strict);
1.1       maekawa   126:       }else if (strcmp(ob1.lc.str,"CurrentContextp") == 0) {
1.5       takayama  127:         rob.tag = Sclass;
                    128:         rob.lc.ival = CLASSNAME_CONTEXT;
                    129:         rob.rc.voidp = CurrentContextp;
1.1       maekawa   130:       }else if (strcmp(ob1.lc.str,"PrimitiveContextp") == 0) {
1.5       takayama  131:         rob.tag = Sclass;
                    132:         rob.lc.ival = CLASSNAME_CONTEXT;
                    133:         rob.rc.voidp = PrimitiveContextp;
1.1       maekawa   134:       }else if (strcmp(ob1.lc.str,"NullContextp") == 0) {
1.5       takayama  135:         rob.tag = Sclass;
                    136:         rob.lc.ival = CLASSNAME_CONTEXT;
                    137:         rob.rc.voidp = (struct context *)NULL;
1.1       maekawa   138:       }else if (strcmp(ob1.lc.str,"Strict2") == 0) {
1.5       takayama  139:         rob = KpoInteger(Strict2);
1.1       maekawa   140:       }else if (strcmp(ob1.lc.str,"SigIgn") == 0) {
1.5       takayama  141:         rob = KpoInteger(SigIgn);
1.1       maekawa   142:       }else if (strcmp(ob1.lc.str,"KSPushEnvMode") == 0) {
1.5       takayama  143:         rob = KpoInteger(KSPushEnvMode);
1.1       maekawa   144:       }else if (strcmp(ob1.lc.str,"KanGBmessage") == 0) {
1.5       takayama  145:         rob = KpoInteger(KanGBmessage);
1.1       maekawa   146:       }else if (strcmp(ob1.lc.str,"TimerOn") == 0) {
1.5       takayama  147:         rob = KpoInteger(TimerOn);
1.1       maekawa   148:       }else if (strcmp(ob1.lc.str,"orderMatrix") == 0) {
1.5       takayama  149:         rob = KgetOrderMatrixOfCurrentRing();
1.1       maekawa   150:       }else if (strcmp(ob1.lc.str,"gbListTower") == 0) {
1.5       takayama  151:         if (CurrentRingp->gbListTower == NULL) rob = NullObject;
                    152:         else rob = *((struct object *)(CurrentRingp->gbListTower));
1.1       maekawa   153:       }else if (strcmp(ob1.lc.str,"outputOrder") == 0) {
1.5       takayama  154:         n = CurrentRingp->n;
                    155:         ob1 = newObjectArray(n*2);
                    156:         for (i=0; i<2*n; i++) {
                    157:           putoa(ob1,i,KpoInteger(CurrentRingp->outputOrder[i]));
                    158:         }
                    159:         rob = ob1;
1.1       maekawa   160:       }else if (strcmp(ob1.lc.str,"multSymbol") == 0) {
1.5       takayama  161:         rob = KpoInteger(OutputStyle);
1.1       maekawa   162:       }else if (strcmp(ob1.lc.str,"Sugar") == 0) {
1.5       takayama  163:         rob = KpoInteger(Sugar);
1.1       maekawa   164:       }else if (strcmp(ob1.lc.str,"Homogenize_vec") == 0) {
1.5       takayama  165:         rob = KpoInteger(Homogenize_vec);
1.1       maekawa   166:       }else if (strcmp(ob1.lc.str,"Schreyer")==0) {
1.5       takayama  167:         rob = KpoInteger( CurrentRingp->schreyer );
1.1       maekawa   168:       }else if (strcmp(ob1.lc.str,"ringName")==0) {
1.5       takayama  169:         rob = KpoString( CurrentRingp->name );
1.1       maekawa   170:       }else if (strcmp(ob1.lc.str,"CmoDMSOutputOption")==0) {
1.5       takayama  171:         rob = KpoInteger( CmoDMSOutputOption );
1.1       maekawa   172:       }else if (strcmp(ob1.lc.str,"Version")==0) {
1.5       takayama  173:         rob = KpoString(VersionString);
1.1       maekawa   174:       }else if (strcmp(ob1.lc.str,"RingStack")==0) {
1.5       takayama  175:         KsetUpRing(NullObject,NullObject,NullObject,NullObject,NullObject);
                    176:         rob = KSpop(); /* This is exceptional style */
1.1       maekawa   177:       }else if (strcmp(ob1.lc.str,"AvoidTheSameRing")==0) {
1.5       takayama  178:         rob = KpoInteger(AvoidTheSameRing);
1.2       takayama  179:       }else if (strcmp(ob1.lc.str,"LeftBracket")==0) {
1.5       takayama  180:         rob = KpoString(LeftBracket);
1.2       takayama  181:       }else if (strcmp(ob1.lc.str,"RightBracket")==0) {
1.5       takayama  182:         rob = KpoString(RightBracket);
1.4       takayama  183:       }else if (strcmp(ob1.lc.str,"SecureMode")==0) {
1.5       takayama  184:         rob = KpoInteger(SecureMode);
1.7       takayama  185:       }else if (strcmp(ob1.lc.str,"Ecart")==0) {
                    186:         rob = KpoInteger(Ecart);
1.8       takayama  187:       }else if (strcmp(ob1.lc.str,"EcartAutomaticHomogenization")==0) {
                    188:         rob = KpoInteger(EcartAutomaticHomogenization);
1.11      takayama  189:       }else if (strcmp(ob1.lc.str,"TraceLift")==0) {
                    190:         rob = KpoInteger(TraceLift);
1.12    ! takayama  191:       }else if (strcmp(ob1.lc.str,"DoCancel")==0) {
        !           192:         rob = KpoInteger(DoCancel);
1.1       maekawa   193:       }else{
1.5       takayama  194:         warningKan("KsystemVariable():Unknown key word.\n");
1.1       maekawa   195:       }
                    196:       break;
                    197:     default:
                    198:       warningKan("KsystemVariable():Invalid argument\n");
                    199:       break;
                    200:     }
                    201:     break;
                    202:   case 2: /* set value */
                    203:     ob1 = getoa(ob,0);
                    204:     ob2 = getoa(ob,1);
                    205:     switch (Lookup[ob1.tag][ob2.tag]) {
                    206:     case SdollarSinteger:
                    207:       if (strcmp(ob1.lc.str,"PrintDollar") == 0) {
1.5       takayama  208:         PrintDollar = ob2.lc.ival;
                    209:         rob = KpoInteger(PrintDollar);
1.1       maekawa   210:       }else if (strcmp(ob1.lc.str,"Wrap") == 0) {
1.5       takayama  211:         Wrap = ob2.lc.ival;
                    212:         rob = KpoInteger(Wrap);
                    213:         /*}else if (strcmp(ob1.lc.str,"P") == 0) {
                    214:           P = ob2.lc.ival;  Q should be set here too.
                    215:           CurrentRingp->p = P;
                    216:           rob = KpoInteger(P); */
1.1       maekawa   217:       }else if (strcmp(ob1.lc.str,"NN") == 0) {
1.5       takayama  218:         if (ob2.lc.ival <= CurrentRingp->n && ob2.lc.ival >= CurrentRingp->m) {
                    219:           CurrentRingp->nn = ob2.lc.ival;
                    220:         }else{
                    221:           warningKan("New value of NN is out of bound.");
                    222:         }
                    223:         rob = KpoInteger(ob1.lc.ival);
1.1       maekawa   224:       }else if (strcmp(ob1.lc.str,"Verbose") == 0) {
1.5       takayama  225:         Verbose = ob2.lc.ival;
                    226:         rob = KpoInteger(Verbose);
1.1       maekawa   227:       }else if (strcmp(ob1.lc.str,"UseCriterion1") == 0) {
1.5       takayama  228:         UseCriterion1 = ob2.lc.ival;
                    229:         rob = KpoInteger(UseCriterion1);
1.1       maekawa   230:       }else if (strcmp(ob1.lc.str,"UseCriterion2B") == 0) {
1.5       takayama  231:         UseCriterion2B = ob2.lc.ival;
                    232:         rob = KpoInteger(UseCriterion2B);
1.1       maekawa   233:       }else if (strcmp(ob1.lc.str,"ReduceLowerTerms") == 0) {
1.5       takayama  234:         ReduceLowerTerms = ob2.lc.ival;
                    235:         rob = KpoInteger(ReduceLowerTerms);
1.1       maekawa   236:       }else if (strcmp(ob1.lc.str,"CheckHomogenization") == 0) {
1.5       takayama  237:         CheckHomogenization = ob2.lc.ival;
                    238:         rob = KpoInteger(CheckHomogenization);
1.1       maekawa   239:       }else if (strcmp(ob1.lc.str,"Homogenize") == 0) {
1.5       takayama  240:         Homogenize = ob2.lc.ival;
                    241:         rob = KpoInteger(Homogenize);
1.1       maekawa   242:       }else if (strcmp(ob1.lc.str,"Statistics") == 0) {
1.5       takayama  243:         Statistics = ob2.lc.ival;
                    244:         rob = KpoInteger(Statistics);
1.3       takayama  245:       }else if (strcmp(ob1.lc.str,"AutoReduce") == 0) {
1.5       takayama  246:         AutoReduce = ob2.lc.ival;
                    247:         rob = KpoInteger(AutoReduce);
1.1       maekawa   248:       }else if (strcmp(ob1.lc.str,"ErrorMessageMode") == 0) {
1.5       takayama  249:         ErrorMessageMode = ob2.lc.ival;
                    250:         rob = KpoInteger(ErrorMessageMode);
1.1       maekawa   251:       }else if (strcmp(ob1.lc.str,"WarningMessageMode") == 0) {
1.5       takayama  252:         WarningMessageMode = ob2.lc.ival;
                    253:         rob = KpoInteger(WarningMessageMode);
1.1       maekawa   254:       }else if (strcmp(ob1.lc.str,"CatchCtrlC") == 0) {
1.5       takayama  255:         CatchCtrlC = ob2.lc.ival;
                    256:         rob = KpoInteger(CatchCtrlC);
1.1       maekawa   257:       }else if (strcmp(ob1.lc.str,"Strict") == 0) {
1.5       takayama  258:         Strict = ob2.lc.ival;
                    259:         rob = KpoInteger(Strict);
1.1       maekawa   260:       }else if (strcmp(ob1.lc.str,"Strict2") == 0) {
1.5       takayama  261:         Strict2 = ob2.lc.ival;
                    262:         rob = KpoInteger(Strict2);
1.1       maekawa   263:       }else if (strcmp(ob1.lc.str,"SigIgn") == 0) {
1.5       takayama  264:         SigIgn = ob2.lc.ival;
                    265:         if (SigIgn) signal(SIGINT,SIG_IGN);
                    266:         else signal(SIGINT,ctrlC);
                    267:         rob = KpoInteger(SigIgn);
1.1       maekawa   268:       }else if (strcmp(ob1.lc.str,"KSPushEnvMode") == 0) {
1.5       takayama  269:         KSPushEnvMode = ob2.lc.ival;
                    270:         rob = KpoInteger(KSPushEnvMode);
1.1       maekawa   271:       }else if (strcmp(ob1.lc.str,"KanGBmessage") == 0) {
1.5       takayama  272:         KanGBmessage = ob2.lc.ival;
                    273:         rob = KpoInteger(KanGBmessage);
1.1       maekawa   274:       }else if (strcmp(ob1.lc.str,"TimerOn") == 0) {
1.5       takayama  275:         TimerOn = ob2.lc.ival;
                    276:         rob = KpoInteger(TimerOn);
1.1       maekawa   277:       }else if (strcmp(ob1.lc.str,"multSymbol") == 0) {
1.5       takayama  278:         OutputStyle = KopInteger(ob2);
                    279:         rob = KpoInteger(OutputStyle);
1.1       maekawa   280:       }else if (strcmp(ob1.lc.str,"Sugar") == 0) {
1.5       takayama  281:         Sugar = KopInteger(ob2);
                    282:         if (Sugar && ReduceLowerTerms) {
                    283:           ReduceLowerTerms = 0;
                    284:           warningKan("ReduceLowerTerms is automatically set to 0, because Sugar = 1.");
                    285:           /* You cannot use both ReduceLowerTerms and sugar.
                    286:              See gb.c, reduction_sugar. */
                    287:         }
                    288:         rob = KpoInteger(Sugar);
1.1       maekawa   289:       }else if (strcmp(ob1.lc.str,"Homogenize_vec") == 0) {
1.5       takayama  290:         Homogenize_vec = KopInteger(ob2);
                    291:         rob = KpoInteger(Homogenize_vec);
1.1       maekawa   292:       }else if (strcmp(ob1.lc.str,"CmoDMSOutputOption") == 0) {
1.5       takayama  293:         CmoDMSOutputOption = KopInteger(ob2);
                    294:         rob = KpoInteger(CmoDMSOutputOption);
1.1       maekawa   295:       }else if (strcmp(ob1.lc.str,"DebugReductionRed") == 0) {
1.5       takayama  296:         DebugReductionRed = KopInteger(ob2);
                    297:         rob = KpoInteger(DebugReductionRed);
1.9       takayama  298:       }else if (strcmp(ob1.lc.str,"DebugReductionEcart") == 0) {
                    299:         DebugReductionEcart = KopInteger(ob2);
                    300:         rob = KpoInteger(DebugReductionEcart);
1.1       maekawa   301:       }else if (strcmp(ob1.lc.str,"AvoidTheSameRing") == 0) {
1.5       takayama  302:         AvoidTheSameRing = KopInteger(ob2);
                    303:         rob = KpoInteger(AvoidTheSameRing);
1.4       takayama  304:       }else if (strcmp(ob1.lc.str,"SecureMode") == 0) {
1.5       takayama  305:         if (KopInteger(ob2) >= SecureMode) {
                    306:           SecureMode = KopInteger(ob2);
                    307:         }else{
                    308:           errorKan1("%s\n","You cannot weaken the security level.");
                    309:         }
                    310:         rob = KpoInteger(SecureMode);
1.7       takayama  311:       }else if (strcmp(ob1.lc.str,"Ecart") == 0) {
                    312:         Ecart = KopInteger(ob2);
                    313:         rob = KpoInteger(Ecart);
1.8       takayama  314:       }else if (strcmp(ob1.lc.str,"EcartAutomaticHomogenization") == 0) {
1.10      takayama  315:         EcartAutomaticHomogenization = KopInteger(ob2);
1.8       takayama  316:         rob = KpoInteger(EcartAutomaticHomogenization);
1.11      takayama  317:       }else if (strcmp(ob1.lc.str,"TraceLift") == 0) {
                    318:         TraceLift = KopInteger(ob2);
                    319:         rob = KpoInteger(TraceLift);
1.12    ! takayama  320:       }else if (strcmp(ob1.lc.str,"DoCancel") == 0) {
        !           321:         DoCancel = KopInteger(ob2);
        !           322:         rob = KpoInteger(DoCancel);
1.1       maekawa   323:       }else{
1.5       takayama  324:         warningKan("KsystemVariable():Unknown key word.\n");
1.1       maekawa   325:       }
                    326:       break;
                    327:     case SdollarSdollar:
                    328:       if (strcmp(ob1.lc.str,"ringName") == 0) {
1.5       takayama  329:         CurrentRingp->name = KopString(ob2);
                    330:         rob = KpoString(CurrentRingp->name);
1.2       takayama  331:       }else if (strcmp(ob1.lc.str,"LeftBracket") == 0) {
1.5       takayama  332:         LeftBracket = KopString(ob2);
                    333:         rob = KpoString(LeftBracket);
1.2       takayama  334:       }else if (strcmp(ob1.lc.str,"RightBracket") == 0) {
1.5       takayama  335:         RightBracket = KopString(ob2);
                    336:         rob = KpoString(RightBracket);
1.1       maekawa   337:       }else{
1.5       takayama  338:         warningKan("KsystemVariable():Unknown key word.\n");
1.1       maekawa   339:       }
                    340:       break;
                    341:     case SdollarSring:
                    342:       if (strcmp(ob1.lc.str,"CurrentRingp") == 0) {
1.5       takayama  343:         CurrentRingp = ob2.lc.ringp;
                    344:         rob = KpoRingp(CurrentRingp);
1.1       maekawa   345:       }else{
1.5       takayama  346:         warningKan("KsystemVariable():Unknown key word.\n");
1.1       maekawa   347:       }
                    348:       break;
                    349:     case SdollarSclass:
                    350:       if (strcmp(ob1.lc.str,"PrimitiveContextp") == 0) {
1.5       takayama  351:         if (ectag(ob2) == CLASSNAME_CONTEXT) {
                    352:           PrimitiveContextp = (struct context *)ob2.rc.voidp;
                    353:           rob = ob2;
                    354:         }else{
                    355:           warningKan("The second argument must be class.context.\n");
                    356:           rob = NullObject;
                    357:         }
1.1       maekawa   358:       }else {
1.5       takayama  359:         warningKan("KsystemVariable():Unknown key word.\n");
1.1       maekawa   360:       }
                    361:       break;
                    362:     case SdollarSlist:
                    363:       if (strcmp(ob1.lc.str,"gbListTower") == 0) {
1.5       takayama  364:         if (AvoidTheSameRing)
                    365:           warningKan("Changing gbListTower may cause a trouble under AvoidTheSameRing == 1.");
                    366:         CurrentRingp->gbListTower = newObject();
                    367:         *((struct object *)(CurrentRingp->gbListTower)) = ob2;
                    368:         rob = *((struct object *)(CurrentRingp->gbListTower));
1.1       maekawa   369:       }else {
1.5       takayama  370:         warningKan("KsystemVariable(): Unknown key word to set value.\n");
1.1       maekawa   371:       }
                    372:       break;
                    373:     case SdollarSarray:
                    374:       if (strcmp(ob1.lc.str,"outputOrder") == 0) {
1.5       takayama  375:         rob = KsetOutputOrder(ob2,CurrentRingp);
1.1       maekawa   376:       }else if (strcmp(ob1.lc.str,"variableNames") == 0) {
1.5       takayama  377:         rob = KsetVariableNames(ob2,CurrentRingp);
1.1       maekawa   378:       }else {
1.5       takayama  379:         warningKan("KsystemVariable(): Unknown key word to set value.\n");
1.1       maekawa   380:       }
                    381:       break;
                    382:     default:
                    383:       warningKan("KsystemVariable():Invalid argument.\n");
                    384:     }
                    385:     break;
                    386:   case 3:
                    387:     ob1 = getoa(ob,0); ob2 = getoa(ob,1); ob3 = getoa(ob,2);
                    388:     switch(Lookup[ob1.tag][ob2.tag]) {
                    389:     case SdollarSdollar:
                    390:       if (strcmp(ob2.lc.str,"var") == 0) {
1.5       takayama  391:         if (strcmp(ob1.lc.str,"x")==0) {
                    392:           if (ob3.tag != Sinteger) {
                    393:             warningKan("[$x$ $var$ ? ] The 3rd argument must be integer.");
                    394:             break;
                    395:           }
                    396:           if (ob3.lc.ival >= 0 && ob3.lc.ival < CurrentRingp->n) {
                    397:             rob = KpoString(CurrentRingp->x[ob3.lc.ival]);
                    398:           }else{
                    399:             warningKan("[$x$ $var$ ? ] The 3rd argument is out of range.");
                    400:             break;
                    401:           }
                    402:         }else if (strcmp(ob1.lc.str,"D")==0) {
                    403:           if (ob3.tag != Sinteger) {
                    404:             warningKan("[$D$ $var$ ? ] The 3rd argument must be integer.");
                    405:             break;
                    406:           }
                    407:           if (ob3.lc.ival >= 0 && ob3.lc.ival < CurrentRingp->n) {
                    408:             rob = KpoString(CurrentRingp->D[ob3.lc.ival]);
                    409:           }else{
                    410:             warningKan("[$D$ $var$ ? ] The 3rd argument is out of range.");
                    411:             break;
                    412:           }
                    413:         }
1.1       maekawa   414:       }else{
1.5       takayama  415:         warningKan("KsystemVariable(): Invalid argument.\n");
1.1       maekawa   416:       }
                    417:       break;
                    418:     default:
                    419:       warningKan("KsystemVariable(): Invalid argument.\n");
                    420:       break;
                    421:     }
                    422:     break;
                    423:   default:
                    424:     warningKan("KsystemVariable():Invalid argument.\n");
                    425:     break;
                    426:   }
                    427:   return(rob);
                    428: }
                    429:
                    430: warningOption(str)
1.5       takayama  431:      char *str;
1.1       maekawa   432: {
                    433:   fprintf(stderr,"Warning(option.c): %s\n",str);
                    434: }

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