intg2c_csv_init()
Initialize tables from 'CodeFlag.txt'.
Returns
• G2C_NOERROR No error.
Author
Alyson Stahl
Date
8/2/24
Definition at line 215 of file g2ccsv.c.
References doc, g2c_csv_strsep(), G2C_ECSV, G2C_ENAMETOOLONG, G2C_ENOMEM, g2c_find_table(),
G2C_MAX_GRIB_CODE_LEN, G2C_MAX_GRIB_DESC_LEN, G2C_MAX_GRIB_LEVEL_DESC_LEN, G2C_MAX_GRIB_STATUS_LEN,
G2C_MAX_GRIB_TITLE_LEN, G2C_NOERROR, and g2c_table.
Referenced by g2c_log_file(), and g2c_log_section1().
staticchar*g2c_csv_strsep(char**stringp,constchar*delim)[static]
Implementation of strsep for code portability. Extracts first token in string given a delimiter.
Parametersstringp The address of a pointer to string to be separated. This value is overwritten with the value
past the delimiter.
delim Characters that delimit the tokens.
Author
Alyson Stahl
Date
11/6/24
Returns
a pointer to the original value of stringp
Definition at line 192 of file g2ccsv.c.
Referenced by g2c_csv_init().
intg2c_find_desc(char*title,intcode,char*desc)
Given a table title and an integer code, find a description.
Parameterstitle Title of table.
code Code to search for as an int.
desc Pointer that gets a copy of the description. Must be allocated to G2C_MAX_GRIB_DESC_LEN + 1.
Author
Ed Hartnett
Date
8/28/22
Returns
0 for success, error code otherwise.
Definition at line 131 of file g2ccsv.c.
References g2c_find_desc_str(), and G2C_MAX_GRIB_CODE_LEN.
Referenced by g2c_log_section1().
intg2c_find_desc_str(char*title,char*code,char*desc)
Given a table title and a code, find a description.
Parameterstitle Title of table.
code Code to search for.
desc Pointer that gets a copy of the description. Must be allocated to G2C_MAX_GRIB_DESC_LEN + 1.
Author
Ed Hartnett
Date
8/28/22
Returns
0 for success, error code otherwise.
Definition at line 84 of file g2ccsv.c.
References G2C_EINVAL, G2C_ENOTFOUND, G2C_MAX_GRIB_CODE_LEN, G2C_MAX_GRIB_TITLE_LEN, G2C_NOERROR, and
g2c_table.
Referenced by g2c_find_desc().
G2C_CODE_ENTRY_T*g2c_find_entry(char*desc,G2C_CODE_TABLE_T*table)
Find an entry in a table given a description.
Parametersdesc The description of the entry to find.
table A pointer to the table to search.
Author
Ed Hartnett
Date
8/29/22
Returns
a pointer to the matching entry, or NULL if not found.
Definition at line 169 of file g2ccsv.c.
References G2C_MAX_GRIB_DESC_LEN.
G2C_CODE_TABLE_T*g2c_find_table(char*key)
Find a table given a key.
Parameterskey The table title to find.
Author
Ed Hartnett
Date
8/28/22
Returns
a pointer to the matching code table, or NULL if not found.
Definition at line 148 of file g2ccsv.c.
References G2C_MAX_GRIB_TITLE_LEN, and g2c_table.
Referenced by g2c_csv_init().
voidg2c_free_tables()
Free table memory.
Author
Ed Hartnett
Date
8/28/22
Definition at line 42 of file g2ccsv.c.
References g2c_table.
Referenced by g2c_log_file().
voidg2c_print_tables()
Print the table data.
Author
Ed Hartnett
Date
8/28/22
Definition at line 23 of file g2ccsv.c.
References g2c_table.