summaryrefslogtreecommitdiff
path: root/lib/util/util_str_hex.h
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2021-01-24 09:15:29 +0100
committerVolker Lendecke <vl@samba.org>2021-01-28 16:58:35 +0000
commit2b9ba992b610ebc600f573d8b3f46568d5347cec (patch)
treedd59c52ad5a956cea36e207ce3c38f255eae6f29 /lib/util/util_str_hex.h
parent522ef9e6a57ba46c6c097c088deb27fe12f3b300 (diff)
downloadsamba-2b9ba992b610ebc600f573d8b3f46568d5347cec.tar.gz
lib: Simplify parse_guid_string() and ndr_syntax_id_from_string()
Return "bool" instead of NTSTATUS, use hex_byte() instead of read_hex_bytes(). And parse directly into a struct GUID instead of the components. 99 lines less code. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Diffstat (limited to 'lib/util/util_str_hex.h')
-rw-r--r--lib/util/util_str_hex.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/util/util_str_hex.h b/lib/util/util_str_hex.h
index d0d53e3ed05..7dd527fcdab 100644
--- a/lib/util/util_str_hex.h
+++ b/lib/util/util_str_hex.h
@@ -1,10 +1,5 @@
-#include "../libcli/util/ntstatus.h"
+#include "replace.h"
-NTSTATUS read_hex_bytes(const char *s, uint hexchars, uint64_t *dest);
-
-NTSTATUS parse_guid_string(const char *s,
- uint32_t *time_low,
- uint32_t *time_mid,
- uint32_t *time_hi_and_version,
- uint32_t clock_seq[2],
- uint32_t node[6]);
+bool hex_uint32(const char *in, uint32_t *out);
+struct GUID;
+bool parse_guid_string(const char *s, struct GUID *guid);