table of contents
g2ccsv.c(3) | Library Functions Manual | g2ccsv.c(3) |
NAME¶
g2ccsv.c - This file reads the GRIB2 CSV files.
SYNOPSIS¶
#include <grib2_int.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Functions¶
int g2c_csv_init ()
Initialize tables from 'CodeFlag.txt'. int g2c_find_desc (char *title,
int code, char *desc)
Given a table title and an integer code, find a description. int
g2c_find_desc_str (char *title, char *code, char *desc)
Given a table title and a code, find a description. G2C_CODE_ENTRY_T *
g2c_find_entry (char *desc, G2C_CODE_TABLE_T *table)
Find an entry in a table given a description. G2C_CODE_TABLE_T *
g2c_find_table (char *key)
Find a table given a key. void g2c_free_tables ()
Free table memory. void g2c_print_tables ()
Print the table data.
Variables¶
FILE * doc
Contains the parsed CSV document. G2C_CODE_TABLE_T * g2c_table =
NULL
Pointer to the list of code tables.
Detailed Description¶
This file reads the GRIB2 CSV files.
Author
Date
Definition in file g2ccsv.c.
Function Documentation¶
int g2c_csv_init ()¶
Initialize tables from 'CodeFlag.txt'.
Returns
- •
- G2C_NOERROR No error.
Author
Date
Definition at line 189 of file g2ccsv.c.
References doc, 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().
int g2c_find_desc (char * title, int code, char * desc)¶
Given a table title and an integer code, find a description.
Parameters
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
Date
Returns
Definition at line 131 of file g2ccsv.c.
References g2c_find_desc_str(), and G2C_MAX_GRIB_CODE_LEN.
Referenced by g2c_log_section1().
int g2c_find_desc_str (char * title, char * code, char * desc)¶
Given a table title and a code, find a description.
Parameters
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
Date
Returns
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.
Parameters
table A pointer to the table to search.
Author
Date
Returns
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.
Parameters
Author
Date
Returns
Definition at line 148 of file g2ccsv.c.
References G2C_MAX_GRIB_TITLE_LEN, and g2c_table.
Referenced by g2c_csv_init().
void g2c_free_tables ()¶
Free table memory.
Author
Date
Definition at line 42 of file g2ccsv.c.
References g2c_table.
Referenced by g2c_log_file().
void g2c_print_tables ()¶
Print the table data.
Author
Date
Definition at line 23 of file g2ccsv.c.
References g2c_table.
Variable Documentation¶
FILE* doc¶
Contains the parsed CSV document.
Definition at line 13 of file g2ccsv.c.
Referenced by g2c_csv_init().
G2C_CODE_TABLE_T* g2c_table = NULL¶
Pointer to the list of code tables.
Definition at line 16 of file g2ccsv.c.
Referenced by g2c_csv_init(), g2c_find_desc_str(), g2c_find_table(), g2c_free_tables(), g2c_log_file(), and g2c_print_tables().
Author¶
Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.
Version 2.0.0 | NCEPLIBS-g2c |