Motr  M0
buf_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from lib/buf.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "lib/buf.h"
8 #include "lib/buf_xc.h"
9 
12 
13 static struct _m0_buf_s {
16 } _m0_buf = {
17  ._type = {
19  .xct_name = "m0_buf",
20  .xct_sizeof = sizeof (struct m0_buf),
21  .xct_nr = 2,
23  }
24 };
25 
27 M0_BASSERT(offsetof(struct _m0_buf_s, _child[0]) ==
28  offsetof(struct m0_xcode_type, xct_child[0]));
29 
30 static struct _m0_bufs_s {
33 } _m0_bufs = {
34  ._type = {
36  .xct_name = "m0_bufs",
37  .xct_sizeof = sizeof (struct m0_bufs),
38  .xct_nr = 2,
40  }
41 };
42 
44 M0_BASSERT(offsetof(struct _m0_bufs_s, _child[0]) ==
45  offsetof(struct m0_xcode_type, xct_child[0]));
46 
47 
48 M0_BASSERT(sizeof(struct m0_buf) == 16U);
49 
50 M0_BASSERT(sizeof ((struct m0_buf *)0)->b_nob == 8U);
51 M0_BASSERT(offsetof(struct m0_buf, b_nob) == 0U);
52 M0_BASSERT(sizeof ((struct m0_buf *)0)->b_addr == 8U);
53 M0_BASSERT(offsetof(struct m0_buf, b_addr) == 8U);
54 
55 M0_BASSERT(sizeof(struct m0_bufs) == 16U);
56 
57 M0_BASSERT(sizeof ((struct m0_bufs *)0)->ab_count == 4U);
58 M0_BASSERT(offsetof(struct m0_bufs, ab_count) == 0U);
59 M0_BASSERT(sizeof ((struct m0_bufs *)0)->ab_elems == 8U);
60 M0_BASSERT(offsetof(struct m0_bufs, ab_elems) == 8U);
61 
62 
63 
64 M0_INTERNAL void m0_xc_m0_buf_struct_init(void)
65 {
66  _m0_buf._child[0] = (struct m0_xcode_field) {
67  .xf_name = "b_nob",
68 
69  .xf_type = &M0_XT_U64,
70 
71  .xf_tag = 0,
72  .xf_opaque = NULL,
73  .xf_offset = offsetof(struct m0_buf, b_nob),
74  .xf_read = NULL,
75  .xf_decor = {
77  }
78  };
80 
81  _m0_buf._child[1] = (struct m0_xcode_field) {
82  .xf_name = "b_addr",
83 
84  .xf_type = &M0_XT_U8,
85 
86  .xf_tag = 0,
87  .xf_opaque = NULL,
88  .xf_offset = offsetof(struct m0_buf, b_addr),
89  .xf_read = NULL,
90  .xf_decor = {
92  }
93  };
94  m0_xc_u8_init();
95 
97 }
98 
99 M0_INTERNAL void m0_xc_m0_bufs_struct_init(void)
100 {
101  _m0_bufs._child[0] = (struct m0_xcode_field) {
102  .xf_name = "ab_count",
103 
104  .xf_type = &M0_XT_U32,
105 
106  .xf_tag = 0,
107  .xf_opaque = NULL,
108  .xf_offset = offsetof(struct m0_bufs, ab_count),
109  .xf_read = NULL,
110  .xf_decor = {
112  }
113  };
114  m0_xc_u32_init();
115 
116  _m0_bufs._child[1] = (struct m0_xcode_field) {
117  .xf_name = "ab_elems",
118 
119  .xf_type = m0_buf_xc,
120 
121  .xf_tag = 0,
122  .xf_opaque = NULL,
123  .xf_offset = offsetof(struct m0_bufs, ab_elems),
124  .xf_read = NULL,
125  .xf_decor = {
127  }
128  };
130 
132 }
133 
134 M0_INTERNAL void m0_xc_lib_buf_init(void)
135 {
138 }
139 
140 M0_INTERNAL void m0_xc_lib_buf_fini(void)
141 {
142 }
static struct _m0_bufs_s _m0_bufs
struct m0_xcode_type * m0_buf_xc
Definition: buf_xc.c:10
#define NULL
Definition: misc.h:38
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
M0_INTERNAL void m0_xc_m0_buf_struct_init(void)
Definition: buf_xc.c:64
Definition: buf.h:37
M0_INTERNAL void m0_xc_lib_buf_fini(void)
Definition: buf_xc.c:140
struct m0_xcode_type * m0_bufs_xc
Definition: buf_xc.c:11
void * b_addr
Definition: buf.h:231
struct m0_xcode_type _type
Definition: buf_xc.c:14
struct m0_xcode_field _child[2]
Definition: buf_xc.c:15
M0_BASSERT(offsetof(struct _m0_buf_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
#define M0_POST(cond)
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
void m0_xc_u64_init(void)
Definition: xcode.c:904
M0_INTERNAL void m0_xc_m0_bufs_struct_init(void)
Definition: buf_xc.c:99
uint32_t ab_count
Definition: buf.h:230
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
struct m0_xcode_type _type
Definition: buf_xc.c:31
struct m0_xcode_field _child[2]
Definition: buf_xc.c:32
static struct _m0_buf_s _m0_buf
const struct m0_xcode_type M0_XT_U8
Definition: xcode.c:924
void m0_xc_u8_init(void)
Definition: xcode.c:892
Definition: buf.h:43
void m0_xc_u32_init(void)
Definition: xcode.c:900
struct m0_buf * ab_elems
Definition: buf.h:231
const char * xf_name
Definition: xcode.h:251
const struct m0_xcode_type M0_XT_U64
Definition: xcode.c:940
#define offsetof(typ, memb)
Definition: misc.h:29
M0_INTERNAL void m0_xc_lib_buf_init(void)
Definition: buf_xc.c:134
m0_bcount_t b_nob
Definition: buf.h:230