MCPcopy Create free account
hub / github.com/Singular/Singular / newstruct_String

Function newstruct_String

Singular/newstruct.cc:50–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 return (RingDependend(t)|| (t==DEF_CMD) ||(t==LIST_CMD));
49}
50char * newstruct_String(blackbox *b, void *d)
51{
52 if (d==NULL) return omStrDup("oo");
53 else
54 {
55 newstruct_desc ad=(newstruct_desc)(b->data);
56
57 newstruct_proc p=ad->procs;
58 while((p!=NULL)&&(p->t!=STRING_CMD))
59 p=p->next;
60
61 if (p!=NULL)
62 {
63 sleftv tmp;
64 tmp.Init();
65 tmp.rtyp=ad->id;
66 void * newstruct_Copy(blackbox*, void *); //forward declaration
67 tmp.data=(void*)newstruct_Copy(b,d);
68 idrec hh;
69 hh.Init();
70 hh.id=Tok2Cmdname(p->t);
71 hh.typ=PROC_CMD;
72 hh.data.pinf=p->p;
73 BOOLEAN sl=iiMake_proc(&hh,NULL,&tmp);
74
75 if ((!sl)&& (iiRETURNEXPR.Typ() == STRING_CMD))
76 {
77 char *res = (char*)iiRETURNEXPR.CopyD();
78 iiRETURNEXPR.Init();
79 return res;
80 }
81 iiRETURNEXPR.CleanUp();
82 iiRETURNEXPR.Init();
83 }
84
85 lists l=(lists)d;
86 newstruct_member a=ad->member;
87 StringSetS("");
88 loop
89 {
90 StringAppendS(a->name);
91 StringAppendS("=");
92 if (((!RingDependend(a->typ)&&!RingDependend(l->m[a->pos].rtyp)))
93 //|| ((rEqual((ring)l->m[a->pos-1].data,currRing))
94 || (((ring)l->m[a->pos-1].data==currRing)
95 && (currRing!=NULL)))
96 {
97 // list may depend on currRing
98 if (l->m[a->pos].rtyp==LIST_CMD)
99 {
100 StringAppendS("<list>");
101 }
102 else
103 if (l->m[a->pos].rtyp==STRING_CMD)
104 {
105 StringAppendS((char*)l->m[a->pos].Data());
106 }
107 else

Callers

nothing calls this directly

Calls 13

newstruct_CopyFunction · 0.85
iiMake_procFunction · 0.85
StringSetSFunction · 0.85
StringAppendSFunction · 0.85
StringEndSFunction · 0.85
CleanUpMethod · 0.80
Tok2CmdnameFunction · 0.70
RingDependendFunction · 0.70
InitMethod · 0.45
TypMethod · 0.45
CopyDMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected