From 0bdc1514fd9a8fb4655869e6f240a53639531c68 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 9 Jul 2010 13:52:15 -0700 Subject: [PATCH] io.streams.limited: remove unlimit* --- basis/http/server/server.factor | 1 - basis/images/jpeg/jpeg.factor | 2 +- basis/io/streams/limited/limited-docs.factor | 16 +--------- basis/io/streams/limited/limited-tests.factor | 29 ------------------- basis/io/streams/limited/limited.factor | 6 ---- 5 files changed, 2 insertions(+), 52 deletions(-) diff --git a/basis/http/server/server.factor b/basis/http/server/server.factor index 9a323bd38d..c551f5608b 100644 --- a/basis/http/server/server.factor +++ b/basis/http/server/server.factor @@ -51,7 +51,6 @@ ERROR: no-boundary ; SYMBOL: upload-limit : read-multipart-data ( request -- mime-parts ) - unlimited-input upload-limit get limited-input [ "content-type" header ] [ "content-length" header string>number limited-input ] bi diff --git a/basis/images/jpeg/jpeg.factor b/basis/images/jpeg/jpeg.factor index 89e6851793..fa6d5688bc 100644 --- a/basis/images/jpeg/jpeg.factor +++ b/basis/images/jpeg/jpeg.factor @@ -366,7 +366,7 @@ ERROR: not-a-jpeg-image ; [ parse-marker { SOI } = [ not-a-jpeg-image ] unless parse-headers - unlimited-input contents + contents ] with-input-stream ; PRIVATE> diff --git a/basis/io/streams/limited/limited-docs.factor b/basis/io/streams/limited/limited-docs.factor index 37f9c2f27b..5a06dedf0d 100644 --- a/basis/io/streams/limited/limited-docs.factor +++ b/basis/io/streams/limited/limited-docs.factor @@ -27,13 +27,6 @@ HELP: limit-stream } } ; -HELP: unlimit-stream -{ $values - { "stream" "an input stream" } - { "stream'" "a stream" } -} -{ $description "Returns the underlying stream of a limited stream." } ; - HELP: limited-stream { $values { "value" "a limited-stream class" } @@ -44,18 +37,11 @@ HELP: limited-input { $values { "limit" integer } } { $description "Wraps the current " { $link input-stream } " in a " { $link limited-stream } "." } ; -HELP: unlimited-input -{ $description "Returns the underlying stream of the limited-stream stored in " { $link input-stream } "." } ; - ARTICLE: "io.streams.limited" "Limited input streams" "The " { $vocab-link "io.streams.limited" } " vocabulary wraps a stream to behave as if it had only a limited number of bytes, either throwing an error or returning " { $link f } " upon reaching the end. Limiting a non-seekable stream keeps a byte count and triggers the end-of-stream behavior when this byte count has been reached. However, limiting a seekable stream creates a window of bytes that supports seeking and re-reading of bytes in that window." $nl "Wrap a stream in a limited stream:" { $subsections limited-stream } "Wrap the current " { $link input-stream } " in a limited stream:" -{ $subsections limited-input } -"Unlimits a limited stream:" -{ $subsections unlimit-stream } -"Unlimits the current " { $link input-stream } ":" -{ $subsections unlimited-input } ; +{ $subsections limited-input } ; ABOUT: "io.streams.limited" diff --git a/basis/io/streams/limited/limited-tests.factor b/basis/io/streams/limited/limited-tests.factor index 12e5a38340..7ce7bd2016 100644 --- a/basis/io/streams/limited/limited-tests.factor +++ b/basis/io/streams/limited/limited-tests.factor @@ -54,35 +54,6 @@ IN: io.streams.limited.tests 4 over stream-read drop 10 swap stream-read ] unit-test -[ t ] -[ - "abc" 3 limit-stream unlimit-stream - "abc" = -] unit-test - -[ t ] -[ - "abc" 3 limit-stream unlimit-stream - "abc" = -] unit-test - -[ t ] -[ - [ - "resource:license.txt" utf8 &dispose - 3 limit-stream unlimit-stream - "resource:license.txt" utf8 &dispose - [ decoder? ] both? - ] with-destructors -] unit-test - - -[ "asdf" ] [ - "asdf" 2 [ - unlimited-input contents - ] with-input-stream -] unit-test - ! pipes are duplex and not seekable [ "as" ] [ latin1 [ 2 ] change-in diff --git a/basis/io/streams/limited/limited.factor b/basis/io/streams/limited/limited.factor index 45494b3c1d..ba709bd7f1 100644 --- a/basis/io/streams/limited/limited.factor +++ b/basis/io/streams/limited/limited.factor @@ -39,12 +39,6 @@ M: object unlimit-stream ( stream -- stream' ) ; : limited-input ( limit -- ) [ input-stream ] dip '[ _ limit-stream ] change ; -: unlimited-input ( -- ) - input-stream [ unlimit-stream ] change ; - -: with-unlimited-stream ( stream quot -- ) - [ clone unlimit-stream ] dip call ; inline - : with-limited-stream ( stream limit quot -- ) [ limit-stream ] dip call ; inline