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