g2cinq.c(3)
π g2cinq.c β Library Functions Manual, section 3 π
okay bestie, welcome to the inquiry corner of NCEPLIBS-g2c π¦ this is the page for g2cinq.c, and it's giving "let me ask the GRIB2 file some questions" energy. all the functions here are about learning things, not changing things. pure gossip, no drama. π
β¨ NAME β¨
g2cinq.c β Inquiry functions.
like. that's it. that's the name. iconic behavior honestly π
πΈ SYNOPSIS πΈ
#include 'grib2_int.h'
#include <stdarg.h>
π«Ά Functions
EXTERN_MUTEX (m)β if pthreads are enabled, use an externally-defined mutex for thread-safety. keeping it safe out here fr fr π₯int g2c_inq (int g2cid, int *num_msg)β learn about a GRIB2 file.int g2c_inq_dim (int g2cid, int msg_num, int prod_num, int dim_num, size_t *len, char *name, float *val)β learn about the one of the dimensions of a GRIB2 product.int g2c_inq_dim_info (int g2cid, int msg_num, int prod_num, int dim_num, size_t *len, char *name)β learn about the one of the dimensions of a GRIB2 product.int g2c_inq_msg (int g2cid, int msg_num, unsigned char *discipline, int *num_fields, int *num_local, short *center, short *subcenter, unsigned char *master_version, unsigned char *local_version)β learn about a GRIB2 message.int g2c_inq_msg_time (int g2cid, int msg_num, unsigned char *sig_ref_time, short *year, unsigned char *month, unsigned char *day, unsigned char *hour, unsigned char *minute, unsigned char *second)β learn about the date/time information in a GRIB2 message.int g2c_inq_prod (int g2cid, int msg_num, int prod_num, int *pds_template_len, long long int *pds_template, int *gds_template_len, long long int *gds_template, int *drs_template_len, long long int *drs_template)β inquire about a product.
π Variables
G2C_FILE_INFO_T g2c_file [G2C_MAX_FILES+1]β global file information.
π Detailed Description π
Inquiry functions. that's the whole vibe. you ask, it answers. π
π Author
Ed Hartnett
π Date
10/21/22
π Definition in file g2cinq.c.
π Function Documentation π
β¨ EXTERN_MUTEX (m ) β¨
If pthreads are enabled, use externally-defined mutex for thread-safety.
like, no cap, this is the lock so your threads don't trip over each other π«Ά
β¨ int g2c_inq (int g2cid, int * num_msg) β¨
Learn about a GRIB2 file. the whole file. one little query, so much tea β
Parameters
g2cidβ ID of the opened file, as fromg2c_open().num_msgβ Pointer that gets the number of messages in the file. Ignored ifNULL.
Returns
G2C_NOERRORβ No error. πG2C_EBADIDβ File ID not found. π
Author
Ed Hartnett
Date
10/21/22
Definition at line 31 of file g2cinq.c.
References
G2C_EBADID, g2c_file, G2C_MAX_FILES, G2C_NOERROR, MUTEX_LOCK, and MUTEX_UNLOCK.
β¨ int g2c_inq_dim (int g2cid, int msg_num, int prod_num, int dim_num, size_t * len, char * name, float * val) β¨
Learn about the one of the dimensions of a GRIB2 product. This function will return the size, name, and values along the dimension. yes bestie, all three β she's generous π
Parameters
g2cidβ ID of the opened file, as fromg2c_open().msg_numβ Number of the message in the file, starting with the first message as0. (zero-indexed, the way the universe intended β¨)prod_numβ Product number.dim_numβ Dimension number, with the first dimension as0.lenβ Pointer that gets the length of this dimension. Ignored ifNULL.nameβ Pointer that gets the name of this dimension. Must have memory of sizeG2C_MAX_NAME. Ignored ifNULL.valβ Pointer that gets array of dimension values, of lengthlen. Ignored ifNULL.
Returns
G2C_NOERRORβ No error.G2C_EBADIDβ File ID not found.G2C_ENOMSGβ Message not found.G2C_ENOPRODUCTβ Product not found.G2C_ENOSECTIONβ GDS not found.
Author
Ed Hartnett
Date
10/21/22
Definition at line 372 of file g2cinq.c.
References
G2C_EBADID, G2C_EINVAL, G2C_ENOMSG, G2C_ENOPRODUCT, G2C_ENOSECTION, g2c_file, G2C_MAX_FILES, G2C_MAX_NAME, G2C_NOERROR, g2c_dim_info::len, g2c_message_info::msg_num, MUTEX_LOCK, MUTEX_UNLOCK, g2c_dim_info::name, g2c_message_info::next, g2c_section_info::next, g2c_section_info::prev, g2c_message_info::sec, g2c_section_info::sec_info, g2c_section_info::sec_num, and g2c_dim_info::value.
Referenced by
g2c_inq_dim_info().
β¨ int g2c_inq_dim_info (int g2cid, int msg_num, int prod_num, int dim_num, size_t * len, char * name) β¨
Learn about the one of the dimensions of a GRIB2 product. This function will return the size and name of the dimension. she's the lite version of g2c_inq_dim() β same energy, no values, still slaying πΈ
Parameters
g2cidβ ID of the opened file, as fromg2c_open().msg_numβ Number of the message in the file, starting with the first message as0.prod_numβ Product number.dim_numβ Dimension number, with the first dimension as0.lenβ Pointer that gets the length of this dimension. Ignored ifNULL.nameβ Pointer that gets the name of this dimension. Must have memory of sizeG2C_MAX_NAME. Ignored ifNULL.
Returns
G2C_NOERRORβ No error.G2C_EBADIDβ File ID not found.G2C_ENOMSGβ Message not found.G2C_ENOPRODUCTβ Product not found.G2C_ENOSECTIONβ GDS not found.
Author
Ed Hartnett
Date
10/21/22
Definition at line 468 of file g2cinq.c.
References
g2c_inq_dim().
β¨ int g2c_inq_msg (int g2cid, int msg_num, unsigned char * discipline, int * num_fields, int * num_local, short * center, short * subcenter, unsigned char * master_version, unsigned char * local_version) β¨
Learn about a GRIB2 message. one message, so many little facts, it's giving main character π
Parameters
g2cidβ ID of the opened file, as fromg2c_open().msg_numβ Number of the message in the file, starting with the first message as0.disciplineβ Pointer that gets the discipline from the message. Ignored ifNULL.num_fieldsβ Pointer that gets the number of fields in the message. Ignored ifNULL.num_localβ Pointer that gets the number of local sections in the message. Ignored ifNULL.centerβ Pointer that gets the code for the producing center from the message. Ignored ifNULL.subcenterβ Pointer that gets the code for the producing subcenter from the message. Ignored ifNULL.master_versionβ Pointer that gets the master version from the message. Ignored ifNULL.local_versionβ Pointer that gets the local version from the message. Ignored ifNULL.
literally every single one of these is "Ignored ifNULL". passNULLfor the ones you don't care about, bestie, she's not gonna be mad π
Returns
G2C_NOERRORβ No error.G2C_EBADIDβ File ID not found.G2C_ENOMSGβ Message not found.
Author
Ed Hartnett
Date
10/21/22
Definition at line 87 of file g2cinq.c.
References
g2c_message_info::center, g2c_message_info::discipline, G2C_EBADID, G2C_EINVAL, G2C_ENOMSG, g2c_file, G2C_MAX_FILES, G2C_NOERROR, g2c_message_info::local_version, g2c_message_info::master_version, g2c_message_info::msg_num, MUTEX_LOCK, MUTEX_UNLOCK, g2c_message_info::next, g2c_message_info::num_fields, g2c_message_info::num_local, and g2c_message_info::subcenter.
β¨ int g2c_inq_msg_time (int g2cid, int msg_num, unsigned char * sig_ref_time, short * year, unsigned char * month, unsigned char * day, unsigned char * hour, unsigned char * minute, unsigned char * second) β¨
Learn about the date/time information in a GRIB2 message. it's giving calendar app but for GRIB2 π¦
Parameters
g2cidβ ID of the opened file, as fromg2c_open().msg_numβ Number of the message in the file, starting with the first message as0.sig_ref_timeβ Pointer that gets Significane of reference time value from the message. Ignored ifNULL. (yes, "Significane" β that's the spelling in the original and I'm not about to fix Ed's typo, that's his legacy π)yearβ Pointer that gets the year from the message. Ignored ifNULL.monthβ Pointer that gets the month from the message. Ignored ifNULL.dayβ Pointer that gets the day from the message. Ignored ifNULL.hourβ Pointer that gets the hour from the message. Ignored ifNULL.minuteβ Pointer that gets the minute from the message. Ignored ifNULL.secondβ Pointer that gets the seconds from the message. Ignored ifNULL.
Returns
G2C_NOERRORβ No error.G2C_EBADIDβ File ID not found.G2C_ENOMSGβ Message not found.
Author
Ed Hartnett
Date
10/22/22 (note the date bestie, this one's a day newer than the rest, we love a late-night commit β)
Definition at line 170 of file g2cinq.c.
References
g2c_message_info::day, G2C_EBADID, G2C_EINVAL, G2C_ENOMSG, g2c_file, G2C_MAX_FILES, G2C_NOERROR, g2c_message_info::hour, g2c_message_info::minute, g2c_message_info::month, g2c_message_info::msg_num, MUTEX_LOCK, MUTEX_UNLOCK, g2c_message_info::next, g2c_message_info::second, g2c_message_info::sig_ref_time, and g2c_message_info::year.
β¨ int g2c_inq_prod (int g2cid, int msg_num, int prod_num, int * pds_template_len, long long int * pds_template, int * gds_template_len, long long int * gds_template, int * drs_template_len, long long int * drs_template) β¨
Inquire about a product. the template triple-threat: PDS, GDS, and DRS all in one call π
Parameters
g2cidβ File ID.msg_numβ Message number.prod_numβ Product number.pds_template_lenβ PDS template length. Ignored ifNULL.pds_templateβ Pointer that gets the PDS template. Ignored ifNULL.gds_template_lenβ GDS template length. Ignored ifNULL.gds_templateβ Pointer that gets the GDS template. Ignored ifNULL.drs_template_lenβ The DRS template length. Ignored ifNULL.drs_templateβ Pointer that gets the DRS template. Ignored ifNULL.
Returns
G2C_NOERRORβ No error.G2C_EBADIDβ File ID not found.G2C_ENOMSGβ Message not found.G2C_ENOPRODUCTβ Product not found.G2C_ENOSECTIONβ Section not found.
Author
Ed Hartnett
Date
10/21/22
Definition at line 247 of file g2cinq.c.
References
G2C_EBADID, G2C_EINVAL, G2C_ENOMSG, G2C_ENOPRODUCT, G2C_ENOSECTION, g2c_file, G2C_MAX_FILES, G2C_NOERROR, g2c_message_info::msg_num, MUTEX_LOCK, MUTEX_UNLOCK, g2c_message_info::next, g2c_section_info::next, g2c_section_info::prev, g2c_message_info::sec, g2c_section_info::sec_info, g2c_section_info::sec_num, g2c_section_info::template, and g2c_section_info::template_len.
π¦ Variable Documentation π¦
β¨ G2C_FILE_INFO_T g2c_file[G2C_MAX_FILES+1] [extern] β¨
Global file information.
Definition at line 10 of file g2cfile.c.
note bestie: the variable lives ing2cfile.ceven though this whole page is aboutg2cinq.c. different file, same family π
π Author π
Generated automatically by Doxygen for NCEPLIBS-g2c from the source code. not a human, not a bestie, just a robot doing its little documentation dance π€β¨
aaaand that's the whole page!! π this was g2cinq.c(3) from NCEPLIBS-g2c, Version 2.3.0 β that's the source and the version, go off π if you ever need to know something about a GRIB2 file, you know exactly who to ask. periodt. π
π₯
π¦ where this page comes from
- ubuntu resolute: libg2c-dev 2.3.0-4 Β· LGPL-3.0-only
- ubuntu stonking: libg2c-dev 2.3.0-7 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms