|
|
|
@ -42,10 +42,10 @@
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
(link-num
|
|
|
|
|
((number? link-num)
|
|
|
|
|
(if (and (< link-num (length current-page-links)) (> link-num -1))
|
|
|
|
|
(begin (set! forward '()) (list-ref current-page-links link-num))
|
|
|
|
|
(begin (print-error (string-append "Invalid link ID: " (number->string link-num))) #f)
|
|
|
|
|
(begin (print-error (string-append "Invalid link ID: " link-num)) #f)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
(else (if (~bool in)
|
|
|
|
@ -76,7 +76,7 @@
|
|
|
|
|
(cond
|
|
|
|
|
((equal? (car link-line) "0") (get-lines link-line))
|
|
|
|
|
((equal? (car link-line) "1") (get-lines link-line))
|
|
|
|
|
(else (print-error (string-append "Type " "\"" (number->string link-num) "\"" " requests are not currently supported")))
|
|
|
|
|
(else (print-error (string-format "Type \"%v\" requests are not currently supported" link-line)))
|
|
|
|
|
)
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
@ -91,7 +91,7 @@
|
|
|
|
|
(set! output (read-all (write (string-append (get-line-path link-line) "\r\n") conn)))
|
|
|
|
|
(close conn)
|
|
|
|
|
(if (exception? output)
|
|
|
|
|
(print-error (string-format "Could not retrieve page data from {}" (get-line-path link-line)))
|
|
|
|
|
(print-error (string-format "Could not retrieve page data from %v" (get-line-path link-line)))
|
|
|
|
|
(begin (display output)(set! history (cons link-line history))))))
|
|
|
|
|
;; If map, print it and add it to history
|
|
|
|
|
;; also fill out the current links list
|
|
|
|
@ -99,7 +99,7 @@
|
|
|
|
|
(set! output (read-all (write (string-append (get-line-path link-line) "\r\n") conn)))
|
|
|
|
|
(close conn)
|
|
|
|
|
(if (exception? output)
|
|
|
|
|
(print-error (string-format "Could not retrieve page data from {}" (get-line-path link-line)))
|
|
|
|
|
(print-error (string-format "Could not retrieve page data from %v" (get-line-path link-line)))
|
|
|
|
|
(begin
|
|
|
|
|
(set! output (string->list output "\n"))
|
|
|
|
|
(set! current-page-links '())
|
|
|
|
@ -227,8 +227,8 @@
|
|
|
|
|
(define print-line (lambda (line-split)
|
|
|
|
|
(define link-num (length current-page-links))
|
|
|
|
|
(if (equal? (get-line-type line-split) "i")
|
|
|
|
|
(display "\t" (get-line-text line-split) "\n")
|
|
|
|
|
(display (string-format "[{}]\t{}\n" link-num (get-line-text line-split)))
|
|
|
|
|
(display (string-format " \t%v\n" (get-line-text line-split)))
|
|
|
|
|
(display (string-format "[%-2v]\t%v\n" link-num (get-line-text line-split)))
|
|
|
|
|
)
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|