summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits/dirUtils.c
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-02-12 15:17:36 +0000
committersimonmar <unknown>2002-02-12 15:17:36 +0000
commit2cc5b907318f97e19b28b2ad8ed9ff8c1f401dcc (patch)
tree2fefe09bc63464ac3a28ea37b61eefc5e506685a /ghc/lib/std/cbits/dirUtils.c
parent239e9471e104fd88ec93bf42623c3a68a496657a (diff)
downloadhaskell-2cc5b907318f97e19b28b2ad8ed9ff8c1f401dcc.tar.gz
[project @ 2002-02-12 15:17:13 by simonmar]
Switch over to the new hierarchical libraries --------------------------------------------- This commit reorganises our libraries to use the new hierarchical module namespace extension. The basic story is this: - fptools/libraries contains the new hierarchical libraries. Everything in here is "clean", i.e. most deprecated stuff has been removed. - fptools/libraries/base is the new base package (replacing "std") and contains roughly what was previously in std, lang, and concurrent, minus deprecated stuff. Things that are *not allowed* in libraries/base include: Addr, ForeignObj, ByteArray, MutableByteArray, _casm_, _ccall_, ``'', PrimIO For ByteArrays and MutableByteArrays we use UArray and STUArray/IOUArray respectively now. Modules previously called PrelFoo are now under fptools/libraries/GHC. eg. PrelBase is now GHC.Base. - fptools/libraries/haskell98 provides the Haskell 98 std. libraries (Char, IO, Numeric etc.) as a package. This package is enabled by default. - fptools/libraries/network is a rearranged version of the existing net package (the old package net is still available; see below). - Other packages will migrate to fptools/libraries in due course. NB. you need to checkout fptools/libraries as well as fptools/hslibs now. The nightly build scripts will need to be tweaked. - fptools/hslibs still contains (almost) the same stuff as before. Where libraries have moved into the new hierarchy, the hslibs version contains a "stub" that just re-exports the new version. The idea is that code will gradually migrate from fptools/hslibs into fptools/libraries as it gets cleaned up, and in a version or two we can remove the old packages altogether. - I've taken the opportunity to make some changes to the build system, ripping out the old hslibs Makefile stuff from mk/target.mk; the new package building Makefile code is in mk/package.mk (auto-included from mk/target.mk). The main improvement is that packages now register themselves at make boot time using ghc-pkg, and the monolithic package.conf in ghc/driver is gone. I've updated the standard packages but haven't tested win32, graphics, xlib, object-io, or OpenGL yet. The Makefiles in these packages may need some further tweaks, and they'll need pkg.conf.in files added. - Unfortunately all this rearrangement meant I had to bump the interface-file version and create a bunch of .hi-boot-6 files :-(
Diffstat (limited to 'ghc/lib/std/cbits/dirUtils.c')
-rw-r--r--ghc/lib/std/cbits/dirUtils.c126
1 files changed, 0 insertions, 126 deletions
diff --git a/ghc/lib/std/cbits/dirUtils.c b/ghc/lib/std/cbits/dirUtils.c
deleted file mode 100644
index 4277797f56..0000000000
--- a/ghc/lib/std/cbits/dirUtils.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * (c) The GRASP/AQUA Project, Glasgow University, 1994-
- *
- * Directory Runtime Support
- */
-#include "dirUtils.h"
-
-#if defined(mingw32_TARGET_OS)
-#include <windows.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#ifdef HAVE_STDDEF_H
-# include <stddef.h>
-#endif
-#ifdef HAVE_ERRNO_H
-# include <errno.h>
-#endif
-
-HsInt
-prel_mkdir(HsAddr pathName, HsInt mode)
-{
-#if defined(mingw32_TARGET_OS)
- return mkdir(pathName);
-#else
- return mkdir(pathName,mode);
-#endif
-}
-
-HsInt
-prel_lstat(HsAddr fname, HsAddr st)
-{
-#ifdef HAVE_LSTAT
- return lstat((const char*)fname, (struct stat*)st);
-#else
- return stat((const char*)fname, (struct stat*)st);
-#endif
-}
-
-HsInt prel_s_ISDIR(mode_t m) {return S_ISDIR(m);}
-HsInt prel_s_ISREG(mode_t m) {return S_ISREG(m);}
-
-HsInt prel_path_max() { return PATH_MAX; }
-mode_t prel_R_OK() { return R_OK; }
-mode_t prel_W_OK() { return W_OK; }
-mode_t prel_X_OK() { return X_OK; }
-
-mode_t prel_S_IRUSR() { return S_IRUSR; }
-mode_t prel_S_IWUSR() { return S_IWUSR; }
-mode_t prel_S_IXUSR() { return S_IXUSR; }
-
-HsAddr prel_d_name(struct dirent* d)
-{
-#ifndef mingw32_TARGET_OS
- return (HsAddr)(&d->d_name);
-#else
- return (HsAddr)(d->d_name);
-#endif
-}
-
-HsInt prel_end_of_dir()
-{
-#ifndef mingw32_TARGET_OS
- return 0;
-#else
- return ENOENT;
-#endif
-}
-
-/*
- * read an entry from the directory stream; opt for the
- * re-entrant friendly way of doing this, if available.
- */
-HsInt
-prel_readdir(HsAddr dirPtr, HsAddr pDirEnt)
-{
- struct dirent **pDirE = (struct dirent**)pDirEnt;
-#if HAVE_READDIR_R
- struct dirent* p;
- int res;
- static unsigned int nm_max = -1;
-
- if (pDirE == NULL) {
- return -1;
- }
- if (nm_max == -1) {
-#ifdef NAME_MAX
- nm_max = NAME_MAX + 1;
-#else
- nm_max = pathconf(".", _PC_NAME_MAX);
- if (nm_max == -1) { nm_max = 255; }
- nm_max++;
-#endif
- }
- p = (struct dirent*)malloc(sizeof(struct dirent) + nm_max);
- if (p == NULL) return -1;
- res = readdir_r((DIR*)dirPtr, p, pDirE);
- if (res != 0) {
- *pDirE = NULL;
- free(p);
- }
- return res;
-#else
-
- if (pDirE == NULL) {
- return -1;
- }
-
- *pDirE = readdir((DIR*)dirPtr);
- if (*pDirE == NULL) {
- return -1;
- } else {
- return 0;
- }
-#endif
-}
-
-void
-prel_free_dirent(HsAddr dEnt)
-{
-#if HAVE_READDIR_R
- free(dEnt);
-#endif
-}