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

seekgb.c - Search a file for the next GRIB message.

Author

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

NCEPLIBS-g2c                                      Version 2.1.0                                      seekgb.c(3)

Detailed Description

       Search a file for the next GRIB message.

       Author
           Stephen Gilbert

       Date
           2002-10-28

   ProgramHistoryLog
       Date   Programmer   Comments    2002-10-28   GILBERT   Modified from Iredell's skgb subroutine
       2009-01-16   VUONG   Changed lskip to 4 instead of sizof(g2int)    2022-09-11   Hartnett   Added
       g2c_seekgb() function.

       Definition in file seekgb.c.

Function Documentation

voidseekgb(FILE*lugb,g2intiseek,g2intmseek,g2int*lskip,g2int*lgrib)
       Search a file for the next GRIB Message. The search is done starting at byte offset iseek of the file
       referenced by lugb for mseek bytes at a time. If found, the starting position and length of the message
       are returned in lskip and lgrib, respectively. The search is terminated when an EOF or I/O error is
       encountered.

   ProgramHistoryLog
       Date   Programmer   Comments    2002-10-28   GILBERT   Modified from Iredell's skgb subroutine
       2009-01-16   VUONG   Changed lskip to 4 instead of sizof(g2int)

       Parameterslugb FILE pointer for the file to search. File must be opened before this routine is called.
           iseek The number of bytes in the file to skip before search.
           mseek The maximum number of bytes to search at a time (must be at least 16, but larger numbers like
           4092 will result in better perfomance).
           lskip Pointer that gets the number of bytes to skip from the beggining of the file to where the GRIB
           message starts.
           lgrib Pointer that gets the number of bytes in message (set to 0, if no message found).

       Author
           Stephen Gilbert

       Date
           2002-10-28

       Definition at line 46 of file seekgb.c.

       References BYTE, gbit(), and LOG.

       Referenced by g2c_get_msg().

Name

       seekgb.c - Search a file for the next GRIB message.

Synopsis

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

   Functions
       void seekgb (FILE *lugb, g2int iseek, g2int mseek, g2int *lskip, g2int *lgrib)
           Search a file for the next GRIB Message.

See Also