Changeset 483400 in git
- Timestamp:
- Sep 8, 1998, 9:51:38 AM (25 years ago)
- Branches:
- (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
- Children:
- e25d2506636b3594dcac635aaedc2d79526a2bce
- Parents:
- 22a6c7f06481695868b5e29ea6c97befee635701
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/extra.cc
r22a6c7 r483400 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: extra.cc,v 1.6 6 1998-07-23 15:44:38 Singular Exp $ */4 /* $Id: extra.cc,v 1.67 1998-09-08 07:51:38 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: general interface to internals of Singular ("system" command) … … 93 93 * the "system" command 94 94 */ 95 BOOLEAN jjSYSTEM(leftv res, leftv h)95 BOOLEAN jjSYSTEM(leftv res, leftv args) 96 96 { 97 if( h->Typ() == STRING_CMD)97 if(args->Typ() == STRING_CMD) 98 98 { 99 const char *sys_cmd=(char *)(args->Data()); 100 leftv h=args->next; 99 101 // ONLY documented system calls go here 100 102 // Undocumented system calls go down into #ifdef HAVE_EXTENDED_SYSTEM 101 103 /*==================== nblocks ==================================*/ 102 if (strcmp( (char*)(h->Data()), "nblocks") == 0)104 if (strcmp(sys_cmd, "nblocks") == 0) 103 105 { 104 106 ring r; 105 if (h ->next== NULL)107 if (h == NULL) 106 108 { 107 109 if (currRingHdl != NULL) … … 117 119 else 118 120 { 119 if (h-> next->Typ() != RING_CMD)121 if (h->Typ() != RING_CMD) 120 122 { 121 123 WerrorS("ring expected"); 122 124 return TRUE; 123 125 } 124 r = (ring) h-> next->Data();126 r = (ring) h->Data(); 125 127 } 126 128 res->rtyp = INT_CMD; … … 129 131 } 130 132 /*==================== version ==================================*/ 131 if(strcmp( (char*)(h->Data()),"version")==0)133 if(strcmp(sys_cmd,"version")==0) 132 134 { 133 135 res->rtyp=INT_CMD; … … 137 139 else 138 140 /*==================== gen ==================================*/ 139 if(strcmp( (char*)(h->Data()),"gen")==0)141 if(strcmp(sys_cmd,"gen")==0) 140 142 { 141 143 res->rtyp=INT_CMD; … … 145 147 else 146 148 /*==================== sh ==================================*/ 147 #ifndef __MWERKS__148 if(strcmp((char*)(h->Data()),"sh")==0)149 {149 if(strcmp(sys_cmd,"sh")==0) 150 { 151 #ifndef __MWERKS__ 150 152 #ifndef MSDOS 151 153 #ifdef HAVE_FEREAD … … 153 155 #endif 154 156 #endif 157 #endif 155 158 res->rtyp=INT_CMD; 156 if (h->next==NULL) res->data = (void *)system("sh"); 157 else res->data = (void*) system((char*)(h->next->Data())); 159 #ifndef __MWERKS__ 160 if (h==NULL) res->data = (void *)system("sh"); 161 else if (h->Typ()==STRING_CMD) 162 res->data = (void*) system((char*)(h->Data())); 163 else 164 WerrorS("string expected"); 165 #else 166 res->data=(void *)0; 167 #endif 168 #ifndef __MWERKS__ 158 169 #ifndef MSDOS 159 170 #ifdef HAVE_FEREAD … … 161 172 #endif 162 173 #endif 163 return FALSE;164 }165 else166 #endif174 #endif 175 return FALSE; 176 } 177 else 167 178 /*==================== with ==================================*/ 168 if(strcmp( (char*)(h->Data()),"with")==0)169 { 170 if (h ->next==NULL)179 if(strcmp(sys_cmd,"with")==0) 180 { 181 if (h==NULL) 171 182 { 172 183 res->rtyp=STRING_CMD; … … 174 185 return FALSE; 175 186 } 176 else if (h-> next->Typ()==STRING_CMD)187 else if (h->Typ()==STRING_CMD) 177 188 { 178 189 #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else 179 char *s=(char *)h-> next->Data();190 char *s=(char *)h->Data(); 180 191 res->rtyp=INT_CMD; 181 192 #ifdef DRING … … 223 234 else 224 235 /*==================== pid ==================================*/ 236 if (strcmp(sys_cmd,"pid")==0) 237 { 238 res->rtyp=INT_CMD; 225 239 #ifndef MSDOS 226 240 #ifndef __MWERKS__ 227 if (strcmp((char*)(h->Data()),"pid")==0)228 {229 res->rtyp=INT_CMD;230 241 res->data=(void *)getpid(); 231 return FALSE; 232 } 233 else 242 #else 243 res->data=(void *)1; 234 244 #endif 245 #else 246 res->data=(void *)1; 235 247 #endif 248 return FALSE; 249 } 250 else 236 251 /*==================== getenv ==================================*/ 237 if (strcmp( (char*)(h->Data()),"getenv")==0)238 { 239 if ((h ->next!=NULL) && (h->next->Typ()==STRING_CMD))252 if (strcmp(sys_cmd,"getenv")==0) 253 { 254 if ((h!=NULL) && (h->Typ()==STRING_CMD)) 240 255 { 241 256 res->rtyp=STRING_CMD; 242 char *r=getenv((char *)h-> next->Data());257 char *r=getenv((char *)h->Data()); 243 258 if (r==NULL) r=""; 244 259 res->data=(void *)mstrdup(r); … … 255 270 #ifndef MSDOS 256 271 #if defined(HAVE_FEREAD) || defined(HAVE_READLINE) 257 if (strcmp( (char*)(h->Data()),"tty")==0)272 if (strcmp(sys_cmd,"tty")==0) 258 273 { 259 274 #ifdef HAVE_FEREAD … … 266 281 system("stty sane"); 267 282 #endif 268 if ((h ->next!=NULL)&&(h->next->Typ()==INT_CMD))269 { 270 fe_use_fgets=(int)h-> next->Data();283 if ((h!=NULL)&&(h->Typ()==INT_CMD)) 284 { 285 fe_use_fgets=(int)h->Data(); 271 286 fe_set_input_mode(); 272 287 } … … 279 294 /*==================== Singular ==================================*/ 280 295 #ifndef __MWERKS__ 281 if (strcmp( (char*)(h->data), "Singular") == 0)296 if (strcmp(sys_cmd, "Singular") == 0) 282 297 { 283 298 res->rtyp=STRING_CMD; … … 292 307 #endif 293 308 /*==================== options ==================================*/ 294 if (strstr( (char*)(h->data), "--") == (char*)(h->data))309 if (strstr(sys_cmd, "--") == sys_cmd) 295 310 { 296 311 BOOLEAN mainGetSingOptionValue(const char* name, char** result); 297 312 char* val; 298 313 299 if (mainGetSingOptionValue(&( (char*)(h->data))[2], &val))314 if (mainGetSingOptionValue(&(sys_cmd)[2], &val)) 300 315 { 301 316 if ((unsigned int) val > 1) … … 313 328 else 314 329 { 315 Werror("Unknown option %s\n", (char*)(h->data));330 Werror("Unknown option %s\n", sys_cmd); 316 331 return TRUE; 317 332 } … … 319 334 else 320 335 /*==================== HC ==================================*/ 321 if (strcmp( (char*)(h->data),"HC")==0)336 if (strcmp(sys_cmd,"HC")==0) 322 337 { 323 338 res->rtyp=INT_CMD; … … 327 342 else 328 343 /*==================== random ==================================*/ 329 if(strcmp( (char*)(h->Data()),"random")==0)330 { 331 if ((h ->next!=NULL) &&(h->next->Typ()==INT_CMD))332 { 333 siRandomStart=(int)h-> next->Data();344 if(strcmp(sys_cmd,"random")==0) 345 { 346 if ((h!=NULL) &&(h->Typ()==INT_CMD)) 347 { 348 siRandomStart=(int)h->Data(); 334 349 #ifdef buildin_rand 335 350 siSeed=siRandomStart; … … 339 354 return FALSE; 340 355 } 341 else if (h ->next!= NULL)356 else if (h != NULL) 342 357 { 343 358 WerrorS("int expected"); … … 351 366 // should go below 352 367 #ifdef HAVE_LIBFAC_P 353 if(strcmp( (char*)(h->Data()),"neworder")==0)354 { 355 if ((h ->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))368 if(strcmp(sys_cmd,"neworder")==0) 369 { 370 if ((h!=NULL) &&(h->Typ()==IDEAL_CMD)) 356 371 { 357 372 res->rtyp=STRING_CMD; 358 res->data=(void *)singclap_neworder((ideal)h-> next->Data());373 res->data=(void *)singclap_neworder((ideal)h->Data()); 359 374 return FALSE; 360 375 } … … 365 380 #endif 366 381 /*==================== contributors =============================*/ 367 if(strcmp( (char*)(h->Data()),"contributors") == 0)382 if(strcmp(sys_cmd,"contributors") == 0) 368 383 { 369 384 res->rtyp=STRING_CMD; … … 376 391 /*================= Extended system call ========================*/ 377 392 #ifdef HAVE_EXTENDED_SYSTEM 378 return(jjEXTENDED_SYSTEM(res, h));393 return(jjEXTENDED_SYSTEM(res, args)); 379 394 #else 380 Werror S(feNotImplemented );395 Werror( "system(\"%s\",...) %s", sys_cmd, feNotImplemented ); 381 396 #endif 382 397 } … … 398 413 if(h->Typ() == STRING_CMD) 399 414 { 415 char *sys_cmd=(char *)(h->Data()); 416 h=h->next; 400 417 /*==================== latest ==================================*/ 401 if(strcmp( (char*)(h->Data()),"la")==0)402 { 403 if (h ->next!=NULL)418 if(strcmp(sys_cmd,"la")==0) 419 { 420 if (h!=NULL) 404 421 { 405 422 int i0=-1, i1=-1; 406 leftv hh=h->next ->next;423 leftv hh=h->next; 407 424 if ((hh!=NULL)&&(hh->Typ()==INT_CMD)) 408 425 { … … 411 428 i1=(int)hh->next->Data(); 412 429 } 413 if(h-> next->Typ()==IDEAL_CMD)430 if(h->Typ()==IDEAL_CMD) 414 431 { 415 432 // "la",<ideal>[,<int d0>[,<int d1>]]: … … 420 437 if (i0==(-1)) i0=0; 421 438 } 422 ideal I=(ideal)(h-> next->Data());439 ideal I=(ideal)(h->Data()); 423 440 laSet(); 424 441 ideal m=laI2Mo(I,i0,i1); … … 429 446 } 430 447 else 431 if(h-> next->Typ()==MODUL_CMD)448 if(h->Typ()==MODUL_CMD) 432 449 { 433 450 // "la",<module>[,<int c0>[,<int c1>]]: … … 438 455 if (i0==(-1)) i0=1; 439 456 } 440 ideal M=(ideal)(h-> next->Data());457 ideal M=(ideal)(h->Data()); 441 458 laSet(); 442 459 ideal I=laMo2I(M,i0,i1); … … 452 469 else 453 470 /*==================== naIdeal ==================================*/ 454 if(strcmp( (char*)(h->Data()),"naIdeal")==0)455 { 456 if ((h ->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))457 { 458 naSetIdeal((ideal)h-> next->Data());471 if(strcmp(sys_cmd,"naIdeal")==0) 472 { 473 if ((h!=NULL) &&(h->Typ()==IDEAL_CMD)) 474 { 475 naSetIdeal((ideal)h->Data()); 459 476 return FALSE; 460 477 } … … 465 482 /*==================== isSqrFree =============================*/ 466 483 #ifdef HAVE_FACTORY 467 if(strcmp( (char*)(h->Data()),"isSqrFree")==0)468 { 469 if ((h ->next!=NULL) &&(h->next->Typ()==POLY_CMD))484 if(strcmp(sys_cmd,"isSqrFree")==0) 485 { 486 if ((h!=NULL) &&(h->Typ()==POLY_CMD)) 470 487 { 471 488 res->rtyp=INT_CMD; 472 res->data=(void *)singclap_isSqrFree((poly)h-> next->Data());489 res->data=(void *)singclap_isSqrFree((poly)h->Data()); 473 490 return FALSE; 474 491 } … … 483 500 #ifndef atarist 484 501 #ifdef unix 485 if(strcmp( (char*)(h->Data()),"alarm")==0)486 { 487 if ((h ->next!=NULL) &&(h->next->Typ()==INT_CMD))502 if(strcmp(sys_cmd,"alarm")==0) 503 { 504 if ((h!=NULL) &&(h->Typ()==INT_CMD)) 488 505 { 489 506 // standard variant -> SIGALARM (standard: abort) … … 492 509 struct itimerval t,o; 493 510 memset(&t,0,sizeof(t)); 494 t.it_value.tv_sec =(unsigned)h-> next->Data();511 t.it_value.tv_sec =(unsigned)h->Data(); 495 512 setitimer(ITIMER_VIRTUAL,&t,&o); 496 513 return FALSE; … … 506 523 /*==================== red =============================*/ 507 524 #if 0 508 if(strcmp( (char*)(h->Data()),"red")==0)509 { 510 if ((h->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))525 if(strcmp(sys_cmd,"red")==0) 526 { 527 if ((h!=NULL) &&(h->Typ()==IDEAL_CMD)) 511 528 { 512 529 res->rtyp=IDEAL_CMD; 513 res->data=(void *)kStdred((ideal)h-> next->Data(),NULL,testHomog,NULL);530 res->data=(void *)kStdred((ideal)h->Data(),NULL,testHomog,NULL); 514 531 setFlag(res,FLAG_STD); 515 532 return FALSE; … … 521 538 #endif 522 539 /*==================== algfetch =====================*/ 523 if (strcmp( (char*)(h->Data()),"algfetch")==0)540 if (strcmp(sys_cmd,"algfetch")==0) 524 541 { 525 542 int k; 526 543 idhdl w; 527 544 ideal i0, i1; 528 leftv v=h->next; 529 ring r0=(ring)v->Data(); 530 v = v->next; 545 ring r0=(ring)h->Data(); 546 leftv v = h->next; 531 547 w = r0->idroot->get(v->Name(),myynest); 532 548 i0 = IDIDEAL(w); … … 542 558 else 543 559 /*==================== algmap =======================*/ 544 if (strcmp( (char*)(h->Data()),"algmap")==0)560 if (strcmp(sys_cmd,"algmap")==0) 545 561 { 546 562 int k; 547 563 idhdl w; 548 564 ideal i0, i1, i, j; 549 leftv v=h->next; 550 ring r0=(ring)v->Data(); 551 v = v->next; 565 ring r0=(ring)h->Data(); 566 leftv v = h->next; 552 567 w = r0->idroot->get(v->Name(),myynest); 553 568 i0 = IDIDEAL(w); … … 569 584 #ifdef STDTRACE 570 585 /* Parameter : Ideal, Liste mit Links. */ 571 if(strcmp( (char*)(h->Data()),"stdtrace")==0)572 { 573 if ((h ->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))586 if(strcmp(sys_cmd,"stdtrace")==0) 587 { 588 if ((h!=NULL) &&(h->Typ()==IDEAL_CMD)) 574 589 { 575 590 leftv root = NULL, … … 577 592 lv = NULL; 578 593 lists l = NULL; 579 ideal I = (ideal)(h-> next->Data());580 lists links = (lists)(h->next-> next->Data());594 ideal I = (ideal)(h->Data()); 595 lists links = (lists)(h->next->Data()); 581 596 tHomog hom = testHomog; 582 int rw = (int)(h->next->next-> next->Data());597 int rw = (int)(h->next->next->Data()); 583 598 584 599 if(I==NULL) … … 618 633 #ifdef HAVE_FACTORY 619 634 /*==================== fastcomb =============================*/ 620 if(strcmp( (char*)(h->Data()),"fastcomb")==0)621 { 622 if ((h ->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))635 if(strcmp(sys_cmd,"fastcomb")==0) 636 { 637 if ((h!=NULL) &&(h->Typ()==IDEAL_CMD)) 623 638 { 624 639 int i=0; 625 if (h->next->next!=NULL) 626 { 627 if (h->next->next->Typ()!=POLY_CMD) 640 if (h->next!=NULL) 641 { 642 if (h->next->Typ()!=POLY_CMD) 643 { 644 Warn("Wrong types for poly= comb(ideal,poly)"); 645 } 646 } 647 res->rtyp=POLY_CMD; 648 res->data=(void *) fglmLinearCombination( 649 (ideal)h->Data(),(poly)h->next->Data()); 650 return FALSE; 651 } 652 else 653 WerrorS("ideal expected"); 654 } 655 else 656 /*==================== comb =============================*/ 657 if(strcmp(sys_cmd,"comb")==0) 658 { 659 if ((h!=NULL) &&(h->Typ()==IDEAL_CMD)) 660 { 661 int i=0; 662 if (h->next!=NULL) 663 { 664 if (h->next->Typ()!=POLY_CMD) 628 665 { 629 666 Warn("Wrong types for poly= comb(ideal,poly)"); … … 631 668 } 632 669 res->rtyp=POLY_CMD; 633 res->data=(void *) fglmLinearCombination(634 (ideal)h->next->Data(),(poly)h->next->next->Data());670 res->data=(void *)fglmNewLinearCombination( 671 (ideal)h->Data(),(poly)h->next->Data()); 635 672 return FALSE; 636 673 } … … 639 676 } 640 677 else 641 /*==================== comb =============================*/642 if(strcmp((char*)(h->Data()),"comb")==0)643 {644 if ((h->next!=NULL) &&(h->next->Typ()==IDEAL_CMD))645 {646 int i=0;647 if (h->next->next!=NULL)648 {649 if (h->next->next->Typ()!=POLY_CMD)650 {651 Warn("Wrong types for poly= comb(ideal,poly)");652 }653 }654 res->rtyp=POLY_CMD;655 res->data=(void *)fglmNewLinearCombination(656 (ideal)h->next->Data(),(poly)h->next->next->Data());657 return FALSE;658 }659 else660 WerrorS("ideal expected");661 }662 else663 678 #endif 664 679 /*==================== barstep =============================*/ 665 if(strcmp( (char*)(h->Data()),"barstep")==0)666 { 667 if ((h ->next!=NULL) &&(h->next->Typ()==MATRIX_CMD))668 { 669 if (h->next ->next!=NULL)670 { 671 if (h->next-> next->Typ()!=POLY_CMD)680 if(strcmp(sys_cmd,"barstep")==0) 681 { 682 if ((h!=NULL) &&(h->Typ()==MATRIX_CMD)) 683 { 684 if (h->next!=NULL) 685 { 686 if (h->next->Typ()!=POLY_CMD) 672 687 { 673 688 Warn("Wrong types for barstep(matrix,poly)"); … … 675 690 } 676 691 int r,c; 677 poly div=(poly)h->next-> next->Data();692 poly div=(poly)h->next->Data(); 678 693 res->rtyp=MATRIX_CMD; 679 res->data=(void *)mpOneStepBareiss((matrix)h-> next->Data(),694 res->data=(void *)mpOneStepBareiss((matrix)h->Data(), 680 695 &div,&r,&c); 681 696 Print("div: ");pWrite(div); … … 690 705 #ifdef FACTORY_GCD_TEST 691 706 /*=======================gcd Testerei ================================*/ 692 if ( ! strcmp( (char*)(h->Data()), "setgcd" ) ) {693 if ( (h ->next != NULL) && (h->next->Typ() == INT_CMD) ) {694 CFPrimitiveGcdUtil::setAlgorithm( (int)h-> next->Data() );707 if ( ! strcmp( sys_cmd, "setgcd" ) ) { 708 if ( (h != NULL) && (h->Typ() == INT_CMD) ) { 709 CFPrimitiveGcdUtil::setAlgorithm( (int)h->Data() ); 695 710 return FALSE; 696 711 } else … … 701 716 702 717 #ifdef FACTORY_GCD_TIMING 703 if ( ! strcmp( (char*)(h->Data()), "gcdtime" ) ) {718 if ( ! strcmp( sys_cmd, "gcdtime" ) ) { 704 719 TIMING_PRINT( contentTimer, "time used for content: " ); 705 720 TIMING_PRINT( algContentTimer, "time used for algContent: " ); … … 714 729 715 730 #ifdef FACTORY_GCD_STAT 716 if ( ! strcmp( (char*)(h->Data()), "gcdstat" ) ) {731 if ( ! strcmp( sys_cmd, "gcdstat" ) ) { 717 732 printGcdTotal(); 718 733 printContTotal(); … … 724 739 #endif 725 740 /*==================== lib ==================================*/ 726 if(strcmp( (char*)(h->Data()),"LIB")==0)741 if(strcmp(sys_cmd,"LIB")==0) 727 742 { 728 743 #ifdef HAVE_NAMESPACES 729 idhdl hh=namespaceroot->get((char*)h-> next->Data(),0);744 idhdl hh=namespaceroot->get((char*)h->Data(),0); 730 745 #else /* HAVE_NAMESPACES */ 731 idhdl hh=idroot->get((char*)h-> next->Data(),0);746 idhdl hh=idroot->get((char*)h->Data(),0); 732 747 #endif /* HAVE_NAMESPACES */ 733 748 if ((hh!=NULL)&&(IDTYP(hh)==PROC_CMD)) … … 740 755 } 741 756 else 742 Warn("`%s` not found",(char*)h-> next->Data());757 Warn("`%s` not found",(char*)h->Data()); 743 758 } 744 759 else 745 760 #ifdef HAVE_NAMESPACES 746 761 /*==================== nspush ===================================*/ 747 if(strcmp( (char*)(h->Data()),"nspush")==0)748 { 749 idhdl hh=namespaceroot->get((char*)h-> next->Data(),0, TRUE);762 if(strcmp(sys_cmd,"nspush")==0) 763 { 764 idhdl hh=namespaceroot->get((char*)h->Data(),0, TRUE); 750 765 if ((hh!=NULL)&&(IDTYP(hh)==PACKAGE_CMD)) 751 766 { … … 754 769 } 755 770 else 756 Warn("package `%s` not found",(char*)h-> next->Data());771 Warn("package `%s` not found",(char*)h->Data()); 757 772 } 758 773 else 759 774 /*==================== nspop ====================================*/ 760 if(strcmp( (char*)(h->Data()),"nspop")==0)775 if(strcmp(sys_cmd,"nspop")==0) 761 776 { 762 777 namespaceroot->pop(); … … 765 780 else 766 781 /*==================== nsstack ===================================*/ 767 if(strcmp( (char*)(h->Data()),"nsstack")==0)782 if(strcmp(sys_cmd,"nsstack")==0) 768 783 { 769 784 namehdl nshdl = namespaceroot; … … 777 792 #endif /* HAVE_NAMESPACES */ 778 793 /*==================== proclist =================================*/ 779 if(strcmp( (char*)(h->Data()),"proclist")==0)794 if(strcmp(sys_cmd,"proclist")==0) 780 795 { 781 796 piShowProcList(); … … 785 800 #ifdef HAVE_DYNAMIC_LOADING 786 801 /*==================== load ==================================*/ 787 if(strcmp( (char*)(h->Data()),"load")==0)788 { 789 if ((h ->next!=NULL) && (h->next->Typ()==STRING_CMD)) {802 if(strcmp(sys_cmd,"load")==0) 803 { 804 if ((h!=NULL) && (h->Typ()==STRING_CMD)) { 790 805 int iiAddCproc(char *libname, char *procname, BOOLEAN pstatic, 791 806 BOOLEAN(*func)(leftv res, leftv v)); … … 796 811 res->rtyp=STRING_CMD; 797 812 798 fprintf(stderr, "Loading %s\n", h-> next->Data());813 fprintf(stderr, "Loading %s\n", h->Data()); 799 814 res->data=(void *)mstrdup(""); 800 815 if((vp=dlopen(h->next->Data(),RTLD_LAZY))==(void *)NULL) 801 816 { 802 817 WerrorS("dlopen failed"); 803 Werror("%s not found", h-> next->Data());818 Werror("%s not found", h->Data()); 804 819 } 805 820 else … … 818 833 /* ==================== newton ================================*/ 819 834 #ifdef HAVE_NEWTON 820 if(strcmp( (char*)(h->Data()),"newton")==0)821 { 822 if ((h-> next->Typ()!=POLY_CMD)823 || (h->next-> next->Typ()!=INT_CMD)824 || (h->next->next-> next->Typ()!=INT_CMD))835 if(strcmp(sys_cmd,"newton")==0) 836 { 837 if ((h->Typ()!=POLY_CMD) 838 || (h->next->Typ()!=INT_CMD) 839 || (h->next->next->Typ()!=INT_CMD)) 825 840 { 826 841 WerrorS("system(\"newton\",<poly>,<int>,<int>) expected"); 827 842 return TRUE; 828 843 } 829 poly p=(poly)(h-> next->Data());844 poly p=(poly)(h->Data()); 830 845 int l=pLength(p); 831 846 short *points=(short *)Alloc(currRing->N*l*sizeof(short)); … … 846 861 (short*) points, // points: x_1, y_1,z_1, x_2,y_2,z2,... 847 862 currRing->OrdSgn==-1, 848 (int) (h->next-> next->Data()), // 1: Milnor, 0: Newton849 (int) (h->next->next-> next->Data()) // debug863 (int) (h->next->Data()), // 1: Milnor, 0: Newton 864 (int) (h->next->next->Data()) // debug 850 865 ); 851 866 //----<>---Output----------------------- … … 909 924 /*==================== print all option values =================*/ 910 925 #ifndef NDEBUG 911 if (strcmp( (char*)(h->data), "options") == 0)926 if (strcmp(sys_cmd, "options") == 0) 912 927 { 913 928 void mainOptionValues(); … … 917 932 else 918 933 #endif 919 Werror S(feNotImplemented );934 Werror( "system(\"%s\",...) %s", sys_cmd, feNotImplemented ); 920 935 } 921 936 return TRUE;
Note: See TracChangeset
for help on using the changeset viewer.