g2cprod.c(3)

πŸ“¦
version 2.3.0 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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