Viewer for host-info

part of darcs patch Thu Sep 22 18:43:55 EEST 2005  Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de>
This commit is contained in:
eknauel 2005-09-27 16:34:02 +00:00
parent 54907fe26e
commit 1d2a36c982
1 changed files with 32 additions and 1 deletions

View File

@ -100,4 +100,35 @@
(make-info-viewer make-protocol-info-select-list)) (make-info-viewer make-protocol-info-select-list))
(register-plugin! (register-plugin!
(make-view-plugin make-protocol-info-viewer protocol-info?)) (make-view-plugin make-protocol-info-viewer protocol-info?))
(define (make-host-info-select-list hi num-lines)
(make-select-list
(append
(list
(make-unmarked-text-element
(cons 'name (host-info:name hi))
#t
(format #f "Name: ~a" (host-info:name hi)))
(make-unmarked-text-element
(cons 'text "") #f "Aliases:"))
(map (lambda (alias)
(make-unmarked-text-element
(cons 'alias alias) #t
(format #f " ~a" alias)))
(host-info:aliases hi))
(list
(make-unmarked-text-element
(cons 'text "") #f "Addresses:"))
(map (lambda (address)
(make-unmarked-text-element
(cons 'address address) #t
(format #f " ~a" address)))
(host-info:addresses hi)))
num-lines))
(define make-host-info-viewer
(make-info-viewer make-host-info-select-list))
(register-plugin!
(make-view-plugin make-host-info-viewer host-info?))