maug
Quick and dirty C mini-augmentation library.
|
$MAUG_ROOT/tools/serial.c
, generates code based on the header files it is pointed at. In general, header files processed by this tool must meet the following requirements:# define parse_field_type_table( f ) \ parse_field_type_table_base( f ) \ f( custom_type_a, 101 ) \ f( struct custom_type_b, 102 ) \In this example,
custom_type_a
is the name of the type and 101
is its ID. The IDs start from 100 and there can be thousands.If custom_type_a
is provided here, a callback of type mserialize_cb_t() and mdeserialize_cb_t() (called mseralize_custom_type_a and mdeserialize_custom_type_b) must be provided by a linked translation unit.For struct custom_type_b
, the callbacks would be called mseralize_struct_custom_type_b() and mdeseralize_struct_custom_type_b().