-- Stability : provisional
-- Portability : non-portable (requires POSIX)
--
--- POSIX data types
+-- POSIX data types: Haskell equivalents of the types defined by the
+-- @\<sys/types.h>@ C header on a POSIX system.
--
-----------------------------------------------------------------------------
+#include "config.h"
+
module System.Posix.Types (
+
+ -- * POSIX data types
CDev(..), CIno(..), CMode(..), COff(..), CPid(..), CSsize(..),
#ifndef mingw32_TARGET_OS
CGid(..), CNlink(..), CSsize(..), CUid(..), CCc(..), CSpeed(..),
- CTcflag(..), CBlkCnt(..),
+ CTcflag(..),
#endif
Fd(..),
+#ifndef mingw32_TARGET_OS
+ LinkCount,
+ UserID,
+ GroupID,
+#endif
+
ByteCount,
ClockTick,
EpochTime,
FileOffset,
- GroupID,
- LinkCount,
ProcessID,
ProcessGroupID,
- UserID,
DeviceID,
FileID,
FileMode
#include "Dynamic.h"
#include "CTypes.h"
-#include "config.h"
NUMERIC_TYPE(CDev,tyConCDev,"CDev",HTYPE_DEV_T)
INTEGRAL_TYPE(CIno,tyConCIno,"CIno",HTYPE_INO_T)
NUMERIC_TYPE(CCc,tyConCCc,"CCc",HTYPE_CC_T)
NUMERIC_TYPE(CSpeed,tyConCSpeed,"CSpeed",HTYPE_SPEED_T)
INTEGRAL_TYPE(CTcflag,tyConCTcflag,"CTcflag",HTYPE_TCFLAG_T)
-INTEGRAL_TYPE(CBlkCnt,tyConBlkCnd,"CBlkCnt",HTYPE_BLKCNT_T)
#endif
+-- ToDo: blksize_t, clockid_t, blkcnt_t, fsblkcnt_t, fsfilcnt_t, id_t, key_t
+-- suseconds_t, timer_t, useconds_t
+
-- Make an Fd type rather than using CInt everywhere
INTEGRAL_TYPE(Fd,tyConFd,"Fd",CInt)
-- nicer names, and backwards compatibility with POSIX library:
+#ifndef mingw32_TARGET_OS
+type LinkCount = CNlink
+type UserID = CUid
+type GroupID = CGid
+#endif
+
type ByteCount = CSize
type ClockTick = CClock
type EpochTime = CTime
-type LinkCount = CNlink
type DeviceID = CDev
type FileID = CIno
type FileMode = CMode
type ProcessID = CPid
-type UserID = CUid
-type GroupID = CGid
type FileOffset = COff
type ProcessGroupID = CPid