aboutsummaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--types.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/types.h b/types.h
new file mode 100644
index 0000000..0a7e592
--- /dev/null
+++ b/types.h
@@ -0,0 +1,12 @@
+#pragma once
+
+#include <stddef.h>
+#include <unistd.h>
+
+struct string {
+ char *data;
+ size_t len;
+};
+
+#define STRING(x) (struct string){x, sizeof(x)-1}
+#define WRITES(x, y) write(x, y.data, y.len);