03020097f2603ba0610b25ec46a28dd2ac65cf40
[ghc-hetmet.git] / ghc / lib / std / cbits / stgio.h
1 #ifndef STGIO_H
2 #define STGIO_H
3
4 /* Decls for routines in ghc/lib/cbits/ only used there.
5  * This file is used when compiling the Haskell library
6  * that _ccalls_ those routines; and when compiling those
7  * routines (to check consistency).
8  */
9
10 /* closeFile.lc */
11 StgInt closeFile PROTO((StgForeignObj));
12
13 /* createDirectory.lc */
14 StgInt createDirectory PROTO((StgByteArray));
15
16 /* directoryAux.lc */
17 StgAddr openDir__ PROTO((StgByteArray));
18 StgAddr readDir__ PROTO((StgAddr));
19
20 /* echoAux.lc */
21 StgInt setTerminalEcho PROTO((StgForeignObj, StgInt));
22 StgInt getTerminalEcho PROTO((StgForeignObj));
23 StgInt isTerminalDevice PROTO((StgForeignObj));
24
25 /* env.lc */
26 char *  strDup          PROTO((const char *));
27 int     setenviron      PROTO((char **));
28 int     copyenv         (STG_NO_ARGS);
29 int     _setenv         PROTO((char *));
30 int     delenv          PROTO((char *));
31
32 /* errno.lc */
33 extern  int ghc_errno;
34 extern  int ghc_errtype;
35 void    cvtErrno(STG_NO_ARGS);
36 void    stdErrno(STG_NO_ARGS);
37
38 /* execvpe.lc */
39 int     execvpe PROTO((char *, char **, char **));
40
41 /* fileEOF.lc */
42 StgInt  fileEOF PROTO((StgForeignObj));
43 /* fileGetc.lc */
44 StgInt  fileGetc PROTO((StgForeignObj));
45
46 /* fileLookAhead.lc */
47 StgInt  fileLookAhead PROTO((StgForeignObj));
48
49 /* filePosn.lc */
50 StgInt  getFilePosn PROTO((StgForeignObj));
51 StgInt  setFilePosn PROTO((StgForeignObj, StgInt));
52
53 /* filePutc.lc */
54 StgInt  filePutc    PROTO((StgForeignObj, StgInt));
55
56 /* fileSize.lc */
57 StgInt  fileSize    PROTO((StgForeignObj, StgByteArray));
58
59 /* flushFile.lc */
60 StgInt  flushFile   PROTO((StgForeignObj));
61
62 /* freeFile.lc */
63 void freeStdFile PROTO((StgForeignObj));
64 void freeFile PROTO((StgForeignObj));
65
66 /* getBufferMode.lc */
67 StgInt  getBufferMode PROTO((StgForeignObj));
68
69 /* getClockTime.lc */
70 StgInt  getClockTime PROTO((StgByteArray, StgByteArray));
71 StgAddr showTime     PROTO((I_, StgByteArray, StgByteArray));
72 StgAddr toClockSec   PROTO((I_, I_, I_, I_, I_, I_, I_, StgByteArray));
73 StgAddr toLocalTime  PROTO((I_, StgByteArray, StgByteArray));
74 StgAddr toUTCTime    PROTO((I_, StgByteArray, StgByteArray));
75
76 /* getCPUTime.lc */
77 StgByteArray getCPUTime PROTO((StgByteArray));
78 StgInt clockTicks();
79
80 /* getCurrentDirectory.lc */
81 StgAddr getCurrentDirectory(STG_NO_ARGS);
82
83 /* getLock.lc */
84 int     lockFile    PROTO((int, int));
85 int     unlockFile  PROTO((int));
86 StgInt  getLock     PROTO((StgForeignObj, StgInt));
87
88 /* inputReady.lc */
89 StgInt  inputReady  PROTO((StgForeignObj,StgInt));
90
91 /* openFile.lc */
92 StgAddr openFile PROTO((StgByteArray, StgByteArray));
93 StgAddr openFd   PROTO((StgInt, StgByteArray));
94
95 /* readFile.lc */
96 StgInt  readBlock PROTO((StgAddr, StgForeignObj, StgInt));
97 StgInt  readLine PROTO((StgAddr,  StgForeignObj, StgInt));
98 StgInt  readChar PROTO((StgForeignObj));
99
100 /* removeDirectory.lc */
101 StgInt removeDirectory PROTO((StgByteArray));
102
103 /* removeFile.lc */
104 StgInt removeFile PROTO((StgByteArray));
105
106 /* renameDirectory.lc */
107 StgInt renameDirectory PROTO((StgByteArray, StgByteArray));
108
109 /* renameFile.lc */
110 StgInt renameFile PROTO((StgByteArray, StgByteArray));
111
112 /* seekFile.lc */
113 StgInt  seekFile  PROTO((StgForeignObj, StgInt, StgInt, StgByteArray));
114 StgInt  seekFileP PROTO((StgForeignObj));
115
116 /* setBuffering.lc */
117 StgInt  setBuffering PROTO((StgForeignObj, StgInt));
118
119 /* setCurrentDirectory.lc */
120 StgInt setCurrentDirectory PROTO((StgByteArray));
121
122 /* showTime.lc */
123 StgAddr showTime PROTO((StgInt, StgByteArray, StgByteArray));
124
125 /* system.lc */
126 StgInt  systemCmd PROTO((StgByteArray));
127
128 /* toLocalTime.lc */
129 StgAddr toLocalTime PROTO((StgInt, StgByteArray, StgByteArray));
130
131 /* toUTCTime.lc */
132 StgAddr toUTCTime PROTO((StgInt, StgByteArray, StgByteArray));
133
134 /* toClockSec.lc */
135 StgAddr toClockSec PROTO((StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgByteArray));
136
137 /* writeFile.lc */
138 StgInt  writeFile PROTO((StgAddr, StgForeignObj, StgInt));
139
140 #endif /* ! STGIO_H */