[project @ 1998-05-12 16:40:09 by sof]
[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 /* env.lc */
21 char *  strDup          PROTO((const char *));
22 int     setenviron      PROTO((char **));
23 int     copyenv         (STG_NO_ARGS);
24 int     _setenv         PROTO((char *));
25 int     delenv          PROTO((char *));
26
27 /* errno.lc */
28 extern  int ghc_errno;
29 extern  int ghc_errtype;
30 void    cvtErrno(STG_NO_ARGS);
31 void    stdErrno(STG_NO_ARGS);
32
33 /* execvpe.lc */
34 int     execvpe PROTO((char *, char **, char **));
35
36 /* fileEOF.lc */
37 StgInt  fileEOF PROTO((StgForeignObj));
38 /* fileGetc.lc */
39 StgInt  fileGetc PROTO((StgForeignObj));
40
41 /* fileLookAhead.lc */
42 StgInt  fileLookAhead PROTO((StgForeignObj));
43
44 /* filePosn.lc */
45 StgInt  getFilePosn PROTO((StgForeignObj));
46 StgInt  setFilePosn PROTO((StgForeignObj, StgInt));
47
48 /* filePutc.lc */
49 StgInt  filePutc    PROTO((StgForeignObj, StgInt));
50
51 /* fileSize.lc */
52 StgInt  fileSize    PROTO((StgForeignObj, StgByteArray));
53
54 /* flushFile.lc */
55 StgInt  flushFile   PROTO((StgForeignObj));
56
57 /* freeFile.lc */
58 void freeStdFile PROTO((StgForeignObj));
59 void freeFile PROTO((StgForeignObj));
60
61 /* getBufferMode.lc */
62 StgInt  getBufferMode PROTO((StgForeignObj));
63
64 /* getClockTime.lc */
65 StgInt  getClockTime PROTO((StgByteArray, StgByteArray));
66 StgAddr showTime     PROTO((I_, StgByteArray, StgByteArray));
67 StgAddr toClockSec   PROTO((I_, I_, I_, I_, I_, I_, I_, StgByteArray));
68 StgAddr toLocalTime  PROTO((I_, StgByteArray, StgByteArray));
69 StgAddr toUTCTime    PROTO((I_, StgByteArray, StgByteArray));
70
71 /* getCPUTime.lc */
72 StgByteArray getCPUTime PROTO((StgByteArray));
73 StgInt clockTicks();
74
75 /* getCurrentDirectory.lc */
76 StgAddr getCurrentDirectory(STG_NO_ARGS);
77
78 /* getLock.lc */
79 int     lockFile    PROTO((int, int));
80 int     unlockFile  PROTO((int));
81 StgInt  getLock     PROTO((StgForeignObj, StgInt));
82
83 /* inputReady.lc */
84 StgInt  inputReady  PROTO((StgForeignObj,StgInt));
85
86 /* openFile.lc */
87 StgAddr openFile PROTO((StgByteArray, StgByteArray));
88 StgAddr openFd   PROTO((StgInt, StgByteArray));
89
90 /* readFile.lc */
91 StgInt  readBlock PROTO((StgAddr, StgForeignObj, StgInt));
92 StgInt  readLine PROTO((StgAddr,  StgForeignObj, StgInt));
93 StgInt  readChar PROTO((StgForeignObj));
94
95 /* removeDirectory.lc */
96 StgInt removeDirectory PROTO((StgByteArray));
97
98 /* removeFile.lc */
99 StgInt removeFile PROTO((StgByteArray));
100
101 /* renameDirectory.lc */
102 StgInt renameDirectory PROTO((StgByteArray, StgByteArray));
103
104 /* renameFile.lc */
105 StgInt renameFile PROTO((StgByteArray, StgByteArray));
106
107 /* seekFile.lc */
108 StgInt  seekFile  PROTO((StgForeignObj, StgInt, StgInt, StgByteArray));
109 StgInt  seekFileP PROTO((StgForeignObj));
110
111 /* setBuffering.lc */
112 StgInt  setBuffering PROTO((StgForeignObj, StgInt));
113
114 /* setCurrentDirectory.lc */
115 StgInt setCurrentDirectory PROTO((StgByteArray));
116
117 /* showTime.lc */
118 StgAddr showTime PROTO((StgInt, StgByteArray, StgByteArray));
119
120 /* system.lc */
121 StgInt  systemCmd PROTO((StgByteArray));
122
123 /* toLocalTime.lc */
124 StgAddr toLocalTime PROTO((StgInt, StgByteArray, StgByteArray));
125
126 /* toUTCTime.lc */
127 StgAddr toUTCTime PROTO((StgInt, StgByteArray, StgByteArray));
128
129 /* toClockSec.lc */
130 StgAddr toClockSec PROTO((StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgByteArray));
131
132 /* writeFile.lc */
133 StgInt  writeFile PROTO((StgAddr, StgForeignObj, StgInt));
134
135 #endif /* ! STGIO_H */