From 3e9c75318b0eb1114fb7361dbc467990674804b6 Mon Sep 17 00:00:00 2001 From: wrmr Date: Sun, 3 Nov 2024 02:48:05 -0500 Subject: start working on fetching --- net.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'net.h') diff --git a/net.h b/net.h index 0b4422f..8483120 100644 --- a/net.h +++ b/net.h @@ -1,10 +1,10 @@ #ifndef NET_H #define NET_H -#include "doc.h" +#include "buf.h" -#define HOST_MAX 255 -#define PATH_MAX 255 +#define HOST_MAX 256 +#define PATH_MAX 256 enum protocol { PROT_UNKNOWN, @@ -13,6 +13,13 @@ enum protocol { PROT_GEMINI, }; +enum doc_type { + TYPE_UNKNOWN, + TYPE_GOPHERDOC, + TYPE_GEMTEXT, + TYPE_PLAIN, +}; + struct addr { char host[HOST_MAX]; char path[PATH_MAX]; @@ -22,5 +29,6 @@ struct addr { }; int net_addr(const char *url, struct addr *adr, enum protocol prot_default); +int net_fetch(const struct addr *adr, struct buf *buf); #endif -- cgit 1.4.1-2-gfad0