;;;; chicken-wrap.scm - Standalone wrapper generator (declare (export ##compiler#debugging-chicken)) (define-constant +version+ 1.7) (define ##compiler#debugging-chicken '()) (require-extension srfi-1 utils easyffi-base) (define (usage #!optional (status 0)) (print #< (string-length arg) 1) (char=? #\- (string-ref arg 0)) ) (usage 1) ) (else arg) ) ) args) ) ) (when (null? files) (usage 1)) (for-each (lambda (f) (define (process) (print "\n;;; generated by chicken-wrap from " f #\newline) (pp `(begin ,@(parse-easy-ffi (read-all (if (string=? f "-") (current-input-port) f) ) ) ) ) ) (if *to-stdout* (process) (with-output-to-file (pathname-replace-extension f "scm") process) ) ) files) ) ) (main (command-line-arguments))