Changeset 4d22d3 in git
- Timestamp:
- Nov 29, 2010, 1:27:32 PM (13 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- af71455603162123e6412ac27852bb08ea8f5126
- Parents:
- 9b3de5f869ff6e2bd56ac42abe6a8bf462e8153b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ssiLink.cc
r9b3de5 r4d22d3 32 32 #include <kernel/longrat.h> 33 33 #include <kernel/ideals.h> 34 #include <kernel/intvec.h> 34 35 #include "subexpr.h" 35 36 #include "silink.h" … … 248 249 { 249 250 ssiWrite(l,&(dd->m[i])); 251 } 252 } 253 void ssiWriteIntvec(ssiInfo *d,intvec * v) 254 { 255 fprintf(d->f_write,"%d ",v->length()); 256 int i; 257 for(i=0;i<v->length();i++) 258 { 259 fprintf(d->f_write,"%d ",(*v)[i]); 250 260 } 251 261 } … … 505 515 return L; 506 516 } 517 intvec* ssiReadIntvec(ssiInfo *d) 518 { 519 int nr; 520 fscanf(d->f_read,"%d",&nr); 521 intvec *v=new intvec(nr); 522 for(int i=0;i<nr;i++) 523 { 524 fscanf(d->f_read,"%d",&((*v)[i])); 525 } 526 return v; 527 } 507 528 508 529 //**************************************************************************/ … … 549 570 { 550 571 link_list hh=(link_list)ssiToBeClosed->next; 551 572 /* we know: l is the first entry in ssiToBeClosed-list */ 552 573 while(hh!=NULL) 553 574 { … … 559 580 hh->l->data=NULL; 560 581 SI_LINK_SET_CLOSE_P(hh->l); 561 562 563 582 link_list nn=(link_list)hh->next; 583 omFree(hh); 584 hh=nn; 564 585 } 565 586 ssiToBeClosed->next=NULL; 566 587 close(pc[1]); close(cp[0]); 567 588 d->f_read=fdopen(pc[0],"r"); … … 935 956 case 16: res->rtyp=NONE; res->data=NULL; 936 957 break; 958 case 17: res->rtyp=INTVEC_CMD; 959 res->data=ssiReadIntvec(d); 960 break; 937 961 case 99: ssiClose(l); exit(0); 938 962 case 0: if (feof(d->f_read)) … … 1031 1055 ssiWriteList(l,(lists)dd); 1032 1056 break; 1057 case INTVEC_CMD: 1058 fprintf(d->f_write,"17 "); 1059 ssiWriteIntvec(d,(intvec *)dd); 1060 break; 1033 1061 default: Werror("not implemented (t:%d, rtyp:%d)",tt, data->rtyp); 1034 1062 d->level=0; … … 1223 1251 // 15 setring ....... 1224 1252 // 16 nothing 1253 // 17 intvec <len> ... 1225 1254 // 1226 1255 // 99: quit Singular
Note: See TracChangeset
for help on using the changeset viewer.