@# This requires a hacked version of man2html @# See here: http://www.kylheku.com/cgit/man @(bind symhash @(hash :equal-based)) @(bind tagmap @(hash :equal-based)) @(bind tochash @(hash :equal-based)) @(bind closedtxt " [+]") @(bind opentxt " [-]") @(bind xpnall "[expand all]") @(bind clpsall "[collapse all]") @(bind closed t) @(do (defvar dupes (hash)) (defvar tagnum (hash :equal-based)) (defvarl disamb (hash :equal-based)) (defvarl dist-counter 0) (defun hash-str (str) (for ((lim (len str)) (i 0) (h 0) g) ((< i lim) h) ((inc i)) (set h (+ (ash h 4) (int-chr [str i]))) (set g (logand h #x7c000000)) (set h (logtrunc (logxor h (logxor (ash g -26) g)) 32)))) (defun hash-title (title) (let* ((h (logtrunc (hash-str title) 32)) (existing [dupes h])) (when existing (unless (equal title existing) (error "~a ~a hash collision!" existing title))) (set [dupes h] title) (format nil "N-~,08X" h))) (defun toc-tag (sec) `TOC-@sec`) (set [tagmap "lbAB"] (hash-title "NAME")) (defun enumerate (title) (let ((num (inc [tagnum title 0]))) `@title@(if (> num 1) `-@num` "")`)) (defun process-ambiguities (hash) (hash-update hash (do if (eql (length @1) 1) (first @1) (let ((new-tag (format nil "D-~,04X" (inc dist-counter)))) (set [disamb new-tag] (reverse @1)) new-tag))))) Content-type: text/html @(skip 15)