[project @ 2001-05-18 14:18:34 by simonmar]
[ghc-hetmet.git] / ghc / lib / std / cbits / fileEOF.c
index ba97822..ac0f114 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
  *
- * $Id: fileEOF.c,v 1.1 1998/04/10 10:54:21 simonm Exp $
+ * $Id: fileEOF.c,v 1.4 1999/11/25 16:54:14 simonmar Exp $
  *
  * hIsEOF Runtime Support
  */
 #include "stgio.h"
 
 StgInt
-fileEOF(StgAddr fp)
+fileEOF(StgForeignPtr ptr)
 {
-    if (fileLookAhead(fp) != EOF)
+    IOFileObject* fo = (IOFileObject*)ptr;
+
+    if ( FILEOBJ_IS_EOF(fo) )
+       return 1;
+
+    if (fileLookAhead(ptr) != EOF)
        return 0;
     else if (ghc_errtype == ERR_EOF)
        return 1;