summary refs log tree commit diff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c19
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("?");