-/*
- * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
+/* -----------------------------------------------------------------------------
+ * $Id: stgio.h,v 1.21 2000/05/28 17:47:27 panne Exp $
*
- * $Id: stgio.h,v 1.13 1999/09/30 12:42:26 sof Exp $
+ * (c) The GRASP/AQUA Project, Glasgow University, 1994-1999
*
* Helper code for GHC's IO subsystem.
- */
+ *
+ * ---------------------------------------------------------------------------*/
#ifndef STGIO_H
#define STGIO_H
+#include "stgerror.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
- * routines (to check consistency).
+/* Function prototypes for the I/O subsytem...
*/
-#include "error.h"
-
/* closeFile.c */
StgAddr allocMemory__ (StgInt);
void flushConnectedBuf (StgForeignPtr);
/* freeFile.c */
-void freeStdFile (StgForeignPtr);
-void freeFile (StgForeignPtr);
-void freeStdFileObject (StgForeignPtr);
-void freeFileObject (StgForeignPtr);
+void freeStdFile (StgAddr);
+void freeStdFileObject (StgAddr);
+void freeFileObject (StgAddr);
StgAddr ref_freeStdFileObject (void);
StgAddr ref_freeFileObject (void);
StgInt prim_getClockTime(StgByteArray, StgByteArray);
/* getCPUTime.c */
-StgByteArray getCPUTime (StgByteArray);
+StgInt getCPUTime (StgByteArray);
StgInt clockTicks(void);
/* getCurrentDirectory.c */
/* readFile.c */
StgInt readBlock (StgForeignPtr);
-StgInt readChunk (StgForeignPtr,StgAddr,StgInt);
+StgInt readChunk (StgForeignPtr,StgAddr,StgInt,StgInt);
StgInt readLine (StgForeignPtr);
StgInt readChar (StgForeignPtr);
StgInt systemCmd (StgByteArray);
/* timezone.c */
-StgInt get_tm_sec ( StgAddr );
-StgInt get_tm_min ( StgAddr );
-StgInt get_tm_hour ( StgAddr );
-StgInt get_tm_mday ( StgAddr );
-StgInt get_tm_mon ( StgAddr );
-StgInt get_tm_year ( StgAddr );
-StgInt get_tm_wday ( StgAddr );
-StgInt get_tm_yday ( StgAddr );
-StgInt get_tm_isdst ( StgAddr );
-StgAddr prim_ZONE ( StgAddr );
-StgInt prim_GMTOFF ( StgAddr );
-StgInt prim_SETZONE ( StgAddr, StgAddr );
-StgInt sizeof_word ( void );
-StgInt sizeof_struct_tm ( void );
-StgInt sizeof_time_t ( void );
-char* get_ZONE ( StgAddr );
+StgInt get_tm_sec ( StgAddr );
+StgInt get_tm_min ( StgAddr );
+StgInt get_tm_hour ( StgAddr );
+StgInt get_tm_mday ( StgAddr );
+StgInt get_tm_mon ( StgAddr );
+StgInt get_tm_year ( StgAddr );
+StgInt get_tm_wday ( StgAddr );
+StgInt get_tm_yday ( StgAddr );
+StgInt get_tm_isdst ( StgAddr );
+StgAddr prim_ZONE ( StgAddr );
+StgInt prim_GMTOFF ( StgAddr );
+void prim_SETZONE ( StgAddr, StgAddr );
+StgInt sizeof_word ( void );
+StgInt sizeof_struct_tm ( void );
+StgInt sizeof_time_t ( void );
+char* get_ZONE ( StgAddr );
/* toLocalTime.c */
-StgAddr toLocalTime (StgInt, StgByteArray, StgByteArray);
+StgInt toLocalTime (StgInt, StgByteArray, StgByteArray);
StgInt prim_toLocalTime ( StgInt64,StgByteArray );
/* toUTCTime.c */
-StgAddr toUTCTime (StgInt, StgByteArray, StgByteArray);
+StgInt toUTCTime (StgInt, StgByteArray, StgByteArray);
StgInt prim_toUTCTime ( StgInt64,StgByteArray );
/* toClockSec.c */
StgInt toClockSec (StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgByteArray);
/* writeError.c */
+StgAddr addrOf_ErrorHdrHook(void);
void writeErrString__ (StgAddr, StgByteArray, StgInt);
+
/* writeFile.c */
-StgInt writeBuf (StgForeignPtr, StgAddr, StgInt);
-StgInt writeBufBA (StgForeignPtr, StgByteArray, StgInt);
+StgInt writeBuf (StgForeignPtr, StgAddr, StgInt, StgInt);
+StgInt writeBufBA (StgForeignPtr, StgByteArray, StgInt, StgInt);
StgInt writeFileObject (StgForeignPtr, StgInt);
StgInt writeBuffer (StgForeignPtr, StgInt);
+StgInt write_ (StgForeignPtr ptr, StgAddr buf, StgInt len);
#endif /* ! STGIO_H */