Motr  M0
fop_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from dtm0/fop.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "dtm0/fop.h"
8 #include "dtm0/fop_xc.h"
9 
12 
13 static struct _dtm0_req_fop_s {
16 } _dtm0_req_fop = {
17  ._type = {
19  .xct_name = "dtm0_req_fop",
20  .xct_sizeof = sizeof (struct dtm0_req_fop),
21  .xct_nr = 3,
22  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC,
23  }
24 };
25 
27 M0_BASSERT(offsetof(struct _dtm0_req_fop_s, _child[0]) ==
28  offsetof(struct m0_xcode_type, xct_child[0]));
29 
30 static struct _dtm0_rep_fop_s {
33 } _dtm0_rep_fop = {
34  ._type = {
36  .xct_name = "dtm0_rep_fop",
37  .xct_sizeof = sizeof (struct dtm0_rep_fop),
38  .xct_nr = 2,
39  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC,
40  }
41 };
42 
44 M0_BASSERT(offsetof(struct _dtm0_rep_fop_s, _child[0]) ==
45  offsetof(struct m0_xcode_type, xct_child[0]));
46 
47 
48 M0_BASSERT(sizeof(struct dtm0_req_fop) == 64U);
49 
50 M0_BASSERT(sizeof ((struct dtm0_req_fop *)0)->dtr_msg == 4U);
51 M0_BASSERT(offsetof(struct dtm0_req_fop, dtr_msg) == 0U);
52 M0_BASSERT(sizeof ((struct dtm0_req_fop *)0)->dtr_txr == 40U);
53 M0_BASSERT(offsetof(struct dtm0_req_fop, dtr_txr) == 8U);
54 M0_BASSERT(sizeof ((struct dtm0_req_fop *)0)->dtr_payload == 16U);
56 
57 M0_BASSERT(sizeof(struct dtm0_rep_fop) == 48U);
58 
59 M0_BASSERT(sizeof ((struct dtm0_rep_fop *)0)->dr_rc == 4U);
60 M0_BASSERT(offsetof(struct dtm0_rep_fop, dr_rc) == 0U);
61 M0_BASSERT(sizeof ((struct dtm0_rep_fop *)0)->dr_txr == 40U);
62 M0_BASSERT(offsetof(struct dtm0_rep_fop, dr_txr) == 8U);
63 
64 
66  { .xev_idx = 0, .xev_name = "DTM_TEST", .xev_val = 0 },
67  { .xev_idx = 1, .xev_name = "DTM_EXECUTE", .xev_val = 1 },
68  { .xev_idx = 2, .xev_name = "DTM_EXECUTED", .xev_val = 2 },
69  { .xev_idx = 3, .xev_name = "DTM_PERSISTENT", .xev_val = 3 },
70  { .xev_idx = 4, .xev_name = "DTM_REDO", .xev_val = 4 },
71  { .xev_idx = -1, .xev_name = "Invalid value of enum 'm0_dtm0s_msg'." }
72 };
73 
75  .xe_name = "m0_dtm0s_msg",
76  .xe_nr = 5,
77  .xe_val = m0_dtm0s_msg_data,
78  .xe_maxlen = 14
79 };
80 
81 M0_INTERNAL void m0_xc_dtm0_req_fop_struct_init(void)
82 {
83  _dtm0_req_fop._child[0] = (struct m0_xcode_field) {
84  .xf_name = "dtr_msg",
85 
86  .xf_type = &M0_XT_U32,
87 
88  .xf_tag = 0,
89  .xf_opaque = NULL,
90  .xf_offset = offsetof(struct dtm0_req_fop, dtr_msg),
91  .xf_read = &m0_xcode_enum_field_read,
92  .xf_decor = {
94  }
95  };
97 
98  _dtm0_req_fop._child[1] = (struct m0_xcode_field) {
99  .xf_name = "dtr_txr",
100 
101  .xf_type = m0_dtm0_tx_desc_xc,
102 
103  .xf_tag = 0,
104  .xf_opaque = NULL,
105  .xf_offset = offsetof(struct dtm0_req_fop, dtr_txr),
106  .xf_read = NULL,
107  .xf_decor = {
109  }
110  };
112 
113  _dtm0_req_fop._child[2] = (struct m0_xcode_field) {
114  .xf_name = "dtr_payload",
115 
116  .xf_type = m0_buf_xc,
117 
118  .xf_tag = 0,
119  .xf_opaque = NULL,
120  .xf_offset = offsetof(struct dtm0_req_fop, dtr_payload),
121  .xf_read = NULL,
122  .xf_decor = {
124  }
125  };
127 
129 }
130 
131 M0_INTERNAL void m0_xc_dtm0_rep_fop_struct_init(void)
132 {
133  _dtm0_rep_fop._child[0] = (struct m0_xcode_field) {
134  .xf_name = "dr_rc",
135 
136  .xf_type = &M0_XT_U32,
137 
138  .xf_tag = 0,
139  .xf_opaque = NULL,
140  .xf_offset = offsetof(struct dtm0_rep_fop, dr_rc),
141  .xf_read = NULL,
142  .xf_decor = {
144  }
145  };
146  m0_xc_u32_init();
147 
148  _dtm0_rep_fop._child[1] = (struct m0_xcode_field) {
149  .xf_name = "dr_txr",
150 
151  .xf_type = m0_dtm0_tx_desc_xc,
152 
153  .xf_tag = 0,
154  .xf_opaque = NULL,
155  .xf_offset = offsetof(struct dtm0_rep_fop, dr_txr),
156  .xf_read = NULL,
157  .xf_decor = {
159  }
160  };
162 
164 }
165 
166 M0_INTERNAL void m0_xc_dtm0_fop_init(void)
167 {
170 }
171 
172 M0_INTERNAL void m0_xc_dtm0_fop_fini(void)
173 {
174 }
struct m0_xcode_type _type
Definition: fop_xc.c:31
struct m0_xcode_type * m0_buf_xc
Definition: buf_xc.c:10
struct m0_dtm0_tx_desc dr_txr
Definition: fop.h:47
M0_INTERNAL void m0_xc_dtm0_fop_init(void)
Definition: fop_xc.c:166
struct m0_xcode_type * dtm0_req_fop_xc
Definition: fop_xc.c:10
#define NULL
Definition: misc.h:38
struct m0_xcode_enum m0_xc_m0_dtm0s_msg_enum
Definition: fop_xc.c:74
M0_INTERNAL void m0_xc_dtm0_fop_fini(void)
Definition: fop_xc.c:172
struct m0_xcode_type * dtm0_rep_fop_xc
Definition: fop_xc.c:11
struct m0_xcode_field _child[2]
Definition: fop_xc.c:32
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
const char * xe_name
Definition: enum.h:58
M0_INTERNAL void m0_xc_m0_buf_struct_init(void)
Definition: buf_xc.c:64
static struct _dtm0_rep_fop_s _dtm0_rep_fop
int32_t dr_rc
Definition: fop.h:45
const struct m0_xcode_enum_val m0_dtm0s_msg_data[]
Definition: fop_xc.c:65
struct m0_dtm0_tx_desc dtr_txr
Definition: fop.h:45
static struct _dtm0_req_fop_s _dtm0_req_fop
struct m0_xcode_field _child[3]
Definition: fop_xc.c:15
M0_INTERNAL void m0_xc_dtm0_req_fop_struct_init(void)
Definition: fop_xc.c:81
M0_BASSERT(offsetof(struct _dtm0_req_fop_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
M0_INTERNAL void m0_xc_m0_dtm0_tx_desc_struct_init(void)
Definition: tx_desc_xc.c:234
struct m0_xcode_type _type
Definition: fop_xc.c:14
#define M0_POST(cond)
struct m0_xcode_type * m0_dtm0_tx_desc_xc
Definition: tx_desc_xc.c:13
M0_INTERNAL void m0_xc_dtm0_rep_fop_struct_init(void)
Definition: fop_xc.c:131
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
struct m0_buf dtr_payload
Definition: fop.h:46
void m0_xc_u32_init(void)
Definition: xcode.c:900
const char * xf_name
Definition: xcode.h:251
#define offsetof(typ, memb)
Definition: misc.h:29
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