Struct in ldk_package.h

LDKPackageEntry

typedef struct LDKPackageEntry LDKPackageEntry;
Macro in ldk_package.h

LDK_PACKAGE_FILE_EXTENSION

#define LDK_PACKAGE_FILE_EXTENSION ".box"
Function in ldk_package.h

ldk_package_entry_at

Get the package entry by index.

LDK_API const LDKPackageEntry * ldk_package_entry_at(
 const LDKPackage *package,
 u32 index
);

Parameters

const LDKPackage *package
Opened package used by this operation.
u32 index
Zero-based index of the selected item.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_package.h

ldk_package_entry_count

Count the package entry.

LDK_API u32 ldk_package_entry_count(const LDKPackage *package);

Parameters

const LDKPackage *package
Opened package used by this operation.

Returns

Number of matching entries.

Function in ldk_package.h

ldk_package_entry_extract

Extract one package entry to a filesystem path.

LDK_API bool ldk_package_entry_extract(
 LDKPackage *package,
 const LDKPackageEntry *entry,
 const char *destination_path
);

Parameters

LDKPackage *package
Opened package used by this operation.
const LDKPackageEntry *entry
Package entry being inspected or read.
const char *destination_path
Filesystem path for the extracted file.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_package.h

ldk_package_entry_find

Find the package entry.

LDK_API const LDKPackageEntry * ldk_package_entry_find(
 const LDKPackage *package,
 const char *path
);

Parameters

const LDKPackage *package
Opened package used by this operation.
const char *path
Path identifying the file or resource.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_package.h

ldk_package_entry_get_path

Get the logical path of a package entry.

LDK_API const char * ldk_package_entry_get_path(const LDKPackageEntry *entry);

Parameters

const LDKPackageEntry *entry
Package entry being inspected or read.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_package.h

ldk_package_entry_get_size

Get the uncompressed byte size of an entry.

LDK_API u64 ldk_package_entry_get_size(const LDKPackageEntry *entry);

Parameters

const LDKPackageEntry *entry
Package entry being inspected or read.

Returns

Size of the result, in bytes where applicable.

Function in ldk_package.h

ldk_package_entry_get_stored_size

Get the stored byte size of an entry.

LDK_API u64 ldk_package_entry_get_stored_size(const LDKPackageEntry *entry);

Parameters

const LDKPackageEntry *entry
Package entry being inspected or read.

Returns

Size of the result, in bytes where applicable.

Function in ldk_package.h

ldk_package_entry_read

Copy an entire uncompressed package entry into caller-provided memory. The destination must have at least ldk_package_entry_get_size(entry) bytes available.

LDK_API bool ldk_package_entry_read(
 LDKPackage *package,
 const LDKPackageEntry *entry,
 void *out_data,
 u64 out_size
);

Parameters

LDKPackage *package
Opened package used by this operation.
const LDKPackageEntry *entry
Package entry being inspected or read.
void *out_data
Destination buffer for the resulting data.
u64 out_size
Receives or specifies the byte size of the output buffer, as defined by the operation.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_package.h

ldk_package_entry_read_at

Read a byte range from an uncompressed package entry. Reaching the end of an entry is not an error. The out_read parameter reports the number of bytes copied.

LDK_API bool ldk_package_entry_read_at(
 const LDKPackage *package,
 const LDKPackageEntry *entry,
 u64 offset,
 void *out_data,
 u64 size,
 u64 *out_read
);

Parameters

const LDKPackage *package
Opened package used by this operation.
const LDKPackageEntry *entry
Package entry being inspected or read.
u64 offset
Byte offset into the resource or entry.
void *out_data
Destination buffer for the resulting data.
u64 size
Size of the data or region, in bytes where applicable.
u64 *out_read
Receives the number of bytes actually read.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_package.h

ldk_package_file_hash

Compute the FNV-1a hash of a package file.

LDK_API bool ldk_package_file_hash(
 const char *path,
 u64 *out_hash
);

Parameters

const char *path
Path identifying the file or resource.
u64 *out_hash
Receives the computed hash.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_package.h

ldk_package_writer_add_file

Add an existing filesystem file to a package being written.

LDK_API bool ldk_package_writer_add_file(
 LDKPackageWriter *writer,
 const char *source_path,
 const char *package_path,
 LDKPackageCompression compression
);

Parameters

LDKPackageWriter *writer
Package writer being updated.
const char *source_path
Filesystem path of the source file.
const char *package_path
Logical path of the file inside the package.
LDKPackageCompression compression
Compression mode stored for this package entry.

Returns

True if the operation succeeds; false otherwise.