[project @ 2002-08-29 11:29:40 by simonmar]
[ghc-base.git] / Foreign / C / Types.hs
index eaffa3c..e953d4a 100644 (file)
@@ -1,16 +1,14 @@
 {-# OPTIONS -fno-implicit-prelude #-}
 -----------------------------------------------------------------------------
--- 
+-- |
 -- Module      :  Foreign.C.Types
 -- Copyright   :  (c) The FFI task force 2001
--- License     :  BSD-style (see the file libraries/core/LICENSE)
+-- License     :  BSD-style (see the file libraries/base/LICENSE)
 -- 
 -- Maintainer  :  ffi@haskell.org
 -- Stability   :  provisional
 -- Portability :  portable
 --
--- $Id: Types.hs,v 1.3 2002/02/05 17:32:25 simonmar Exp $
---
 -- Mapping of C types to corresponding Haskell types. A cool hack...
 --
 -----------------------------------------------------------------------------
@@ -20,14 +18,25 @@ module Foreign.C.Types
          -- Typeable, Storable, Bounded, Real, Integral, Bits
          CChar(..),  CSChar(..),  CUChar(..)
        , CShort(..), CUShort(..), CInt(..),   CUInt(..)
-       , CLong(..),  CULong(..),  CLLong(..), CULLong(..)
+       , CLong(..),  CULong(..)
+       , CPtrdiff(..), CSize(..), CWchar(..), CSigAtomic(..)
+#ifndef __HUGS__
+        , CLLong(..), CULLong(..)
+#endif
+         -- Numeric types, instances of: Eq, Ord, Num, Read, Show, Enum,
+         -- Typeable, Storable
+       , CClock(..),   CTime(..)
 
          -- Floating types, instances of: Eq, Ord, Num, Read, Show, Enum,
          -- Typeable, Storable, Real, Fractional, Floating, RealFrac,
          -- RealFloat 
        , CFloat(..),  CDouble(..), CLDouble(..)
+
+          -- Instances of: Eq and Storable
+       , CFile,        CFpos,     CJmpBuf
        ) where
 
+import Foreign.C.TypesISO
 import Data.Bits       ( Bits(..) )
 import Data.Int                ( Int8,  Int16,  Int32,  Int64  )
 import Data.Word       ( Word8, Word16, Word32, Word64 )
@@ -43,6 +52,7 @@ import GHC.Read
 import GHC.Num
 #endif
 
+#include "Dynamic.h"
 #include "CTypes.h"
 
 INTEGRAL_TYPE(CChar,tyConCChar,"CChar",HTYPE_CHAR)
@@ -58,8 +68,10 @@ INTEGRAL_TYPE(CUInt,tyConCUInt,"CUInt",HTYPE_UNSIGNED_INT)
 INTEGRAL_TYPE(CLong,tyConCLong,"CLong",HTYPE_LONG)
 INTEGRAL_TYPE(CULong,tyConCULong,"CULong",HTYPE_UNSIGNED_LONG)
 
+#ifndef __HUGS__
 INTEGRAL_TYPE(CLLong,tyConCLLong,"CLLong",HTYPE_LONG_LONG)
 INTEGRAL_TYPE(CULLong,tyConCULLong,"CULLong",HTYPE_UNSIGNED_LONG_LONG)
+#endif
 
 {-# RULES
 "fromIntegral/a->CChar"   fromIntegral = \x -> CChar   (fromIntegral x)
@@ -92,24 +104,3 @@ FLOATING_TYPE(CDouble,tyConCDouble,"CDouble",HTYPE_DOUBLE)
 -- HACK: Currently no long double in the FFI, so we simply re-use double
 FLOATING_TYPE(CLDouble,tyConCLDouble,"CLDouble",HTYPE_DOUBLE)
 
-
-#include "Dynamic.h"
-INSTANCE_TYPEABLE0(CChar,cCharTc,"CChar")
-INSTANCE_TYPEABLE0(CSChar,cSCharTc,"CSChar")
-INSTANCE_TYPEABLE0(CUChar,cUCharTc,"CUChar")
-
-INSTANCE_TYPEABLE0(CShort,cShortTc,"CShort")
-INSTANCE_TYPEABLE0(CUShort,cUShortTc,"CUShort")
-
-INSTANCE_TYPEABLE0(CInt,cIntTc,"CInt")
-INSTANCE_TYPEABLE0(CUInt,cUIntTc,"CUInt")
-
-INSTANCE_TYPEABLE0(CLong,cLongTc,"CLong")
-INSTANCE_TYPEABLE0(CULong,cULongTc,"CULong")
-
-INSTANCE_TYPEABLE0(CLLong,cLLongTc,"CLLong")
-INSTANCE_TYPEABLE0(CULLong,cULLongTc,"CULLong")
-
-INSTANCE_TYPEABLE0(CFloat,cFloatTc,"CFloat")
-INSTANCE_TYPEABLE0(CDouble,cDoubleTc,"CDouble")
-INSTANCE_TYPEABLE0(CLDouble,cLDoubleTc,"CLDouble")