Typedefs | |
typedef struct grib_handle | grib_handle |
Functions | |
int | grib_count_messages (grib_context *c, FILE *f, int *n) |
Counts the messages contained in a file resource. | |
grib_handle * | grib_handle_new_from_file (grib_context *c, FILE *f, int *error) |
Create a handle from a file resource. | |
grib_handle * | grib_handle_new_from_message (grib_context *c, void *data, size_t data_len) |
Create a handle from a user message. | |
grib_handle * | grib_handle_new_from_message_copy (grib_context *c, const void *data, size_t data_len) |
Create a handle from a user message. | |
grib_handle * | grib_handle_new_from_template (grib_context *c, const char *res_name) |
Create a handle from a read_only template resource. | |
grib_handle * | grib_handle_clone (grib_handle *h) |
Clone an existing handle using the context of the original handle, The message is copied and reparsed. | |
int | grib_handle_delete (grib_handle *h) |
Frees a handle, also frees the message if it is not a user message. |
typedef struct grib_handle grib_handle |
Grib handle, structure giving access to parsed grib values by keys
int grib_count_messages | ( | grib_context * | c, | |
FILE * | f, | |||
int * | n | |||
) |
Counts the messages contained in a file resource.
c | : the context from wich the handle will be created (NULL for default context) | |
f | : the file resource | |
n | : the number of messages in the file |
grib_handle* grib_handle_clone | ( | grib_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 grib_handle_delete | ( | grib_handle * | h | ) |
Frees a handle, also frees the message if it is not a user message.
h | : The handle to be deleted |
grib_handle* grib_handle_new_from_file | ( | grib_context * | c, | |
FILE * | f, | |||
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 any more to avoid memory leaks.
c | : the context from wich 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 |
grib_handle* grib_handle_new_from_message | ( | grib_context * | c, | |
void * | data, | |||
size_t | data_len | |||
) |
Create a handle from a user message.
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 |
grib_handle* grib_handle_new_from_message_copy | ( | grib_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 wich the handle will be created (NULL for default context) | |
data | : the actual message | |
data_len | : the length of the message in number of bytes |
grib_handle* grib_handle_new_from_template | ( | grib_context * | c, | |
const char * | res_name | |||
) |
Create a handle from a read_only template resource.
The message is copied at the creation of the handle
c | : the context from wich the handle will be created (NULL for default context) | |
res_name | : the resource name |