libdballe 4.0.18
context.h
Go to the documentation of this file.
00001 /*
00002  * DB-ALLe - Archive for punctual meteorological data
00003  *
00004  * Copyright (C) 2005--2010  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/msg.h>
00036 #include <stdio.h>
00037 
00041 struct _dba_msg_context
00042 {
00044     int ltype1;
00046     int l1;
00048     int ltype2;
00050     int l2;
00052     int pind;
00054     int p1;
00056     int p2;
00057 
00059     int data_count;
00060 
00065     int data_alloc;
00066 
00070     dba_var* data;
00071 };
00072 
00081 dba_err dba_msg_context_create(int ltype1, int l1, int ltype2, int l2, int pind, int p1, int p2, dba_msg_context* l);
00082 
00093 dba_err dba_msg_context_copy(dba_msg_context src, dba_msg_context* dst);
00094 
00101 void dba_msg_context_delete(dba_msg_context l);
00102 
00103 
00114 int dba_msg_context_compare(const dba_msg_context l1, const dba_msg_context l2);
00115 
00137 int dba_msg_context_compare2(const dba_msg_context l, int ltype1, int l1, int ltype2, int l2, int pind, int p1, int p2);
00138 
00139 
00150 dba_err dba_msg_context_set_nocopy(dba_msg_context l, dba_var var);
00151 
00152 #if 0
00153 dba_err dba_msg_context_set(dba_msg msg, dba_var var, dba_varcode code, int ltype, int l1, int l2, int pind, int p1, int p2);
00154 dba_err dba_msg_context_set_by_id(dba_msg msg, dba_var var, int id);
00155 dba_err dba_msg_context_set_nocopy_by_id(dba_msg msg, dba_var var, int id);
00156 dba_err dba_msg_context_seti(dba_msg msg, dba_varcode code, int val, int conf, int ltype, int l1, int l2, int pind, int p1, int p2);
00157 dba_err dba_msg_context_setd(dba_msg msg, dba_varcode code, double val, int conf, int ltype, int l1, int l2, int pind, int p1, int p2);
00158 dba_err dba_msg_context_setc(dba_msg msg, dba_varcode code, const char* val, int conf, int ltype, int l1, int l2, int pind, int p1, int p2);
00159 #endif
00160 
00171 dba_var dba_msg_context_find(dba_msg_context l, dba_varcode code);
00172 
00183 dba_var dba_msg_context_find_by_id(dba_msg_context l, int id);
00184 
00190 dba_var dba_msg_context_find_vsig(dba_msg_context l);
00191 
00200 void dba_msg_context_print(dba_msg_context l, FILE* out);
00201 
00215 void dba_msg_context_diff(dba_msg_context l1, dba_msg_context l2, int* diffs, FILE* out);
00216 
00217 
00218 struct lua_State;
00219 
00223 dba_err dba_msg_context_lua_push(dba_msg_context var, struct lua_State* L);
00224 
00230 dba_msg_context dba_msg_context_lua_check(struct lua_State* L, int idx);
00231 
00232 #ifdef  __cplusplus
00233 }
00234 #endif
00235 
00236 // vim:set ts=4 sw=4:
00237 #endif