---
name: "g2_unpack6.c"
section: "3"
platform: "linux"
package: "libg2c-dev"
version: "2.1.0-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/g2_unpack6.c"
---

# g2\_unpack6.c(3)

Unpack Section 6 (Bit-Map Section) of a GRIB2 message.

## NAME

g2\_unpack6.c - Unpack Section 6 (Bit-Map Section) of a GRIB2 message.

## SYNOPSIS

`#include 'grib2_int.h'`\
 `#include <stdio.h>`\
 `#include <stdlib.h>`\

### Functions

**g2int** **g2\_unpack6** (unsigned char \*cgrib, **g2int** \*iofst, **g2int** ngpts, **g2int** \*ibmap, **g2int** \*\*bmap)\
 Unpack Section 6 (Bit-Map Section) of a GRIB2 message.

## Detailed Description

Unpack Section 6 (Bit-Map Section) of a GRIB2 message.

**Author**

Stephen Gilbert

**Date**

2002-10-31

Definition in file **g2\_unpack6.c**.

## Function Documentation

### g2int g2\_unpack6 (unsigned char \* cgrib, g2int \* iofst, g2int ngpts, g2int \* ibmap, g2int \*\* bmap)

Unpack Section 6 (Bit-Map Section) of a GRIB2 message.

**Parameters**

*cgrib* char array containing Section 6 of the GRIB2 message. \
 *iofst* Bit offset of the beginning of Section 6 in cgrib. \
 *ngpts* Number of grid points specified in the bit-map \
 *ibmap* Bitmap indicator (see Code Table 6.0)

- •

  0 bitmap applies and is included in Section 6.

- •

  1-253 Predefined bitmap applies

- •

  254 Previously defined bitmap applies to this field

- •

  255 Bit map does not apply to this product.

*bmap* Pointer to an integer array containing decoded bitmap. (if ibmap=0)

**Returns**

- •

  **G2\_NO\_ERROR** No error.

- •

  **G2\_UNPACK\_BAD\_SEC** Array passed had incorrect section number.

- •

  **G2\_UNPACK6\_BAD\_BITMAP** Unrecognized pre-defined bit-map.

- •

  **G2\_UNPACK\_NO\_MEM** Memory allocation error.

**Author**

Stephen Gilbert

**Date**

2002-10-31

Definition at line **32** of file **g2\_unpack6.c**.

References **G2\_NO\_ERROR**, **G2\_UNPACK\_BAD\_SEC**, **G2\_UNPACK\_NO\_MEM**, **gbit()**, and **gbits()**.

Referenced by **g2\_getfld()**.

## Author

Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.
