4 , GeneralizedNewtypeDeriving
6 {-# OPTIONS_GHC -fno-warn-unused-binds #-}
8 -----------------------------------------------------------------------------
10 -- Module : System.Posix.Types
11 -- Copyright : (c) The University of Glasgow 2002
12 -- License : BSD-style (see the file libraries/base/LICENSE)
14 -- Maintainer : libraries@haskell.org
15 -- Stability : provisional
16 -- Portability : non-portable (requires POSIX)
18 -- POSIX data types: Haskell equivalents of the types defined by the
19 -- @\<sys\/types.h>@ C header on a POSIX system.
21 -----------------------------------------------------------------------------
34 #define HTYPE_TCFLAG_T
40 #include "HsBaseConfig.h"
43 module System.Posix.Types (
46 #if defined(HTYPE_DEV_T)
49 #if defined(HTYPE_INO_T)
52 #if defined(HTYPE_MODE_T)
55 #if defined(HTYPE_OFF_T)
58 #if defined(HTYPE_PID_T)
61 #if defined(HTYPE_SSIZE_T)
65 #if defined(HTYPE_GID_T)
68 #if defined(HTYPE_NLINK_T)
71 #if defined(HTYPE_UID_T)
74 #if defined(HTYPE_CC_T)
77 #if defined(HTYPE_SPEED_T)
80 #if defined(HTYPE_TCFLAG_T)
83 #if defined(HTYPE_RLIM_T)
89 #if defined(HTYPE_NLINK_T)
92 #if defined(HTYPE_UID_T)
95 #if defined(HTYPE_GID_T)
112 import NHC.PosixTypes
121 #ifdef __GLASGOW_HASKELL__
135 #if defined(HTYPE_DEV_T)
136 ARITHMETIC_TYPE(CDev,tyConCDev,"CDev",HTYPE_DEV_T)
138 #if defined(HTYPE_INO_T)
139 INTEGRAL_TYPE(CIno,tyConCIno,"CIno",HTYPE_INO_T)
141 #if defined(HTYPE_MODE_T)
142 INTEGRAL_TYPE(CMode,tyConCMode,"CMode",HTYPE_MODE_T)
144 #if defined(HTYPE_OFF_T)
145 INTEGRAL_TYPE(COff,tyConCOff,"COff",HTYPE_OFF_T)
147 #if defined(HTYPE_PID_T)
148 INTEGRAL_TYPE(CPid,tyConCPid,"CPid",HTYPE_PID_T)
151 #if defined(HTYPE_SSIZE_T)
152 INTEGRAL_TYPE(CSsize,tyConCSsize,"CSsize",HTYPE_SSIZE_T)
155 #if defined(HTYPE_GID_T)
156 INTEGRAL_TYPE(CGid,tyConCGid,"CGid",HTYPE_GID_T)
158 #if defined(HTYPE_NLINK_T)
159 INTEGRAL_TYPE(CNlink,tyConCNlink,"CNlink",HTYPE_NLINK_T)
162 #if defined(HTYPE_UID_T)
163 INTEGRAL_TYPE(CUid,tyConCUid,"CUid",HTYPE_UID_T)
165 #if defined(HTYPE_CC_T)
166 ARITHMETIC_TYPE(CCc,tyConCCc,"CCc",HTYPE_CC_T)
168 #if defined(HTYPE_SPEED_T)
169 ARITHMETIC_TYPE(CSpeed,tyConCSpeed,"CSpeed",HTYPE_SPEED_T)
171 #if defined(HTYPE_TCFLAG_T)
172 INTEGRAL_TYPE(CTcflag,tyConCTcflag,"CTcflag",HTYPE_TCFLAG_T)
174 #if defined(HTYPE_RLIM_T)
175 INTEGRAL_TYPE(CRLim,tyConCRlim,"CRLim",HTYPE_RLIM_T)
178 -- ToDo: blksize_t, clockid_t, blkcnt_t, fsblkcnt_t, fsfilcnt_t, id_t, key_t
179 -- suseconds_t, timer_t, useconds_t
181 -- Make an Fd type rather than using CInt everywhere
182 INTEGRAL_TYPE(Fd,tyConFd,"Fd",CInt)
184 -- nicer names, and backwards compatibility with POSIX library:
185 #if defined(HTYPE_NLINK_T)
186 type LinkCount = CNlink
188 #if defined(HTYPE_UID_T)
191 #if defined(HTYPE_GID_T)
195 #endif /* !__NHC__ */
197 type ByteCount = CSize
198 type ClockTick = CClock
199 type EpochTime = CTime
202 type FileMode = CMode
203 type ProcessID = CPid
204 type FileOffset = COff
205 type ProcessGroupID = CPid