axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
typedef int(* axlStreamDecode)(const char *source, int source_size, const char *source_encoding, char *output, int output_size, int *output_converted, int *remain_source_index, axlPointer user_data)

Handler definition for the set of functions that allows to translate content into a particular format back to utf-8, which is the default format used for internal data stored by Axl.

sourceThe source content to be decoded into utf-8.
source_sizeThe size of the source content to be decoded.
source_encodingThe encoding of the source.
outputThe output of the decode operation. This buffer is memory allocated by the caller. The size to be written is limited by the following parameter.
output_sizeThe size of the output produced (in terms of octects not utf-8 logical units).
remain_source_indexReference where the last index of valid input still pending to be process. Especially useful under situation where the decode function returns 2.
The handler must return 1 if the operation was completed, 2 if the operation was completed but not enough size was found on output buffer to store the content or 0 if the function fails.