Function gnunet_sys::GNUNET_try_compression[][src]

pub unsafe extern "C" fn GNUNET_try_compression(
    data: *const c_char,
    old_size: usize,
    result: *mut *mut c_char,
    new_size: *mut usize
) -> c_int

Try to compress the given block of data using libz. Only returns the compressed block if compression worked and the new block is actually smaller. Decompress using #GNUNET_decompress().

@param data block to compress; if compression resulted in a smaller block, the first bytes of data are updated to the compressed data @param old_size number of bytes in data @param[out] result set to the compressed data, if compression worked @param[out] new_size set to size of result, if compression worked @return #GNUNET_YES if compression reduce the size, #GNUNET_NO if compression did not help