summary refs log tree commit diff stats
path: root/include/qemu/cutils.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-03-23 19:57:32 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2022-04-06 14:31:43 +0200
commit415b732751daeccfff681898a716180ceb34dc4e (patch)
tree4e0c8c154a6c3f801b982ab7b274bf413031cc5f /include/qemu/cutils.h
parent544803c7a19bd2359ee3a0b3607ead71bf1f9394 (diff)
downloadfocaccia-qemu-415b732751daeccfff681898a716180ceb34dc4e.tar.gz
focaccia-qemu-415b732751daeccfff681898a716180ceb34dc4e.zip
include: move C/util-related declarations to cutils.h
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220323155743.1585078-22-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qemu/cutils.h')
-rw-r--r--include/qemu/cutils.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h
index 320543950c..2137e65260 100644
--- a/include/qemu/cutils.h
+++ b/include/qemu/cutils.h
@@ -214,4 +214,24 @@ static inline const char *yes_no(bool b)
      return b ? "yes" : "no";
 }
 
+/*
+ * helper to parse debug environment variables
+ */
+int parse_debug_env(const char *name, int max, int initial);
+
+/*
+ * Hexdump a line of a byte buffer into a hexadecimal/ASCII buffer
+ */
+#define QEMU_HEXDUMP_LINE_BYTES 16 /* Number of bytes to dump */
+#define QEMU_HEXDUMP_LINE_LEN 75   /* Number of characters in line */
+void qemu_hexdump_line(char *line, unsigned int b, const void *bufptr,
+                       unsigned int len, bool ascii);
+
+/*
+ * Hexdump a buffer to a file. An optional string prefix is added to every line
+ */
+
+void qemu_hexdump(FILE *fp, const char *prefix,
+                  const void *bufptr, size_t size);
+
 #endif