.TH "g2_gribend.c" 3 "Tue May 3 2022" "Version 1.6.4" "NCEPLIBS-g2c" \" -*- nroff -*- .ad l .nh .SH NAME g2_gribend.c \- Finalize a GRIB2 message after all grids and fields have been added\&. .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include 'grib2\&.h'\fP .br .SS "Functions" .in +1c .ti -1c .RI "\fBg2int\fP \fBg2_gribend\fP (unsigned char *cgrib)" .br .RI "This routine finalizes a GRIB2 message after all grids and fields have been added\&. " .in -1c .SH "Detailed Description" .PP Finalize a GRIB2 message after all grids and fields have been added\&. .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2002-10-31 .RE .PP .PP Definition in file \fBg2_gribend\&.c\fP\&. .SH "Function Documentation" .PP .SS "\fBg2int\fP g2_gribend (unsigned char * cgrib)" .PP This routine finalizes a GRIB2 message after all grids and fields have been added\&. It adds the End Section ('7777') to the end of the GRIB message and calculates the length and stores it in the appropriate place in Section 0\&. This routine is used with routines \fBg2_create()\fP, \fBg2_addlocal()\fP, \fBg2_addgrid()\fP, and \fBg2_addfield()\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 containing all the data sections added be previous calls to g2_create, g2_addlocal, g2_addgrid, and g2_addfield\&. After function is called, contains the finalized GRIB2 message\&. .RE .PP \fBReturns\fP .RS 4 .IP "\(bu" 2 > 0 = Length of the final GRIB2 message in bytes\&. .IP "\(bu" 2 -1 = GRIB message was not initialized\&. Need to call routine g2_create first\&. .IP "\(bu" 2 -2 = GRIB message already complete\&. .IP "\(bu" 2 -3 = Sum of Section byte counts doesn't add to total byte count .IP "\(bu" 2 -4 = Previous Section was not 7\&. .PP .RE .PP \fBNote\fP .RS 4 This routine is intended for use with routines \fBg2_create()\fP, \fBg2_addlocal()\fP, \fBg2_addgrid()\fP, and \fBg2_addfield()\fP to create a complete GRIB2 message\&. .RE .PP \fBAuthor\fP .RS 4 Stephen Gilbert .RE .PP \fBDate\fP .RS 4 2002-10-31 .RE .PP .PP Definition at line 36 of file g2_gribend\&.c\&. .PP References gbit(), and sbit()\&. .SH "Author" .PP Generated automatically by Doxygen for NCEPLIBS-g2c from the source code\&.