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_IMPORT_H 00023 #define DBA_IMPORT_H 00024 00025 #ifdef __cplusplus 00026 extern "C" { 00027 #endif 00028 00034 #include <dballe/db/db.h> 00035 #include <dballe/msg/msgs.h> 00036 00037 /* Import the attributes. */ 00038 #define DBA_IMPORT_ATTRS 1 00039 /* Attempt to merge pseudoana extra information into the existing ones. */ 00040 #define DBA_IMPORT_FULL_PSEUDOANA 2 00041 /* Import datetime information as data to preserve their attributes. */ 00042 #define DBA_IMPORT_DATETIME_ATTRS 4 00043 /* Message data will overwrite existing values; otherwise, trying to insert 00044 * existing data will cause an error. */ 00045 #define DBA_IMPORT_OVERWRITE 8 00046 /* Perform the import outside of the transaction. This will make the function 00047 * faster but not atomic: if interrupted, for example in case of error, then 00048 * the data inserted before the interruption will stay in the database. */ 00049 #define DBA_IMPORT_NO_TRANSACTIONS 16 00050 00067 dba_err dba_import_msg(dba_db db, dba_msg msg, const char* repmemo, int flags); 00068 00085 dba_err dba_import_msgs(dba_db db, dba_msgs msgs, const char* repmemo, int flags); 00086 00087 00088 #ifdef __cplusplus 00089 } 00090 #endif 00091 00092 #endif