[project @ 2001-01-11 17:25:56 by simonmar]
authorsimonmar <unknown>
Thu, 11 Jan 2001 17:25:59 +0000 (17:25 +0000)
committersimonmar <unknown>
Thu, 11 Jan 2001 17:25:59 +0000 (17:25 +0000)
commitefa881239effd5ea4cb403c2c03ebb09fbdfd363
tree4df44109399eba37e4c7843115ceaf8d4f45614b
parente18bb2e86eb13bdb98cc0afc7c2aa8e56d98bcc7
[project @ 2001-01-11 17:25:56 by simonmar]
Re-organisation of ghc/lib/std and hslibs/lang
----------------------------------------------

In brief: move deprecated features out of ghc/lib/std and into
hslibs/lang, move new FFI libraries into ghc/lib/std and start
using them.

- foreign import may now return an unboxed type (this was
  advertised to work before, but in fact didn't).  Subsequent
  cleanups in PrelInt/PrelWord.

- Ptr is now defined in ghc/lib/std/PrelPtr.lhs.  Ptr is no
  longer a newtype of Addr, it is defined directly in terms of
  Addr#.

- PrelAddr has disappeared from ghc/lib/std, all uses of Addr in
  ghc/lib/std have been replaced with Ptr.  The definitions of
  Addr has been moved to hslibs/lang/Addr.lhs, as has
  lots of other Addr-related stuff.

- ForeignObj has been removed from ghc/lib/std, and replaced with
  ForeignPtr.  The definition of ForeignObj has been moved to
  hslibs/lang/ForeignObj.lhs.

- Most of the new FFI has been moved into ghc/lib/std in the form
  of modules PrelMarshalAlloc, PrelCString, PrelCError,
  PrelMarshalError, PrelMarshalArray, PrelMarshalUtils,
  PrelCTypes, PrelCTypesISO, and PrelStorable.  The corresponding
  modules in hslibs/lang simply re-export the contents of these
  modules.

- PrelPosixTypes defines a few POSIX types (CMode == mode_t,
  etc.)

- PrelCError changed to access errno using foreign label and peek
  (the POSIX book I have says that errno is guaranteed to be an
  extern int, so this should be OK until I get around to making
  errno thread-safe).

- Hacked the macros that generate the code for CTypes and
  CTypesISO to generate much less code
  (ghc/lib/std/cbits/CTypes.h).

- RtsAPI is now a bit more honest when it comes to building heap
  objects (it uses the correct constructors).

- the Bits class and related stuff has been moved to ghc/lib/std
  (it was simpler this way).

- Directory and System have been converted to use the new FFI.
48 files changed:
ghc/compiler/prelude/PrelNames.lhs
ghc/compiler/prelude/TysWiredIn.lhs
ghc/compiler/typecheck/TcForeign.lhs
ghc/compiler/typecheck/TcInstDcls.lhs
ghc/driver/PackageSrc.hs
ghc/includes/RtsAPI.h
ghc/lib/std/CPUTime.lhs
ghc/lib/std/Directory.hsc [moved from ghc/lib/std/Directory.lhs with 55% similarity]
ghc/lib/std/Makefile
ghc/lib/std/PrelAddr.lhs [deleted file]
ghc/lib/std/PrelBits.lhs [new file with mode: 0644]
ghc/lib/std/PrelByteArr.lhs
ghc/lib/std/PrelCError.lhs [new file with mode: 0644]
ghc/lib/std/PrelCString.lhs [new file with mode: 0644]
ghc/lib/std/PrelCTypes.lhs [new file with mode: 0644]
ghc/lib/std/PrelCTypesISO.lhs [new file with mode: 0644]
ghc/lib/std/PrelDynamic.lhs
ghc/lib/std/PrelForeign.lhs
ghc/lib/std/PrelHandle.lhs
ghc/lib/std/PrelIO.lhs
ghc/lib/std/PrelIOBase.lhs
ghc/lib/std/PrelInt.lhs
ghc/lib/std/PrelMarshalAlloc.lhs [new file with mode: 0644]
ghc/lib/std/PrelMarshalArray.lhs [new file with mode: 0644]
ghc/lib/std/PrelMarshalError.lhs [new file with mode: 0644]
ghc/lib/std/PrelMarshalUtils.lhs [new file with mode: 0644]
ghc/lib/std/PrelPack.lhs
ghc/lib/std/PrelPosixTypes.hsc [new file with mode: 0644]
ghc/lib/std/PrelPtr.lhs [new file with mode: 0644]
ghc/lib/std/PrelStorable.lhs [new file with mode: 0644]
ghc/lib/std/PrelWeak.lhs
ghc/lib/std/PrelWord.lhs
ghc/lib/std/System.lhs
ghc/lib/std/Time.lhs
ghc/lib/std/cbits/CTypes.h [new file with mode: 0644]
ghc/lib/std/cbits/createDirectory.c [deleted file]
ghc/lib/std/cbits/directoryAux.c [deleted file]
ghc/lib/std/cbits/getCurrentDirectory.c [deleted file]
ghc/lib/std/cbits/getDirectoryContents.c [deleted file]
ghc/lib/std/cbits/progargs.c
ghc/lib/std/cbits/removeDirectory.c [deleted file]
ghc/lib/std/cbits/removeFile.c [deleted file]
ghc/lib/std/cbits/renameDirectory.c [deleted file]
ghc/lib/std/cbits/renameFile.c [deleted file]
ghc/lib/std/cbits/setCurrentDirectory.c [deleted file]
ghc/rts/Prelude.h
ghc/rts/RtsAPI.c
ghc/rts/RtsAPIDeprec.c [new file with mode: 0644]