=pod =head1 NAME xds - eXtendable Data Serialization =head1 SYNOPSIS =head1 DESCRIPTION =over 4 =item xds_t* B(xds_mode_t I); Valid settings for I are B and B. If successful, a valid handle is returned -- B otherwise. If the routine fails, the system variable B is set apropriately. =item void B(xds_t* I); Free all internally allocated resources associated with this context. I must be a handle obtained by calling B. =item int B(xds_t* I, const char* I, xds_engine_t I, void* I); Register the function I as formatting engine in context I under the name I. The function must have the following prototype: int my_engine(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list args); It must gather its values from I and encode/decode them into I. The encoded/decoded representation must not take up more than I byte of memory, because that's the maximum I can hold. If the buffer is too small, I must return B. In case of no error, I must return B. The variable I is passed through to the function every time it is called; it is not touched in any way by the xds library. =item int B(xds_t* I, const char* I); Remove encoding/decoding engine I from context I. The function will return B if successful and B if I is not a registered engine. =item int B(xds_t* I, xds_scope_t I, void* I, size_t I); Encoding mode: Set internal buffer used in context I to I. The buffer has a capacity of I byte. I may be set to B or B. A "loaned" buffer is one that is owned by the application; xds will use it, but it will not B the buffer nor will it try to B it if it's too small. A buffer given to xds as a "gift" is henceforth owned by xds and may be Bd or Bed as the library sees fit. If I is B, I must be a pointer obtained from calling B or a comparable system routine. Calling B with a I of B will cause the xds library to allocate a buffer of its own. I is ignored in this case. Decoding mode: I contains the encoded representation of the data to be used for following B calls. The encoded data is I byte long. Unlike in encoding mode, such a buffer is not modified, hence there is no need to extend the buffer. If I is set to B, the library will B I when the context is destroyed. =item int B(xds_t* I, xds_scope_t flag, void** buffer, size_t* buffer_size); This routine will write the address and size of the internal buffer in context I to I and I. The I parameter determines who owns the buffer after that; setting I to B means that the buffer is owned by the xds library and that the user may not rely on its contents still being there after another xds library function call. Furthermore, calling B will flush the registered buffer, meaning that coming B calls will start at the beginning and potentially overwrite the buffer contents. Setting I to B means that the returned buffer is owned by the application programmer from now on, it is no longer modified or used in any way by the library. =item int B(xds_t* I, const char* I, ...); =item int B(xds_t* I, const char* I, ...); =item int B(xds_t* I, const char* I, va_list I); =item int B(xds_t* I, const char* I, va_list I); =back =cut