This module provides a unified interface to read and write messages to files in various formats.
Format-specific implementation is not provided by this module, but other libraries can implement format specific read and write functions and register them with dba_file.
#include <dballe/core/rawmsg.h>
Go to the source code of this file.
Typedefs | |
typedef _dba_file * | dba_file |
Opaque structure representing a file with meteorological data. | |
Functions | |
dba_err | dba_file_create (dba_encoding type, const char *name, const char *mode, dba_file *file) |
Create a dba_file structure. | |
void | dba_file_delete (dba_file file) |
Delete a dba_file. | |
dba_encoding | dba_file_type (dba_file file) |
Get the type of the dba_file. | |
const char * | dba_file_name (dba_file file) |
Get the name of the dba_file. | |
dba_err | dba_file_read (dba_file file, dba_rawmsg msg, int *found) |
Read a message from the file. | |
dba_err | dba_file_write (dba_file file, dba_rawmsg msg) |
Write the encoded message data to the file. |
dba_err dba_file_create | ( | dba_encoding | type, | |
const char * | name, | |||
const char * | mode, | |||
dba_file * | file | |||
) |
Create a dba_file structure.
type | The type of data contained in the file. If -1 is passed, then dba_file_create will attempt to autodetect the file type from its first byte. | |
name | The name of the file to access | |
mode | The opening mode of the file, as used by fopen. |
file | The new file, to be deallocated with dba_file_delete() |
void dba_file_delete | ( | dba_file | file | ) |
Delete a dba_file.
file | The file to delete. |
const char* dba_file_name | ( | dba_file | file | ) |
Get the name of the dba_file.
file | The dba_file to query. |
dba_err dba_file_read | ( | dba_file | file, | |
dba_rawmsg | msg, | |||
int * | found | |||
) |
dba_encoding dba_file_type | ( | dba_file | file | ) |
Get the type of the dba_file.
file | The dba_file to query. |
dba_err dba_file_write | ( | dba_file | file, | |
dba_rawmsg | msg | |||
) |
Write the encoded message data to the file.
file | The dba_file to write to | |
msg | The dba_rawmsg with the encoded data to write |