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 UINT32 or UINT16 or UINT8 into the buffer *before* formatting the actual string to the buffer, and, in unformatting one ignores the length of the string because unformatting procedure will take it automatically.

EXAMPLE

    Formatting:    ..., SILC_STR_UINT32(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 UINT8, UINT16 or UINT32 in unformatting.

    _ALLOC routines automatically allocates memory for the variable sent
    as argument in unformatting.