Motr  M0
note_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from ha/note.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "ha/note.h"
8 #include "ha/note_xc.h"
9 
14 
15 static struct _m0_ha_note_s {
18 } _m0_ha_note = {
19  ._type = {
21  .xct_name = "m0_ha_note",
22  .xct_sizeof = sizeof (struct m0_ha_note),
23  .xct_nr = 2,
24  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC,
25  }
26 };
27 
29 M0_BASSERT(offsetof(struct _m0_ha_note_s, _child[0]) ==
30  offsetof(struct m0_xcode_type, xct_child[0]));
31 
32 static struct _m0_ha_nvec_s {
35 } _m0_ha_nvec = {
36  ._type = {
38  .xct_name = "m0_ha_nvec",
39  .xct_sizeof = sizeof (struct m0_ha_nvec),
40  .xct_nr = 2,
41  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC,
42  }
43 };
44 
46 M0_BASSERT(offsetof(struct _m0_ha_nvec_s, _child[0]) ==
47  offsetof(struct m0_xcode_type, xct_child[0]));
48 
49 static struct _m0_ha_msg_nvec_array_s {
53  ._type = {
55  .xct_name = "m0_ha_msg_nvec_array",
56  .xct_sizeof = sizeof (struct m0_ha_msg_nvec_array),
57  .xct_nr = 1,
58  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC,
59  }
60 };
61 
63 M0_BASSERT(offsetof(struct _m0_ha_msg_nvec_array_s, _child[0]) ==
64  offsetof(struct m0_xcode_type, xct_child[0]));
65 
66 static struct _m0_ha_msg_nvec_s {
69 } _m0_ha_msg_nvec = {
70  ._type = {
72  .xct_name = "m0_ha_msg_nvec",
73  .xct_sizeof = sizeof (struct m0_ha_msg_nvec),
74  .xct_nr = 5,
75  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC,
76  }
77 };
78 
80 M0_BASSERT(offsetof(struct _m0_ha_msg_nvec_s, _child[0]) ==
81  offsetof(struct m0_xcode_type, xct_child[0]));
82 
83 
84 M0_BASSERT(sizeof(struct m0_ha_note) == 24U);
85 
86 M0_BASSERT(sizeof ((struct m0_ha_note *)0)->no_id == 16U);
87 M0_BASSERT(offsetof(struct m0_ha_note, no_id) == 0U);
88 M0_BASSERT(sizeof ((struct m0_ha_note *)0)->no_state == 4U);
89 M0_BASSERT(offsetof(struct m0_ha_note, no_state) == 16U);
90 
91 M0_BASSERT(sizeof(struct m0_ha_nvec) == 16U);
92 
93 M0_BASSERT(sizeof ((struct m0_ha_nvec *)0)->nv_nr == 4U);
94 M0_BASSERT(offsetof(struct m0_ha_nvec, nv_nr) == 0U);
95 M0_BASSERT(sizeof ((struct m0_ha_nvec *)0)->nv_note == 8U);
96 M0_BASSERT(offsetof(struct m0_ha_nvec, nv_note) == 8U);
97 
98 M0_BASSERT(sizeof(struct m0_ha_msg_nvec_array) == 24576U);
99 
100 M0_BASSERT(sizeof ((struct m0_ha_msg_nvec_array *)0)->hmna_arr == 24576U);
102 
103 M0_BASSERT(sizeof(struct m0_ha_msg_nvec) == 24608U);
104 
105 M0_BASSERT(sizeof ((struct m0_ha_msg_nvec *)0)->hmnv_type == 8U);
107 M0_BASSERT(sizeof ((struct m0_ha_msg_nvec *)0)->hmnv_id_of_get == 8U);
109 M0_BASSERT(sizeof ((struct m0_ha_msg_nvec *)0)->hmnv_ignore_same_state == 8U);
111 M0_BASSERT(sizeof ((struct m0_ha_msg_nvec *)0)->hmnv_nr == 8U);
112 M0_BASSERT(offsetof(struct m0_ha_msg_nvec, hmnv_nr) == 24U);
113 M0_BASSERT(sizeof ((struct m0_ha_msg_nvec *)0)->hmnv_arr == 24576U);
114 M0_BASSERT(offsetof(struct m0_ha_msg_nvec, hmnv_arr) == 32U);
115 
116 
117 
118 M0_INTERNAL void m0_xc_m0_ha_note_struct_init(void)
119 {
120  _m0_ha_note._child[0] = (struct m0_xcode_field) {
121  .xf_name = "no_id",
122 
123  .xf_type = m0_fid_xc,
124 
125  .xf_tag = 0,
126  .xf_opaque = NULL,
127  .xf_offset = offsetof(struct m0_ha_note, no_id),
128  .xf_read = NULL,
129  .xf_decor = {
131  }
132  };
134 
135  _m0_ha_note._child[1] = (struct m0_xcode_field) {
136  .xf_name = "no_state",
137 
138  .xf_type = &M0_XT_U32,
139 
140  .xf_tag = 0,
141  .xf_opaque = NULL,
142  .xf_offset = offsetof(struct m0_ha_note, no_state),
143  .xf_read = NULL,
144  .xf_decor = {
146  }
147  };
148  m0_xc_u32_init();
149 
151 }
152 
153 M0_INTERNAL void m0_xc_m0_ha_nvec_struct_init(void)
154 {
155  _m0_ha_nvec._child[0] = (struct m0_xcode_field) {
156  .xf_name = "nv_nr",
157 
158  .xf_type = &M0_XT_U32,
159 
160  .xf_tag = 0,
161  .xf_opaque = NULL,
162  .xf_offset = offsetof(struct m0_ha_nvec, nv_nr),
163  .xf_read = NULL,
164  .xf_decor = {
166  }
167  };
168  m0_xc_u32_init();
169 
170  _m0_ha_nvec._child[1] = (struct m0_xcode_field) {
171  .xf_name = "nv_note",
172 
173  .xf_type = m0_ha_note_xc,
174 
175  .xf_tag = 0,
176  .xf_opaque = NULL,
177  .xf_offset = offsetof(struct m0_ha_nvec, nv_note),
178  .xf_read = NULL,
179  .xf_decor = {
181  }
182  };
184 
186 }
187 
189 {
191  .xf_name = "hmna_arr",
192 
193  .xf_type = m0_ha_note_xc,
194 
195  .xf_tag = 1024,
196  .xf_opaque = NULL,
197  .xf_offset = offsetof(struct m0_ha_msg_nvec_array, hmna_arr),
198  .xf_read = NULL,
199  .xf_decor = {
201  }
202  };
204 
206 }
207 
208 M0_INTERNAL void m0_xc_m0_ha_msg_nvec_struct_init(void)
209 {
210  _m0_ha_msg_nvec._child[0] = (struct m0_xcode_field) {
211  .xf_name = "hmnv_type",
212 
213  .xf_type = &M0_XT_U64,
214 
215  .xf_tag = 0,
216  .xf_opaque = NULL,
217  .xf_offset = offsetof(struct m0_ha_msg_nvec, hmnv_type),
218  .xf_read = NULL,
219  .xf_decor = {
221  }
222  };
223  m0_xc_u64_init();
224 
225  _m0_ha_msg_nvec._child[1] = (struct m0_xcode_field) {
226  .xf_name = "hmnv_id_of_get",
227 
228  .xf_type = &M0_XT_U64,
229 
230  .xf_tag = 0,
231  .xf_opaque = NULL,
232  .xf_offset = offsetof(struct m0_ha_msg_nvec, hmnv_id_of_get),
233  .xf_read = NULL,
234  .xf_decor = {
236  }
237  };
238  m0_xc_u64_init();
239 
240  _m0_ha_msg_nvec._child[2] = (struct m0_xcode_field) {
241  .xf_name = "hmnv_ignore_same_state",
242 
243  .xf_type = &M0_XT_U64,
244 
245  .xf_tag = 0,
246  .xf_opaque = NULL,
247  .xf_offset = offsetof(struct m0_ha_msg_nvec, hmnv_ignore_same_state),
248  .xf_read = NULL,
249  .xf_decor = {
251  }
252  };
253  m0_xc_u64_init();
254 
255  _m0_ha_msg_nvec._child[3] = (struct m0_xcode_field) {
256  .xf_name = "hmnv_nr",
257 
258  .xf_type = &M0_XT_U64,
259 
260  .xf_tag = 0,
261  .xf_opaque = NULL,
262  .xf_offset = offsetof(struct m0_ha_msg_nvec, hmnv_nr),
263  .xf_read = NULL,
264  .xf_decor = {
266  }
267  };
268  m0_xc_u64_init();
269 
270  _m0_ha_msg_nvec._child[4] = (struct m0_xcode_field) {
271  .xf_name = "hmnv_arr",
272 
273  .xf_type = m0_ha_msg_nvec_array_xc,
274 
275  .xf_tag = 0,
276  .xf_opaque = NULL,
277  .xf_offset = offsetof(struct m0_ha_msg_nvec, hmnv_arr),
278  .xf_read = NULL,
279  .xf_decor = {
281  }
282  };
284 
286 }
287 
288 M0_INTERNAL void m0_xc_ha_note_init(void)
289 {
294 }
295 
296 M0_INTERNAL void m0_xc_ha_note_fini(void)
297 {
298 }
M0_BASSERT(offsetof(struct _m0_ha_note_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
M0_INTERNAL void m0_xc_m0_ha_note_struct_init(void)
Definition: note_xc.c:118
struct m0_xcode_field _child[1]
Definition: note_xc.c:51
struct m0_xcode_field _child[2]
Definition: note_xc.c:34
static struct _m0_ha_msg_nvec_array_s _m0_ha_msg_nvec_array
#define NULL
Definition: misc.h:38
struct m0_xcode_type _type
Definition: note_xc.c:33
M0_INTERNAL void m0_xc_m0_ha_nvec_struct_init(void)
Definition: note_xc.c:153
struct m0_xcode_type _type
Definition: note_xc.c:50
struct m0_xcode_type * m0_ha_nvec_xc
Definition: note_xc.c:11
struct m0_fid no_id
Definition: note.h:325
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
M0_INTERNAL void m0_xc_ha_note_init(void)
Definition: note_xc.c:288
M0_INTERNAL void m0_xc_m0_fid_struct_init(void)
Definition: fid_xc.c:64
struct m0_ha_note * nv_note
Definition: note.h:332
static struct _m0_ha_note_s _m0_ha_note
M0_INTERNAL void m0_xc_m0_ha_msg_nvec_struct_init(void)
Definition: note_xc.c:208
struct m0_xcode_type * m0_ha_msg_nvec_array_xc
Definition: note_xc.c:12
struct m0_ha_note hmna_arr[M0_HA_STATE_UPDATE_LIMIT]
Definition: note.h:324
struct m0_xcode_type _type
Definition: note_xc.c:16
#define M0_POST(cond)
struct m0_xcode_type _type
Definition: note_xc.c:67
static struct _m0_ha_msg_nvec_s _m0_ha_msg_nvec
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
struct m0_xcode_field _child[5]
Definition: note_xc.c:68
struct m0_xcode_field _child[2]
Definition: note_xc.c:17
uint32_t no_state
Definition: note.h:327
struct m0_xcode_type * m0_ha_msg_nvec_xc
Definition: note_xc.c:13
struct m0_xcode_type * m0_ha_note_xc
Definition: note_xc.c:10
void m0_xc_u64_init(void)
Definition: xcode.c:904
uint64_t hmnv_type
Definition: note.h:325
struct m0_ha_msg_nvec_array hmnv_arr
Definition: note.h:364
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
uint64_t hmnv_id_of_get
Definition: note.h:326
M0_INTERNAL void m0_xc_ha_note_fini(void)
Definition: note_xc.c:296
M0_INTERNAL void m0_xc_m0_ha_msg_nvec_array_struct_init(void)
Definition: note_xc.c:188
void m0_xc_u32_init(void)
Definition: xcode.c:900
int32_t nv_nr
Definition: note.h:331
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
#define offsetof(typ, memb)
Definition: misc.h:29
static struct _m0_ha_nvec_s _m0_ha_nvec
uint64_t hmnv_ignore_same_state
Definition: note.h:362
uint64_t hmnv_nr
Definition: note.h:363