From f689ae053903e329575df22990e97c8d5cc54717 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 26 Nov 1999 16:25:57 +0000 Subject: [PATCH] [project @ 1999-11-26 16:25:55 by simonmar] Rename error.h to stgerror.h --- ghc/lib/std/cbits/fileGetc.c | 3 +-- ghc/lib/std/cbits/fileObject.c | 3 +-- ghc/lib/std/cbits/filePutc.c | 3 +-- ghc/lib/std/cbits/freeFile.c | 3 +-- ghc/lib/std/cbits/openFile.c | 3 +-- ghc/lib/std/cbits/{error.h => stgerror.h} | 14 ++++++++++---- ghc/lib/std/cbits/stgio.h | 17 +++++++---------- ghc/lib/std/cbits/toClockSec.c | 4 ++-- ghc/lib/std/cbits/toLocalTime.c | 4 ++-- ghc/lib/std/cbits/toUTCTime.c | 4 ++-- ghc/lib/std/cbits/writeFile.c | 3 ++- 11 files changed, 30 insertions(+), 31 deletions(-) rename ghc/lib/std/cbits/{error.h => stgerror.h} (90%) diff --git a/ghc/lib/std/cbits/fileGetc.c b/ghc/lib/std/cbits/fileGetc.c index 3431d49..0be92e7 100644 --- a/ghc/lib/std/cbits/fileGetc.c +++ b/ghc/lib/std/cbits/fileGetc.c @@ -1,14 +1,13 @@ /* * (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 diff --git a/ghc/lib/std/cbits/fileObject.c b/ghc/lib/std/cbits/fileObject.c index de789e9..30bfe17 100644 --- a/ghc/lib/std/cbits/fileObject.c +++ b/ghc/lib/std/cbits/fileObject.c @@ -1,14 +1,13 @@ /* * (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 diff --git a/ghc/lib/std/cbits/filePutc.c b/ghc/lib/std/cbits/filePutc.c index f2ce4a9..a95cbf1 100644 --- a/ghc/lib/std/cbits/filePutc.c +++ b/ghc/lib/std/cbits/filePutc.c @@ -1,14 +1,13 @@ /* * (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 diff --git a/ghc/lib/std/cbits/freeFile.c b/ghc/lib/std/cbits/freeFile.c index aaf492f..ffe5723 100644 --- a/ghc/lib/std/cbits/freeFile.c +++ b/ghc/lib/std/cbits/freeFile.c @@ -1,14 +1,13 @@ /* * (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 diff --git a/ghc/lib/std/cbits/openFile.c b/ghc/lib/std/cbits/openFile.c index d1b0d6d..90ae2d8 100644 --- a/ghc/lib/std/cbits/openFile.c +++ b/ghc/lib/std/cbits/openFile.c @@ -1,7 +1,7 @@ /* * (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 */ @@ -11,7 +11,6 @@ #include "Rts.h" #include "stgio.h" -#include "fileObject.h" #ifdef HAVE_SYS_TYPES_H #include diff --git a/ghc/lib/std/cbits/error.h b/ghc/lib/std/cbits/stgerror.h similarity index 90% rename from ghc/lib/std/cbits/error.h rename to ghc/lib/std/cbits/stgerror.h index 9473fd3..225194b 100644 --- a/ghc/lib/std/cbits/error.h +++ b/ghc/lib/std/cbits/stgerror.h @@ -1,10 +1,14 @@ -/* - * (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 @@ -139,3 +143,5 @@ #define GHC_EVERSION -111 #define GHC_EWOULDBLOCK -112 #define GHC_EXDEV -113 + +#endif /* STGERROR_H */ diff --git a/ghc/lib/std/cbits/stgio.h b/ghc/lib/std/cbits/stgio.h index 1c5f2a1..a80db36 100644 --- a/ghc/lib/std/cbits/stgio.h +++ b/ghc/lib/std/cbits/stgio.h @@ -1,24 +1,21 @@ -/* - * (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); diff --git a/ghc/lib/std/cbits/toClockSec.c b/ghc/lib/std/cbits/toClockSec.c index 742e814..b461fba 100644 --- a/ghc/lib/std/cbits/toClockSec.c +++ b/ghc/lib/std/cbits/toClockSec.c @@ -1,14 +1,14 @@ /* * (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) diff --git a/ghc/lib/std/cbits/toLocalTime.c b/ghc/lib/std/cbits/toLocalTime.c index 1304805..c2b7bb7 100644 --- a/ghc/lib/std/cbits/toLocalTime.c +++ b/ghc/lib/std/cbits/toLocalTime.c @@ -1,14 +1,14 @@ /* * (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) diff --git a/ghc/lib/std/cbits/toUTCTime.c b/ghc/lib/std/cbits/toUTCTime.c index a9f9280..44b598a 100644 --- a/ghc/lib/std/cbits/toUTCTime.c +++ b/ghc/lib/std/cbits/toUTCTime.c @@ -1,14 +1,14 @@ /* * (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) diff --git a/ghc/lib/std/cbits/writeFile.c b/ghc/lib/std/cbits/writeFile.c index f5ae542..108ce99 100644 --- a/ghc/lib/std/cbits/writeFile.c +++ b/ghc/lib/std/cbits/writeFile.c @@ -1,7 +1,7 @@ /* * (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 */ @@ -116,6 +116,7 @@ writeBuf(StgForeignPtr ptr, StgAddr buf, StgInt len) ) { /* Flush buffer */ rc = writeFileObject(ptr, fo->bufWPtr); + /* ToDo: undo buffer fill if we're blocking.. */ if (rc != 0) { return rc; } -- 1.7.10.4