context.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 DBALLE_DB_CONTEXT_H
00023 #define DBALLE_DB_CONTEXT_H
00024 
00025 #ifdef  __cplusplus
00026 extern "C" {
00027 #endif
00028 
00035 #include <dballe/db/internals.h>
00036 
00037 struct _dba_db;
00038     
00042 struct _dba_db_context
00043 {
00045     struct _dba_db* db;
00047     SQLHSTMT sstm;
00049     SQLHSTMT sdstm;
00051     SQLHSTMT istm;
00053     SQLHSTMT dstm;
00054 
00056     DBALLE_SQL_C_SINT_TYPE id;
00057 
00059     DBALLE_SQL_C_SINT_TYPE id_ana;
00061     DBALLE_SQL_C_SINT_TYPE id_report;
00063     SQL_TIMESTAMP_STRUCT date;
00065     DBALLE_SQL_C_SINT_TYPE ltype;
00067     DBALLE_SQL_C_SINT_TYPE l1;
00069     DBALLE_SQL_C_SINT_TYPE l2;
00071     DBALLE_SQL_C_SINT_TYPE pind;
00073     DBALLE_SQL_C_SINT_TYPE p1;
00075     DBALLE_SQL_C_SINT_TYPE p2;
00076 };
00078 typedef struct _dba_db_context* dba_db_context;
00079 
00090 dba_err dba_db_context_create(dba_db db, dba_db_context* ins);
00091 
00098 void dba_db_context_delete(dba_db_context ins);
00099 
00110 dba_err dba_db_context_get_id(dba_db_context ins, int *id);
00111 
00122 dba_err dba_db_context_get_data(dba_db_context ins, int id);
00123 
00136 dba_err dba_db_context_obtain_ana(dba_db_context ins, int *id);
00137 
00148 dba_err dba_db_context_insert(dba_db_context ins, int *id);
00149 
00159 dba_err dba_db_context_remove(dba_db_context ins);
00160 
00161 #ifdef  __cplusplus
00162 }
00163 #endif
00164 
00165 /* vim:set ts=4 sw=4: */
00166 #endif

Generated on Fri Jun 22 15:18:09 2007 for libdballe-db by  doxygen 1.5.2