58 g2int i, lensec, nbits, isecnum;
61 g2int mapid[13] = {2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1};
65 gbit(cgrib, &lensec, *iofst, 32);
67 gbit(cgrib, &isecnum, *iofst, 8);
73 fprintf(stderr,
"g2_unpack1: Not Section 1 data.\n");
80 if (!(*ids = calloc(*idslen,
sizeof(
g2int))))
83 for (i = 0; i < *idslen; i++)
86 gbit(cgrib, *ids + i, *iofst, nbits);
87 *iofst = *iofst + nbits;
g2int g2_unpack1(unsigned char *cgrib, g2int *iofst, g2int **ids, g2int *idslen)
This subroutine unpacks Section 1 - Identification Section as defined in GRIB Edition 2.
void gbit(unsigned char *in, g2int *iout, g2int iskip, g2int nbits)
Get bits - unpack bits: Extract arbitrary size values from a packed bit string, right justifying each...
#define G2_UNPACK_BAD_SEC
Bad section number in unpacking function.
#define G2_UNPACK_NO_MEM
Error allocating memory in unpack function.
#define G2_NO_ERROR
Function succeeded.
int64_t g2int
Long integer type.
Header file with internal function prototypes NCEPLIBS-g2c library.