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