#include "libkmod.h"
#include "libkmod-internal.h"
-const struct kmod_ext kmod_exts[] = {
- {".ko", sizeof(".ko") - 1},
+static const struct kmod_ext {
+ const char *ext;
+ size_t len;
+} kmod_exts[] = {
+ {KMOD_EXTENSION_UNCOMPRESSED, sizeof(KMOD_EXTENSION_UNCOMPRESSED) - 1},
#ifdef ENABLE_ZLIB
{".ko.gz", sizeof(".ko.gz") - 1},
#endif
#include <shared/macro.h>
-#define KMOD_EXT_UNC 0
-
-extern const struct kmod_ext {
- const char *ext;
- size_t len;
-} kmod_exts[];
+#define KMOD_EXTENSION_UNCOMPRESSED ".ko"
int alias_normalize(const char *alias, char buf[PATH_MAX], size_t *len) _must_check_ __attribute__((nonnull(1,2)));
char *modname_normalize(const char *modname, char buf[PATH_MAX], size_t *len) __attribute__((nonnull(1, 2)));
if (mod->relpath != NULL) {
size_t uncrelpathlen = lastslash - mod->relpath + modnamesz
- + kmod_exts[KMOD_EXT_UNC].len;
+ + strlen(KMOD_EXTENSION_UNCOMPRESSED);
mod->uncrelpath = memdup(mod->relpath, uncrelpathlen + 1);
mod->uncrelpath[uncrelpathlen] = '\0';
err = hash_add_unique(depmod->modules_by_uncrelpath,