00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 MSG_POLLUTION
00091 };
00093 typedef enum _dba_msg_type dba_msg_type;
00094
00098 struct _dba_msg
00099 {
00101 dba_msg_type type;
00102
00104 int data_count;
00105
00110 int data_alloc;
00111
00115 dba_msg_level* data;
00116 };
00118 typedef struct _dba_msg* dba_msg;
00119
00128 const char* dba_msg_type_name(dba_msg_type type);
00129
00130
00139 dba_err dba_msg_create(dba_msg* msg);
00140
00149 void dba_msg_print(dba_msg msg, FILE* out);
00150
00164 void dba_msg_diff(dba_msg msg1, dba_msg msg2, int* diffs, FILE* out);
00165
00172 void dba_msg_delete(dba_msg msg);
00173
00174
00202 dba_err dba_msg_set(dba_msg msg, dba_var var, dba_varcode code, int ltype1, int l1, int ltype2, int l2, int pind, int p1, int p2);
00203
00228 dba_err dba_msg_set_nocopy(dba_msg msg, dba_var var, int ltype1, int l1, int ltype2, int l2, int pind, int p1, int p2);
00229
00242 dba_err dba_msg_set_by_id(dba_msg msg, dba_var var, int id);
00243
00258 dba_err dba_msg_set_nocopy_by_id(dba_msg msg, dba_var var, int id);
00259
00288 dba_err dba_msg_seti(dba_msg msg, dba_varcode code, int val, int conf, int ltype1, int l1, int ltype2, int l2, int pind, int p1, int p2);
00289
00318 dba_err dba_msg_setd(dba_msg msg, dba_varcode code, double val, int conf, int ltype1, int l1, int ltype2, int l2, int pind, int p1, int p2);
00319
00348 dba_err dba_msg_setc(dba_msg msg, dba_varcode code, const char* val, int conf, int ltype1, int l1, int ltype2, int l2, int pind, int p1, int p2);
00349
00350
00365 dba_msg_level dba_msg_find_level(dba_msg msg, int ltype1, int l1, int ltype2, int l2);
00366
00389 dba_msg_datum dba_msg_find(dba_msg msg, dba_varcode code, int ltype1, int l1, int ltype2, int l2, int pind, int p1, int p2);
00390
00401 dba_msg_datum dba_msg_find_by_id(dba_msg msg, int id);
00402
00403
00412 dba_msg_type dba_msg_get_type(dba_msg msg);
00413
00414
00418 dba_msg_type dba_msg_type_from_repcod(int repcod);
00419
00423 int dba_msg_repcod_from_type(dba_msg_type type);
00424
00425
00434 dba_err dba_msg_sounding_pack_levels(dba_msg msg, dba_msg* dst);
00435
00445 dba_err dba_msg_sounding_unpack_levels(dba_msg msg, dba_msg* dst);
00446
00447 #include <dballe/msg/vars.h>
00448
00449 #ifdef __cplusplus
00450 }
00451 #endif
00452
00453
00454 #endif