Go to main content

man pages section 3: DAX Library Functions

Exit Print View

Updated: Friday, August 13, 2021
 
 

dax_encode (3DAX)

Name

dax_encode - zip data for a specified codec

Synopsis

cc [ flag... ] file... -ldax [ library...]

#include <dax.h>
 
dax_result_t
dax_encode(dax_context_t *ctx, dax_vec_t *src,
    void *buf, size_t *buflen, dax_zip_t *codec);

Description

This function zips the data in src by using the specified codec and writes the code word stream to buf. The buflen parameter specifies the size of buf in bytes. It returns the number of bytes written to buf in buflen.

Return Values

Returns the number of code words written to buf in the dax_result_t count field and sets the dax_result_t status field to one of the following values:

DAX_SUCCESS

Operation completed successfully

DAX_EINVAL

Invalid argument for src

DAX_ETHREAD

The calling thread did not create ctx

DAX_EOVERFLOW

Output buffer overflow. Returns the required buffer size in buflen.

DAX_EZIP

Some bytes in src->data have no matching symbol in codec, or the src->data is not compressible. buf may be modified.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/library
Interface Stability
Committed

See Also

dax_zip(3DAX), dax_zip_create(3DAX), libdax(3LIB)