Motr  M0
graph_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from graph/graph.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "graph/graph.h"
8 #include "graph/graph_xc.h"
9 
13 
14 static struct _m0_graph_s {
17 } _m0_graph = {
18  ._type = {
20  .xct_name = "m0_graph",
21  .xct_sizeof = sizeof (struct m0_graph),
22  .xct_nr = 1,
23  .xct_flags = 0,
24  }
25 };
26 
28 M0_BASSERT(offsetof(struct _m0_graph_s, _child[0]) ==
29  offsetof(struct m0_xcode_type, xct_child[0]));
30 
31 static struct _m0_garc_s {
34 } _m0_garc = {
35  ._type = {
37  .xct_name = "m0_garc",
38  .xct_sizeof = sizeof (struct m0_garc),
39  .xct_nr = 3,
40  .xct_flags = 0,
41  }
42 };
43 
45 M0_BASSERT(offsetof(struct _m0_garc_s, _child[0]) ==
46  offsetof(struct m0_xcode_type, xct_child[0]));
47 
48 static struct _m0_gvertice_s {
51 } _m0_gvertice = {
52  ._type = {
54  .xct_name = "m0_gvertice",
55  .xct_sizeof = sizeof (struct m0_gvertice),
56  .xct_nr = 6,
57  .xct_flags = 0,
58  }
59 };
60 
62 M0_BASSERT(offsetof(struct _m0_gvertice_s, _child[0]) ==
63  offsetof(struct m0_xcode_type, xct_child[0]));
64 
65 
66 M0_BASSERT(sizeof(struct m0_graph) == 144U);
67 
68 M0_BASSERT(sizeof ((struct m0_graph *)0)->g_anchor == 144U);
69 M0_BASSERT(offsetof(struct m0_graph, g_anchor) == 0U);
70 
71 M0_BASSERT(sizeof(struct m0_garc) == 48U);
72 
73 M0_BASSERT(sizeof ((struct m0_garc *)0)->as_fid == 16U);
74 M0_BASSERT(offsetof(struct m0_garc, as_fid) == 0U);
75 M0_BASSERT(sizeof ((struct m0_garc *)0)->as_local == 16U);
76 M0_BASSERT(offsetof(struct m0_garc, as_local) == 16U);
77 M0_BASSERT(sizeof ((struct m0_garc *)0)->as_remote == 16U);
78 M0_BASSERT(offsetof(struct m0_garc, as_remote) == 32U);
79 
80 M0_BASSERT(sizeof(struct m0_gvertice) == 144U);
81 
82 M0_BASSERT(sizeof ((struct m0_gvertice *)0)->vh_typeid == 8U);
83 M0_BASSERT(offsetof(struct m0_gvertice, vh_typeid) == 0U);
84 M0_BASSERT(sizeof ((struct m0_gvertice *)0)->vh_fid == 16U);
85 M0_BASSERT(offsetof(struct m0_gvertice, vh_fid) == 8U);
86 M0_BASSERT(sizeof ((struct m0_gvertice *)0)->vh_gen == 8U);
87 M0_BASSERT(offsetof(struct m0_gvertice, vh_gen) == 24U);
88 M0_BASSERT(sizeof ((struct m0_gvertice *)0)->vh_cookie == 16U);
89 M0_BASSERT(offsetof(struct m0_gvertice, vh_cookie) == 32U);
90 M0_BASSERT(sizeof ((struct m0_gvertice *)0)->vh_next == 48U);
91 M0_BASSERT(offsetof(struct m0_gvertice, vh_next) == 48U);
92 M0_BASSERT(sizeof ((struct m0_gvertice *)0)->vh_prev == 48U);
93 M0_BASSERT(offsetof(struct m0_gvertice, vh_prev) == 96U);
94 
95 
96 
97 M0_INTERNAL void m0_xc_m0_graph_struct_init(void)
98 {
99  _m0_graph._child[0] = (struct m0_xcode_field) {
100  .xf_name = "g_anchor",
101 
102  .xf_type = m0_gvertice_xc,
103 
104  .xf_tag = 0,
105  .xf_opaque = NULL,
106  .xf_offset = offsetof(struct m0_graph, g_anchor),
107  .xf_read = NULL,
108  .xf_decor = {
110  }
111  };
113 
115 }
116 
117 M0_INTERNAL void m0_xc_m0_garc_struct_init(void)
118 {
119  _m0_garc._child[0] = (struct m0_xcode_field) {
120  .xf_name = "as_fid",
121 
122  .xf_type = m0_fid_xc,
123 
124  .xf_tag = 0,
125  .xf_opaque = NULL,
126  .xf_offset = offsetof(struct m0_garc, as_fid),
127  .xf_read = NULL,
128  .xf_decor = {
130  }
131  };
133 
134  _m0_garc._child[1] = (struct m0_xcode_field) {
135  .xf_name = "as_local",
136 
137  .xf_type = m0_cookie_xc,
138 
139  .xf_tag = 0,
140  .xf_opaque = NULL,
141  .xf_offset = offsetof(struct m0_garc, as_local),
142  .xf_read = NULL,
143  .xf_decor = {
145  }
146  };
148 
149  _m0_garc._child[2] = (struct m0_xcode_field) {
150  .xf_name = "as_remote",
151 
152  .xf_type = m0_cookie_xc,
153 
154  .xf_tag = 0,
155  .xf_opaque = NULL,
156  .xf_offset = offsetof(struct m0_garc, as_remote),
157  .xf_read = NULL,
158  .xf_decor = {
160  }
161  };
163 
165 }
166 
167 M0_INTERNAL void m0_xc_m0_gvertice_struct_init(void)
168 {
169  _m0_gvertice._child[0] = (struct m0_xcode_field) {
170  .xf_name = "vh_typeid",
171 
172  .xf_type = &M0_XT_U64,
173 
174  .xf_tag = 0,
175  .xf_opaque = NULL,
176  .xf_offset = offsetof(struct m0_gvertice, vh_typeid),
177  .xf_read = NULL,
178  .xf_decor = {
180  }
181  };
182  m0_xc_u64_init();
183 
184  _m0_gvertice._child[1] = (struct m0_xcode_field) {
185  .xf_name = "vh_fid",
186 
187  .xf_type = m0_fid_xc,
188 
189  .xf_tag = 0,
190  .xf_opaque = NULL,
191  .xf_offset = offsetof(struct m0_gvertice, vh_fid),
192  .xf_read = NULL,
193  .xf_decor = {
195  }
196  };
198 
199  _m0_gvertice._child[2] = (struct m0_xcode_field) {
200  .xf_name = "vh_gen",
201 
202  .xf_type = &M0_XT_U64,
203 
204  .xf_tag = 0,
205  .xf_opaque = NULL,
206  .xf_offset = offsetof(struct m0_gvertice, vh_gen),
207  .xf_read = NULL,
208  .xf_decor = {
210  }
211  };
212  m0_xc_u64_init();
213 
214  _m0_gvertice._child[3] = (struct m0_xcode_field) {
215  .xf_name = "vh_cookie",
216 
217  .xf_type = m0_cookie_xc,
218 
219  .xf_tag = 0,
220  .xf_opaque = NULL,
221  .xf_offset = offsetof(struct m0_gvertice, vh_cookie),
222  .xf_read = NULL,
223  .xf_decor = {
225  }
226  };
228 
229  _m0_gvertice._child[4] = (struct m0_xcode_field) {
230  .xf_name = "vh_next",
231 
232  .xf_type = m0_garc_xc,
233 
234  .xf_tag = 0,
235  .xf_opaque = NULL,
236  .xf_offset = offsetof(struct m0_gvertice, vh_next),
237  .xf_read = NULL,
238  .xf_decor = {
240  }
241  };
243 
244  _m0_gvertice._child[5] = (struct m0_xcode_field) {
245  .xf_name = "vh_prev",
246 
247  .xf_type = m0_garc_xc,
248 
249  .xf_tag = 0,
250  .xf_opaque = NULL,
251  .xf_offset = offsetof(struct m0_gvertice, vh_prev),
252  .xf_read = NULL,
253  .xf_decor = {
255  }
256  };
258 
260 }
261 
262 M0_INTERNAL void m0_xc_graph_graph_init(void)
263 {
267 }
268 
269 M0_INTERNAL void m0_xc_graph_graph_fini(void)
270 {
271 }
struct m0_xcode_field _child[6]
Definition: graph_xc.c:50
M0_INTERNAL void m0_xc_m0_gvertice_struct_init(void)
Definition: graph_xc.c:167
#define NULL
Definition: misc.h:38
static struct _m0_graph_s _m0_graph
struct m0_xcode_type _type
Definition: graph_xc.c:32
M0_INTERNAL void m0_xc_graph_graph_init(void)
Definition: graph_xc.c:262
struct m0_xcode_type * m0_garc_xc
Definition: graph_xc.c:11
M0_BASSERT(offsetof(struct _m0_graph_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
M0_INTERNAL void m0_xc_m0_cookie_struct_init(void)
Definition: cookie_xc.c:39
struct m0_xcode_type _type
Definition: graph_xc.c:15
Definition: graph.h:51
struct m0_xcode_field _child[1]
Definition: graph_xc.c:16
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_field _child[3]
Definition: graph_xc.c:33
M0_INTERNAL void m0_xc_graph_graph_fini(void)
Definition: graph_xc.c:269
static struct _m0_garc_s _m0_garc
#define M0_POST(cond)
struct m0_xcode_type * m0_gvertice_xc
Definition: graph_xc.c:12
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
static struct _m0_gvertice_s _m0_gvertice
void m0_xc_u64_init(void)
Definition: xcode.c:904
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
struct m0_xcode_type * m0_graph_xc
Definition: graph_xc.c:10
struct m0_xcode_type * m0_cookie_xc
Definition: cookie_xc.c:10
struct m0_xcode_type _type
Definition: graph_xc.c:49
M0_INTERNAL void m0_xc_m0_graph_struct_init(void)
Definition: graph_xc.c:97
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_m0_garc_struct_init(void)
Definition: graph_xc.c:117
Definition: graph.h:66
#define offsetof(typ, memb)
Definition: misc.h:29