msg.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_H
00023 #define DBA_MSG_H
00024 
00025 #ifdef  __cplusplus
00026 extern "C" {
00027 #endif
00028 
00071 #include <dballe/msg/level.h>
00072 #include <stdio.h>
00073 
00077 enum _dba_msg_type {
00078     MSG_GENERIC,    
00079     MSG_SYNOP,      
00080     MSG_PILOT,      
00081     MSG_TEMP,       
00082     MSG_TEMP_SHIP,  
00083     MSG_AIREP,      
00084     MSG_AMDAR,      
00085     MSG_ACARS,      
00086     MSG_SHIP,       
00087     MSG_BUOY,       
00088     MSG_METAR,      
00089     MSG_SAT         
00090 };
00092 typedef enum _dba_msg_type dba_msg_type;
00093 
00097 struct _dba_msg
00098 {
00100     dba_msg_type type;
00101 
00103     int data_count;
00104 
00109     int data_alloc;
00110 
00114     dba_msg_level* data;
00115 };
00117 typedef struct _dba_msg* dba_msg;
00118 
00127 const char* dba_msg_type_name(dba_msg_type type);
00128 
00129 
00138 dba_err dba_msg_create(dba_msg* msg);
00139 
00148 void dba_msg_print(dba_msg msg, FILE* out);
00149 
00163 void dba_msg_diff(dba_msg msg1, dba_msg msg2, int* diffs, FILE* out);
00164 
00171 void dba_msg_delete(dba_msg msg);
00172 
00173 
00199 dba_err dba_msg_set(dba_msg msg, dba_var var, dba_varcode code, int ltype, int l1, int l2, int pind, int p1, int p2);
00200 
00225 dba_err dba_msg_set_nocopy(dba_msg msg, dba_var var, int ltype, int l1, int l2, int pind, int p1, int p2);
00226 
00239 dba_err dba_msg_set_by_id(dba_msg msg, dba_var var, int id);
00240 
00255 dba_err dba_msg_set_nocopy_by_id(dba_msg msg, dba_var var, int id);
00256 
00285 dba_err dba_msg_seti(dba_msg msg, dba_varcode code, int val, int conf, int ltype, int l1, int l2, int pind, int p1, int p2);
00286 
00315 dba_err dba_msg_setd(dba_msg msg, dba_varcode code, double val, int conf, int ltype, int l1, int l2, int pind, int p1, int p2);
00316 
00345 dba_err dba_msg_setc(dba_msg msg, dba_varcode code, const char* val, int conf, int ltype, int l1, int l2, int pind, int p1, int p2);
00346 
00347 
00362 dba_msg_level dba_msg_find_level(dba_msg msg, int ltype, int l1, int l2);
00363 
00386 dba_msg_datum dba_msg_find(dba_msg msg, dba_varcode code, int ltype, int l1, int l2, int pind, int p1, int p2);
00387 
00398 dba_msg_datum dba_msg_find_by_id(dba_msg msg, int id);
00399 
00400 
00409 dba_msg_type dba_msg_get_type(dba_msg msg);
00410 
00411 
00415 dba_msg_type dba_msg_type_from_repcod(int repcod);
00416 
00420 int dba_msg_repcod_from_type(dba_msg_type type);
00421 
00422 
00431 dba_err dba_msg_sounding_pack_levels(dba_msg msg, dba_msg* dst);
00432 
00442 dba_err dba_msg_sounding_unpack_levels(dba_msg msg, dba_msg* dst);
00443 
00444 #include <dballe/msg/vars.h>
00445 
00446 #ifdef  __cplusplus
00447 }
00448 #endif
00449 
00450 // vim:set ts=4 sw=4:
00451 #endif

Generated on Fri Jun 22 14:45:48 2007 for libdballe-db by  doxygen 1.5.2