NCEPLIBS-g2c  1.8.0
g2_addlocal.c File Reference

Add a Local Use Section (Section 2) to a GRIB2 message. More...

#include <stdio.h>
#include "grib2_int.h"

Go to the source code of this file.

Functions

g2int g2_addlocal (unsigned char *cgrib, unsigned char *csec2, g2int lcsec2)
 This routine adds a Local Use Section (Section 2) to a GRIB2 message. More...
 

Detailed Description

Add a Local Use Section (Section 2) to a GRIB2 message.

Author
Stephen Gilbeert
Date
2002-11-01

Definition in file g2_addlocal.c.

Function Documentation

◆ g2_addlocal()

g2int g2_addlocal ( unsigned char *  cgrib,
unsigned char *  csec2,
g2int  lcsec2 
)

This routine adds a Local Use Section (Section 2) to a GRIB2 message.

It is used with routines g2_create(), g2_addgrid(), g2_addfield(), and g2_gribend() to create a complete GRIB2 message.

Parameters
cgribChar array that contains the GRIB2 message to which section 2 should be added. Must be allocated large enough to store the entire GRIB2 message.
csec2Character array containing information to be added in Section 2.
lcsec2Number of bytes of character array csec2 to be added to Section 2.
Returns
> 0 = Current size of updated GRIB2 message.
Note
The Local Use Section (Section 2) can only follow Section 1 or Section 7 in a GRIB2 message.
Author
Stephen Gilbeert
Date
2002-11-01

Definition at line 40 of file g2_addlocal.c.

References G2_ADD_MSG_COMPLETE, G2_ADD_MSG_INIT, G2_BAD_SEC, G2_BAD_SEC_COUNTS, g2c_check_msg(), G2C_EMSGCOMPLETE, G2C_ENOTGRIB, gbit(), and sbit().