Motr  M0
test_gccxml_simple_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from xcode/ut/test_gccxml_simple.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
9 
16 
17 static struct _optfid_s {
20 } _optfid = {
21  ._type = {
23  .xct_name = "optfid",
24  .xct_sizeof = sizeof (struct optfid),
25  .xct_nr = 3,
26  .xct_flags = 0,
27  }
28 };
29 
31 M0_BASSERT(offsetof(struct _optfid_s, _child[0]) ==
32  offsetof(struct m0_xcode_type, xct_child[0]));
33 
34 static struct _optfidarray_s {
37 } _optfidarray = {
38  ._type = {
40  .xct_name = "optfidarray",
41  .xct_sizeof = sizeof (struct optfidarray),
42  .xct_nr = 2,
43  .xct_flags = 0,
44  }
45 };
46 
48 M0_BASSERT(offsetof(struct _optfidarray_s, _child[0]) ==
49  offsetof(struct m0_xcode_type, xct_child[0]));
50 
51 static struct _fixarray_s {
54 } _fixarray = {
55  ._type = {
57  .xct_name = "fixarray",
58  .xct_sizeof = sizeof (struct fixarray),
59  .xct_nr = 2,
60  .xct_flags = 0,
61  }
62 };
63 
65 M0_BASSERT(offsetof(struct _fixarray_s, _child[0]) ==
66  offsetof(struct m0_xcode_type, xct_child[0]));
67 
68 static struct _testtypes_s {
71 } _testtypes = {
72  ._type = {
74  .xct_name = "testtypes",
75  .xct_sizeof = sizeof (struct testtypes),
76  .xct_nr = 7,
77  .xct_flags = 0,
78  }
79 };
80 
82 M0_BASSERT(offsetof(struct _testtypes_s, _child[0]) ==
83  offsetof(struct m0_xcode_type, xct_child[0]));
84 
85 static struct _inlinearray_s {
88 } _inlinearray = {
89  ._type = {
91  .xct_name = "inlinearray",
92  .xct_sizeof = sizeof (struct inlinearray),
93  .xct_nr = 1,
94  .xct_flags = 0,
95  }
96 };
97 
99 M0_BASSERT(offsetof(struct _inlinearray_s, _child[0]) ==
100  offsetof(struct m0_xcode_type, xct_child[0]));
101 
102 static struct _enumfield_s {
105 } _enumfield = {
106  ._type = {
108  .xct_name = "enumfield",
109  .xct_sizeof = sizeof (struct enumfield),
110  .xct_nr = 4,
111  .xct_flags = 0,
112  }
113 };
114 
116 M0_BASSERT(offsetof(struct _enumfield_s, _child[0]) ==
117  offsetof(struct m0_xcode_type, xct_child[0]));
118 
119 
120 M0_BASSERT(sizeof(struct optfid) == 24U);
121 
122 M0_BASSERT(sizeof ((struct optfid *)0)->o_flag == 1U);
123 M0_BASSERT(offsetof(struct optfid, o_flag) == 0U);
124 M0_BASSERT(sizeof ((struct optfid *)0)->u.o_fid == 16U);
125 M0_BASSERT(offsetof(struct optfid, u.o_fid) == 8U);
126 M0_BASSERT(sizeof ((struct optfid *)0)->u.o_short == 4U);
127 M0_BASSERT(offsetof(struct optfid, u.o_short) == 8U);
128 
129 M0_BASSERT(sizeof(struct optfidarray) == 16U);
130 
131 M0_BASSERT(sizeof ((struct optfidarray *)0)->ofa_nr == 8U);
132 M0_BASSERT(offsetof(struct optfidarray, ofa_nr) == 0U);
133 M0_BASSERT(sizeof ((struct optfidarray *)0)->ofa_data == 8U);
134 M0_BASSERT(offsetof(struct optfidarray, ofa_data) == 8U);
135 
136 M0_BASSERT(sizeof(struct fixarray) == 8U);
137 
138 M0_BASSERT(sizeof ((struct fixarray *)0)->fa_none == 0U);
139 M0_BASSERT(offsetof(struct fixarray, fa_none) == 0U);
140 M0_BASSERT(sizeof ((struct fixarray *)0)->fa_data == 8U);
141 M0_BASSERT(offsetof(struct fixarray, fa_data) == 0U);
142 
143 M0_BASSERT(sizeof(struct testtypes) == 56U);
144 
145 M0_BASSERT(sizeof ((struct testtypes *)0)->tt_char == 1U);
146 M0_BASSERT(offsetof(struct testtypes, tt_char) == 0U);
147 M0_BASSERT(sizeof ((struct testtypes *)0)->tt_pchar == 8U);
148 M0_BASSERT(offsetof(struct testtypes, tt_pchar) == 8U);
149 M0_BASSERT(sizeof ((struct testtypes *)0)->tt_cpchar == 8U);
150 M0_BASSERT(offsetof(struct testtypes, tt_cpchar) == 16U);
151 M0_BASSERT(sizeof ((struct testtypes *)0)->tt_int == 4U);
152 M0_BASSERT(offsetof(struct testtypes, tt_int) == 24U);
153 M0_BASSERT(sizeof ((struct testtypes *)0)->tt_ll == 8U);
154 M0_BASSERT(offsetof(struct testtypes, tt_ll) == 32U);
155 M0_BASSERT(sizeof ((struct testtypes *)0)->tt_ui == 4U);
156 M0_BASSERT(offsetof(struct testtypes, tt_ui) == 40U);
157 M0_BASSERT(sizeof ((struct testtypes *)0)->tt_buf == 8U);
158 M0_BASSERT(offsetof(struct testtypes, tt_buf) == 48U);
159 
160 M0_BASSERT(sizeof(struct inlinearray) == 280U);
161 
162 M0_BASSERT(sizeof ((struct inlinearray *)0)->ia_bugs == 280U);
163 M0_BASSERT(offsetof(struct inlinearray, ia_bugs) == 0U);
164 
165 M0_BASSERT(sizeof(struct enumfield) == 32U);
166 
167 M0_BASSERT(sizeof ((struct enumfield *)0)->ef_0 == 8U);
168 M0_BASSERT(offsetof(struct enumfield, ef_0) == 0U);
169 M0_BASSERT(sizeof ((struct enumfield *)0)->ef_enum == 8U);
170 M0_BASSERT(offsetof(struct enumfield, ef_enum) == 8U);
171 M0_BASSERT(sizeof ((struct enumfield *)0)->ef_bitm == 8U);
172 M0_BASSERT(offsetof(struct enumfield, ef_bitm) == 16U);
173 M0_BASSERT(sizeof ((struct enumfield *)0)->ef_1 == 8U);
174 M0_BASSERT(offsetof(struct enumfield, ef_1) == 24U);
175 
176 
178  { .xev_idx = 0, .xev_name = "TE_0", .xev_val = 0 },
179  { .xev_idx = 1, .xev_name = "TE_1", .xev_val = 1 },
180  { .xev_idx = 2, .xev_name = "TE_5", .xev_val = 5 },
181  { .xev_idx = 3, .xev_name = "TE_33", .xev_val = 33 },
182  { .xev_idx = -1, .xev_name = "Invalid value of enum 'testenum'." }
183 };
184 
186  .xe_name = "testenum",
187  .xe_nr = 4,
188  .xe_val = testenum_data,
189  .xe_maxlen = 5
190 };
192  { .xev_idx = 0, .xev_name = "BM_ZERO", .xev_val = 1 },
193  { .xev_idx = 1, .xev_name = "BM_SIX", .xev_val = 64 },
194  { .xev_idx = 2, .xev_name = "BM_FOUR", .xev_val = 16 },
195  { .xev_idx = 3, .xev_name = "BM_NINE", .xev_val = 512 },
196  { .xev_idx = 4, .xev_name = "BM_FIVE", .xev_val = 32 },
197  { .xev_idx = -1, .xev_name = "Invalid value of enum 'testbitmask'." }
198 };
199 
201  .xe_name = "testbitmask",
202  .xe_nr = 5,
203  .xe_val = testbitmask_data,
204  .xe_maxlen = 7
205 };
206 
207 M0_INTERNAL void m0_xc_optfid_struct_init(void)
208 {
209  _optfid._child[0] = (struct m0_xcode_field) {
210  .xf_name = "o_flag",
211 
212  .xf_type = &M0_XT_U8,
213 
214  .xf_tag = 0,
215  .xf_opaque = NULL,
216  .xf_offset = offsetof(struct optfid, o_flag),
217  .xf_read = NULL,
218  .xf_decor = {
220  }
221  };
222  m0_xc_u8_init();
223 
224  _optfid._child[1] = (struct m0_xcode_field) {
225  .xf_name = "o_fid",
226 
227  .xf_type = m0_fid_xc,
228 
229  .xf_tag = 1,
230  .xf_opaque = NULL,
231  .xf_offset = offsetof(struct optfid, u.o_fid),
232  .xf_read = NULL,
233  .xf_decor = {
235  }
236  };
238 
239  _optfid._child[2] = (struct m0_xcode_field) {
240  .xf_name = "o_short",
241 
242  .xf_type = &M0_XT_U32,
243 
244  .xf_tag = 3,
245  .xf_opaque = NULL,
246  .xf_offset = offsetof(struct optfid, u.o_short),
247  .xf_read = NULL,
248  .xf_decor = {
250  }
251  };
252  m0_xc_u32_init();
253 
255 }
256 
257 M0_INTERNAL void m0_xc_optfidarray_struct_init(void)
258 {
259  _optfidarray._child[0] = (struct m0_xcode_field) {
260  .xf_name = "ofa_nr",
261 
262  .xf_type = &M0_XT_U64,
263 
264  .xf_tag = 0,
265  .xf_opaque = NULL,
266  .xf_offset = offsetof(struct optfidarray, ofa_nr),
267  .xf_read = NULL,
268  .xf_decor = {
270  }
271  };
272  m0_xc_u64_init();
273 
274  _optfidarray._child[1] = (struct m0_xcode_field) {
275  .xf_name = "ofa_data",
276 
277  .xf_type = optfid_xc,
278 
279  .xf_tag = 0,
280  .xf_opaque = NULL,
281  .xf_offset = offsetof(struct optfidarray, ofa_data),
282  .xf_read = NULL,
283  .xf_decor = {
285  }
286  };
288 
290 }
291 
292 M0_INTERNAL void m0_xc_fixarray_struct_init(void)
293 {
294  _fixarray._child[0] = (struct m0_xcode_field) {
295  .xf_name = "fa_none",
296 
297  .xf_type = &M0_XT_VOID,
298 
299  .xf_tag = NR,
300  .xf_opaque = NULL,
301  .xf_offset = offsetof(struct fixarray, fa_none),
302  .xf_read = NULL,
303  .xf_decor = {
305  }
306  };
307  m0_xc_void_init();
308 
309  _fixarray._child[1] = (struct m0_xcode_field) {
310  .xf_name = "fa_data",
311 
312  .xf_type = optfid_xc,
313 
314  .xf_tag = 0,
315  .xf_opaque = NULL,
316  .xf_offset = offsetof(struct fixarray, fa_data),
317  .xf_read = NULL,
318  .xf_decor = {
320  }
321  };
323 
325 }
326 
327 M0_INTERNAL void m0_xc_testtypes_struct_init(void)
328 {
329  _testtypes._child[0] = (struct m0_xcode_field) {
330  .xf_name = "tt_char",
331 
332  .xf_type = &M0_XT_U8,
333 
334  .xf_tag = 0,
335  .xf_opaque = NULL,
336  .xf_offset = offsetof(struct testtypes, tt_char),
337  .xf_read = NULL,
338  .xf_decor = {
340  }
341  };
342  m0_xc_u8_init();
343 
344  _testtypes._child[1] = (struct m0_xcode_field) {
345  .xf_name = "tt_pchar",
346 
347  .xf_type = &M0_XT_U64,
348 
349  .xf_tag = 0,
350  .xf_opaque = NULL,
351  .xf_offset = offsetof(struct testtypes, tt_pchar),
352  .xf_read = NULL,
353  .xf_decor = {
355  }
356  };
357  m0_xc_u64_init();
358 
359  _testtypes._child[2] = (struct m0_xcode_field) {
360  .xf_name = "tt_cpchar",
361 
362  .xf_type = &M0_XT_U64,
363 
364  .xf_tag = 0,
365  .xf_opaque = NULL,
366  .xf_offset = offsetof(struct testtypes, tt_cpchar),
367  .xf_read = NULL,
368  .xf_decor = {
370  }
371  };
372  m0_xc_u64_init();
373 
374  _testtypes._child[3] = (struct m0_xcode_field) {
375  .xf_name = "tt_int",
376 
377  .xf_type = &M0_XT_U32,
378 
379  .xf_tag = 0,
380  .xf_opaque = NULL,
381  .xf_offset = offsetof(struct testtypes, tt_int),
382  .xf_read = NULL,
383  .xf_decor = {
385  }
386  };
387  m0_xc_u32_init();
388 
389  _testtypes._child[4] = (struct m0_xcode_field) {
390  .xf_name = "tt_ll",
391 
392  .xf_type = &M0_XT_U64,
393 
394  .xf_tag = 0,
395  .xf_opaque = NULL,
396  .xf_offset = offsetof(struct testtypes, tt_ll),
397  .xf_read = NULL,
398  .xf_decor = {
400  }
401  };
402  m0_xc_u64_init();
403 
404  _testtypes._child[5] = (struct m0_xcode_field) {
405  .xf_name = "tt_ui",
406 
407  .xf_type = &M0_XT_U32,
408 
409  .xf_tag = 0,
410  .xf_opaque = NULL,
411  .xf_offset = offsetof(struct testtypes, tt_ui),
412  .xf_read = NULL,
413  .xf_decor = {
415  }
416  };
417  m0_xc_u32_init();
418 
419  _testtypes._child[6] = (struct m0_xcode_field) {
420  .xf_name = "tt_buf",
421 
422  .xf_type = &M0_XT_U64,
423 
424  .xf_tag = 0,
425  .xf_opaque = NULL,
426  .xf_offset = offsetof(struct testtypes, tt_buf),
427  .xf_read = NULL,
428  .xf_decor = {
430  }
431  };
432  m0_xc_u64_init();
433 
435 }
436 
437 M0_INTERNAL void m0_xc_inlinearray_struct_init(void)
438 {
439  _inlinearray._child[0] = (struct m0_xcode_field) {
440  .xf_name = "ia_bugs",
441 
442  .xf_type = testtypes_xc,
443 
444  .xf_tag = 5,
445  .xf_opaque = NULL,
446  .xf_offset = offsetof(struct inlinearray, ia_bugs),
447  .xf_read = NULL,
448  .xf_decor = {
450  }
451  };
453 
455 }
456 
457 M0_INTERNAL void m0_xc_enumfield_struct_init(void)
458 {
459  _enumfield._child[0] = (struct m0_xcode_field) {
460  .xf_name = "ef_0",
461 
462  .xf_type = &M0_XT_U64,
463 
464  .xf_tag = 0,
465  .xf_opaque = NULL,
466  .xf_offset = offsetof(struct enumfield, ef_0),
467  .xf_read = NULL,
468  .xf_decor = {
470  }
471  };
472  m0_xc_u64_init();
473 
474  _enumfield._child[1] = (struct m0_xcode_field) {
475  .xf_name = "ef_enum",
476 
477  .xf_type = &M0_XT_U64,
478 
479  .xf_tag = 0,
480  .xf_opaque = NULL,
481  .xf_offset = offsetof(struct enumfield, ef_enum),
482  .xf_read = &m0_xcode_enum_field_read,
483  .xf_decor = {
485  }
486  };
487  m0_xc_u64_init();
488 
489  _enumfield._child[2] = (struct m0_xcode_field) {
490  .xf_name = "ef_bitm",
491 
492  .xf_type = &M0_XT_U64,
493 
494  .xf_tag = 0,
495  .xf_opaque = NULL,
496  .xf_offset = offsetof(struct enumfield, ef_bitm),
497  .xf_read = &m0_xcode_bitmask_field_read,
498  .xf_decor = {
500  }
501  };
502  m0_xc_u64_init();
503 
504  _enumfield._child[3] = (struct m0_xcode_field) {
505  .xf_name = "ef_1",
506 
507  .xf_type = &M0_XT_U64,
508 
509  .xf_tag = 0,
510  .xf_opaque = NULL,
511  .xf_offset = offsetof(struct enumfield, ef_1),
512  .xf_read = NULL,
513  .xf_decor = {
515  }
516  };
517  m0_xc_u64_init();
518 
520 }
521 
523 {
530 }
531 
533 {
534 }
M0_INTERNAL void m0_xc_inlinearray_struct_init(void)
static struct _inlinearray_s _inlinearray
struct m0_xcode_field _child[7]
#define NULL
Definition: misc.h:38
struct m0_xcode_type * enumfield_xc
struct m0_xcode_field _child[1]
union @126 u
M0_INTERNAL void m0_xc_xcode_ut_test_gccxml_simple_fini(void)
static struct _enumfield_s _enumfield
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
struct m0_xcode_type _type
void m0_xc_void_init(void)
Definition: xcode.c:908
M0_BASSERT(offsetof(struct _optfid_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
struct m0_xcode_field _child[2]
const char * xe_name
Definition: enum.h:58
struct m0_xcode_field _child[3]
struct m0_xcode_type * inlinearray_xc
struct m0_xcode_type _type
const struct m0_xcode_enum_val testenum_data[]
struct m0_xcode_type _type
M0_INTERNAL void m0_xc_enumfield_struct_init(void)
static struct _optfid_s _optfid
struct m0_xcode_type * optfidarray_xc
struct m0_xcode_type _type
struct m0_xcode_field _child[2]
struct m0_xcode_enum m0_xc_testenum_enum
Definition: storage.c:317
const struct m0_xcode_type M0_XT_VOID
Definition: xcode.c:916
M0_INTERNAL void m0_xc_fixarray_struct_init(void)
M0_INTERNAL void m0_xc_xcode_ut_test_gccxml_simple_init(void)
M0_INTERNAL void m0_xc_optfid_struct_init(void)
struct m0_xcode_type _type
#define M0_POST(cond)
const struct m0_xcode_enum_val testbitmask_data[]
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
struct m0_xcode_type * fixarray_xc
struct m0_xcode_enum m0_xc_testbitmask_enum
struct m0_xcode_field _child[4]
void m0_xc_u64_init(void)
Definition: xcode.c:904
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
M0_INTERNAL int m0_xcode_bitmask_field_read(const struct m0_xcode_cursor *it, struct m0_xcode_obj *obj, const char *str)
Definition: enum.c:155
struct m0_xcode_type _type
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
M0_INTERNAL void m0_xc_testtypes_struct_init(void)
const struct m0_xcode_type M0_XT_U8
Definition: xcode.c:924
struct m0_xcode_type * testtypes_xc
void m0_xc_u8_init(void)
Definition: xcode.c:892
void m0_xc_u32_init(void)
Definition: xcode.c:900
static struct _testtypes_s _testtypes
static struct _optfidarray_s _optfidarray
const char * xf_name
Definition: xcode.h:251
struct m0_xcode_type * m0_fid_xc
Definition: fid_xc.c:10
const struct m0_xcode_type M0_XT_U64
Definition: xcode.c:940
M0_INTERNAL void m0_xc_optfidarray_struct_init(void)
#define offsetof(typ, memb)
Definition: misc.h:29
struct m0_xcode_type * optfid_xc
M0_INTERNAL int m0_xcode_enum_field_read(const struct m0_xcode_cursor *it, struct m0_xcode_obj *obj, const char *str)
Definition: enum.c:142
static struct _fixarray_s _fixarray