mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-11-23 15:00:52 +07:00
d84631afc2
Move zstd-related function to a separate file so it's easier to isolate the dependency on each decompression library. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Link: https://github.com/kmod-project/kmod/pull/58 Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
40 lines
868 B
C
40 lines
868 B
C
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
/*
|
|
* Copyright © 2024 Intel Corporation
|
|
*/
|
|
|
|
#include <errno.h>
|
|
|
|
#include <libkmod/libkmod-internal.h>
|
|
|
|
struct kmod_ctx;
|
|
struct kmod_elf;
|
|
|
|
struct kmod_file {
|
|
int fd;
|
|
enum kmod_file_compression_type compression;
|
|
off_t size;
|
|
void *memory;
|
|
int (*load)(struct kmod_file *file);
|
|
const struct kmod_ctx *ctx;
|
|
struct kmod_elf *elf;
|
|
};
|
|
|
|
#ifdef ENABLE_XZ
|
|
int kmod_file_load_xz(struct kmod_file *file);
|
|
#else
|
|
static inline int kmod_file_load_xz(struct kmod_file *file) { return -ENOSYS; }
|
|
#endif
|
|
|
|
#ifdef ENABLE_ZLIB
|
|
int kmod_file_load_zlib(struct kmod_file *file);
|
|
#else
|
|
static inline int kmod_file_load_zlib(struct kmod_file *file) { return -ENOSYS; }
|
|
#endif
|
|
|
|
#ifdef ENABLE_ZSTD
|
|
int kmod_file_load_zstd(struct kmod_file *file);
|
|
#else
|
|
static inline int kmod_file_load_zstd(struct kmod_file *file) { return -ENOSYS; }
|
|
#endif
|