aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-10-22 14:05:05 +0000
committerdos-reis <gdr@axiomatics.org>2008-10-22 14:05:05 +0000
commit103b2d845a96451055d6795eaede7e4070977731 (patch)
treece10ad55c9569f4d2e140d9b158a5719e7406787 /src
parenta702ea88c792e54d6a44b89efb09c265f542704a (diff)
downloadopen-axiom-103b2d845a96451055d6795eaede7e4070977731.tar.gz
* algebra/net.spad.pamphlet (InputOutputBinaryFile): New.
(position$InputBinaryFile): New. (position!$InputBinaryFile): Likewise. * algebra/exposed.lsp.pamphlet: Expose InputOutputBinaryFile. * algebra/Makefile.pamphlet (axiom_algebra_layer_user): Add IOBFILE.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/algebra/Makefile.in6
-rw-r--r--src/algebra/Makefile.pamphlet6
-rw-r--r--src/algebra/exposed.lsp.pamphlet1
-rw-r--r--src/algebra/net.spad.pamphlet43
5 files changed, 62 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4596fc9f..434c3c3f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2008-10-22 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * algebra/net.spad.pamphlet (InputOutputBinaryFile): New.
+ (position$InputBinaryFile): New.
+ (position!$InputBinaryFile): Likewise.
+ * algebra/exposed.lsp.pamphlet: Expose InputOutputBinaryFile.
+ * algebra/Makefile.pamphlet (axiom_algebra_layer_user): Add IOBFILE.
+
2008-10-21 Gabriel Dos Reis <gdr@cs.tamu.edu>
* boot/ast.boot: Expand on native call translation.
diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in
index f3521c0a..2bf2dc80 100644
--- a/src/algebra/Makefile.in
+++ b/src/algebra/Makefile.in
@@ -826,7 +826,8 @@ axiom_algebra_layer_user = \
LETAST SUCHAST RDUCEAST COLONAST ADDAST CAPSLAST \
CASEAST HASAST ISAST CATAST WHEREAST COMMAAST \
QQUTAST DEFAST MACROAST SPADXPT SPADAST \
- INBFILE OUTBFILE RGBCMDL RGBCSPC CTORKIND CTOR
+ INBFILE OUTBFILE IOBFILE RGBCMDL RGBCSPC CTORKIND \
+ CTOR
axiom_algebra_layer_user_nrlibs = \
$(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_user))
@@ -881,10 +882,13 @@ SPADAST.NRLIB/code.$(FASLEXT): \
CLLCTAST LSTAST EXITAST RETAST CRCEAST PRTDAST RSTRCAST \
SEGAST SEQAST LETAST SUCHTAST COLONAST CASEAST HASAST \
ISAST))
+
INBFILE.NRLIB/code.$(FASLEXT): $(OUT)/FNAME.$(FASLEXT) \
$(OUT)/INBCON.$(FASLEXT) $(OUT)/STRING.$(FASLEXT)
OUTBFILE.NRLIB/code.$(FASLEXT): $(OUT)/FNAME.$(FASLEXT) \
$(OUT)/OUTBCON.$(FASLEXT) $(OUT)/STRING.$(FASLEXT)
+IOBFILE.NRLIB/code.$(FASLEXT): $(OUT)/INBFILE.$(FASLEXT) \
+ $(OUT)/OUTBFILE.$(FASLEXT)
CTOR.NRLIB/code.$(FASLEXT): $(OUT)/CTORKIND.$(FASLEXT) \
$(OUT)/IDENT.$(FASLEXT)
diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet
index 609786e6..16cb9d93 100644
--- a/src/algebra/Makefile.pamphlet
+++ b/src/algebra/Makefile.pamphlet
@@ -1253,7 +1253,8 @@ axiom_algebra_layer_user = \
LETAST SUCHAST RDUCEAST COLONAST ADDAST CAPSLAST \
CASEAST HASAST ISAST CATAST WHEREAST COMMAAST \
QQUTAST DEFAST MACROAST SPADXPT SPADAST \
- INBFILE OUTBFILE RGBCMDL RGBCSPC CTORKIND CTOR
+ INBFILE OUTBFILE IOBFILE RGBCMDL RGBCSPC CTORKIND \
+ CTOR
axiom_algebra_layer_user_nrlibs = \
$(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_user))
@@ -1308,10 +1309,13 @@ SPADAST.NRLIB/code.$(FASLEXT): \
CLLCTAST LSTAST EXITAST RETAST CRCEAST PRTDAST RSTRCAST \
SEGAST SEQAST LETAST SUCHTAST COLONAST CASEAST HASAST \
ISAST))
+
INBFILE.NRLIB/code.$(FASLEXT): $(OUT)/FNAME.$(FASLEXT) \
$(OUT)/INBCON.$(FASLEXT) $(OUT)/STRING.$(FASLEXT)
OUTBFILE.NRLIB/code.$(FASLEXT): $(OUT)/FNAME.$(FASLEXT) \
$(OUT)/OUTBCON.$(FASLEXT) $(OUT)/STRING.$(FASLEXT)
+IOBFILE.NRLIB/code.$(FASLEXT): $(OUT)/INBFILE.$(FASLEXT) \
+ $(OUT)/OUTBFILE.$(FASLEXT)
CTOR.NRLIB/code.$(FASLEXT): $(OUT)/CTORKIND.$(FASLEXT) \
$(OUT)/IDENT.$(FASLEXT)
diff --git a/src/algebra/exposed.lsp.pamphlet b/src/algebra/exposed.lsp.pamphlet
index 18e6384f..9d54ae9c 100644
--- a/src/algebra/exposed.lsp.pamphlet
+++ b/src/algebra/exposed.lsp.pamphlet
@@ -201,6 +201,7 @@
(|InfiniteTupleFunctions3| . ITFUN3)
(|Infinity| . INFINITY)
(|InputBinaryFile| . INBFILE)
+ (|InputOutputBinaryFile| . IOBFILE)
(|Integer| . INT)
(|IntegerCombinatoricFunctions| . COMBINAT)
(|IntegerLinearDependence| . ZLINDEP)
diff --git a/src/algebra/net.spad.pamphlet b/src/algebra/net.spad.pamphlet
index c44130e2..ba8bfdc7 100644
--- a/src/algebra/net.spad.pamphlet
+++ b/src/algebra/net.spad.pamphlet
@@ -130,6 +130,10 @@ InputBinaryFile(): Public == Private where
++ eof?(ifile) holds when the last read reached end of file.
isOpen?: % -> Boolean
++ open?(ifile) holds if `ifile' is in open state.
+ position: % -> SingleInteger
+ ++ position(f) returns the current byte-position in the file `f'.
+ position!: (%,SingleInteger) -> SingleInteger
+ ++ position(f,p) sets the current byte-position to `i'.
Private == add
Rep == Record(stream: SExpression, filename: FileName, eof: Boolean)
inputBinaryFile(f: FileName) ==
@@ -153,6 +157,15 @@ InputBinaryFile(): Public == Private where
rep(ifile).stream := closeFile(rep(ifile).stream)$Lisp
rep(ifile).eof := true
ifile
+ position ifile ==
+ isOpen? ifile =>
+ FILE_-POSITION(rep(ifile).stream)$Lisp
+ error "file is not open"
+ position!(ifile,p) ==
+ isOpen? ifile =>
+ FILE_-POSITION(rep(ifile).stream,p)$Lisp
+ p
+ error "file is not open"
coerce(ifile: %): OutputForm ==
rep(ifile).filename::OutputForm
@
@@ -197,6 +210,35 @@ OutputBinaryFile(): Public == Private where
rep(ifile).filename::OutputForm
@
+\subsection{The InputOutputBinaryFile domain}
+
+<<domain IOBFILE InputOutputBinaryFile>>=
+)abbrev domain IOBFILE InputOutputBinaryFile
+++ Author: Gabriel Dos Reis
+++ Date Created: October 21, 2008
+++ Date Last Modified: October 21, 2008
+++ Description:
+++ This domain provides representation for binary files open
+++ for input and output operations.
+++ See Also: InputBinaryFile, OutputBinaryFile
+InputOutputBinaryFile(): Public == Private where
+ Public == Join(InputOutputByteConduit, CoercibleTo OutputForm) with
+ inputOutputBinaryFile: FileName -> %
+ ++ inputOutputBinaryFile(f) returns an input/output conduit obtained
+ ++ by opening the file designated by `f' as a binary file.
+ inputOutputBinaryFile: String -> %
+ ++ inputOutputBinaryFile(f) returns an input/output conduit obtained
+ ++ by opening the file named by `f' as a binary file.
+ isOpen?: % -> Boolean
+ ++ isOpen?(f) holds if `f' is in open state.
+ Private == (InputBinaryFile, OutputBinaryFile) add
+ Rep == Record(stream: SExpression, filename: FileName)
+ inputOutputBinaryFile(f: FileName) ==
+ per [openBinaryFile(f::String,bothWays$IOMode)$Lisp,f]
+ inputOutputBinaryFile(f: String) ==
+ per [openBinaryFile(f,bothWays$IOMode)$Lisp,f::FileName]
+@
+
\section{The Hostname domain}
@@ -289,6 +331,7 @@ PortNumber(): Public == Private where
<<domain INBFILE InputBinaryFile>>
<<domain OUTBFILE OutputBinaryFile>>
+<<domain IOBFILE InputOutputBinaryFile>>
<<domain HOSTNAME Hostname>>
<<domain PORTNUM PortNumber>>