libdballe 4.0.18
|
00001 /* 00002 * DB-ALLe - Archive for punctual meteorological data 00003 * 00004 * Copyright (C) 2005--2009 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 00028 #ifndef DBA_DB_CURSOR_H 00029 #define DBA_DB_CURSOR_H 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00035 #include <dballe/core/record.h> 00036 #include <dballe/db/querybuf.h> 00037 00042 #define DBA_DB_WANT_COORDS (1 << 0) 00043 00044 #define DBA_DB_WANT_IDENT (1 << 1) 00045 00046 #define DBA_DB_WANT_LEVEL (1 << 2) 00047 00048 #define DBA_DB_WANT_TIMERANGE (1 << 3) 00049 00050 #define DBA_DB_WANT_DATETIME (1 << 4) 00051 00052 #define DBA_DB_WANT_VAR_NAME (1 << 5) 00053 00054 #define DBA_DB_WANT_VAR_VALUE (1 << 6) 00055 00056 #define DBA_DB_WANT_REPCOD (1 << 7) 00057 00058 #define DBA_DB_WANT_ANA_ID (1 << 8) 00059 00060 #define DBA_DB_WANT_CONTEXT_ID (1 << 9) 00061 00066 #define DBA_DB_FROM_PA (1 << 0) 00067 00068 #define DBA_DB_FROM_C (1 << 1) 00069 00070 #define DBA_DB_FROM_D (1 << 2) 00071 00072 #define DBA_DB_FROM_RI (1 << 3) 00073 00074 #define DBA_DB_FROM_CBS (1 << 4) 00075 00076 #define DBA_DB_FROM_DBLO (1 << 5) 00077 00078 #define DBA_DB_FROM_DSTA (1 << 6) 00079 00080 #define DBA_DB_FROM_DANA (1 << 7) 00081 00083 #define DBA_DB_FROM_DDF (1 << 8) 00084 00086 #define DBA_DB_FROM_ADF (1 << 9) 00087 00093 #define DBA_DB_MODIFIER_BEST (1 << 0) 00094 00097 #define DBA_DB_MODIFIER_BIGANA (1 << 1) 00098 00099 #define DBA_DB_MODIFIER_DISTINCT (1 << 2) 00100 00101 #define DBA_DB_MODIFIER_ANAEXTRA (1 << 3) 00102 00103 #define DBA_DB_MODIFIER_NOANAEXTRA (1 << 4) 00104 00105 #define DBA_DB_MODIFIER_UNSORTED (1 << 5) 00106 00110 #define DBA_DB_MODIFIER_STREAM (1 << 6) 00111 00112 #define DBA_DB_MODIFIER_SORT_FOR_EXPORT (1 << 7) 00113 00114 #ifndef DBA_DB_DEFINED 00115 #define DBA_DB_DEFINED 00116 struct _dba_db; 00118 typedef struct _dba_db* dba_db; 00119 #endif 00120 00121 struct _dba_db_cursor; 00123 typedef struct _dba_db_cursor* dba_db_cursor; 00124 00135 dba_err dba_db_cursor_create(dba_db db, dba_db_cursor* cur); 00136 00143 void dba_db_cursor_delete(dba_db_cursor cur); 00144 00162 dba_err dba_db_cursor_query(dba_db_cursor cur, dba_record query, unsigned int wanted, unsigned int modifiers); 00163 00173 int dba_db_cursor_remaining(dba_db_cursor cur); 00174 00190 dba_err dba_db_cursor_next(dba_db_cursor cur, int* has_data); 00191 00207 dba_err dba_db_cursor_to_record(dba_db_cursor cur, dba_record rec); 00208 00209 00210 #if 0 00211 00229 dba_err dba_db_ana_cursor_next(dba_db_cursor cur, dba_record rec, int* is_last); 00230 00253 dba_err dba_db_cursor_next(dba_db_cursor cur, dba_record rec, dba_varcode* var, int* context_id, int* is_last); 00254 #endif 00255 00256 #ifdef __cplusplus 00257 } 00258 #endif 00259 00260 /* vim:set ts=4 sw=4: */ 00261 #endif