compress WIP
This commit is contained in:
parent
9cf3ee9e7e
commit
a8a6ea06df
|
@ -41,7 +41,7 @@
|
||||||
(define *program-name* "compress (GASH)")
|
(define *program-name* "compress (GASH)")
|
||||||
|
|
||||||
(define (_ msg . rest)
|
(define (_ msg . rest)
|
||||||
(cons msg rest))
|
msg)
|
||||||
|
|
||||||
(define (error* status msg . args)
|
(define (error* status msg . args)
|
||||||
(force-output)
|
(force-output)
|
||||||
|
@ -79,6 +79,8 @@
|
||||||
(put-bytevector port (u8-list->bytevector (list #x1F #x9D bits))))
|
(put-bytevector port (u8-list->bytevector (list #x1F #x9D bits))))
|
||||||
|
|
||||||
(define (compress-port in out bits verbose?)
|
(define (compress-port in out bits verbose?)
|
||||||
|
(set-port-encoding! in "ISO-8859-1")
|
||||||
|
(set-port-encoding! out "ISO-8859-1")
|
||||||
#;
|
#;
|
||||||
(begin
|
(begin
|
||||||
(write-lzw-header out bits)
|
(write-lzw-header out bits)
|
||||||
|
@ -123,6 +125,8 @@
|
||||||
(x #f)))
|
(x #f)))
|
||||||
|
|
||||||
(define (uncompress-port in out verbose?)
|
(define (uncompress-port in out verbose?)
|
||||||
|
(set-port-encoding! in "ISO-8859-1")
|
||||||
|
(set-port-encoding! out "ISO-8859-1")
|
||||||
(let ((bits (read-lzw-header in)))
|
(let ((bits (read-lzw-header in)))
|
||||||
(unless bits
|
(unless bits
|
||||||
(error* 1 (_ "incorrect header")))
|
(error* 1 (_ "incorrect header")))
|
||||||
|
|
Loading…
Reference in New Issue