[project @ 2001-09-14 11:25:57 by simonmar]
[ghc-base.git] / include / HsCore.h
index 1bce351..d07e829 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: HsCore.h,v 1.1 2001/06/28 14:15:04 simonmar Exp $
+ * $Id: HsCore.h,v 1.4 2001/09/14 11:25:57 simonmar Exp $
  *
  * Definitions for package `core' which are visible in Haskell land.
  *
@@ -9,6 +9,7 @@
 #define HSCORE_H
 
 #include "config.h"
+#include "HsFFI.h"
 
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+#ifdef HAVE_UTIME_H
+#include <utime.h>
+#endif
 #if defined(HAVE_GETTIMEOFDAY)
 #  ifdef HAVE_SYS_TIME_H
 #   include <sys/time.h>
 #include <vfork.h>
 #endif
 
+extern inline int s_isreg_wrap(m)  { return S_ISREG(m);  }
+extern inline int s_isdir_wrap(m)  { return S_ISDIR(m);  }
+extern inline int s_isfifo_wrap(m) { return S_ISFIFO(m); }
+extern inline int s_isblk_wrap(m)  { return S_ISBLK(m);  }
+extern inline int s_ischr_wrap(m)  { return S_ISCHR(m);  }
+#ifdef S_ISSOCK
+extern inline int s_issock_wrap(m) { return S_ISSOCK(m); }
+#endif
+
+extern inline void *
+memcpy_wrap_dst_off(char *dst, int dst_off, char *src, size_t sz)
+{ return memcpy(dst+dst_off, src, sz); }
+
+extern inline void *
+memcpy_wrap_src_off(char *dst, char *src, int src_off, size_t sz)
+{ return memcpy(dst, src+src_off, sz); }
+
+extern inline int
+read_ba_wrap(int fd, void *ptr, HsInt off, int size)
+{ return read(fd, ptr + off, size); }
+
+extern inline int
+write_wrap(int fd, void *ptr, HsInt off, int size)
+{ return write(fd, ptr + off, size); }
+
+extern inline int
+read_wrap(int fd, void *ptr, HsInt off, int size)
+{ return read(fd, ptr + off, size); }
+
 #include "lockFile.h"
 
 #include "HsFFI.h"
@@ -87,8 +126,4 @@ HsInt systemCmd(HsAddr cmd);
 /* in inputReady.c */
 int inputReady(int fd, int msecs);
 
-/* in progargs.c */
-HsAddr get_prog_argv(void);
-HsInt  get_prog_argc();
-
 #endif