SILC_STR_*_STRING
NAME
#define SILC_STR_UI8_STRING() ...
#define SILC_STR_UI8_STRING_ALLOC() ...
#define SILC_STR_UI16_STRING() ...
#define SILC_STR_UI16_STRING_ALLOC() ...
#define SILC_STR_UI32_STRING() ...
#define SILC_STR_UI32_STRING_ALLOC() ...
DESCRIPTION
Unsigned NULL terminated string. Note that the string must be
NULL terminated because strlen() will be used to get the length of
the string.
Formatting: SILC_STR_UI32_STRING(unsigned char *)
Unformatting: SILC_STR_UI32_STRING(unsigned char **)
Unformatting procedure will check for length of the string from the
buffer before trying to get the string out. Thus, one *must* format the
length as UI_INT or UI_SHORT into the buffer *before* formatting the
actual string to the buffer, and, in unformatting one must ignore the
length of the string because unformatting procedure will take it
automatically.
Example:
Formatting: ..., SILC_STR_UI_INT(strlen(string)),
SILC_STR_UI32_STRING(string), ...
Unformatting: ..., SILC_STR_UI32_STRING(&string), ...
I.e., you can ignore the formatted length field in unformatting.
UI8, UI16 and UI32 means that the length is considered to be
either char (8 bits), short (16 bits) or int (32 bits) in
unformatting.
_ALLOC routines automatically allocates memory for the variable sent
as argument in unformatting.
|