4 #include "fileObject.h"
6 /* Decls for routines in ghc/lib/cbits/ only used there.
7 * This file is used when compiling the Haskell library
8 * that _ccalls_ those routines; and when compiling those
9 * routines (to check consistency).
13 StgAddr allocMemory__ PROTO((StgInt));
16 StgInt closeFile PROTO((StgForeignObj,StgInt));
18 /* createDirectory.lc */
19 StgInt createDirectory PROTO((StgByteArray));
22 StgAddr openDir__ PROTO((StgByteArray));
23 StgAddr readDir__ PROTO((StgAddr));
26 StgInt setTerminalEcho PROTO((StgForeignObj, StgInt));
27 StgInt getTerminalEcho PROTO((StgForeignObj));
28 StgInt isTerminalDevice PROTO((StgForeignObj));
31 char * strDup PROTO((const char *));
32 int setenviron PROTO((char **));
33 int copyenv (STG_NO_ARGS);
34 int _setenv PROTO((char *));
35 int delenv PROTO((char *));
39 extern int ghc_errtype;
40 void cvtErrno(STG_NO_ARGS);
41 void stdErrno(STG_NO_ARGS);
42 StgAddr getErrStr__(STG_NO_ARGS);
43 StgInt getErrNo__(STG_NO_ARGS);
44 StgInt getErrType__(STG_NO_ARGS);
47 int execvpe PROTO((char *, char **, char **));
50 StgInt fileEOF PROTO((StgForeignObj));
52 StgInt fileGetc PROTO((StgForeignObj));
54 /* fileLookAhead.lc */
55 StgInt fileLookAhead PROTO((StgForeignObj));
56 StgInt ungetChar PROTO((StgForeignObj,StgChar));
59 void setBufFlags PROTO((StgForeignObj, StgInt));
60 void setBufWPtr PROTO((StgForeignObj, StgInt));
61 StgInt getBufWPtr PROTO((StgForeignObj));
62 void setBuf PROTO((StgForeignObj, StgAddr, StgInt));
63 StgAddr getBuf PROTO((StgForeignObj));
64 StgAddr getWriteableBuf PROTO((StgForeignObj));
65 StgAddr getBufStart PROTO((StgForeignObj,StgInt));
66 StgInt getBufSize PROTO((StgForeignObj));
67 void setFilePtr PROTO((StgForeignObj, StgAddr));
68 StgAddr getFilePtr PROTO((StgForeignObj));
69 void setConnectedTo PROTO((StgForeignObj, StgForeignObj, StgInt));
70 void setPushbackBufSize PROTO((StgInt));
71 StgInt getPushbackBufSize (STG_NO_ARGS);
72 void setNonBlockingIOFlag__ PROTO((StgForeignObj));
73 void clearNonBlockingIOFlag__ PROTO((StgForeignObj));
74 void setConnNonBlockingIOFlag__ PROTO((StgForeignObj));
75 void clearConnNonBlockingIOFlag__ PROTO((StgForeignObj));
76 StgInt getFileFd PROTO((StgForeignObj));
77 StgInt getConnFileFd PROTO((StgForeignObj));
80 StgInt getFilePosn PROTO((StgForeignObj));
81 StgInt setFilePosn PROTO((StgForeignObj, StgInt));
84 StgInt filePutc PROTO((StgForeignObj, StgChar));
87 StgInt fileSize PROTO((StgForeignObj, StgByteArray));
90 StgInt flushFile PROTO((StgForeignObj));
91 StgInt flushBuffer PROTO((StgForeignObj));
92 StgInt flushReadBuffer PROTO((StgForeignObj));
93 void flushConnectedHandle PROTO((StgForeignObj));
96 void freeStdFile PROTO((StgForeignObj));
97 void freeFile PROTO((StgForeignObj));
98 void freeStdFileObject PROTO((StgForeignObj));
99 void freeFileObject PROTO((StgForeignObj));
101 /* getBufferMode.lc */
102 StgInt getBufferMode PROTO((StgForeignObj));
104 /* getClockTime.lc */
105 StgInt getClockTime PROTO((StgByteArray, StgByteArray));
106 StgAddr showTime PROTO((I_, StgByteArray, StgByteArray));
107 StgAddr toClockSec PROTO((I_, I_, I_, I_, I_, I_, I_, StgByteArray));
108 StgAddr toLocalTime PROTO((I_, StgByteArray, StgByteArray));
109 StgAddr toUTCTime PROTO((I_, StgByteArray, StgByteArray));
112 StgByteArray getCPUTime PROTO((StgByteArray));
115 /* getCurrentDirectory.lc */
116 StgAddr getCurrentDirectory(STG_NO_ARGS);
119 int lockFile PROTO((int, int));
120 int unlockFile PROTO((int));
121 StgInt getLock PROTO((StgInt, StgInt));
124 StgInt inputReady PROTO((StgForeignObj,StgInt));
127 IOFileObject* openFile PROTO((StgByteArray, StgInt, StgInt, StgInt));
128 IOFileObject* openFd PROTO((StgInt, StgInt, StgInt));
129 IOFileObject* openStdFile PROTO((StgInt, StgInt, StgInt));
132 StgInt readBlock PROTO((StgForeignObj));
133 StgInt readChunk PROTO((StgForeignObj,StgAddr,StgInt));
134 StgInt readLine PROTO((StgForeignObj));
135 StgInt readChar PROTO((StgForeignObj));
137 /* removeDirectory.lc */
138 StgInt removeDirectory PROTO((StgByteArray));
141 StgInt removeFile PROTO((StgByteArray));
143 /* renameDirectory.lc */
144 StgInt renameDirectory PROTO((StgByteArray, StgByteArray));
147 StgInt renameFile PROTO((StgByteArray, StgByteArray));
150 StgInt seekFile PROTO((StgForeignObj, StgInt, StgInt, StgByteArray));
151 StgInt seekFileP PROTO((StgForeignObj));
153 /* setBuffering.lc */
154 StgInt setBuffering PROTO((StgForeignObj, StgInt));
156 /* setCurrentDirectory.lc */
157 StgInt setCurrentDirectory PROTO((StgByteArray));
160 StgAddr showTime PROTO((StgInt, StgByteArray, StgByteArray));
163 StgInt systemCmd PROTO((StgByteArray));
166 StgAddr toLocalTime PROTO((StgInt, StgByteArray, StgByteArray));
169 StgAddr toUTCTime PROTO((StgInt, StgByteArray, StgByteArray));
172 StgAddr toClockSec PROTO((StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgByteArray));
175 void writeErrString__ PROTO((StgAddr, StgByteArray, StgInt));
177 StgInt writeFile PROTO((StgAddr, StgForeignObj, StgInt));
178 StgInt writeBuf PROTO((StgForeignObj, StgAddr, StgInt));
179 StgInt writeBufBA PROTO((StgForeignObj, StgByteArray, StgInt));
180 StgInt writeFileObject PROTO((StgForeignObj, StgInt));
181 StgInt writeBuffer PROTO((StgForeignObj, StgInt));
183 #endif /* ! STGIO_H */