diff options
author | wrmr | 2024-11-03 02:48:05 -0500 |
---|---|---|
committer | wrmr | 2024-11-03 02:48:05 -0500 |
commit | 3e9c75318b0eb1114fb7361dbc467990674804b6 (patch) | |
tree | 504efbb2fe56c4700055ec584170cb77237c732a /main.c | |
parent | 610808a5902adad751a4acdbcc310803a51fed5d (diff) |
start working on fetching
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/main.c b/main.c index 64343bc..0c36a34 100644 --- a/main.c +++ b/main.c @@ -5,7 +5,6 @@ #include <stdlib.h> #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("?"); |