wiredtiger_struct_pack

Function wiredtiger_struct_pack 

Source
pub unsafe extern "C" fn wiredtiger_struct_pack(
    session: *mut WT_SESSION,
    buffer: *mut c_void,
    len: usize,
    format: *const c_char,
    ...
) -> c_int
Expand description

Pack a structure into a buffer.

See @ref packing for a description of the permitted format strings.

@section pack_examples Packing Examples

For example, the string “iSh” will pack a 32-bit integer followed by a NUL-terminated string, followed by a 16-bit integer. The default, big-endian encoding will be used, with no alignment. This could be used in C as follows:

@snippet ex_all.c Pack fields into a buffer

Then later, the values can be unpacked as follows:

@snippet ex_all.c Unpack fields from a buffer

@param session the session handle @param buffer a pointer to a packed byte array @param len the number of valid bytes in the buffer @param format the data format, see @ref packing @errors