summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/string_view.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/string_view.h b/src/util/string_view.h
new file mode 100644
index 0000000..82f7b0c
--- /dev/null
+++ b/src/util/string_view.h
@@ -0,0 +1,10 @@
+#pragma once
+
+#include <stddef.h>
+
+
+// A non-owned view on a (sub)string.
+struct string_view {
+ char *s;
+ size_t len;
+};