[project @ 1998-08-14 12:42:01 by sof]
[ghc-hetmet.git] / ghc / lib / std / cbits / stgio.h
index 0302009..1a2071f 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef STGIO_H
 #define STGIO_H
 
+#include "fileObject.h"
+
 /* 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
@@ -8,7 +10,10 @@
  */
 
 /* closeFile.lc */
-StgInt closeFile PROTO((StgForeignObj));
+StgAddr allocMemory__ PROTO((StgInt));
+
+/* closeFile.lc */
+StgInt closeFile PROTO((StgForeignObj,StgInt));
 
 /* createDirectory.lc */
 StgInt createDirectory PROTO((StgByteArray));
@@ -34,6 +39,9 @@ extern        int ghc_errno;
 extern int ghc_errtype;
 void   cvtErrno(STG_NO_ARGS);
 void   stdErrno(STG_NO_ARGS);
+StgAddr getErrStr__(STG_NO_ARGS);
+StgInt  getErrNo__(STG_NO_ARGS);
+StgInt  getErrType__(STG_NO_ARGS);
 
 /* execvpe.lc */
 int    execvpe PROTO((char *, char **, char **));
@@ -45,6 +53,28 @@ StgInt       fileGetc PROTO((StgForeignObj));
 
 /* fileLookAhead.lc */
 StgInt fileLookAhead PROTO((StgForeignObj));
+StgInt ungetChar PROTO((StgForeignObj,StgInt));
+
+/* fileObject.lc */
+void    setBufFlags PROTO((StgForeignObj, StgInt));
+void    setBufWPtr  PROTO((StgForeignObj, StgInt));
+StgInt  getBufWPtr  PROTO((StgForeignObj));
+void    setBuf      PROTO((StgForeignObj, StgAddr, StgInt));
+StgAddr getBuf      PROTO((StgForeignObj));
+StgAddr getWriteableBuf PROTO((StgForeignObj));
+StgAddr getBufStart PROTO((StgForeignObj,StgInt));
+StgInt  getBufSize  PROTO((StgForeignObj));
+void    setFilePtr  PROTO((StgForeignObj, StgAddr));
+StgAddr getFilePtr  PROTO((StgForeignObj));
+void    setConnectedTo  PROTO((StgForeignObj, StgForeignObj, StgInt));
+void    setPushbackBufSize PROTO((StgInt));
+StgInt  getPushbackBufSize (STG_NO_ARGS);
+void    setNonBlockingIOFlag__ PROTO((StgForeignObj));
+void    clearNonBlockingIOFlag__ PROTO((StgForeignObj));
+void    setConnNonBlockingIOFlag__ PROTO((StgForeignObj));
+void    clearConnNonBlockingIOFlag__ PROTO((StgForeignObj));
+StgInt  getFileFd  PROTO((StgForeignObj));
+StgInt  getConnFileFd  PROTO((StgForeignObj));
 
 /* filePosn.lc */
 StgInt getFilePosn PROTO((StgForeignObj));
@@ -58,10 +88,14 @@ StgInt      fileSize    PROTO((StgForeignObj, StgByteArray));
 
 /* flushFile.lc */
 StgInt flushFile   PROTO((StgForeignObj));
+StgInt flushBuffer PROTO((StgForeignObj));
+StgInt flushReadBuffer PROTO((StgForeignObj));
 
 /* freeFile.lc */
 void freeStdFile PROTO((StgForeignObj));
 void freeFile PROTO((StgForeignObj));
+void freeStdFileObject PROTO((StgForeignObj));
+void freeFileObject PROTO((StgForeignObj));
 
 /* getBufferMode.lc */
 StgInt getBufferMode PROTO((StgForeignObj));
@@ -83,18 +117,20 @@ StgAddr getCurrentDirectory(STG_NO_ARGS);
 /* getLock.lc */
 int     lockFile    PROTO((int, int));
 int     unlockFile  PROTO((int));
-StgInt getLock     PROTO((StgForeignObj, StgInt));
+StgInt getLock     PROTO((StgInt, StgInt));
 
 /* inputReady.lc */
 StgInt inputReady  PROTO((StgForeignObj,StgInt));
 
 /* openFile.lc */
-StgAddr openFile PROTO((StgByteArray, StgByteArray));
-StgAddr openFd   PROTO((StgInt, StgByteArray));
+IOFileObject* openFile    PROTO((StgByteArray, StgInt, StgInt, StgInt));
+IOFileObject* openFd      PROTO((StgInt, StgInt, StgInt));
+IOFileObject* openStdFile PROTO((StgInt, StgInt, StgInt));
 
 /* readFile.lc */
-StgInt readBlock PROTO((StgAddr, StgForeignObj, StgInt));
-StgInt readLine PROTO((StgAddr,  StgForeignObj, StgInt));
+StgInt readBlock PROTO((StgForeignObj));
+StgInt readChunk PROTO((StgForeignObj,StgAddr,StgInt));
+StgInt readLine PROTO((StgForeignObj));
 StgInt readChar PROTO((StgForeignObj));
 
 /* removeDirectory.lc */
@@ -134,7 +170,13 @@ StgAddr toUTCTime PROTO((StgInt, StgByteArray, StgByteArray));
 /* toClockSec.lc */
 StgAddr toClockSec PROTO((StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgByteArray));
 
+/* writeError.lc */
+void    writeErrString__ PROTO((StgAddr, StgByteArray, StgInt));
 /* writeFile.lc */
 StgInt writeFile PROTO((StgAddr, StgForeignObj, StgInt));
+StgInt writeBuf  PROTO((StgForeignObj, StgAddr, StgInt));
+StgInt writeBufBA  PROTO((StgForeignObj, StgByteArray, StgInt));
+StgInt writeFileObject PROTO((StgForeignObj, StgInt));
+StgInt writeBuffer PROTO((StgForeignObj, StgInt));
 
 #endif /* ! STGIO_H */