bufr2synop 0.24.0
bufr2tac_mrproper.c
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2013-2022 by Guillermo Ballester Valor *
3 * gbv@ogimet.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20/*!
21 \file bufr2tac_mrproper.c
22 \brief file with the code to clean and init structures
23 */
24#include "bufr2tac.h"
25
26/*! \fn void clean_syn_sec0(struct synop_sec0 *s)
27 \brief clean a synop_sec0 struct
28 \param s pointer to the synop_sec0 struct
29*/
30void clean_syn_sec0 ( struct synop_sec0 *s )
31{
32 memset ( s, 0, sizeof ( struct synop_sec0 ) );
33}
34
35/*! \fn void clean_syn_sec1(struct synop_sec1 *s)
36 \brief clean a synop_sec1 struct
37 \param s pointer to the synop_sec1 struct
38*/
39void clean_syn_sec1 ( struct synop_sec1 *s )
40{
41 memset ( s, 0, sizeof ( struct synop_sec1 ) );
42}
43
44/*! \fn void clean_syn_sec2(struct synop_sec2 *s)
45 \brief clean a synop_sec2 struct
46 \param s pointer to the synop_sec2 struct
47*/
48void clean_syn_sec2 ( struct synop_sec2 *s )
49{
50 memset ( s, 0, sizeof ( struct synop_sec2 ) );
51}
52
53/*! \fn void clean_syn_sec3(struct synop_sec3 *s)
54 \brief clean a synop_sec3 struct
55 \param s pointer to the synop_sec3 struct
56*/
57void clean_syn_sec3 ( struct synop_sec3 *s )
58{
59 memset ( s, 0, sizeof ( struct synop_sec3 ) );
60}
61
62/*! \fn void clean_syn_sec4(struct synop_sec4 *s)
63 \brief clean a synop_sec4 struct
64 \param s pointer to the synop_sec4 struct
65*/
66void clean_syn_sec4 ( struct synop_sec4 *s )
67{
68 memset ( s, 0, sizeof ( struct synop_sec4 ) );
69}
70
71/*! \fn void clean_syn_sec5(struct synop_sec5 *s)
72 \brief clean a synop_sec5 struct
73 \param s pointer to the synop_sec5 struct
74*/
75void clean_syn_sec5 ( struct synop_sec5 *s )
76{
77 memset ( s, 0, sizeof ( struct synop_sec5 ) );
78}
79
80
81/*! \fn void clean_report_date_ext(struct report_date_ext *s)
82 \brief clean a synop_ext struct
83 \param s pointer to the synop_ext struct
84*/
86{
87 memset ( s, 0, sizeof ( struct report_date_ext ) );
88}
89
90/*! \fn void clean_wigos_id(struct wigos_id *w)
91 \brief clean a synop_ext struct
92 \param w pointer to the wigos_id struct
93*/
94void clean_wigos_id ( struct wigos_id *w )
95{
96 memset ( w, 0, sizeof ( struct wigos_id ) );
97}
98
99/*!
100 \fn void clean_synop_chunks( struct synop_chunks *syn)
101 \brief cleans a \ref synop_chunks struct
102 \param syn pointer to the struct to clean
103*/
105{
106 syn->mask = 0;
107 clean_report_date_ext ( & ( syn->e ) );
108 clean_wigos_id ( & ( syn->wid ) );
109 clean_syn_sec0 ( & ( syn->s0 ) );
110 clean_syn_sec1 ( & ( syn->s1 ) );
111 clean_syn_sec2 ( & ( syn->s2 ) );
112 clean_syn_sec3 ( & ( syn->s3 ) );
113 clean_syn_sec5 ( & ( syn->s5 ) );
114
115 // default
116 strcpy ( syn->s0.iw,"/" );
117 strcpy ( syn->s1.ir,"/" );
118 strcpy ( syn->s1.ix,"/" );
119 strcpy ( syn->s1.h,"/" );
120 strcpy ( syn->s1.VV,"//" );
121 strcpy ( syn->s1.N,"/" );
122 strcpy ( syn->s1.dd,"//" );
123 strcpy ( syn->s1.ff,"//" );
124
125 syn->error[0] = '\0';
126}
127
128/*! \fn void clean_buoy_sec0(struct buoy_sec0 *s)
129 \brief clean a buoy_sec0 struct
130 \param s pointer to the buoy_sec0 struct
131*/
132void clean_buoy_sec0 ( struct buoy_sec0 *s )
133{
134 memset ( s, 0, sizeof ( struct buoy_sec0 ) );
135}
136
137/*! \fn void clean_buoy_sec1(struct buoy_sec1 *s)
138 \brief clean a buoy_sec1 struct
139 \param s pointer to the buoy_sec1 struct
140*/
141void clean_buoy_sec1 ( struct buoy_sec1 *s )
142{
143 memset ( s, 0, sizeof ( struct buoy_sec1 ) );
144}
145
146/*! \fn void clean_buoy_sec2(struct buoy_sec2 *s)
147 \brief clean a buoy_sec2 struct
148 \param s pointer to the buoy_sec2 struct
149*/
150void clean_buoy_sec2 ( struct buoy_sec2 *s )
151{
152 memset ( s, 0, sizeof ( struct buoy_sec2 ) );
153}
154
155/*! \fn void clean_buoy_sec3(struct buoy_sec3 *s)
156 \brief clean a buoy_sec3 struct
157 \param s pointer to the buoy_sec3 struct
158*/
159void clean_buoy_sec3 ( struct buoy_sec3 *s )
160{
161 memset ( s, 0, sizeof ( struct buoy_sec3 ) );
162}
163
164/*! \fn void clean_buoy_sec4(struct buoy_sec4 *s)
165 \brief clean a buoy_sec4 struct
166 \param s pointer to the buoy_sec3 struct
167*/
168void clean_buoy_sec4 ( struct buoy_sec4 *s )
169{
170 memset ( s, 0, sizeof ( struct buoy_sec4 ) );
171}
172
173/*!
174 \fn void bufr2tac_clean_buoy_chunks( struct buoy_chunks *b)
175 \brief cleans a \ref buoy_chunks struct
176 \param b pointer to the struct to clean
177*/
179{
180 b->mask = 0;
181 clean_report_date_ext ( & ( b->e ) );
182 clean_wigos_id ( & ( b->wid ) );
183 clean_buoy_sec0 ( & ( b->s0 ) );
184 clean_buoy_sec1 ( & ( b->s1 ) );
185 clean_buoy_sec2 ( & ( b->s2 ) );
186 clean_buoy_sec3 ( & ( b->s3 ) );
187 clean_buoy_sec4 ( & ( b->s4 ) );
188
189 b->error[0] = '\0';
190}
191
192/*!
193 \fn void bufr2tac_clean_temp_chunks( struct temp_chunks *t)
194 \brief cleans a \ref buoy_chunks struct
195 \param t pointer to the struct to clean
196*/
198{
199 memset ( t, 0, sizeof ( struct temp_chunks ) );
200}
201
202/*! \fn void clean_climat_sec0(struct climat_sec0 *s)
203 \brief clean a climat_sec0 struct
204 \param s pointer to the climat_sec0 struct
205*/
207{
208 memset ( s, 0, sizeof ( struct climat_sec0 ) );
209}
210
211/*! \fn void clean_climat_sec1(struct climat_sec1 *s)
212 \brief clean a climat_sec1 struct
213 \param s pointer to the climat_sec1 struct
214*/
216{
217 memset ( s, 0, sizeof ( struct climat_sec1 ) );
218}
219
220/*! \fn void clean_climat_sec2(struct climat_sec2 *s)
221 \brief clean a climat_sec2 struct
222 \param s pointer to the climat_sec2 struct
223*/
225{
226 memset ( s, 0, sizeof ( struct climat_sec2 ) );
227}
228
229/*! \fn void clean_climat_sec3(struct climat_sec3 *s)
230 \brief clean a climat_sec3 struct
231 \param s pointer to the climat_sec3 struct
232*/
234{
235 memset ( s, 0, sizeof ( struct climat_sec3 ) );
236}
237
238/*! \fn void clean_climat_sec4(struct climat_sec4 *s)
239 \brief clean a climat_sec4 struct
240 \param s pointer to the climat_sec4 struct
241*/
243{
244 memset ( s, 0, sizeof ( struct climat_sec4 ) );
245}
246
247/*! \fn void clean_climat_old(struct climat_old *s)
248 \brief clean a climat_sec4 struct
249 \param s pointer to the climat_old struct
250*/
251void clean_climat_old ( struct climat_old *s )
252{
253 memset ( s, 0, sizeof ( struct climat_old ) );
254}
255
256
257/*!
258 \fn void bufr2tac_clean_climat_chunks( struct climat_chunks *c)
259 \brief cleans a \ref climat_chunks struct
260 \param c pointer to the struct to clean
261*/
263{
264 c->mask = 0;
265 clean_report_date_ext ( & ( c->e ) );
266 clean_wigos_id ( & ( c->wid ) );
267 clean_climat_sec0 ( & ( c->s0 ) );
268 clean_climat_sec1 ( & ( c->s1 ) );
269 clean_climat_sec2 ( & ( c->s2 ) );
270 clean_climat_sec3 ( & ( c->s3 ) );
271 clean_climat_sec4 ( & ( c->s4 ) );
272 clean_climat_old ( & ( c->o ) );
273 c->error[0] = '\0';
274}
275
277{
278 if (m != NULL)
279 memset(m, 0, sizeof (struct metreport));
280}
Include header file for binary bufr2tac.
void clean_syn_sec2(struct synop_sec2 *s)
clean a synop_sec2 struct
void clean_buoy_sec2(struct buoy_sec2 *s)
clean a buoy_sec2 struct
void bufr2tac_clean_temp_chunks(struct temp_chunks *t)
cleans a buoy_chunks struct
void clean_buoy_sec1(struct buoy_sec1 *s)
clean a buoy_sec1 struct
void clean_climat_old(struct climat_old *s)
clean a climat_sec4 struct
void clean_wigos_id(struct wigos_id *w)
clean a synop_ext struct
void clean_buoy_sec0(struct buoy_sec0 *s)
clean a buoy_sec0 struct
void clean_climat_sec1(struct climat_sec1 *s)
clean a climat_sec1 struct
void clean_climat_sec0(struct climat_sec0 *s)
clean a climat_sec0 struct
void clean_syn_sec1(struct synop_sec1 *s)
clean a synop_sec1 struct
void clean_syn_sec0(struct synop_sec0 *s)
clean a synop_sec0 struct
void clean_buoy_sec4(struct buoy_sec4 *s)
clean a buoy_sec4 struct
void bufr2tac_clean_metreport(struct metreport *m)
void clean_climat_sec2(struct climat_sec2 *s)
clean a climat_sec2 struct
void clean_climat_sec3(struct climat_sec3 *s)
clean a climat_sec3 struct
void bufr2tac_clean_climat_chunks(struct climat_chunks *c)
cleans a climat_chunks struct
void bufr2tac_clean_buoy_chunks(struct buoy_chunks *b)
cleans a buoy_chunks struct
void bufr2tac_clean_synop_chunks(struct synop_chunks *syn)
void clean_climat_sec4(struct climat_sec4 *s)
clean a climat_sec4 struct
void clean_syn_sec5(struct synop_sec5 *s)
clean a synop_sec5 struct
void clean_syn_sec3(struct synop_sec3 *s)
clean a synop_sec3 struct
void clean_buoy_sec3(struct buoy_sec3 *s)
clean a buoy_sec3 struct
void clean_syn_sec4(struct synop_sec4 *s)
clean a synop_sec4 struct
void clean_report_date_ext(struct report_date_ext *s)
clean a synop_ext struct
contains all possible substrings from a synop report is parsed with success
Definition: metbuoy.h:197
struct buoy_sec3 s3
Definition: metbuoy.h:204
struct wigos_id wid
Definition: metbuoy.h:200
char error[128]
Definition: metbuoy.h:206
struct buoy_sec2 s2
Definition: metbuoy.h:203
struct report_date_ext e
Definition: metbuoy.h:199
int mask
Definition: metbuoy.h:198
struct buoy_sec1 s1
Definition: metbuoy.h:202
struct buoy_sec4 s4
Definition: metbuoy.h:205
struct buoy_sec0 s0
Definition: metbuoy.h:201
contains all possible substrings from section 0 when a report is parsed with success
Definition: metbuoy.h:65
contains all possible substrings from section 1 when a report is parsed with success
Definition: metbuoy.h:90
contains all possible substrings from section 2 when a report is parsed with success
Definition: metbuoy.h:111
contains all possible substrings from section 3 when a report is parsed with success
Definition: metbuoy.h:148
contains all possible substrings from section 4 when a report is parsed with success
Definition: metbuoy.h:162
contains all possible substrings from a synop report is parsed with success
Definition: metclimat.h:213
struct climat_old o
Definition: metclimat.h:222
struct climat_sec4 s4
Definition: metclimat.h:221
struct report_date_ext e
Definition: metclimat.h:215
struct climat_sec1 s1
Definition: metclimat.h:218
struct climat_sec0 s0
Definition: metclimat.h:217
struct wigos_id wid
Definition: metclimat.h:216
char error[128]
Definition: metclimat.h:223
struct climat_sec2 s2
Definition: metclimat.h:219
struct climat_sec3 s3
Definition: metclimat.h:220
contains all possible substrings from old CLIMAT format when a report is parsed with success
Definition: metclimat.h:196
contains all possible substrings from section 0 when a report is parsed with success
Definition: metclimat.h:69
contains all possible substrings from section 1 when a report is parsed with success
Definition: metclimat.h:81
contains all possible substrings from section 2 when a report is parsed with success
Definition: metclimat.h:110
contains all possible substrings from section 3 when a report is parsed with success
Definition: metclimat.h:138
contains all possible substrings from section 4 when a report is parsed with success
Definition: metclimat.h:167
all the information for a meteorological report in WMO text format from a BUFR file
Definition: bufr2tac.h:309
contains extensions, not in wmo. Date/time UTC information
Definition: metcommon.h:32
contains all possible substrings from a synop report is parsed with success
Definition: metsynop.h:293
struct synop_sec1 s1
Definition: metsynop.h:298
struct synop_sec2 s2
Definition: metsynop.h:299
struct synop_sec3 s3
Definition: metsynop.h:300
struct wigos_id wid
Definition: metsynop.h:296
char error[128]
Definition: metsynop.h:303
struct synop_sec5 s5
Definition: metsynop.h:302
struct report_date_ext e
Definition: metsynop.h:295
struct synop_sec0 s0
Definition: metsynop.h:297
contains all possible substrings from section 0 when a report is parsed with success
Definition: metsynop.h:91
char iw[2]
Definition: metsynop.h:100
contains all possible substrings from section 1 when a report is parsed with success
Definition: metsynop.h:122
char ix[2]
Definition: metsynop.h:124
char ff[4]
Definition: metsynop.h:129
char ir[2]
Definition: metsynop.h:123
char h[2]
Definition: metsynop.h:125
char N[2]
Definition: metsynop.h:127
char VV[4]
Definition: metsynop.h:126
char dd[4]
Definition: metsynop.h:128
contains all possible substrings from section 2 when a report is parsed with success (still incomplet...
Definition: metsynop.h:164
contains most of substrings from section 3 when a report is parsed with success
Definition: metsynop.h:221
contains some of substrings from section 4 when a report is parsed with success
Definition: metsynop.h:268
contains some of substrings from section 5 when a report is parsed with success
Definition: metsynop.h:283
Store the whole TEMP report.
Definition: mettemp.h:511
WIGOS station identifier.
Definition: metcommon.h:46