summaryrefslogtreecommitdiffstats
path: root/nvme.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:57:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:57:49 +0000
commitfc67d3ad9a2903cc33e5cdaedaad51dd86a42236 (patch)
tree4ef72536a965fe220e71aea78b76b6bbbac2ed59 /nvme.h
parentAdding upstream version 2.5. (diff)
downloadnvme-cli-upstream/2.7.1.tar.xz
nvme-cli-upstream/2.7.1.zip
Adding upstream version 2.7.1.upstream/2.7.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--nvme.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/nvme.h b/nvme.h
index d859983..3915698 100644
--- a/nvme.h
+++ b/nvme.h
@@ -28,7 +28,9 @@
#include "plugin.h"
#include "util/json.h"
+#include "util/mem.h"
#include "util/argconfig.h"
+#include "util/cleanup.h"
enum nvme_print_flags {
NORMAL = 0,
@@ -100,15 +102,19 @@ int parse_and_open(struct nvme_dev **dev, int argc, char **argv, const char *des
void dev_close(struct nvme_dev *dev);
+static inline DEFINE_CLEANUP_FUNC(
+ cleanup_nvme_dev, struct nvme_dev *, dev_close)
+#define _cleanup_nvme_dev_ __cleanup__(cleanup_nvme_dev)
+
extern const char *output_format;
-enum nvme_print_flags validate_output_format(const char *format);
+int validate_output_format(const char *format, enum nvme_print_flags *flags);
+bool nvme_is_output_format_json(void);
int __id_ctrl(int argc, char **argv, struct command *cmd,
struct plugin *plugin, void (*vs)(uint8_t *vs, struct json_object *root));
extern int current_index;
-void *nvme_alloc(size_t len, bool *huge);
-void nvme_free(void *p, bool huge);
+
const char *nvme_strerror(int errnum);
unsigned long long elapsed_utime(struct timeval start_time,