Go to main content

man pages section 3: DAX Library Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

dax_zip_get_contig (3DAX)

Name

dax_zip_get_contig - convert codec to byte stream

Synopsis

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

#include <dax.h>

dax_status_t
dax_zip_get_contig(dax_context_t *ctx, dax_zip_t *codec,
    void *buf, size_t *buflen);

Description

This function converts codec to the byte stream format and writes it to buf. The byte stream format is described in the dax_zip_create_contig(3DAX) man page. buflen specifies the size of buf in bytes. To avoid the DAX_EOVERFLOW error condition, buflen must be at least the size specified by the max_zip_contig property as described in the dax_get_props(3DAX) man page. There is no alignment restriction on buf. It returns the number of bytes written to buf in buflen.

Return Values

DAX_SUCCESS

Operation completed successfully

DAX_ETHREAD

The calling thread did not create ctx

DAX_EOVERFLOW

Output buffer overflow. The required buffer size is returned in buflen.

Usage

With this function, you can write a compressed vector and its codec to a byte addressable storage, such as a file. Later, you can read the byte stream and re-create the dax_zip_t object by using the dax_zip_create_contig() function.

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_contig(3DAX), libdax(3LIB)

Notes

Though the dax_zip_get_contig() function accepts a buf with any alignment, if you pass the same buf to the dax_zip_create_contig() function, it must be 16-byte aligned.