summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-02-17 17:25:28 +0100
committerTobias Klauser <tklauser@distanz.ch>2015-02-17 17:25:28 +0100
commit9a390acd44203dc7847ad05d86ac07082336c7fe (patch)
treeacf10a650982b9b5c90e49ee35b661f46bc84bb3 /util.h
parent4bcd6157b2b44e700dd824d58248f4a98b2c536e (diff)
llmnr-query: Add simple LLMNR query program
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'util.h')
-rw-r--r--util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/util.h b/util.h
index 8a21467..13a8637 100644
--- a/util.h
+++ b/util.h
@@ -21,6 +21,7 @@
#define UTIL_H
#include <stdarg.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -55,4 +56,16 @@ void *xzalloc(size_t size);
void *xrealloc(void *ptr, size_t size);
char *xstrdup(const char *s);
+static inline bool xstreq(const char *str1, const char *str2)
+{
+ size_t n = strlen(str1);
+
+ if (n != strlen(str2))
+ return false;
+ if (strncmp(str1, str2, n) != 0)
+ return false;
+
+ return true;
+}
+
#endif /* UTIL_H */