| 458 | #define IS_BIGENDIAN() ( (*(char*)&bei) == 0 ) |
| 459 | |
| 460 | void |
| 461 | init_nhfile(NHFILE *nhfp) |
| 462 | { |
| 463 | if (nhfp->structlevel) { |
| 464 | if (nhfp->fd != -1) { |
| 465 | impossible("Warning - Unclosed structlevel file being reinitialized"); |
| 466 | (void) nhclose(nhfp->fd); |
| 467 | } |
| 468 | } else if (nhfp->fpdef) { |
| 469 | if (nhfp->fpdef) { |
| 470 | impossible("Warning - Unclosed fieldlevel file being reinitialized"); |
| 471 | (void) fclose(nhfp->fpdef); |
| 472 | } |
| 473 | } |
| 474 | nhfp->fd = -1; |
| 475 | nhfp->fpdef = (FILE *) 0; |
| 476 | |
| 477 | nhfp->mode = COUNTING; |
| 478 | nhfp->structlevel = TRUE; |
| 479 | nhfp->fieldlevel = FALSE; |
| 480 | nhfp->addinfo = FALSE; |
| 481 | nhfp->bendian = IS_BIGENDIAN(); |
| 482 | nhfp->fplog = (FILE *) 0; |
| 483 | nhfp->fpdebug = (FILE *) 0; |
| 484 | nhfp->rcount = nhfp->wcount = 0; |
| 485 | nhfp->eof = FALSE; |
| 486 | nhfp->fnidx = 0; |
| 487 | nhfp->style.deflt = FALSE; |
| 488 | nhfp->style.binary = TRUE; |
| 489 | nhfp->nhfpconvert = 0; |
| 490 | } |
| 491 | |
| 492 | #ifndef SFCTOOL |
| 493 | staticfn |
no test coverage detected