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 --- main.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 64343bc..0c36a34 100644 --- a/main.c +++ b/main.c @@ -5,7 +5,6 @@ #include #include "doc.h" -#include "net.h" #include "err.h" #include "nav.h" @@ -13,20 +12,6 @@ /* navigation */ -int nav_to(const char *url) { - struct addr a; - static enum protocol prot_default = PROT_FILE; /* change to gopher later */ - if (net_addr(url, &a, prot_default)) { - return -1; - } - prot_default = a.prot; - return 0; -} - -int nav_link_nr(unsigned long link_nr) { - return 0; -} - /* commands */ struct cmd { @@ -48,7 +33,7 @@ int cmd_do(char *cmd, struct nav_state *ns) { unsigned long n = strtoul(cmd, NULL, 10); if (errno) { perr("invalid link number"); - } else if (nav_link_nr(n)) { + } else if (nav_link_nr(ns, n)) { perr("navigation failure"); } } @@ -63,7 +48,7 @@ int cmd_do(char *cmd, struct nav_state *ns) { nav_redraw(ns); break; case 'g': - if (nav_to(cmd + 1)) perr("navigation failure"); + if (nav_to(ns, cmd + 1)) perr("navigation failure"); break; default: perr("?"); -- cgit 1.4.1-2-gfad0