summary refs log tree commit diff
path: root/net.h
diff options
context:
space:
mode:
authorwrmr2024-11-02 15:10:41 -0500
committerwrmr2024-11-02 15:10:41 -0500
commit58214ec5f982c1b97aadce254c958a5f922c9724 (patch)
treeae64cb697531b0ee619350645e47adf186febfe7 /net.h
parentdf1b0b23569e5244d5b9398802fec6435a995368 (diff)
split main.c in several places, began work on design doc
Diffstat (limited to 'net.h')
-rw-r--r--net.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/net.h b/net.h
new file mode 100644
index 0000000..0b4422f
--- /dev/null
+++ b/net.h
@@ -0,0 +1,26 @@
+#ifndef NET_H
+#define NET_H
+
+#include "doc.h"
+
+#define HOST_MAX 255
+#define PATH_MAX 255
+
+enum protocol {
+	PROT_UNKNOWN,
+	PROT_FILE,
+	PROT_GOPHER,
+	PROT_GEMINI,
+};
+
+struct addr {
+	char host[HOST_MAX];
+	char path[PATH_MAX];
+	size_t host_len, path_len;
+	enum protocol prot;
+	enum doc_type type;
+};
+
+int net_addr(const char *url, struct addr *adr, enum protocol prot_default);
+
+#endif