LDKPackageEntry
typedef struct LDKPackageEntry LDKPackageEntry;
typedef struct LDKPackageEntry LDKPackageEntry;
#define LDK_PACKAGE_FILE_EXTENSION ".box"
Get the package entry by index.
LDK_API const LDKPackageEntry * ldk_package_entry_at(
const LDKPackage *package,
u32 index
);
const LDKPackage *packageu32 indexPointer to the requested object or data; NULL when unavailable.
Count the package entry.
LDK_API u32 ldk_package_entry_count(const LDKPackage *package);
const LDKPackage *packageNumber of matching entries.
Extract one package entry to a filesystem path.
LDK_API bool ldk_package_entry_extract(
LDKPackage *package,
const LDKPackageEntry *entry,
const char *destination_path
);
LDKPackage *packageconst LDKPackageEntry *entryconst char *destination_pathTrue if the operation succeeds; false otherwise.
Find the package entry.
LDK_API const LDKPackageEntry * ldk_package_entry_find(
const LDKPackage *package,
const char *path
);
const LDKPackage *packageconst char *pathPointer to the requested object or data; NULL when unavailable.
Get the compression mode of a package entry.
LDK_API LDKPackageCompression ldk_package_entry_get_compression(const LDKPackageEntry *entry);
const LDKPackageEntry *entryThe requested value.
Get the logical path of a package entry.
LDK_API const char * ldk_package_entry_get_path(const LDKPackageEntry *entry);
const LDKPackageEntry *entryPointer to the requested object or data; NULL when unavailable.
Get the uncompressed byte size of an entry.
LDK_API u64 ldk_package_entry_get_size(const LDKPackageEntry *entry);
const LDKPackageEntry *entrySize of the result, in bytes where applicable.
Get the stored byte size of an entry.
LDK_API u64 ldk_package_entry_get_stored_size(const LDKPackageEntry *entry);
const LDKPackageEntry *entrySize of the result, in bytes where applicable.
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
);
LDKPackage *packageconst LDKPackageEntry *entryvoid *out_datau64 out_sizeTrue if the operation succeeds; false otherwise.
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
);
const LDKPackage *packageconst LDKPackageEntry *entryu64 offsetvoid *out_datau64 sizeu64 *out_readTrue if the operation succeeds; false otherwise.
Compute the FNV-1a hash of a package file.
LDK_API bool ldk_package_file_hash(
const char *path,
u64 *out_hash
);
const char *pathu64 *out_hashTrue if the operation succeeds; false otherwise.
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
);
LDKPackageWriter *writerconst char *source_pathconst char *package_pathLDKPackageCompression compressionTrue if the operation succeeds; false otherwise.