[project @ 1998-11-11 17:40:07 by sof]
[ghc-hetmet.git] / ghc / lib / std / cbits / stgio.h
1 #ifndef STGIO_H
2 #define STGIO_H
3
4 #include "fileObject.h"
5
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).
10  */
11
12 /* closeFile.lc */
13 StgAddr allocMemory__ PROTO((StgInt));
14
15 /* closeFile.lc */
16 StgInt closeFile PROTO((StgForeignObj,StgInt));
17
18 /* createDirectory.lc */
19 StgInt createDirectory PROTO((StgByteArray));
20
21 /* directoryAux.lc */
22 StgAddr openDir__ PROTO((StgByteArray));
23 StgAddr readDir__ PROTO((StgAddr));
24
25 /* echoAux.lc */
26 StgInt setTerminalEcho PROTO((StgForeignObj, StgInt));
27 StgInt getTerminalEcho PROTO((StgForeignObj));
28 StgInt isTerminalDevice PROTO((StgForeignObj));
29
30 /* env.lc */
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 *));
36
37 /* errno.lc */
38 extern  int ghc_errno;
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);
45
46 /* execvpe.lc */
47 int     execvpe PROTO((char *, char **, char **));
48
49 /* fileEOF.lc */
50 StgInt  fileEOF PROTO((StgForeignObj));
51 /* fileGetc.lc */
52 StgInt  fileGetc PROTO((StgForeignObj));
53
54 /* fileLookAhead.lc */
55 StgInt  fileLookAhead PROTO((StgForeignObj));
56 StgInt  ungetChar PROTO((StgForeignObj,StgChar));
57
58 /* fileObject.lc */
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));
78
79 /* filePosn.lc */
80 StgInt  getFilePosn PROTO((StgForeignObj));
81 StgInt  setFilePosn PROTO((StgForeignObj, StgInt));
82
83 /* filePutc.lc */
84 StgInt  filePutc    PROTO((StgForeignObj, StgChar));
85
86 /* fileSize.lc */
87 StgInt  fileSize    PROTO((StgForeignObj, StgByteArray));
88
89 /* flushFile.lc */
90 StgInt  flushFile   PROTO((StgForeignObj));
91 StgInt  flushBuffer PROTO((StgForeignObj));
92 StgInt  flushReadBuffer PROTO((StgForeignObj));
93
94 /* freeFile.lc */
95 void freeStdFile PROTO((StgForeignObj));
96 void freeFile PROTO((StgForeignObj));
97 void freeStdFileObject PROTO((StgForeignObj));
98 void freeFileObject PROTO((StgForeignObj));
99
100 /* getBufferMode.lc */
101 StgInt  getBufferMode PROTO((StgForeignObj));
102
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));
109
110 /* getCPUTime.lc */
111 StgByteArray getCPUTime PROTO((StgByteArray));
112 StgInt clockTicks();
113
114 /* getCurrentDirectory.lc */
115 StgAddr getCurrentDirectory(STG_NO_ARGS);
116
117 /* getLock.lc */
118 int     lockFile    PROTO((int, int));
119 int     unlockFile  PROTO((int));
120 StgInt  getLock     PROTO((StgInt, StgInt));
121
122 /* inputReady.lc */
123 StgInt  inputReady  PROTO((StgForeignObj,StgInt));
124
125 /* openFile.lc */
126 IOFileObject* openFile    PROTO((StgByteArray, StgInt, StgInt, StgInt));
127 IOFileObject* openFd      PROTO((StgInt, StgInt, StgInt));
128 IOFileObject* openStdFile PROTO((StgInt, StgInt, StgInt));
129
130 /* readFile.lc */
131 StgInt  readBlock PROTO((StgForeignObj));
132 StgInt  readChunk PROTO((StgForeignObj,StgAddr,StgInt));
133 StgInt  readLine PROTO((StgForeignObj));
134 StgInt  readChar PROTO((StgForeignObj));
135
136 /* removeDirectory.lc */
137 StgInt removeDirectory PROTO((StgByteArray));
138
139 /* removeFile.lc */
140 StgInt removeFile PROTO((StgByteArray));
141
142 /* renameDirectory.lc */
143 StgInt renameDirectory PROTO((StgByteArray, StgByteArray));
144
145 /* renameFile.lc */
146 StgInt renameFile PROTO((StgByteArray, StgByteArray));
147
148 /* seekFile.lc */
149 StgInt  seekFile  PROTO((StgForeignObj, StgInt, StgInt, StgByteArray));
150 StgInt  seekFileP PROTO((StgForeignObj));
151
152 /* setBuffering.lc */
153 StgInt  setBuffering PROTO((StgForeignObj, StgInt));
154
155 /* setCurrentDirectory.lc */
156 StgInt setCurrentDirectory PROTO((StgByteArray));
157
158 /* showTime.lc */
159 StgAddr showTime PROTO((StgInt, StgByteArray, StgByteArray));
160
161 /* system.lc */
162 StgInt  systemCmd PROTO((StgByteArray));
163
164 /* toLocalTime.lc */
165 StgAddr toLocalTime PROTO((StgInt, StgByteArray, StgByteArray));
166
167 /* toUTCTime.lc */
168 StgAddr toUTCTime PROTO((StgInt, StgByteArray, StgByteArray));
169
170 /* toClockSec.lc */
171 StgAddr toClockSec PROTO((StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgByteArray));
172
173 /* writeError.lc */
174 void    writeErrString__ PROTO((StgAddr, StgByteArray, StgInt));
175 /* writeFile.lc */
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));
181
182 #endif /* ! STGIO_H */