logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

g2_gribend.c - Finalize a GRIB2 message after all grids and fields have been added.

Author

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

NCEPLIBS-g2c                                      Version 2.1.0                                  g2_gribend.c(3)

Detailed Description

       Finalize a GRIB2 message after all grids and fields have been added.

       Author
           Stephen Gilbert

       Date
           2002-10-31

       Definition in file g2_gribend.c.

Function Documentation

g2intg2_gribend(unsignedchar*cgrib)
       Finalize a GRIB2 message after all grids and fields have been added. This function 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 g2_create(), g2_addlocal(), g2_addgrid(), and
       g2_addfield() to create a complete GRIB2 message.

       Parameterscgrib 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.

       Returns

           • > 0 Length of the final GRIB2 message in bytes.

           • G2_GRIBEND_MSG_INIT GRIB message was not initialized - call g2_create() first.

           • G2_BAD_SEC_COUNTS Sum of Section byte counts doesn't add to total byte count.

           • G2_BAD_SEC Previous Section was not 7.

       Note
           This  routine  is  intended  for  use  with  routines  g2_create(),  g2_addlocal(), g2_addgrid(), and
           g2_addfield() to create a complete GRIB2 message.

       Author
           Stephen Gilbert

       Date
           2002-10-31

       Definition at line 40 of file g2_gribend.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().

Name

       g2_gribend.c - Finalize a GRIB2 message after all grids and fields have been added.

Synopsis

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

   Functionsg2intg2_gribend (unsigned char *cgrib)
           Finalize a GRIB2 message after all grids and fields have been added.

See Also