level.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_MSG_LEVEL_H
00023 #define DBA_MSG_LEVEL_H
00024 
00031 #ifdef  __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 #include <dballe/msg/datum.h>
00036 #include <stdio.h>
00037 
00041 struct _dba_msg_level
00042 {
00044     int ltype;
00046     int l1;
00048     int l2;
00049 
00051     int data_count;
00052 
00057     int data_alloc;
00058 
00062     dba_msg_datum* data;
00063 };
00065 typedef struct _dba_msg_level* dba_msg_level;
00066 
00075 dba_err dba_msg_level_create(int ltype, int l1, int l2, dba_msg_level* l);
00076 
00087 dba_err dba_msg_level_copy(dba_msg_level src, dba_msg_level* dst);
00088 
00095 void dba_msg_level_delete(dba_msg_level l);
00096 
00097 
00108 int dba_msg_level_compare(const dba_msg_level l1, const dba_msg_level l2);
00109 
00125 int dba_msg_level_compare2(const dba_msg_level l, int ltype, int l1, int l2);
00126 
00127 
00144 dba_err dba_msg_level_set_nocopy(dba_msg_level l, dba_var var, int pind, int p1, int p2);
00145 
00146 #if 0
00147 dba_err dba_msg_level_set(dba_msg msg, dba_var var, dba_varcode code, int ltype, int l1, int l2, int pind, int p1, int p2);
00148 dba_err dba_msg_level_set_by_id(dba_msg msg, dba_var var, int id);
00149 dba_err dba_msg_level_set_nocopy_by_id(dba_msg msg, dba_var var, int id);
00150 dba_err dba_msg_level_seti(dba_msg msg, dba_varcode code, int val, int conf, int ltype, int l1, int l2, int pind, int p1, int p2);
00151 dba_err dba_msg_level_setd(dba_msg msg, dba_varcode code, double val, int conf, int ltype, int l1, int l2, int pind, int p1, int p2);
00152 dba_err dba_msg_level_setc(dba_msg msg, dba_varcode code, const char* val, int conf, int ltype, int l1, int l2, int pind, int p1, int p2);
00153 #endif
00154 
00171 dba_msg_datum dba_msg_level_find(dba_msg_level l, dba_varcode code, int pind, int p1, int p2);
00172 
00183 dba_msg_datum dba_msg_level_find_by_id(dba_msg_level l, int id);
00184 
00185 
00194 void dba_msg_level_print(dba_msg_level l, FILE* out);
00195 
00209 void dba_msg_level_diff(dba_msg_level l1, dba_msg_level l2, int* diffs, FILE* out);
00210 
00211 #ifdef  __cplusplus
00212 }
00213 #endif
00214 
00215 // vim:set ts=4 sw=4:
00216 #endif

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