Changeset 97c955 in git
- Timestamp:
- Nov 29, 2013, 3:41:32 PM (9 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
- Children:
- d349786aef1f8f2b89aa38d805322367d4c96364
- Parents:
- c42a9f75e7b92be96e4b082346d946500227e213
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-29 15:41:32+01:00
- git-committer:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-29 15:41:51+01:00
- Location:
- Singular
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/links/silink.cc
rc42a9f r97c955 192 192 193 193 //-------------------------------------------------------------------------- 194 BOOLEAN slSetRingDummy(si_link, ring r, BOOLEAN send) 195 { 196 if (currRing!=r) rChangeCurrRing(r); 197 return FALSE; 198 } 194 199 BOOLEAN slOpen(si_link l, short flag, leftv h) 195 200 { … … 218 223 c, l->m->type, l->mode, l->name); 219 224 } 225 if (l->m->SetRing==NULL) l->m->SetRing=slSetRingDummy; 220 226 } 221 227 return res; -
Singular/links/silink.h
rc42a9f r97c955 30 30 typedef BOOLEAN (*slGetDumpProc)(si_link l); 31 31 typedef const char* (*slStatusProc)(si_link l, const char *request); 32 typedef BOOLEAN (*slSetRingProc)(si_link l, ring r, BOOLEAN send); 32 33 33 34 struct s_si_link_extension … … 44 45 slGetDumpProc GetDump; 45 46 slStatusProc Status; 47 slSetRingProc SetRing; 46 48 const char *type; 47 49 }; -
Singular/links/ssiLink.cc
rc42a9f r97c955 53 53 #include <Singular/si_signals.h> 54 54 55 #define SSI_VERSION 5 55 #define SSI_VERSION 6 56 // 5->6: changed newstruct representation 56 57 57 58 // 64 bit version: … … 163 164 { 164 165 mpz_t tmp; 165 166 mpz_init_set_si(tmp,nn); 166 167 fputs("8 ",d->f_write); 167 168 mpz_out_str (d->f_write,32, tmp); 168 169 fputc(' ',d->f_write); 169 170 mpz_clear(tmp); 170 171 } 171 172 #endif … … 434 435 { 435 436 LONG dd=s_readlong(d->f_read); 436 437 //#if SIZEOF_LONG == 8 437 438 return INT_TO_SR(dd); 438 439 440 439 //#else 440 //return nlInit(dd,NULL); 441 //#endif 441 442 } 442 443 case 5: … … 1230 1231 // we are in the top-level, so set the basering to d->r: 1231 1232 if (d->r!=NULL) 1232 1233 1233 { 1234 d->r->ref++; 1234 1235 ssiSetCurrRing(d->r); 1235 1236 } 1236 1237 if (t==15) return ssiRead1(l); 1237 1238 } … … 1289 1290 case 19: res->rtyp=BIGINTMAT_CMD; 1290 1291 res->data=ssiReadBigintmat(d); 1291 1292 break; 1292 1293 case 20: ssiReadBlackbox(res,l); 1293 1294 break; … … 1311 1312 #endif 1312 1313 si_opt_1=n98_o1; 1313 1314 si_opt_2=n98_o2; 1314 1315 return ssiRead1(l); 1315 1316 } … … 1332 1333 } 1333 1334 //**************************************************************************/ 1335 BOOLEAN ssiSetRing(si_link l, ring r, BOOLEAN send) 1336 { 1337 if(SI_LINK_W_OPEN_P(l)==0) 1338 if (slOpen(l,SI_LINK_OPEN|SI_LINK_WRITE,NULL)) return TRUE; 1339 ssiInfo *d = (ssiInfo *)l->data; 1340 if (d->r!=r) 1341 { 1342 if (send) 1343 { 1344 fputs("15 ",d->f_write); 1345 ssiWriteRing(d,r); 1346 } 1347 d->r=r; 1348 } 1349 if (currRing!=r) rChangeCurrRing(r); 1350 return FALSE; 1351 } 1352 //**************************************************************************/ 1353 1334 1354 BOOLEAN ssiWrite(si_link l, leftv data) 1335 1355 { … … 1463 1483 1464 1484 s->Status=slStatusSsi; 1485 s->SetRing=ssiSetRing; 1465 1486 s->type="ssi"; 1466 1487 return s; … … 2010 2031 // 19 bigintmat <r> <c> ... 2011 2032 // 2012 // 20 blackbox <name> ...2033 // 20 blackbox <name> 1 <len> ... 2013 2034 // 2014 2035 // 98: verify version: <ssi-version> <MAX_TOK> <OPT1> <OPT2> -
Singular/newstruct.cc
rc42a9f r97c955 578 578 f->m->Write(f, &l); 579 579 lists ll=(lists)d; 580 memset(&l,0,sizeof(l));581 l.rtyp= LIST_CMD;582 l.data= ll;580 int Ll=lSize(ll); 581 l.rtyp=INT_CMD; 582 l.data=(void*)(long)Ll; 583 583 f->m->Write(f, &l); 584 return FALSE; 585 } 586 587 BOOLEAN newstruct_deserialize(blackbox **/*b*/, void **d, si_link f) 588 { 589 // newstruct is serialiazed as a list, 584 // set all entries corresponding to "real" mebers to 1 in rings 585 char *rings=(char*)omAlloc0(Ll+1); 586 newstruct_member elem=dd->member; 587 while (elem!=NULL) 588 { 589 rings[elem->pos]='\1'; 590 elem=elem->next; 591 } 592 int i; 593 BOOLEAN ring_changed=FALSE; 594 ring save_ring=currRing; 595 for(i=0;i<=Ll;i++) 596 { 597 if (rings[i]=='\0') // ring entry for pos i+1 598 { 599 if (ll->m[i].data!=NULL) 600 { 601 ring_changed=TRUE; 602 f->m->SetRing(f,(ring)ll->m[i].data,TRUE); 603 } 604 } 605 f->m->Write(f,&(ll->m[i])); 606 } 607 if (ring_changed) 608 f->m->SetRing(f,save_ring,FALSE); 609 } 610 611 BOOLEAN newstruct_deserialize(blackbox **b, void **d, si_link f) 612 { 613 // newstruct is serialiazed as analog to a list, 590 614 // just read a list and take data, 591 615 // rtyp must be set correctly (to the blackbox id) by routine calling 592 616 // newstruct_deserialize 593 leftv l=f->m->Read(f); 617 leftv l=f->m->Read(f); // int: length of list 618 int Ll=(int)(long)(l->data); 619 omFree(l); 620 lists L=(lists)omAllocBin(slists_bin); 621 L->Init(Ll+1); 622 for(int i=0;i<=Ll;i++) 623 { 624 l=f->m->Read(f); 625 memcpy(&(L->m[i]),l,sizeof(sleftv)); 626 omFree(l); 627 } 594 628 //newstruct_desc n=(newstruct_desc)b->data; 595 629 //TODO: check compatibility of list l->data with description in n 596 *d= l->data;630 *d=L; 597 631 return FALSE; 598 632 } … … 763 797 return scanNewstructFromString(s,res); 764 798 } 799 765 800 void newstructShow(newstruct_desc d) 766 801 {
Note: See TracChangeset
for help on using the changeset viewer.