summaryrefslogtreecommitdiffstats
path: root/util/cbfstool/common.h
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2015-10-01 15:52:56 +0200
committerPatrick Georgi <pgeorgi@google.com>2015-10-01 14:43:43 +0000
commitca97fa7ac3c035532bbf493613c644514313a190 (patch)
tree5bb04044e70f5639d79955d3e2105aa782fb1beb /util/cbfstool/common.h
parent8b293225573ef05364b741003a1fd95e49794cb1 (diff)
downloadcoreboot-ca97fa7ac3c035532bbf493613c644514313a190.tar.gz
coreboot-ca97fa7ac3c035532bbf493613c644514313a190.tar.bz2
coreboot-ca97fa7ac3c035532bbf493613c644514313a190.zip
cbfstool: Add bintohex function
We need to emit some hex strings. Change-Id: I9e7e184282f6ad0470f2e269f5dc874e78f8b697 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/11766 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'util/cbfstool/common.h')
-rw-r--r--util/cbfstool/common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h
index 8073d12222ca..86ae484544d4 100644
--- a/util/cbfstool/common.h
+++ b/util/cbfstool/common.h
@@ -210,4 +210,11 @@ extern struct xdr xdr_le, xdr_be;
size_t bgets(struct buffer *input, void *output, size_t len);
size_t bputs(struct buffer *b, const void *data, size_t len);
+/* Returns a 0-terminated string containing a hex representation of
+ * len bytes starting at data.
+ * The string is malloc'd and it's the caller's responsibility to free
+ * the memory.
+ * On error, bintohex returns NULL.
+ */
+char *bintohex(uint8_t *data, size_t len);
#endif