134 |
|
} |
135 |
|
|
136 |
|
|
137 |
< |
/* Read the next ID from input */ |
138 |
< |
const char * |
139 |
< |
idmap_next(IDMAP *idmp) |
137 |
> |
/* Read the next ID index from input */ |
138 |
> |
int |
139 |
> |
idmap_next_i(IDMAP *idmp) |
140 |
|
{ |
141 |
|
int ndx = getint(idmp->bytespi, idmp->finp); |
142 |
|
|
143 |
|
if (ndx == EOF && feof(idmp->finp)) |
144 |
< |
return NULL; |
144 |
> |
return -1; |
145 |
|
|
146 |
|
idmp->curpos += idmp->bytespi; |
147 |
|
|
148 |
|
ndx &= (1<<(idmp->bytespi<<3)) - 1; /* undo sign extension */ |
149 |
+ |
|
150 |
+ |
return ndx; |
151 |
+ |
} |
152 |
+ |
|
153 |
+ |
|
154 |
+ |
/* Read the next ID from input */ |
155 |
+ |
const char * |
156 |
+ |
idmap_next(IDMAP *idmp) |
157 |
+ |
{ |
158 |
+ |
int ndx = idmap_next_i(idmp); |
159 |
+ |
|
160 |
+ |
if (ndx < 0) |
161 |
+ |
return NULL; |
162 |
|
|
163 |
|
return mapID(idmp, ndx); |
164 |
|
} |