fast_create_codec()
function:
#include <fastapi.h> fast_codec_t* codec = fast_create_codec (); ...
fast_tag_t
that contains:fast_type_t
Type
(signed / unsigned integer, string, ...)fast_op_t
Op
(Field encoding operation)u32
TID
(Template ID)u32
Slot
(position with a Template ID)fast_encode_new_msg()
and fast_encode_end_msg()
as follows:
#include <fastapi.h> fast_codec_t* codec = fast_create_codec (); fast_encode_new_msg (codec, tag); ... calls to encoding functions ... fast_encode_end_msg (codec, tag); ...
fast_encode_xxx
functions:
#include <fastapi.h> fast_codec_t* codec = fast_create_codec (); fast_tag_t tag1 = MAKE_TAG (FAST_TYPE_U32, FAST_OP_NONE, 0, 0); fast_tag_t tag2 = MAKE_TAG (FAST_TYPE_STR, FAST_OP_NONE, 0, 1); fast_encode_u32 (codec, tag1, 4711); fast_encode_str (codec, tag2, "foo", strlen ("foo"));