#ifndef NET_H #define NET_H #include "buf.h" #define HOST_MAX 256 #define PATH_MAX 256 enum protocol { PROT_UNKNOWN, PROT_FILE, PROT_GOPHER, PROT_GEMINI, }; enum doc_type { DOC_UNKNOWN, DOC_GOPHERDOC, DOC_GEMTEXT, DOC_PLAIN, }; 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); int net_fetch(const struct addr *adr, struct buf *buf); #endif