file_internals.h

Go to the documentation of this file.
00001 /*
00002  * DB-ALLe - Archive for punctual meteorological data
00003  *
00004  * Copyright (C) 2005,2006  ARPA-SIM <urpsim@smr.arpa.emr.it>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00018  *
00019  * Author: Enrico Zini <enrico@enricozini.com>
00020  */
00021 
00022 #ifndef DBA_CORE_FILE_INTERNALS_H
00023 #define DBA_CORE_FILE_INTERNALS_H
00024 
00025 #ifdef  __cplusplus
00026 extern "C" {
00027 #endif
00028 
00034 #include <dballe/core/file.h>
00035 #include <stdio.h>
00036 
00038 typedef dba_err (*dba_file_create_fun)(dba_encoding type, FILE* fd, const char* mode, dba_file* file);
00040 typedef void (*dba_file_delete_fun)(dba_file);
00042 typedef dba_err (*dba_file_read_fun)(dba_file file, dba_rawmsg msg, int* found);
00044 typedef dba_err (*dba_file_write_fun)(dba_file file, dba_rawmsg msg);
00045 
00055 struct _dba_file
00056 {
00058     char* name;
00060     FILE* fd;
00062     int close_on_exit;
00064     int idx;
00066     dba_encoding type;
00067 
00069     dba_file_delete_fun fun_delete;
00071     dba_file_read_fun fun_read;
00073     dba_file_write_fun fun_write;
00074 };
00075 
00084 extern dba_file_create_fun dba_file_aof_create;
00085 
00094 extern dba_file_create_fun dba_file_bufr_create;
00095 
00104 extern dba_file_create_fun dba_file_crex_create;
00105 
00109 dba_err dba_file_default_write_impl(dba_file file, dba_rawmsg msg);
00110 
00111 #ifdef  __cplusplus
00112 }
00113 #endif
00114 
00115 /* vim:set ts=4 sw=4: */
00116 #endif

Generated on Fri Jun 22 15:33:59 2007 for libdballe-msg by  doxygen 1.5.2