| 102 | } |
| 103 | |
| 104 | idhdl 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 | //{ |
no test coverage detected