summaryrefslogtreecommitdiff
path: root/lib/string.h
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2023-08-24 03:04:58 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-08-24 04:19:07 +0200
commiteddc0ffdab239c61cc0e064b6ebd33dfadcef3cd (patch)
tree831a5b64ed6bbd34d8c3e721665599e7197a4dec /lib/string.h
parente3c0eca95642a846ab65261424a51dd99d954017 (diff)
Lib: Add functions for reading and writing of bytestrings
Based on patch from Alexander Zubkov, thanks!
Diffstat (limited to 'lib/string.h')
-rw-r--r--lib/string.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/string.h b/lib/string.h
index 2829943d..161b7651 100644
--- a/lib/string.h
+++ b/lib/string.h
@@ -33,6 +33,9 @@ u64 bstrtoul10(const char *str, char **end);
u64 bstrtoul16(const char *str, char **end);
byte bstrtobyte16(const char *str);
+int bstrhextobin(const char *s, byte *b);
+int bstrbintohex(const byte *b, size_t len, char *buf, size_t size, char delim);
+
int patmatch(const byte *pat, const byte *str);
static inline char *xbasename(const char *str)