diff -Nur netstring.egg netstring.egg
|
|
|
|
| | 1 | ;;; netstring.egg -*- Scheme -*- |
| | 2 | |
| | 3 | ((synopsis "Parsing and writing <a href=\"http://cr.yp.to/proto/netstrings.txt\">netstrings</a>") |
| | 4 | (category parsing) |
| | 5 | (test-dependencies test) |
| | 6 | (license "BSD") |
| | 7 | (author "Moritz Heidkamp") |
| | 8 | (components |
| | 9 | (extension netstring))) |
diff -Nur netstring.meta netstring.meta
|
|
|
|
| 1 | | ((synopsis "Parsing and writing <a href=\"http://cr.yp.to/proto/netstrings.txt\">netstrings</a>") |
| 2 | | (author "Moritz Heidkamp") |
| 3 | | (test-depends test) |
| 4 | | (category parsing) |
| 5 | | (license "BSD")) |
diff -Nur netstring.scm netstring.scm
|
|
|
|
| 2 | 2 | |
| 3 | 3 | (netstring-write netstring-read string->netstring netstring->string) |
| 4 | 4 | |
| 5 | | (import chicken scheme) |
| 6 | | (use (only extras read-string read-token) |
| 7 | | (only ports |
| 8 | | with-output-to-port |
| 9 | | with-output-to-string |
| 10 | | with-input-from-string)) |
| | 5 | (import |
| | 6 | (chicken base) |
| | 7 | (only (chicken format) sprintf) |
| | 8 | (only (chicken io) read-string read-token) |
| | 9 | (only (chicken port) |
| | 10 | with-output-to-port |
| | 11 | with-output-to-string |
| | 12 | with-input-from-string) |
| | 13 | scheme) |
| 11 | 14 | |
| 12 | 15 | (define (netstring-write str #!optional (port (current-output-port)) (terminator #\,)) |
| 13 | 16 | (with-output-to-port port |
| … |
… |
|
| 29 | 32 | |
| 30 | 33 | (cond ((not (= (string-length string) len)) |
| 31 | 34 | (error 'netstring-read |
| 32 | | (format "wrong length, expected ~A but got ~A" |
| | 35 | (sprintf "wrong length, expected ~A but got ~A" |
| 33 | 36 | len |
| 34 | 37 | (string-length string)))) |
| 35 | 38 | (check-terminator? |
diff -Nur netstring.setup netstring.setup
|
|
|
|
| 1 | | (standard-extension "netstring" "0.0.4") |
diff -Nur tests/run.scm tests/run.scm
|
|
|
|
| 1 | | (load-relative "../netstring") |
| 2 | | (import netstring) |
| 3 | | (use test) |
| | 1 | (import (chicken port) netstring test) |
| 4 | 2 | |
| 5 | 3 | (test-begin) |
| 6 | 4 | |