summaryrefslogtreecommitdiffstats
path: root/util/types.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 22:38:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 22:38:51 +0000
commit5d64e8a26388e2abbf6a6585d17392d6e944ae7b (patch)
tree4eae47918df5f83f14e05bede9c361237a7dc089 /util/types.h
parentReleasing debian version 2.4+really2.4-3. (diff)
downloadnvme-cli-5d64e8a26388e2abbf6a6585d17392d6e944ae7b.tar.xz
nvme-cli-5d64e8a26388e2abbf6a6585d17392d6e944ae7b.zip
Merging upstream version 2.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--util/types.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/util/types.h b/util/types.h
index f7fe9fc..595958b 100644
--- a/util/types.h
+++ b/util/types.h
@@ -34,4 +34,27 @@ char *uint128_t_to_si_string(nvme_uint128_t val, __u32 bytes_per_unit);
const char *util_uuid_to_string(unsigned char uuid[NVME_UUID_LEN]);
const char *util_fw_to_string(char *c);
+/**
+ * @brief convert time_t format time to a human readable string
+ *
+ * @param time, input time_t time
+ * @param ts_buf, output time string
+ * @Note, time string format is "Y-M-D|H:M:S:MS"
+ *
+ * @return 0 success
+ */
+int convert_ts(time_t time, char *ts_buf);
+
+/**
+ * @brief print once a progress of spinner to stdout
+ * the output will be looks like if disp_name is "LogDump" and percent is 0.5
+ * LogDump [========================- ] 50%
+
+ *
+ * @param disp_name, const string displayed before spiner
+ * @param percent [0, 1.0] about the progress
+ *
+ */
+void util_spinner(const char *disp_name, float percent);
+
#endif /* _MISC_H */