eccodes
|
Data Structures | |
struct | codes_handle |
struct | codes_multi_handle |
Functions | |
int | codes_count_in_file (codes_context *c, FILE *f, int *n) |
Counts the messages contained in a file resource. More... | |
grib_handle * | codes_handle_new_from_file (grib_context *c, FILE *f, ProductKind product, int *error) |
Create a handle from a file resource. More... | |
grib_handle * | codes_grib_handle_new_from_file (grib_context *c, FILE *f, int *error) |
Create a GRIB handle from a file resource. More... | |
grib_handle * | codes_bufr_handle_new_from_file (grib_context *c, FILE *f, int *error) |
Create a BUFR handle from a file resource. More... | |
int | codes_write_message (codes_handle *h, const char *file, const char *mode) |
Write a coded message to a file. More... | |
codes_handle * | codes_handle_new_from_message (codes_context *c, const void *data, size_t data_len) |
Create a handle from a user message in memory. More... | |
codes_handle * | codes_grib_handle_new_from_multi_message (codes_context *c, void **data, size_t *data_len, int *error) |
Create a handle from a user message in memory. More... | |
codes_handle * | codes_handle_new_from_message_copy (codes_context *c, const void *data, size_t data_len) |
Create a handle from a user message. More... | |
codes_handle * | codes_grib_handle_new_from_samples (codes_context *c, const char *sample_name) |
Create a handle from a GRIB message contained in a samples directory. More... | |
codes_handle * | codes_bufr_handle_new_from_samples (codes_context *c, const char *sample_name) |
Create a handle from a BUFR message contained in a samples directory. More... | |
codes_handle * | codes_handle_clone (codes_handle *h) |
Clone an existing handle using the context of the original handle, The message is copied and reparsed. More... | |
int | codes_handle_delete (codes_handle *h) |
Frees a handle, also frees the message if it is not a user message. More... | |
codes_multi_handle * | codes_grib_multi_handle_new (codes_context *c) |
Create an empty multi-field GRIB handle. More... | |
int | codes_grib_multi_handle_append (codes_handle *h, int start_section, codes_multi_handle *mh) |
Append the sections starting with start_section of the message pointed by h at the end of the multi-field GRIB handle mh. More... | |
int | codes_grib_multi_handle_delete (codes_multi_handle *mh) |
Delete multi-field GRIB handle. More... | |
int | codes_grib_multi_handle_write (codes_multi_handle *mh, FILE *f) |
Write a multi-field GRIB handle in a file. More... | |
The codes_handle is the structure giving access to parsed message values by keys.
grib_handle* codes_bufr_handle_new_from_file | ( | grib_context * | c, |
FILE * | f, | ||
int * | error | ||
) |
Create a BUFR handle from a file resource.
The file is read until a BUFR message is found. The message is then copied. Remember always to delete the handle when it is not needed anymore to avoid memory leaks.
c | : the context from which the handle will be created (NULL for default context) |
f | : the file resource |
error | : error code set if the returned handle is NULL and the end of file is not reached |
codes_handle* codes_bufr_handle_new_from_samples | ( | codes_context * | c, |
const char * | sample_name | ||
) |
Create a handle from a BUFR message contained in a samples directory.
The message is copied at the creation of the handle
c | : the context from which the handle will be created (NULL for default context) |
sample_name | : the name of the sample file (without the .tmpl extension) |
int codes_count_in_file | ( | codes_context * | c, |
FILE * | f, | ||
int * | n | ||
) |
Counts the messages contained in a file resource.
c | : the context from which the handle will be created (NULL for default context) |
f | : the file resource |
n | : the number of messages in the file |
grib_handle* codes_grib_handle_new_from_file | ( | grib_context * | c, |
FILE * | f, | ||
int * | error | ||
) |
Create a GRIB handle from a file resource.
The file is read until a GRIB message is found. The message is then copied. Remember always to delete the handle when it is not needed anymore to avoid memory leaks.
c | : the context from which the handle will be created (NULL for default context) |
f | : the file resource |
error | : error code set if the returned handle is NULL and the end of file is not reached |
codes_handle* codes_grib_handle_new_from_multi_message | ( | codes_context * | c, |
void ** | data, | ||
size_t * | data_len, | ||
int * | error | ||
) |
Create a handle from a user message in memory.
The message will not be freed at the end. The message will be copied as soon as a modification is needed. This function works also with multi field messages.
c | : the context from which the handle will be created (NULL for default context) |
data | : the actual message |
data_len | : the length of the message in number of bytes |
error | : error code |
codes_handle* codes_grib_handle_new_from_samples | ( | codes_context * | c, |
const char * | sample_name | ||
) |
Create a handle from a GRIB message contained in a samples directory.
The message is copied at the creation of the handle
c | : the context from which the handle will be created (NULL for default context) |
sample_name | : the name of the sample file (without the .tmpl extension) |
int codes_grib_multi_handle_append | ( | codes_handle * | h, |
int | start_section, | ||
codes_multi_handle * | mh | ||
) |
Append the sections starting with start_section of the message pointed by h at the end of the multi-field GRIB handle mh.
Remember always to delete the multi-handle when it is not needed any more to avoid memory leaks.
h | : The handle from which the sections are copied. |
start_section | : section number. Starting from this section all the sections to the end of the message will be copied. |
mh | : The multi-field handle on which the sections are appended. |
int codes_grib_multi_handle_delete | ( | codes_multi_handle * | mh | ) |
Delete multi-field GRIB handle.
mh | : The multi-field handle to be deleted. |
codes_multi_handle* codes_grib_multi_handle_new | ( | codes_context * | c | ) |
Create an empty multi-field GRIB handle.
Remember always to delete the multi-handle when it is not needed any more to avoid memory leaks.
c | : the context from which the handle will be created (NULL for default context) |
int codes_grib_multi_handle_write | ( | codes_multi_handle * | mh, |
FILE * | f | ||
) |
Write a multi-field GRIB handle in a file.
Remember always to delete the multi-handle when it is not needed any more to avoid memory leaks.
mh | : The multi-field GRIB handle to be written. |
f | : File on which the file handle is written. |
codes_handle* codes_handle_clone | ( | codes_handle * | h | ) |
Clone an existing handle using the context of the original handle, The message is copied and reparsed.
h | : The handle to be cloned |
int codes_handle_delete | ( | codes_handle * | h | ) |
Frees a handle, also frees the message if it is not a user message.
h | : The handle to be deleted |
grib_handle* codes_handle_new_from_file | ( | grib_context * | c, |
FILE * | f, | ||
ProductKind | product, | ||
int * | error | ||
) |
Create a handle from a file resource.
The file is read until a message is found. The message is then copied. Remember always to delete the handle when it is not needed anymore to avoid memory leaks.
c | : the context from which the handle will be created (NULL for default context) |
f | : the file resource |
product | : the kind of product e.g. PRODUCT_GRIB, PRODUCT_BUFR |
error | : error code set if the returned handle is NULL and the end of file is not reached |
codes_handle* codes_handle_new_from_message | ( | codes_context * | c, |
const void * | data, | ||
size_t | data_len | ||
) |
Create a handle from a user message in memory.
The message will not be freed at the end. The message will be copied as soon as a modification is needed.
c | : the context from which the handle will be created (NULL for default context) |
data | : the actual message |
data_len | : the length of the message in number of bytes |
codes_handle* codes_handle_new_from_message_copy | ( | codes_context * | c, |
const void * | data, | ||
size_t | data_len | ||
) |
Create a handle from a user message.
The message is copied and will be freed with the handle
c | : the context from which the handle will be created (NULL for default context) |
data | : the actual message |
data_len | : the length of the message in number of bytes |
int codes_write_message | ( | codes_handle * | h, |
const char * | file, | ||
const char * | mode | ||
) |
Write a coded message to a file.
h | : codes_handle to be written |
file | : name of the output file |
mode | : mode |