#ifndef STGIO_H
#define STGIO_H
-/* Decls for routines in ghc/runtime/io/ only used there.
+/* Decls for routines in ghc/lib/cbits/ only used there.
* This file is used when compiling the Haskell library
* that _ccalls_ those routines; and when compiling those
* routines (to check consistency).
*/
/* closeFile.lc */
-StgInt closeFile PROTO((StgAddr));
+StgInt closeFile PROTO((StgForeignObj));
/* createDirectory.lc */
StgInt createDirectory PROTO((StgByteArray));
int execvpe PROTO((char *, char **, char **));
/* fileEOF.lc */
-StgInt fileEOF PROTO((StgAddr));
-
+StgInt fileEOF PROTO((StgForeignObj));
/* fileGetc.lc */
-StgInt fileGetc PROTO((StgAddr));
+StgInt fileGetc PROTO((StgForeignObj));
/* fileLookAhead.lc */
-StgInt fileLookAhead PROTO((StgAddr));
+StgInt fileLookAhead PROTO((StgForeignObj));
/* filePosn.lc */
-StgInt getFilePosn PROTO((StgAddr));
-StgInt setFilePosn PROTO((StgAddr, StgInt));
+StgInt getFilePosn PROTO((StgForeignObj));
+StgInt setFilePosn PROTO((StgForeignObj, StgInt));
/* filePutc.lc */
-StgInt filePutc PROTO((StgAddr, StgInt));
+StgInt filePutc PROTO((StgForeignObj, StgInt));
/* fileSize.lc */
-StgInt fileSize PROTO((StgAddr, StgByteArray));
+StgInt fileSize PROTO((StgForeignObj, StgByteArray));
/* flushFile.lc */
-StgInt flushFile PROTO((StgAddr));
+StgInt flushFile PROTO((StgForeignObj));
+
+/* freeFile.lc */
+void freeStdChannel PROTO((StgForeignObj));
+void freeFile PROTO((StgForeignObj));
/* getBufferMode.lc */
-StgInt getBufferMode PROTO((StgAddr));
+StgInt getBufferMode PROTO((StgForeignObj));
/* getClockTime.lc */
StgInt getClockTime PROTO((StgByteArray, StgByteArray));
+StgAddr showTime PROTO((I_, StgByteArray, StgByteArray));
+StgAddr toClockSec PROTO((I_, I_, I_, I_, I_, I_, I_, StgByteArray));
+StgAddr toLocalTime PROTO((I_, StgByteArray, StgByteArray));
+StgAddr toUTCTime PROTO((I_, StgByteArray, StgByteArray));
/* getCPUTime.lc */
StgByteArray getCPUTime PROTO((StgByteArray));
+StgInt clockTicks();
/* getCurrentDirectory.lc */
StgAddr getCurrentDirectory(STG_NO_ARGS);
/* getLock.lc */
int lockFile PROTO((int, int));
-void unlockFile PROTO((int));
-StgInt getLock PROTO((StgAddr, StgInt));
+int unlockFile PROTO((int));
+StgInt getLock PROTO((StgForeignObj, StgInt));
/* inputReady.lc */
-StgInt inputReady PROTO((StgAddr));
+StgInt inputReady PROTO((StgForeignObj));
/* openFile.lc */
StgAddr openFile PROTO((StgByteArray, StgByteArray));
/* readFile.lc */
-StgInt readBlock PROTO((StgAddr, StgAddr, StgInt));
-StgInt readLine PROTO((StgAddr, StgAddr, StgInt));
-StgInt readChar PROTO((StgAddr));
+StgInt readBlock PROTO((StgAddr, StgForeignObj, StgInt));
+StgInt readLine PROTO((StgAddr, StgForeignObj, StgInt));
+StgInt readChar PROTO((StgForeignObj));
/* removeDirectory.lc */
StgInt removeDirectory PROTO((StgByteArray));
StgInt renameFile PROTO((StgByteArray, StgByteArray));
/* seekFile.lc */
-StgInt seekFile PROTO((StgAddr, StgInt, StgInt, StgByteArray));
-StgInt seekFileP PROTO((StgAddr));
+StgInt seekFile PROTO((StgForeignObj, StgInt, StgInt, StgByteArray));
+StgInt seekFileP PROTO((StgForeignObj));
/* setBuffering.lc */
-StgInt setBuffering PROTO((StgAddr, StgInt));
+StgInt setBuffering PROTO((StgForeignObj, StgInt));
/* setCurrentDirectory.lc */
StgInt setCurrentDirectory PROTO((StgByteArray));
StgAddr toClockSec PROTO((StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgByteArray));
/* writeFile.lc */
-StgInt writeFile PROTO((StgAddr, StgAddr, StgInt));
-
-/* SOCKET THINGS ALL TOGETHER: */
-
-#if 0
-LATER
-/* acceptSocket.lc */
-StgInt acceptSocket(I_ sockfd, A_ peer, A_ addrlen);
-
-/* bindSocket.lc */
-StgInt bindSocket(I_ sockfd, A_ myaddr, I_ addrlen, I_ isUnixDomain);
-
-/* connectSocket.lc */
-StgInt connectSocket(I_ sockfd, A_ servaddr, I_ addrlen, I_ isUnixDomain);
-
-/* createSocket.lc */
-StgInt createSocket(I_ family, I_ type, I_ protocol);
-
-/* getPeerName.lc */
-StgInt getPeerName(int sockfd, struct sockaddr *peer, int *namelen);
-
-/* getSockName.lc */
-StgInt getSockName(int sockfd, struct sockaddr *peer, int *namelen);
-
-/* listenSocket.lc */
-StgInt listenSocket(int sockfd, int backlog);
-
-/* readDescriptor.lc */
-StgInt readDescriptor(int fd, char *buf, int nbytes);
-
-/* shutdownSocket.lc */
-StgInt shutdownSocket(int sockfd, int how);
-
-/* writeDescriptor.lc */
-StgInt writeDescriptor(int fd, char *buf, int nbytes);
-#endif /* 0 */
+StgInt writeFile PROTO((StgAddr, StgForeignObj, StgInt));
#endif /* ! STGIO_H */