summaryrefslogtreecommitdiffstats
path: root/wrapper.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:23:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:23:30 +0000
commit4ed089396bc7f14bcb94e80f0f9f4757fd8c48b7 (patch)
tree866986558761a9709a7af1940ba607128a45f775 /wrapper.c
parentReleasing debian version 2.1.2-2. (diff)
downloadnvme-cli-4ed089396bc7f14bcb94e80f0f9f4757fd8c48b7.tar.xz
nvme-cli-4ed089396bc7f14bcb94e80f0f9f4757fd8c48b7.zip
Merging upstream version 2.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wrapper.c')
-rw-r--r--wrapper.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/wrapper.c b/wrapper.c
deleted file mode 100644
index 2ba5b32..0000000
--- a/wrapper.c
+++ /dev/null
@@ -1,42 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * This file is part of nvme-cli
- *
- * Copyright (c) 2022 Daniel Wagner, SUSE
- */
-
-#include <dlfcn.h>
-
-#include <libnvme.h>
-
-#define PROTO(args...) args
-#define ARGS(args...) args
-
-#define VOID_FN(name, proto, args) \
-void __attribute__((weak)) name(proto) \
-{ \
- void (*fn)(proto); \
- fn = dlsym(RTLD_NEXT, #name); \
- if (fn) \
- fn(args); \
-}
-
-#define FN(name, rtype, proto, args, fallback) \
-rtype __attribute__((weak)) name(proto) \
-{ \
- rtype (*fn)(proto); \
- fn = dlsym(RTLD_NEXT, #name); \
- if (fn) \
- return fn(args); \
- return fallback; \
-}
-
-FN(nvme_get_version,
- const char *, PROTO(enum nvme_version type),
- ARGS(type), "n/a")
-
-VOID_FN(nvme_init_copy_range_f1,
- PROTO(struct nvme_copy_range_f1 *copy, __u16 *nlbs,
- __u64 *slbas, __u64 *eilbrts, __u32 *elbatms,
- __u32 *elbats, __u16 nr),
- ARGS(copy, nlbs, slbas, eilbrts, elbatms, elbats, nr))