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

Method get

Singular/ipid.cc:72–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72idhdl idrec::get(const char * s, int level)
73{
74 assume(s!=NULL);
75 assume((level>=0) && (level<=1000)); //not really, but if it isnt in that bounds..
76 idhdl h = this;
77 idhdl found=NULL;
78 int l;
79 const char *id_;
80 unsigned long i=iiS2I(s);
81 char *dummy=(char*)&i;
82 BOOLEAN less4=(dummy[SIZEOF_LONG-1]=='\0');
83 while (h!=NULL)
84 {
85 omCheckAddr((ADDRESS)IDID(h));
86 l=IDLEV(h);
87 if ((l==0)||(l==level))
88 {
89 if (i==h->id_i)
90 {
91 id_=IDID(h);
92 if (less4 || (0 == strcmp(s+SIZEOF_LONG,id_+SIZEOF_LONG)))
93 {
94 if(l==level) return h;
95 found=h;
96 }
97 }
98 }
99 h = IDNEXT(h);
100 }
101 return found;
102}
103
104idhdl idrec::get_level(const char * s, int level)
105{

Callers 15

eatComment2Function · 0.45
eatCommentFunction · 0.45
readUntilFunction · 0.45
openMethod · 0.45
jjSYSTEMFunction · 0.45
jjFETCHFunction · 0.45
jjOPPOSEFunction · 0.45
jjPREIMAGEFunction · 0.45
jjFETCH_MFunction · 0.45
walkProcFunction · 0.45
fractalWalkProcFunction · 0.45

Calls 1

iiS2IFunction · 0.85

Tested by

no test coverage detected