xrif
A fast lossless compression system
Header Processing

These functions populate or read the xrif header.

Collaboration diagram for Header Processing:

Functions

xrif_error_t xrif_write_header (char *header, xrif_t handle)
 Populate a header buffer with the xrif protocol details. More...
 
xrif_error_t xrif_read_header (xrif_t handle, uint32_t *header_size, char *header)
 Configure an xrif handle by reading a xrif protocol header. More...
 

Function Documentation

◆ xrif_read_header()

xrif_error_t xrif_read_header ( xrif_t  handle,
uint32_t *  header_size,
char *  header 
)

Configure an xrif handle by reading a xrif protocol header.

Returns
XRIF_ERROR_NULLPTR if any of the arguments are NULL
XRIF_ERROR_BADHEADER if the xrif magic number is not the first 4 bytes
XRIF_ERROR_WRONGVERSION if the XRIF version in the header is too high for the compiled library
XRIF_NOERROR on success
Parameters
[out]handle[out] the xrif header to configure. This must have been created with xrif_new.
[out]header_size[out] the total size of the header, read from the buffer.
[in]header[in] the buffer containing the header

Definition at line 901 of file xrif.c.

References XRIF_ERROR_BADHEADER, XRIF_ERROR_NULLPTR, and XRIF_ERROR_PRINT.

◆ xrif_write_header()

xrif_error_t xrif_write_header ( char *  header,
xrif_t  handle 
)

Populate a header buffer with the xrif protocol details.

Returns
XRIF_ERROR_NULLPTR if either header or handle is NULL
XRIF_NOERROR on success
Parameters
[out]header[out] the buffer to hold the protocol header. Must be at least 48 bytes long.
[in]handle[in] the xrif handle from which to populate the header. This must have been created with xrif_new.

Definition at line 846 of file xrif.c.

References XRIF_ERROR_NULLPTR, and XRIF_ERROR_PRINT.