1 {-# OPTIONS_GHC -XNoImplicitPrelude #-}
2 -----------------------------------------------------------------------------
4 -- Module : System.Posix.Types
5 -- Copyright : (c) The University of Glasgow 2002
6 -- License : BSD-style (see the file libraries/base/LICENSE)
8 -- Maintainer : libraries@haskell.org
9 -- Stability : provisional
10 -- Portability : non-portable (requires POSIX)
12 -- POSIX data types: Haskell equivalents of the types defined by the
13 -- @\<sys\/types.h>@ C header on a POSIX system.
15 -----------------------------------------------------------------------------
28 #define HTYPE_TCFLAG_T
34 #include "HsBaseConfig.h"
37 module System.Posix.Types (
40 #if defined(HTYPE_DEV_T)
43 #if defined(HTYPE_INO_T)
46 #if defined(HTYPE_MODE_T)
49 #if defined(HTYPE_OFF_T)
52 #if defined(HTYPE_PID_T)
55 #if defined(HTYPE_SSIZE_T)
59 #if defined(HTYPE_GID_T)
62 #if defined(HTYPE_NLINK_T)
65 #if defined(HTYPE_UID_T)
68 #if defined(HTYPE_CC_T)
71 #if defined(HTYPE_SPEED_T)
74 #if defined(HTYPE_TCFLAG_T)
77 #if defined(HTYPE_RLIM_T)
83 #if defined(HTYPE_NLINK_T)
86 #if defined(HTYPE_UID_T)
89 #if defined(HTYPE_GID_T)
106 import NHC.PosixTypes
115 #ifdef __GLASGOW_HASKELL__
129 #if defined(HTYPE_DEV_T)
130 ARITHMETIC_TYPE(CDev,tyConCDev,"CDev",HTYPE_DEV_T)
132 #if defined(HTYPE_INO_T)
133 INTEGRAL_TYPE(CIno,tyConCIno,"CIno",HTYPE_INO_T)
135 #if defined(HTYPE_MODE_T)
136 INTEGRAL_TYPE(CMode,tyConCMode,"CMode",HTYPE_MODE_T)
138 #if defined(HTYPE_OFF_T)
139 INTEGRAL_TYPE(COff,tyConCOff,"COff",HTYPE_OFF_T)
141 #if defined(HTYPE_PID_T)
142 INTEGRAL_TYPE(CPid,tyConCPid,"CPid",HTYPE_PID_T)
145 #if defined(HTYPE_SSIZE_T)
146 INTEGRAL_TYPE(CSsize,tyConCSsize,"CSsize",HTYPE_SSIZE_T)
149 #if defined(HTYPE_GID_T)
150 INTEGRAL_TYPE(CGid,tyConCGid,"CGid",HTYPE_GID_T)
152 #if defined(HTYPE_NLINK_T)
153 INTEGRAL_TYPE(CNlink,tyConCNlink,"CNlink",HTYPE_NLINK_T)
156 #if defined(HTYPE_UID_T)
157 INTEGRAL_TYPE(CUid,tyConCUid,"CUid",HTYPE_UID_T)
159 #if defined(HTYPE_CC_T)
160 ARITHMETIC_TYPE(CCc,tyConCCc,"CCc",HTYPE_CC_T)
162 #if defined(HTYPE_SPEED_T)
163 ARITHMETIC_TYPE(CSpeed,tyConCSpeed,"CSpeed",HTYPE_SPEED_T)
165 #if defined(HTYPE_TCFLAG_T)
166 INTEGRAL_TYPE(CTcflag,tyConCTcflag,"CTcflag",HTYPE_TCFLAG_T)
168 #if defined(HTYPE_RLIM_T)
169 INTEGRAL_TYPE(CRLim,tyConCRlim,"CRLim",HTYPE_RLIM_T)
172 -- ToDo: blksize_t, clockid_t, blkcnt_t, fsblkcnt_t, fsfilcnt_t, id_t, key_t
173 -- suseconds_t, timer_t, useconds_t
175 -- Make an Fd type rather than using CInt everywhere
176 INTEGRAL_TYPE(Fd,tyConFd,"Fd",CInt)
178 -- nicer names, and backwards compatibility with POSIX library:
179 #if defined(HTYPE_NLINK_T)
180 type LinkCount = CNlink
182 #if defined(HTYPE_UID_T)
185 #if defined(HTYPE_GID_T)
189 #endif /* !__NHC__ */
191 type ByteCount = CSize
192 type ClockTick = CClock
193 type EpochTime = CTime
196 type FileMode = CMode
197 type ProcessID = CPid
198 type FileOffset = COff
199 type ProcessGroupID = CPid