Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
C
com.informatimago
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Security & Compliance
Security & Compliance
Dependency List
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
com-informatimago
com.informatimago
Commits
b4e4fb8f
Commit
b4e4fb8f
authored
Sep 13, 2015
by
Pascal J. Bourguignon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added pipe-stream.
parent
dd9653b7
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
924 additions
and
0 deletions
+924
-0
clext/com.informatimago.clext.pipe-stream.asd
clext/com.informatimago.clext.pipe-stream.asd
+90
-0
clext/pipe-stream-test.lisp
clext/pipe-stream-test.lisp
+113
-0
clext/pipe-stream.lisp
clext/pipe-stream.lisp
+721
-0
No files found.
clext/com.informatimago.clext.pipe-stream.asd
0 → 100644
View file @
b4e4fb8f
;;;; -*- mode:lisp;coding:utf-8 -*-
;;;;**************************************************************************
;;;;FILE: com.informatimago.clext.pipe-stream.asd
;;;;LANGUAGE: Common-Lisp
;;;;SYSTEM: Common-Lisp
;;;;USER-INTERFACE: NONE
;;;;DESCRIPTION
;;;;
;;;; ASD file to load the com.informatimago.clext.pipe-stream library.
;;;;
;;;;AUTHORS
;;;; <PJB> Pascal J. Bourguignon <pjb@informatimago.com>
;;;;MODIFICATIONS
;;;; 2015-09-12 <PJB> Created this .asd file.
;;;;BUGS
;;;;LEGAL
;;;; AGPL3
;;;;
;;;; Copyright Pascal J. Bourguignon 2015 - 2015
;;;;
;;;; This program is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU Affero General Public License as published by
;;;; the Free Software Foundation, either version 3 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU Affero General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU Affero General Public License
;;;; along with this program. If not, see http://www.gnu.org/licenses/
;;;;**************************************************************************
#+
mocl
(
asdf:defsystem
"com.informatimago.clext.pipe-stream"
;; system attributes:
:description
"Dummy Informatimago Common Lisp Extensions: Pipe-Streams."
:long-description
"
This system would use TRIVIAL-GRAY-STREAMS, which is not available on MOCL.
"
:author
"Pascal J. Bourguignon <pjb@informatimago.com>"
:maintainer
"Pascal J. Bourguignon <pjb@informatimago.com>"
:licence
"AGPL3"
;; component attributes:
:version
"1.0.4"
:properties
((
#:author-email
.
"pjb@informatimago.com"
)
(
#:date
.
"Summer 2015"
)
((
#:albert
#:output-dir
)
.
"/tmp/documentation/com.informatimago.clext/"
)
((
#:albert
#:formats
)
.
(
"docbook"
))
((
#:albert
#:docbook
#:template
)
.
"book"
)
((
#:albert
#:docbook
#:bgcolor
)
.
"white"
)
((
#:albert
#:docbook
#:textcolor
)
.
"black"
))
#+
asdf-unicode
:encoding
#+
asdf-unicode
:utf-8
:depends-on
()
:components
())
#-
mocl
(
asdf:defsystem
"com.informatimago.clext.pipe-stream"
;; system attributes:
:description
"Informatimago Common Lisp Extensions: Pipe-Streams."
:long-description
"
This system provides PIPE-STREAMS, a pair of input and output stream
with a synchronized queue in the middle.
"
:author
"Pascal J. Bourguignon <pjb@informatimago.com>"
:maintainer
"Pascal J. Bourguignon <pjb@informatimago.com>"
:licence
"AGPL3"
;; component attributes:
:version
"1.0.0"
:properties
((
#:author-email
.
"pjb@informatimago.com"
)
(
#:date
.
"Summer 2015"
)
((
#:albert
#:output-dir
)
.
"/tmp/documentation/com.informatimago.clext/"
)
((
#:albert
#:formats
)
.
(
"docbook"
))
((
#:albert
#:docbook
#:template
)
.
"book"
)
((
#:albert
#:docbook
#:bgcolor
)
.
"white"
)
((
#:albert
#:docbook
#:textcolor
)
.
"black"
))
:depends-on
(
"trivial-gray-streams"
"bordeaux-threads"
)
:components
((
:file
"pipe-stream"
))
#+
adsf3
:in-order-to
#+
adsf3
((
test-op
(
test-op
"com.informatimago.clext.pipe-stream.test"
)))
#+
asdf-unicode
:encoding
#+
asdf-unicode
:utf-8
)
;;;; THE END ;;;;
clext/pipe-stream-test.lisp
0 → 100644
View file @
b4e4fb8f
;;;; -*- mode:lisp;coding:utf-8 -*-
;;;;**************************************************************************
;;;;FILE: pipe-stream-test.lisp
;;;;LANGUAGE: Common-Lisp
;;;;SYSTEM: Common-Lisp
;;;;USER-INTERFACE: NONE
;;;;DESCRIPTION
;;;;
;;;; Tests the pipe streams.
;;;;
;;;;AUTHORS
;;;; <PJB> Pascal J. Bourguignon <pjb@informatimago.com>
;;;;MODIFICATIONS
;;;; 2015-09-13 <PJB> Created.
;;;;BUGS
;;;;LEGAL
;;;; AGPL3
;;;;
;;;; Copyright Pascal J. Bourguignon 2015 - 2015
;;;;
;;;; This program is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU Affero General Public License as published by
;;;; the Free Software Foundation, either version 3 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU Affero General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU Affero General Public License
;;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;;;**************************************************************************
(
defpackage
"COM.INFORMATIMAGO.CLEXT.PIPE.TEST"
(
:use
"COMMON-LISP"
"BORDEAUX-THREADS"
"COM.INFORMATIMAGO.COMMON-LISP.CESARUM.SIMPLE-TEST"
"COM.INFORMATIMAGO.CLEXT.PIPE"
)
(
:export
"TEST/ALL"
))
(
in-package
"COM.INFORMATIMAGO.CLEXT.PIPE.TEST"
)
#-
(
and
)
(
:export
"MAKE-PIPE"
"PIPE"
"PIPE-INPUT-STREAM"
"PIPE-OUTPUT-STREAM"
"PIPE-ELEMENT-TYPE"
"PIPE-CHARACTER-INPUT-STREAM"
"PIPE-CHARACTER-OUTPUT-STREAM"
"PIPE-BINARY-INPUT-STREAM"
"PIPE-BINARY-OUTPUT-STREAM"
)
(
deftype
octet
()
'
(
unsigned-byte
8
))
(
define-test
test/character-io
(
pipe-kind
out-kind
in-kind
)
(
let*
((
buffer-size
(
ecase
pipe-kind
(
:queued
nil
)
(
:buffered
133
)))
(
pipe
(
make-pipe
:element-type
'character
:buffer-size
buffer-size
))
(
output
(
pipe-output-stream
pipe
))
(
input
(
pipe-input-stream
pipe
))
(
producer
(
make-thread
(
ecase
out-kind
(
:char
(
make-character-output
output
buffer-size
))
(
:line
(
make-line-output
output
buffer-size
))
(
:sequence
(
make-string-output
output
buffer-size
)))
:named
"test/character-io/producer"
))
(
consumer
(
make-thread
(
ecase
in-kind
(
:char
(
make-character-input
input
buffer-size
))
(
:line
(
make-line-input
input
buffer-size
))
(
:sequence
(
make-string-input
input
buffer-size
)))
:named
"test/character-io/consumer"
)))
(
join-thread
producer
)
(
join-thread
consomer
)))
(
define-test
test/binary-io
(
pipe-kind
out-kind
in-kind
)
(
let*
((
buffer-size
(
ecase
pipe-kind
(
:queued
nil
)
(
:buffered
133
)))
(
pipe
(
make-pipe
:element-type
'octet
:buffer-size
buffer-size
))
(
output
(
pipe-output-stream
pipe
))
(
input
(
pipe-input-stream
pipe
))
(
producer
(
make-thread
(
ecase
out-kind
(
:byte
(
make-binary-output
output
buffer-size
))
(
:sequence
(
make-sequence-output
output
buffer-size
)))
:named
"test/binary-io/producer"
))
(
consumer
(
make-thread
(
ecase
in-kind
(
:byte
(
make-binary-input
input
buffer-size
))
(
:sequence
(
make-sequence-input
input
buffer-size
)))
:named
"test/binary-io/consumer"
)))
(
join-thread
producer
)
(
join-thread
consomer
)))
(
define-test
test/all
()
(
loop
:for
pipe
:in
'
(
:queued
:buffered
)
:do
(
loop
:for
out
:in
'
(
:char
:line
:sequence
)
:do
(
loop
:for
in
:in
'
(
:char
:line
:sequence
)
:do
(
test/character-io
pipe
out
in
))))
(
loop
:for
pipe
:in
'
(
:queued
:buffered
)
:do
(
loop
:for
out
:in
'
(
:byte
:sequence
)
:do
(
loop
:for
in
:in
'
(
:byte
:sequence
)
:do
(
test/binary-io
pipe
out
in
)))))
;;;; THE END ;;;;
clext/pipe-stream.lisp
0 → 100644
View file @
b4e4fb8f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment