[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.5

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

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