1 /*
2  * PortProcedures.h - <port> procedures.
3  *
4  *   Copyright (c) 2008  Higepon(Taro Minowa)  <higepon@users.sourceforge.jp>
5  *
6  *   Redistribution and use in source and binary forms, with or without
7  *   modification, are permitted provided that the following conditions
8  *   are met:
9  *
10  *   1. Redistributions of source code must retain the above copyright
11  *      notice, this list of conditions and the following disclaimer.
12  *
13  *   2. Redistributions in binary form must reproduce the above copyright
14  *      notice, this list of conditions and the following disclaimer in the
15  *      documentation and/or other materials provided with the distribution.
16  *
17  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
23  *   TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  *   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25  *   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  *   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  *
29  *  $Id: PortProcedures.h 261 2008-07-25 06:16:44Z higepon $
30  */
31 
32 #ifndef SCHEME_PORT_PROCEDURES_
33 #define SCHEME_PORT_PROCEDURES_
34 
35 #include "scheme.h"
36 
37 namespace scheme {
38 
39     ucs4string utf8ToUtf32(const char* s, int len);
40     ucs4string utf16ToUtf32(const char* s, int len);
41     char* utf32toUtf8(const ucs4string& s);
42     Object makeCustomTextualInputOutputPortEx(VM* theVM, int argc, const Object* argv);
43     Object makeCustomBinaryInputOutputPortEx(VM* theVM, int argc, const Object* argv);
44     Object openFileInputOutputPortEx(VM* theVM, int argc, const Object* argv);
45     Object peekCharEx(VM* theVM, int argc, const Object* argv);
46     Object getDatumEx(VM* theVM, int argc, const Object* argv);
47     Object getStringAllEx(VM* theVM, int argc, const Object* argv);
48     Object getStringNDEx(VM* theVM, int argc, const Object* argv);
49     Object getCharEx(VM* theVM, int argc, const Object* argv);
50     Object getBytevectorAllEx(VM* theVM, int argc, const Object* argv);
51     Object getBytevectorSomeEx(VM* theVM, int argc, const Object* argv);
52     Object getBytevectorNDEx(VM* theVM, int argc, const Object* argv);
53     Object portHasPortPositionPEx(VM* theVM, int argc, const Object* argv);
54     Object portHasSetPortPositionDPEx(VM* theVM, int argc, const Object* argv);
55     Object setPortPositionDEx(VM* theVM, int argc, const Object* argv);
56     Object portPositionEx(VM* theVM, int argc, const Object* argv);
57     Object openBytevectorInputPortEx(VM* theVM, int argc, const Object* argv);
58     Object portEofPEx(VM* theVM, int argc, const Object* argv);
59     Object writeCharEx(VM* theVM, int argc, const Object* argv);
60     Object putBytevectorEx(VM* theVM, int argc, const Object* argv);
61     Object putCharEx(VM* theVM, int argc, const Object* argv);
62     Object putDatumEx(VM* theVM, int argc, const Object* argv);
63     Object outputPortPEx(VM* theVM, int argc, const Object* argv);
64     Object getStringNEx(VM* theVM, int argc, const Object* argv);
65     Object faslWriteEx(VM* theVM, int argc, const Object* argv);
66     Object faslReadEx(VM* theVM, int argc, const Object* argv);
67     Object openInputFileEx(VM* theVM, int argc, const Object* argv);
68     Object closePortEx(VM* theVM, int argc, const Object* argv);
69     Object getLineEx(VM* theVM, int argc, const Object* argv);
70     Object standardLibraryPathEx(VM* theVM, int argc, const Object* argv);
71     Object standardInputPortEx(VM* theVM, int argc, const Object* argv);
72     Object standardOutputPortEx(VM* theVM, int argc, const Object* argv);
73     Object standardErrorPortEx(VM* theVM, int argc, const Object* argv);
74     Object bytevectorU8SetDEx(VM* theVM, int argc, const Object* argv);
75     Object lookaheadCharEx(VM* theVM, int argc, const Object* argv);
76     Object readEx(VM* theVM, int argc, const Object* argv);
77     Object sysDisplayEx(VM* theVM, int argc, const Object* argv);
78     Object currentErrorPortEx(VM* theVM, int argc, const Object* argv);
79     Object openStringInputPortEx(VM* theVM, int argc, const Object* argv);
80     Object openOutputStringEx(VM* theVM, int argc, const Object* argv);
81     Object openOutputFileEx(VM* theVM, int argc, const Object* argv);
82     Object closeOutputPortEx(VM* theVM, int argc, const Object* argv);
83     Object closeInputPortEx(VM* theVM, int argc, const Object* argv);
84     Object directoryListEx(VM* theVM, int argc, const Object* argv);
85     Object fileExistsPEx(VM* theVM, int argc, const Object* argv);
86     Object deleteFileEx(VM* theVM, int argc, const Object* argv);
87     Object getOutputStringEx(VM* theVM, int argc, const Object* argv);
88     Object formatEx(VM* theVM, int argc, const Object* argv);
89     Object currentInputPortEx(VM* theVM, int argc, const Object* argv);
90     Object currentOutputPortEx(VM* theVM, int argc, const Object* argv);
91     Object setCurrentInputPortDEx(VM* theVM, int argc, const Object* argv);
92     Object setCurrentOutputPortDEx(VM* theVM, int argc, const Object* argv);
93     Object readCharEx(VM* theVM, int argc, const Object* argv);
94     Object writeEx(VM* theVM, int argc, const Object* argv);
95     Object writeSsEx(VM* theVM, int argc, const Object* argv);
96     Object sysPortSeekEx(VM* theVM, int argc, const Object* argv);
97     Object makeCustomBinaryInputPortEx(VM* theVM, int argc, const Object* argv);
98     Object makeCustomBinaryOutputPortEx(VM* theVM, int argc, const Object* argv);
99     Object makeCustomTextualInputPortEx(VM* theVM, int argc, const Object* argv);
100     Object makeCustomTextualOutputPortEx(VM* theVM, int argc, const Object* argv);
101     Object getU8Ex(VM* theVM, int argc, const Object* argv);
102     Object lookaheadU8Ex(VM* theVM, int argc, const Object* argv);
103     Object getBytevectorNEx(VM* theVM, int argc, const Object* argv);
104     //Object getBytevectorNDEx(VM* theVM, int argc, const Object* argv);
105     //Object getBytevectorSomeEx(VM* theVM, int argc, const Object* argv);
106     //Object getBytevectorAllEx(VM* theVM, int argc, const Object* argv);
107     Object transcodedPortEx(VM* theVM, int argc, const Object* argv);
108     Object latin1CodecEx(VM* theVM, int argc, const Object* argv);
109     Object utf8CodecEx(VM* theVM, int argc, const Object* argv);
110     Object utf16CodecEx(VM* theVM, int argc, const Object* argv);
111     Object nativeEolStyleEx(VM* theVM, int argc, const Object* argv);
112     Object makeTranscoderEx(VM* theVM, int argc, const Object* argv);
113     Object nativeTranscoderEx(VM* theVM, int argc, const Object* argv);
114     Object transcoderCodecEx(VM* theVM, int argc, const Object* argv);
115     Object transcoderEolStyleEx(VM* theVM, int argc, const Object* argv);
116     Object transcoderErrorHandlingModeEx(VM* theVM, int argc, const Object* argv);
117     Object bytevectorTostringEx(VM* theVM, int argc, const Object* argv);
118     Object nullTerminatedBytevectorTostringEx(VM* theVM, int argc, const Object* argv);
119     Object stringTobytevectorEx(VM* theVM, int argc, const Object* argv);
120     Object eofObjectEx(VM* theVM, int argc, const Object* argv);
121     Object sysOpenBytevectorOutputPortEx(VM* theVM, int argc, const Object* argv);
122     Object sysGetBytevectorEx(VM* theVM, int argc, const Object* argv);
123     Object openFileOutputPortEx(VM* theVM, int argc, const Object* argv);
124     Object openFileInputPortEx(VM* theVM, int argc, const Object* argv);
125     Object eofObjectPEx(VM* theVM, int argc, const Object* argv);
126     Object bufferModePEx(VM* theVM, int argc, const Object* argv);
127     Object inputPortPEx(VM* theVM, int argc, const Object* argv);
128     Object binaryPortPEx(VM* theVM, int argc, const Object* argv);
129     Object textualPortPEx(VM* theVM, int argc, const Object* argv);
130     Object portPEx(VM* theVM, int argc, const Object* argv);
131     Object portTranscoderEx(VM* theVM, int argc, const Object* argv);
132     Object putU8Ex(VM* theVM, int argc, const Object* argv);
133     Object putStringEx(VM* theVM, int argc, const Object* argv);
134     Object flushOutputPortEx(VM* theVM, int argc, const Object* argv);
135     Object outputPortBufferModeEx(VM* theVM, int argc, const Object* argv);
136     Object fileStatCtimeEx(VM* theVM, int argc, const Object* argv);
137     Object fileStatAtimeEx(VM* theVM, int argc, const Object* argv);
138     Object fileStatMtimeEx(VM* theVM, int argc, const Object* argv);
139     Object fileSizeInBytesEx(VM* theVM, int argc, const Object* argv);
140     Object fileExecutablePEx(VM* theVM, int argc, const Object* argv);
141     Object fileReadablePEx(VM* theVM, int argc, const Object* argv);
142     Object fileWritablePEx(VM* theVM, int argc, const Object* argv);
143     Object fileRegularPEx(VM* theVM, int argc, const Object* argv);
144     Object fileSymbolicLinkPEx(VM* theVM, int argc, const Object* argv);
145     Object fileDirectoryPEx(VM* theVM, int argc, const Object* argv);
146     Object createSymbolicLinkEx(VM* theVM, int argc, const Object* argv);
147     Object renameFileEx(VM* theVM, int argc, const Object* argv);
148     Object deleteDirectoryEx(VM* theVM, int argc, const Object* argv);
149     Object createDirectoryEx(VM* theVM, int argc, const Object* argv);
150     Object fileTostringEx(VM* theVM, int argc, const Object* argv);
151 } // namespace scheme
152 
153 #endif // SCHEME_PORT_PROCEDURES_
154