| 321 | } |
| 322 | |
| 323 | staticfn int |
| 324 | lib_dlb_fseek(dlb *dp, long pos, int whence) |
| 325 | { |
| 326 | long curpos; |
| 327 | |
| 328 | switch (whence) { |
| 329 | case SEEK_CUR: |
| 330 | curpos = dp->mark + pos; |
| 331 | break; |
| 332 | case SEEK_END: |
| 333 | curpos = dp->size - pos; |
| 334 | break; |
| 335 | default: /* set */ |
| 336 | curpos = pos; |
| 337 | break; |
| 338 | } |
| 339 | if (curpos < 0) |
| 340 | curpos = 0; |
| 341 | if (curpos > dp->size) |
| 342 | curpos = dp->size; |
| 343 | |
| 344 | dp->mark = curpos; |
| 345 | return 0; |
| 346 | } |
| 347 | |
| 348 | staticfn char * |
| 349 | lib_dlb_fgets(char *buf, int len, dlb *dp) |
nothing calls this directly
no outgoing calls
no test coverage detected