| 157 | } |
| 158 | |
| 159 | void *intmap_first_(const struct intmap *map, intmap_index_t *indexp) |
| 160 | { |
| 161 | const struct intmap *n; |
| 162 | |
| 163 | if (intmap_empty_(map)) { |
| 164 | errno = ENOENT; |
| 165 | return NULL; |
| 166 | } |
| 167 | |
| 168 | n = map; |
| 169 | /* Anything with NULL value is a node. */ |
| 170 | while (!n->v) |
| 171 | n = &n->u.n->child[0]; |
| 172 | errno = 0; |
| 173 | *indexp = n->u.i; |
| 174 | return n->v; |
| 175 | } |
| 176 | |
| 177 | void *intmap_after_(const struct intmap *map, intmap_index_t *indexp) |
| 178 | { |
no test coverage detected