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

Function newstructChildFromString

Singular/newstruct.cc:810–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

808 return scanNewstructFromString(s,res);
809}
810newstruct_desc newstructChildFromString(const char *parent, const char *s)
811{
812 // find parent:
813 int parent_id=0;
814 blackboxIsCmd(parent,parent_id);
815 if (parent_id<MAX_TOK)
816 {
817 Werror(">>%s< not found",parent);
818 return NULL;
819 }
820 blackbox *parent_bb=getBlackboxStuff(parent_id);
821 // check for the correct type:
822 if (parent_bb->blackbox_destroy!=newstruct_destroy)
823 {
824 Werror(">>%s< is not a user defined type",parent);
825 return NULL;
826 }
827 // setup for scanNewstructFromString:
828 newstruct_desc res=(newstruct_desc)omAlloc0(sizeof(*res));
829 newstruct_desc parent_desc=(newstruct_desc)parent_bb->data;
830 res->size=parent_desc->size;
831 res->member=parent_desc->member;
832 res->parent=parent_desc;
833
834 return scanNewstructFromString(s,res);
835}
836
837void newstructShow(newstruct_desc d)
838{

Callers 1

jjNEWSTRUCT3Function · 0.85

Calls 5

blackboxIsCmdFunction · 0.85
WerrorFunction · 0.85
getBlackboxStuffFunction · 0.85
omAlloc0Function · 0.85
scanNewstructFromStringFunction · 0.85

Tested by

no test coverage detected