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

Method get_level

Singular/ipid.cc:104–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104idhdl idrec::get_level(const char * s, int level)
105{
106 assume(s!=NULL);
107 assume((level>=0) && (level<=1000)); //not really, but if it isnt in that bounds..
108 idhdl h = this;
109 int l;
110 const char *id_;
111 unsigned long i=iiS2I(s);
112 int less4=(i < (1L<<((SIZEOF_LONG-1)*8)));
113 while (h!=NULL)
114 {
115 omCheckAddr((ADDRESS)IDID(h));
116 l=IDLEV(h);
117 if ((l==level)&&(i==h->id_i))
118 {
119 id_=IDID(h);
120 if (less4 || (0 == strcmp(s+SIZEOF_LONG,id_+SIZEOF_LONG)))
121 {
122 return h;
123 }
124 }
125 h = IDNEXT(h);
126 }
127 return NULL;
128}
129
130//idrec::~idrec()
131//{

Callers 3

jjLOADFunction · 0.80
enteridFunction · 0.80
singular_exampleFunction · 0.80

Calls 1

iiS2IFunction · 0.85

Tested by

no test coverage detected