Go to main content

man pages section 3: DAX Library Functions

Exit Print View

Updated: July 2017
 
 

dax_zip_create_contig (3DAX)

Name

dax_zip_create_contig - create a codec from contiguous symbols

Synopsis

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

#include <dax.h>

dax_status_t
dax_zip_create_contig(dax_context_t *ctx, void *buf, size_t length,
    dax_zip_t **codec);

Description

This function is an alternative to the dax_zip_create() function. But in this function, the nsyms, widths, and syms are passed in a contiguous block of length bytes starting at buf. The returned codec uses buf by reference. buf must align on a 16 byte boundary.

The buf block has the following format:

Byte offset
Contents
0 to 1
uint16_t nsyms
2 to ...
uint8_t widths[ ]
... to length - 1
uint8_t syms[ ]

Definitions of nsyms, widths, and syms are available in the dax_zip_create(3DAX) man page. The size of widths is ceil(nsyms/2) bytes. length must not exceed 4098 bytes for libdax version 1, or 8192 bytes for libdax version 2.

The value of length must be equal to 2 + ceil(nsyms/2) + sum(widths). The library only checks this condition if the DAX_DEBUG_EXTRA debug option is set. If the condition is violated and not checked, the results are undefined.

On successful return, the caller must not modify or free buf so long as the returned codec is used in the DAX operations. If this condition is violated, the results are undefined.

Return Values

DAX_SUCCESS

Operation completed successfully

DAX_EINVAL

Invalid argument

DAX_ENOMEM

Memory resources unavailable

DAX_ETHREAD

The calling thread did not create ctx

Attributes

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

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/library
Interface Stability
Committed

Usage

For best performance, align buf to the value of the zip_align_best property as defined in the dax_get_props(3DAX) man page.

See Also

dax_zip_create(3DAX), dax_zip_free(3DAX), dax_set_debug(3DAX)

Notes

libdax version 2 passes buf directly to DAX, avoiding the overhead of converting the codec to a different internal format. libdax version 1 always converts buf to a different format.