Motr  M0
iterator_test_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from fop/ut/iterator_test.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "fop/ut/iterator_test.h"
9 
16 
17 static struct _m0_fop_seg_s {
20 } _m0_fop_seg = {
21  ._type = {
23  .xct_name = "m0_fop_seg",
24  .xct_sizeof = sizeof (struct m0_fop_seg),
25  .xct_nr = 2,
26  .xct_flags = 0,
27  }
28 };
29 
31 M0_BASSERT(offsetof(struct _m0_fop_seg_s, _child[0]) ==
32  offsetof(struct m0_xcode_type, xct_child[0]));
33 
34 static struct _m0_fop_vec_s {
37 } _m0_fop_vec = {
38  ._type = {
40  .xct_name = "m0_fop_vec",
41  .xct_sizeof = sizeof (struct m0_fop_vec),
42  .xct_nr = 2,
43  .xct_flags = 0,
44  }
45 };
46 
48 M0_BASSERT(offsetof(struct _m0_fop_vec_s, _child[0]) ==
49  offsetof(struct m0_xcode_type, xct_child[0]));
50 
51 static struct _m0_fop_optfid_s {
54 } _m0_fop_optfid = {
55  ._type = {
57  .xct_name = "m0_fop_optfid",
58  .xct_sizeof = sizeof (struct m0_fop_optfid),
59  .xct_nr = 2,
60  .xct_flags = 0,
61  }
62 };
63 
65 M0_BASSERT(offsetof(struct _m0_fop_optfid_s, _child[0]) ==
66  offsetof(struct m0_xcode_type, xct_child[0]));
67 
68 static struct _m0_fop_recursive1_s {
72  ._type = {
74  .xct_name = "m0_fop_recursive1",
75  .xct_sizeof = sizeof (struct m0_fop_recursive1),
76  .xct_nr = 3,
77  .xct_flags = 0,
78  }
79 };
80 
82 M0_BASSERT(offsetof(struct _m0_fop_recursive1_s, _child[0]) ==
83  offsetof(struct m0_xcode_type, xct_child[0]));
84 
85 static struct _m0_fop_recursive2_s {
89  ._type = {
91  .xct_name = "m0_fop_recursive2",
92  .xct_sizeof = sizeof (struct m0_fop_recursive2),
93  .xct_nr = 2,
94  .xct_flags = 0,
95  }
96 };
97 
99 M0_BASSERT(offsetof(struct _m0_fop_recursive2_s, _child[0]) ==
100  offsetof(struct m0_xcode_type, xct_child[0]));
101 
102 static struct _m0_fop_iterator_test_s {
106  ._type = {
108  .xct_name = "m0_fop_iterator_test",
109  .xct_sizeof = sizeof (struct m0_fop_iterator_test),
110  .xct_nr = 6,
111  .xct_flags = 0,
112  }
113 };
114 
116 M0_BASSERT(offsetof(struct _m0_fop_iterator_test_s, _child[0]) ==
117  offsetof(struct m0_xcode_type, xct_child[0]));
118 
119 
120 M0_BASSERT(sizeof(struct m0_fop_seg) == 16U);
121 
122 M0_BASSERT(sizeof ((struct m0_fop_seg *)0)->fs_offset == 8U);
123 M0_BASSERT(offsetof(struct m0_fop_seg, fs_offset) == 0U);
124 M0_BASSERT(sizeof ((struct m0_fop_seg *)0)->fs_count == 8U);
125 M0_BASSERT(offsetof(struct m0_fop_seg, fs_count) == 8U);
126 
127 M0_BASSERT(sizeof(struct m0_fop_vec) == 16U);
128 
129 M0_BASSERT(sizeof ((struct m0_fop_vec *)0)->fv_count == 4U);
130 M0_BASSERT(offsetof(struct m0_fop_vec, fv_count) == 0U);
131 M0_BASSERT(sizeof ((struct m0_fop_vec *)0)->fv_seg == 8U);
132 M0_BASSERT(offsetof(struct m0_fop_vec, fv_seg) == 8U);
133 
134 M0_BASSERT(sizeof(struct m0_fop_optfid) == 16U);
135 
136 M0_BASSERT(sizeof ((struct m0_fop_optfid *)0)->fo_fid == 16U);
137 M0_BASSERT(offsetof(struct m0_fop_optfid, fo_fid) == 0U);
138 M0_BASSERT(sizeof ((struct m0_fop_optfid *)0)->fo_none == 0U);
139 M0_BASSERT(offsetof(struct m0_fop_optfid, fo_none) == 16U);
140 
141 M0_BASSERT(sizeof(struct m0_fop_recursive1) == 48U);
142 
143 M0_BASSERT(sizeof ((struct m0_fop_recursive1 *)0)->fr_fid == 16U);
144 M0_BASSERT(offsetof(struct m0_fop_recursive1, fr_fid) == 0U);
145 M0_BASSERT(sizeof ((struct m0_fop_recursive1 *)0)->fr_seq == 16U);
146 M0_BASSERT(offsetof(struct m0_fop_recursive1, fr_seq) == 16U);
147 M0_BASSERT(sizeof ((struct m0_fop_recursive1 *)0)->fr_unn == 16U);
148 M0_BASSERT(offsetof(struct m0_fop_recursive1, fr_unn) == 32U);
149 
150 M0_BASSERT(sizeof(struct m0_fop_recursive2) == 64U);
151 
152 M0_BASSERT(sizeof ((struct m0_fop_recursive2 *)0)->fr_fid == 16U);
153 M0_BASSERT(offsetof(struct m0_fop_recursive2, fr_fid) == 0U);
154 M0_BASSERT(sizeof ((struct m0_fop_recursive2 *)0)->fr_seq == 48U);
155 M0_BASSERT(offsetof(struct m0_fop_recursive2, fr_seq) == 16U);
156 
157 M0_BASSERT(sizeof(struct m0_fop_iterator_test) == 144U);
158 
159 M0_BASSERT(sizeof ((struct m0_fop_iterator_test *)0)->fit_fid == 16U);
160 M0_BASSERT(offsetof(struct m0_fop_iterator_test, fit_fid) == 0U);
161 M0_BASSERT(sizeof ((struct m0_fop_iterator_test *)0)->fit_vec == 16U);
162 M0_BASSERT(offsetof(struct m0_fop_iterator_test, fit_vec) == 16U);
163 M0_BASSERT(sizeof ((struct m0_fop_iterator_test *)0)->fit_opt0 == 16U);
164 M0_BASSERT(offsetof(struct m0_fop_iterator_test, fit_opt0) == 32U);
165 M0_BASSERT(sizeof ((struct m0_fop_iterator_test *)0)->fit_opt1 == 16U);
166 M0_BASSERT(offsetof(struct m0_fop_iterator_test, fit_opt1) == 48U);
167 M0_BASSERT(sizeof ((struct m0_fop_iterator_test *)0)->fit_topt == 16U);
168 M0_BASSERT(offsetof(struct m0_fop_iterator_test, fit_topt) == 64U);
169 M0_BASSERT(sizeof ((struct m0_fop_iterator_test *)0)->fit_rec == 64U);
170 M0_BASSERT(offsetof(struct m0_fop_iterator_test, fit_rec) == 80U);
171 
172 
173 
174 M0_INTERNAL void m0_xc_m0_fop_seg_struct_init(void)
175 {
176  _m0_fop_seg._child[0] = (struct m0_xcode_field) {
177  .xf_name = "fs_offset",
178 
179  .xf_type = &M0_XT_U64,
180 
181  .xf_tag = 0,
182  .xf_opaque = NULL,
183  .xf_offset = offsetof(struct m0_fop_seg, fs_offset),
184  .xf_read = NULL,
185  .xf_decor = {
187  }
188  };
189  m0_xc_u64_init();
190 
191  _m0_fop_seg._child[1] = (struct m0_xcode_field) {
192  .xf_name = "fs_count",
193 
194  .xf_type = &M0_XT_U64,
195 
196  .xf_tag = 0,
197  .xf_opaque = NULL,
198  .xf_offset = offsetof(struct m0_fop_seg, fs_count),
199  .xf_read = NULL,
200  .xf_decor = {
202  }
203  };
204  m0_xc_u64_init();
205 
207 }
208 
209 M0_INTERNAL void m0_xc_m0_fop_vec_struct_init(void)
210 {
211  _m0_fop_vec._child[0] = (struct m0_xcode_field) {
212  .xf_name = "fv_count",
213 
214  .xf_type = &M0_XT_U32,
215 
216  .xf_tag = 0,
217  .xf_opaque = NULL,
218  .xf_offset = offsetof(struct m0_fop_vec, fv_count),
219  .xf_read = NULL,
220  .xf_decor = {
222  }
223  };
224  m0_xc_u32_init();
225 
226  _m0_fop_vec._child[1] = (struct m0_xcode_field) {
227  .xf_name = "fv_seg",
228 
229  .xf_type = m0_fop_seg_xc,
230 
231  .xf_tag = 0,
232  .xf_opaque = NULL,
233  .xf_offset = offsetof(struct m0_fop_vec, fv_seg),
234  .xf_read = NULL,
235  .xf_decor = {
237  }
238  };
240 
242 }
243 
244 M0_INTERNAL void m0_xc_m0_fop_optfid_struct_init(void)
245 {
246  _m0_fop_optfid._child[0] = (struct m0_xcode_field) {
247  .xf_name = "fo_fid",
248 
249  .xf_type = m0_fid_xc,
250 
251  .xf_tag = 0,
252  .xf_opaque = NULL,
253  .xf_offset = offsetof(struct m0_fop_optfid, fo_fid),
254  .xf_read = NULL,
255  .xf_decor = {
257  }
258  };
260 
261  _m0_fop_optfid._child[1] = (struct m0_xcode_field) {
262  .xf_name = "fo_none",
263 
264  .xf_type = &M0_XT_VOID,
265 
266  .xf_tag = 0,
267  .xf_opaque = NULL,
268  .xf_offset = offsetof(struct m0_fop_optfid, fo_none),
269  .xf_read = NULL,
270  .xf_decor = {
272  }
273  };
274  m0_xc_void_init();
275 
277 }
278 
280 {
282  .xf_name = "fr_fid",
283 
284  .xf_type = m0_fid_xc,
285 
286  .xf_tag = 0,
287  .xf_opaque = NULL,
288  .xf_offset = offsetof(struct m0_fop_recursive1, fr_fid),
289  .xf_read = NULL,
290  .xf_decor = {
292  }
293  };
295 
297  .xf_name = "fr_seq",
298 
299  .xf_type = m0_fop_vec_xc,
300 
301  .xf_tag = 0,
302  .xf_opaque = NULL,
303  .xf_offset = offsetof(struct m0_fop_recursive1, fr_seq),
304  .xf_read = NULL,
305  .xf_decor = {
307  }
308  };
310 
312  .xf_name = "fr_unn",
313 
314  .xf_type = m0_fop_optfid_xc,
315 
316  .xf_tag = 0,
317  .xf_opaque = NULL,
318  .xf_offset = offsetof(struct m0_fop_recursive1, fr_unn),
319  .xf_read = NULL,
320  .xf_decor = {
322  }
323  };
325 
327 }
328 
330 {
332  .xf_name = "fr_fid",
333 
334  .xf_type = m0_fid_xc,
335 
336  .xf_tag = 0,
337  .xf_opaque = NULL,
338  .xf_offset = offsetof(struct m0_fop_recursive2, fr_fid),
339  .xf_read = NULL,
340  .xf_decor = {
342  }
343  };
345 
347  .xf_name = "fr_seq",
348 
349  .xf_type = m0_fop_recursive1_xc,
350 
351  .xf_tag = 0,
352  .xf_opaque = NULL,
353  .xf_offset = offsetof(struct m0_fop_recursive2, fr_seq),
354  .xf_read = NULL,
355  .xf_decor = {
357  }
358  };
360 
362 }
363 
365 {
367  .xf_name = "fit_fid",
368 
369  .xf_type = m0_fid_xc,
370 
371  .xf_tag = 0,
372  .xf_opaque = NULL,
373  .xf_offset = offsetof(struct m0_fop_iterator_test, fit_fid),
374  .xf_read = NULL,
375  .xf_decor = {
377  }
378  };
380 
382  .xf_name = "fit_vec",
383 
384  .xf_type = m0_fop_vec_xc,
385 
386  .xf_tag = 0,
387  .xf_opaque = NULL,
388  .xf_offset = offsetof(struct m0_fop_iterator_test, fit_vec),
389  .xf_read = NULL,
390  .xf_decor = {
392  }
393  };
395 
397  .xf_name = "fit_opt0",
398 
399  .xf_type = m0_fop_optfid_xc,
400 
401  .xf_tag = 0,
402  .xf_opaque = NULL,
403  .xf_offset = offsetof(struct m0_fop_iterator_test, fit_opt0),
404  .xf_read = NULL,
405  .xf_decor = {
407  }
408  };
410 
412  .xf_name = "fit_opt1",
413 
414  .xf_type = m0_fop_optfid_xc,
415 
416  .xf_tag = 0,
417  .xf_opaque = NULL,
418  .xf_offset = offsetof(struct m0_fop_iterator_test, fit_opt1),
419  .xf_read = NULL,
420  .xf_decor = {
422  }
423  };
425 
427  .xf_name = "fit_topt",
428 
429  .xf_type = m0_fop_optfid_xc,
430 
431  .xf_tag = 0,
432  .xf_opaque = NULL,
433  .xf_offset = offsetof(struct m0_fop_iterator_test, fit_topt),
434  .xf_read = NULL,
435  .xf_decor = {
437  }
438  };
440 
442  .xf_name = "fit_rec",
443 
444  .xf_type = m0_fop_recursive2_xc,
445 
446  .xf_tag = 0,
447  .xf_opaque = NULL,
448  .xf_offset = offsetof(struct m0_fop_iterator_test, fit_rec),
449  .xf_read = NULL,
450  .xf_decor = {
452  }
453  };
455 
457 }
458 
459 M0_INTERNAL void m0_xc_fop_ut_iterator_test_init(void)
460 {
467 }
468 
469 M0_INTERNAL void m0_xc_fop_ut_iterator_test_fini(void)
470 {
471 }
M0_INTERNAL void m0_xc_m0_fop_iterator_test_struct_init(void)
M0_BASSERT(offsetof(struct _m0_fop_seg_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
struct m0_xcode_type * m0_fop_recursive1_xc
M0_INTERNAL void m0_xc_fop_ut_iterator_test_init(void)
#define NULL
Definition: misc.h:38
static struct _m0_fop_recursive2_s _m0_fop_recursive2
struct m0_xcode_type * m0_fop_iterator_test_xc
struct m0_xcode_type * m0_fop_recursive2_xc
static struct _m0_fop_iterator_test_s _m0_fop_iterator_test
struct m0_xcode_field _child[2]
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
M0_INTERNAL void m0_xc_m0_fid_struct_init(void)
Definition: fid_xc.c:64
void m0_xc_void_init(void)
Definition: xcode.c:908
M0_INTERNAL void m0_xc_m0_fop_seg_struct_init(void)
M0_INTERNAL void m0_xc_m0_fop_recursive2_struct_init(void)
struct m0_xcode_type _type
struct m0_xcode_type _type
const struct m0_xcode_type M0_XT_VOID
Definition: xcode.c:916
struct m0_xcode_type _type
static struct _m0_fop_optfid_s _m0_fop_optfid
#define M0_POST(cond)
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
static struct _m0_fop_vec_s _m0_fop_vec
void m0_xc_u64_init(void)
Definition: xcode.c:904
struct m0_xcode_type * m0_fop_seg_xc
static struct _m0_fop_recursive1_s _m0_fop_recursive1
struct m0_xcode_field _child[2]
M0_INTERNAL void m0_xc_fop_ut_iterator_test_fini(void)
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
struct m0_xcode_type _type
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
M0_INTERNAL void m0_xc_m0_fop_vec_struct_init(void)
struct m0_xcode_type _type
struct m0_xcode_type _type
void m0_xc_u32_init(void)
Definition: xcode.c:900
struct m0_xcode_type * m0_fop_optfid_xc
static struct _m0_fop_seg_s _m0_fop_seg
const char * xf_name
Definition: xcode.h:251
struct m0_xcode_type * m0_fop_vec_xc
struct m0_xcode_field _child[3]
struct m0_xcode_field _child[2]
struct m0_xcode_type * m0_fid_xc
Definition: fid_xc.c:10
M0_INTERNAL void m0_xc_m0_fop_recursive1_struct_init(void)
const struct m0_xcode_type M0_XT_U64
Definition: xcode.c:940
M0_INTERNAL void m0_xc_m0_fop_optfid_struct_init(void)
#define offsetof(typ, memb)
Definition: misc.h:29
struct m0_xcode_field _child[2]
struct m0_xcode_field _child[6]