Motr
M0
|
![]() |
Data Structures | |
struct | m0_net_test_descr |
Macros | |
#define | TYPE_DESCR(type_name) static const struct m0_net_test_descr type_name ## _descr[] |
#define | USE_TYPE_DESCR(type_name) type_name ## _descr, ARRAY_SIZE(type_name ## _descr) |
#define | FIELD_SIZE(type, field) (sizeof ((type *) 0)->field) |
#define | FIELD_DESCR(type, field) |
#define | FIELD_DESCR_PLAIN(type, field) |
Enumerations | |
enum | m0_net_test_serialize_op { M0_NET_TEST_SERIALIZE, M0_NET_TEST_DESERIALIZE } |
Functions | |
m0_bcount_t | m0_net_test_serialize_data (enum m0_net_test_serialize_op op, void *data, m0_bcount_t data_len, bool plain_data, struct m0_bufvec *bv, m0_bcount_t bv_offset) |
m0_bcount_t | m0_net_test_serialize (enum m0_net_test_serialize_op op, void *obj, const struct m0_net_test_descr descr[], size_t descr_nr, struct m0_bufvec *bv, m0_bcount_t bv_offset) |
static m0_bcount_t | net_test_len_accumulate (m0_bcount_t accumulator, m0_bcount_t addend) |
Recommended to use in field declaration order
Definition at line 63 of file serialize.h.
Definition at line 69 of file serialize.h.
Definition at line 60 of file serialize.h.
#define TYPE_DESCR | ( | type_name | ) | static const struct m0_net_test_descr type_name ## _descr[] |
Definition at line 54 of file serialize.h.
#define USE_TYPE_DESCR | ( | type_name | ) | type_name ## _descr, ARRAY_SIZE(type_name ## _descr) |
Definition at line 57 of file serialize.h.
Operation type.
Enumerator | |
---|---|
M0_NET_TEST_SERIALIZE | Serialize operation. |
M0_NET_TEST_DESERIALIZE | Deserialize operation. |
Definition at line 42 of file serialize.h.
m0_bcount_t m0_net_test_serialize | ( | enum m0_net_test_serialize_op | op, |
void * | obj, | ||
const struct m0_net_test_descr | descr[], | ||
size_t | descr_nr, | ||
struct m0_bufvec * | bv, | ||
m0_bcount_t | bv_offset | ||
) |
Serialize or deserialize data structure with the given description.
op | Operation. Can be M0_NET_TEST_SERIALIZE or M0_NET_TEST_DESERIALIZE. |
obj | Pointer to data structure. |
descr | Array of data field descriptions. |
descr_nr | Described fields number in descr. |
bv | m0_bufvec. Can be NULL - in this case bv_offset is ignored. |
bv_offset | Offset in bv. |
Definition at line 176 of file serialize.c.
m0_bcount_t m0_net_test_serialize_data | ( | enum m0_net_test_serialize_op | op, |
void * | data, | ||
m0_bcount_t | data_len, | ||
bool | plain_data, | ||
struct m0_bufvec * | bv, | ||
m0_bcount_t | bv_offset | ||
) |
Serialize or deserialize data.
Definition at line 163 of file serialize.c.
|
inlinestatic |
Get new len_total value after serializing part of data.
accumulator | Total serialized length before serializing current part of data. |
addend | Length of serialized current part of data. 0 means serializing failed. |
Definition at line 122 of file serialize.h.