(define (serve-record record path config)
(match record
(('shell command) (serve-shell-command command))
+ (('eval expression) (serve-expression expression))
((type display-string selector host port)
(print type display-string "\t" selector "\t" host "\t" port "\r"))
((type display-string selector host)
(let-values (((in-port out-port id) (process command)))
(for-each serve-info-record (read-lines in-port))))
+(define (serve-expression expression)
+ (for-each serve-info-record
+ (string-split (conc (eval expression)) "\n")))
+
;;; main
(define (main)
(run-server (make-server-config root hostname port))
(error "Invalid port argument." port))))))
-(main)
+;; (main)
-;; (define (test)
-;; (run-server (make-server-config "gopher-root" "localhost" 70)))
+(define (test)
+ (run-server (make-server-config "gopher-root" "localhost" 70)))
;; (test)