g2cprod.c(3)
π g2cprod.c β like, the product functions for the g2c library, bestie π
okay so this page lives in section 3 of the Library Functions Manual, and its whole name is g2cprod.c(3). She's giving "niche C library lore" and honestly? we're obsessed. πΈ
β¨ NAME β¨
g2cprod.c β Product functions for the g2c library.
π SYNOPSIS π
#include 'grib2_int.h'
π§ Functions
EXTERN_MUTEX (m)β if pthreads are enabled, use externally-defined mutex for thread-safety. π«Άint g2c_get_prod (int g2cid, int msg_num, int prod_num, int *num_data_points, float *data)β Read the data for a product.
π Variables
G2C_FILE_INFO_T g2c_file [G2C_MAX_FILES+1]β Global file information. she's global, she's an array, she's that girl π
π Detailed Description π
Product functions for the g2c library. that's the whole vibe. β¨
Author: Ed Hartnett
Date: Oct 1, 2022
Definition in file g2cprod.c.
π₯ Function Documentation π₯
EXTERN_MUTEX (m )
If pthreads are enabled, use externally-defined mutex for thread-safety. no cap, that's literally it β the mutex is externally defined and it's here for the threads. π§΅
int g2c_get_prod (int g2cid, int msg_num, int prod_num, int * num_data_points, float * data)
Read the data for a product. main character behavior fr fr π
Parameters
- g2cid β File ID.
- msg_num β Message number in file (first message in file is message 0). yes bestie, we start at 0, not 1. π
- prod_num β Product number in message (first product in message is product 0). again, 0. it's giving zero-indexed, it's giving C.
- num_data_points β Pointer that gets the number of data points in the product. Ignored if
NULL. π«Ά - data β Pointer that gets the data. Ignored if
NULL.
Returns
G2C_NOERRORβ No error. (the good ending π)
Author: Ed Hartnett
Date: Sep 28, 2022
Definition at line 32 of file g2cprod.c.
References g2c_message_info::bytes_to_msg, g2c_section_info::bytes_to_sec, g2c_section5_info::data_def, G2C_EBADID, G2C_EFILE, G2C_EINVAL, G2C_ENOMEM, G2C_ENOMSG, G2C_ENOPRODUCT, G2C_ENOSECTION, G2C_ERROR, g2c_file, G2C_MAX_FILES, G2C_NOERROR, g2c_unpack7(), g2c_section3_info::grid_def, g2c_section_info::msg, g2c_message_info::msg_num, MUTEX_LOCK, MUTEX_UNLOCK, g2c_message_info::next, g2c_section_info::next, g2c_section5_info::num_data_points, g2c_section_info::prev, g2c_message_info::sec, g2c_section_info::sec_info, g2c_section_info::sec_len, g2c_section_info::sec_num, g2c_section_info::template, and g2c_section_info::template_len.
like... look at that list. that's her whole support system. π
Referenced by g2c_degrib2().
π¦ Variable Documentation π¦
G2C_FILE_INFO_T g2c_file[G2C_MAX_FILES+1] [extern]
Global file information. she's extern, she's G2C_MAX_FILES+1 long (yes, +1 β that extra slot is doing the most and we love her for it β¨).
Definition at line 10 of file g2cfile.c.
note bestie: this variable is documented here but it's actually defined over in g2cfile.c. do not come for me, that's just what the page says. π
π Author π
Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.
and that's a wrap, bestie π this whole page came to you from NCEPLIBS-g2c, Version 2.3.0, with the detailed-description date of Oct 1, 2022 and the g2c_get_prod date of Sep 28, 2022. slay, stay hydrated, and remember: G2C_NOERROR is the only return value listed, so that's the one we're manifesting. πβ¨π¦
π¦ 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