/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: fileGetc.c,v 1.3 1998/12/02 13:27:23 simonm Exp $
+ * $Id: fileGetc.c,v 1.4 1999/11/26 16:25:55 simonmar Exp $
*
* hGetChar Runtime Support
*/
#include "Rts.h"
#include "stgio.h"
-#include "error.h"
#define EOT 4
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: fileObject.c,v 1.7 1999/11/23 14:38:40 simonmar Exp $
+ * $Id: fileObject.c,v 1.8 1999/11/26 16:25:56 simonmar Exp $
*
* hPutStr Runtime Support
*/
#include "Rts.h"
#include "stgio.h"
-#include "fileObject.h"
#include <stdio.h>
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: filePutc.c,v 1.9 1999/11/25 16:54:14 simonmar Exp $
+ * $Id: filePutc.c,v 1.10 1999/11/26 16:25:56 simonmar Exp $
*
* hPutChar Runtime Support
*/
#include "Rts.h"
#include "stgio.h"
-#include "error.h"
#if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
#define USE_WINSOCK
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: freeFile.c,v 1.7 1999/11/25 16:54:14 simonmar Exp $
+ * $Id: freeFile.c,v 1.8 1999/11/26 16:25:56 simonmar Exp $
*
* Giving up files
*/
#include "Rts.h"
#include "stgio.h"
-#include "fileObject.h"
#if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
#define USE_WINSOCK
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: openFile.c,v 1.11 1999/11/25 16:54:14 simonmar Exp $
+ * $Id: openFile.c,v 1.12 1999/11/26 16:25:56 simonmar Exp $
*
* openFile Runtime Support
*/
#include "Rts.h"
#include "stgio.h"
-#include "fileObject.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
-/*
- * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
+/* -----------------------------------------------------------------------------
+ * $Id: stgerror.h,v 1.1 1999/11/26 16:25:56 simonmar Exp $
*
- * $Id: error.h,v 1.3 1998/12/02 13:27:21 simonm Exp $
+ * (c) The GRASP/AQUA Project, Glasgow University, 1994-1999
*
* Error codes used by the IO subsystem.
- */
+ *
+ * ---------------------------------------------------------------------------*/
+
+#ifndef STGERROR_H
+#define STGERROR_H
#define ERR_ALREADYEXISTS 1
#define ERR_HARDWAREFAULT 2
#define GHC_EVERSION -111
#define GHC_EWOULDBLOCK -112
#define GHC_EXDEV -113
+
+#endif /* STGERROR_H */
-/*
- * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
+/* -----------------------------------------------------------------------------
+ * $Id: stgio.h,v 1.15 1999/11/26 16:25:56 simonmar Exp $
*
- * $Id: stgio.h,v 1.14 1999/09/30 15:50:03 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);
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: toClockSec.c,v 1.4 1999/09/19 19:21:22 sof Exp $
+ * $Id: toClockSec.c,v 1.5 1999/11/26 16:25:56 simonmar Exp $
*
* toClockSec Runtime Support
*/
#include "Rts.h"
-#include "timezone.h"
#include "stgio.h"
+#include "timezone.h"
StgInt
toClockSec(I_ year, I_ mon, I_ mday, I_ hour, I_ min, I_ sec, I_ isdst, StgByteArray res)
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: toLocalTime.c,v 1.3 1998/12/02 13:28:02 simonm Exp $
+ * $Id: toLocalTime.c,v 1.4 1999/11/26 16:25:56 simonmar Exp $
*
* toCalendarTime Runtime Support
*/
#include "Rts.h"
-#include "timezone.h"
#include "stgio.h"
+#include "timezone.h"
StgAddr
toLocalTime(I_ size, StgByteArray d, StgByteArray res)
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: toUTCTime.c,v 1.3 1998/12/02 13:28:04 simonm Exp $
+ * $Id: toUTCTime.c,v 1.4 1999/11/26 16:25:57 simonmar Exp $
*
* toUTCTime Runtime Support
*/
#include "Rts.h"
-#include "timezone.h"
#include "stgio.h"
+#include "timezone.h"
StgAddr
toUTCTime(I_ size, StgByteArray d, StgByteArray res)
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: writeFile.c,v 1.10 1999/11/25 16:54:15 simonmar Exp $
+ * $Id: writeFile.c,v 1.11 1999/11/26 16:25:57 simonmar Exp $
*
* hPutStr Runtime Support
*/
) {
/* Flush buffer */
rc = writeFileObject(ptr, fo->bufWPtr);
+ /* ToDo: undo buffer fill if we're blocking.. */
if (rc != 0) {
return rc;
}