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));
95 void freeStdFile PROTO((StgForeignObj));
96 void freeFile PROTO((StgForeignObj));
97 void freeStdFileObject PROTO((StgForeignObj));
98 void freeFileObject PROTO((StgForeignObj));
100 /* getBufferMode.lc */
101 StgInt getBufferMode PROTO((StgForeignObj));
103 /* getClockTime.lc */
104 StgInt getClockTime PROTO((StgByteArray, StgByteArray));
105 StgAddr showTime PROTO((I_, StgByteArray, StgByteArray));
106 StgAddr toClockSec PROTO((I_, I_, I_, I_, I_, I_, I_, StgByteArray));
107 StgAddr toLocalTime PROTO((I_, StgByteArray, StgByteArray));
108 StgAddr toUTCTime PROTO((I_, StgByteArray, StgByteArray));
111 StgByteArray getCPUTime PROTO((StgByteArray));
114 /* getCurrentDirectory.lc */
115 StgAddr getCurrentDirectory(STG_NO_ARGS);
118 int lockFile PROTO((int, int));
119 int unlockFile PROTO((int));
120 StgInt getLock PROTO((StgInt, StgInt));
123 StgInt inputReady PROTO((StgForeignObj,StgInt));
126 IOFileObject* openFile PROTO((StgByteArray, StgInt, StgInt, StgInt));
127 IOFileObject* openFd PROTO((StgInt, StgInt, StgInt));
128 IOFileObject* openStdFile PROTO((StgInt, StgInt, StgInt));
131 StgInt readBlock PROTO((StgForeignObj));
132 StgInt readChunk PROTO((StgForeignObj,StgAddr,StgInt));
133 StgInt readLine PROTO((StgForeignObj));
134 StgInt readChar PROTO((StgForeignObj));
136 /* removeDirectory.lc */
137 StgInt removeDirectory PROTO((StgByteArray));
140 StgInt removeFile PROTO((StgByteArray));
142 /* renameDirectory.lc */
143 StgInt renameDirectory PROTO((StgByteArray, StgByteArray));
146 StgInt renameFile PROTO((StgByteArray, StgByteArray));
149 StgInt seekFile PROTO((StgForeignObj, StgInt, StgInt, StgByteArray));
150 StgInt seekFileP PROTO((StgForeignObj));
152 /* setBuffering.lc */
153 StgInt setBuffering PROTO((StgForeignObj, StgInt));
155 /* setCurrentDirectory.lc */
156 StgInt setCurrentDirectory PROTO((StgByteArray));
159 StgAddr showTime PROTO((StgInt, StgByteArray, StgByteArray));
162 StgInt systemCmd PROTO((StgByteArray));
165 StgAddr toLocalTime PROTO((StgInt, StgByteArray, StgByteArray));
168 StgAddr toUTCTime PROTO((StgInt, StgByteArray, StgByteArray));
171 StgAddr toClockSec PROTO((StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgByteArray));
174 void writeErrString__ PROTO((StgAddr, StgByteArray, StgInt));
176 StgInt writeFile PROTO((StgAddr, StgForeignObj, StgInt));
177 StgInt writeBuf PROTO((StgForeignObj, StgAddr, StgInt));
178 StgInt writeBufBA PROTO((StgForeignObj, StgByteArray, StgInt));
179 StgInt writeFileObject PROTO((StgForeignObj, StgInt));
180 StgInt writeBuffer PROTO((StgForeignObj, StgInt));
182 #endif /* ! STGIO_H */