.TH "g2_addlocal.c" 3 "Tue May 3 2022" "Version 1.6.4" "NCEPLIBS-g2c" \" -*- nroff -*- .ad l .nh .SH NAME g2_addlocal.c \- Add a Local Use Section (Section 2) to a GRIB2 message\&. .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include 'grib2\&.h'\fP .br .SS "Functions" .in +1c .ti -1c .RI "\fBg2int\fP \fBg2_addlocal\fP (unsigned char *cgrib, unsigned char *csec2, \fBg2int\fP lcsec2)" .br .RI "This routine adds a Local Use Section (Section 2) to a GRIB2 message\&. " .in -1c .SH "Detailed Description" .PP Add a Local Use Section (Section 2) to a GRIB2 message\&. .PP \fBAuthor\fP .RS 4 Stephen Gilbeert .RE .PP \fBDate\fP .RS 4 2002-11-01 .RE .PP .PP Definition in file \fBg2_addlocal\&.c\fP\&. .SH "Function Documentation" .PP .SS "\fBg2int\fP g2_addlocal (unsigned char * cgrib, unsigned char * csec2, \fBg2int\fP lcsec2)" .PP This routine adds a Local Use Section (Section 2) to a GRIB2 message\&. It is used with routines \fBg2_create()\fP, \fBg2_addgrid()\fP, \fBg2_addfield()\fP, and \fBg2_gribend()\fP to create a complete GRIB2 message\&. \fBg2_create()\fP must be called first to initialize a new GRIB2 message\&. .PP \fBParameters\fP .RS 4 \fIcgrib\fP Char array that contains the GRIB2 message to which section 2 should be added\&. Must be allocated large enough to store the entire GRIB2 message\&. .br \fIcsec2\fP Character array containing information to be added in Section 2\&. .br \fIlcsec2\fP Number of bytes of character array csec2 to be added to Section 2\&. .RE .PP \fBReturns\fP .RS 4 > 0 = Current size of updated GRIB2 message\&. .IP "\(bu" 2 -1 GRIB message was not initialized\&. Need to call routine gribcreate first\&. .IP "\(bu" 2 -2 GRIB message already complete\&. Cannot add new section\&. .IP "\(bu" 2 -3 Sum of Section byte counts doesn't add to total byte count .IP "\(bu" 2 -4 Previous Section was not 1 or 7\&. .PP .RE .PP \fBNote\fP .RS 4 The Local Use Section (Section 2) can only follow Section 1 or Section 7 in a GRIB2 message\&. .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbeert .RE .PP \fBDate\fP .RS 4 2002-11-01 .RE .PP .PP Definition at line 37 of file g2_addlocal\&.c\&. .PP References gbit(), and sbit()\&. .SH "Author" .PP Generated automatically by Doxygen for NCEPLIBS-g2c from the source code\&.