TaPAS
0.2
|
Serialization function for basic C types. More...
#include <ccl/ccl-common.h>
Go to the source code of this file.
Typedefs | |
typedef enum ccl_serializer_status_enum | ccl_serializer_status |
Error code returned by serialization functions. | |
Enumerations | |
enum | ccl_serializer_status_enum { CCL_SERIALIZER_OK = 0, CCL_SERIALIZER_EOF, CCL_SERIALIZER_IO_ERROR, CCL_SERIALIZER_DATA_ERROR } |
Error code returned by serialization functions. More... | |
Serialization function for basic C types.
The detailed description of functions is not given since they all operate in the same way. The name of each function follows the following convention:
ccl_serializer_mode_datatype
where mode is either write
or read
and datatype is one of the following data type: [u]int{8,16,32} or string.
The usage of functions is quite intuitive. They takes three arguments:
write
mode or a pointer to a data with the appropriate type for the read
mode.Before any other operations, functions always that the current value of the error code is CCL_SERIALIZER_OK. If this is not the case the function does nothing else and immediately returns.
All pointers used by the serialization function (input streams, pointers to data and pointers to error codes) are assumed to not be NULL.
Definition in file ccl-serializer.h.
Error code returned by serialization functions.
Definition at line 55 of file ccl-serializer.h.
void ccl_serializer_read_int16 | ( | int16_t * | p_n, |
FILE * | in, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_read_int32 | ( | int32_t * | p_n, |
FILE * | in, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_read_int8 | ( | int8_t * | p_n, |
FILE * | in, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_read_string | ( | char ** | p_s, |
FILE * | in, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_read_uint16 | ( | uint16_t * | p_n, |
FILE * | in, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_read_uint32 | ( | uint32_t * | p_n, |
FILE * | in, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_read_uint8 | ( | uint8_t * | p_n, |
FILE * | in, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_write_int16 | ( | int16_t | n, |
FILE * | out, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_write_int32 | ( | int32_t | n, |
FILE * | out, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_write_int8 | ( | int8_t | n, |
FILE * | out, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_write_string | ( | const char * | s, |
FILE * | out, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_write_uint16 | ( | uint16_t | n, |
FILE * | out, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_write_uint32 | ( | uint32_t | n, |
FILE * | out, | ||
ccl_serializer_status * | p_err | ||
) |
void ccl_serializer_write_uint8 | ( | uint8_t | n, |
FILE * | out, | ||
ccl_serializer_status * | p_err | ||
) |