[project @ 2000-05-28 17:47:27 by panne]
[ghc-hetmet.git] / ghc / lib / std / cbits / stgio.h
index 8dfa5c2..c551226 100644 (file)
@@ -1,24 +1,21 @@
-/* 
- * (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);
 
@@ -120,10 +117,9 @@ StgInt     flushReadBuffer (StgForeignPtr);
 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);
@@ -136,7 +132,7 @@ StgInt      getClockTime (StgByteArray, StgByteArray);
 StgInt  prim_getClockTime(StgByteArray, StgByteArray);
 
 /* getCPUTime.c */
-StgByteArray getCPUTime (StgByteArray);
+StgInt getCPUTime (StgByteArray);
 StgInt clockTicks(void);
 
 /* getCurrentDirectory.c */
@@ -164,7 +160,7 @@ StgInt  get_prog_argc(void);
 
 /* readFile.c */
 StgInt readBlock (StgForeignPtr);
-StgInt readChunk (StgForeignPtr,StgAddr,StgInt);
+StgInt readChunk (StgForeignPtr,StgAddr,StgInt,StgInt);
 StgInt readLine  (StgForeignPtr);
 StgInt readChar  (StgForeignPtr);
 
@@ -202,41 +198,44 @@ StgInt showTime (StgInt, StgByteArray, StgInt, StgByteArray);
 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 */