1 {-# OPTIONS_GHC -XNoImplicitPrelude #-}
2 {-# OPTIONS_GHC -fno-warn-unused-binds #-}
3 -----------------------------------------------------------------------------
5 -- Module : System.Posix.Types
6 -- Copyright : (c) The University of Glasgow 2002
7 -- License : BSD-style (see the file libraries/base/LICENSE)
9 -- Maintainer : libraries@haskell.org
10 -- Stability : provisional
11 -- Portability : non-portable (requires POSIX)
13 -- POSIX data types: Haskell equivalents of the types defined by the
14 -- @\<sys\/types.h>@ C header on a POSIX system.
16 -----------------------------------------------------------------------------
29 #define HTYPE_TCFLAG_T
35 #include "HsBaseConfig.h"
38 module System.Posix.Types (
41 #if defined(HTYPE_DEV_T)
44 #if defined(HTYPE_INO_T)
47 #if defined(HTYPE_MODE_T)
50 #if defined(HTYPE_OFF_T)
53 #if defined(HTYPE_PID_T)
56 #if defined(HTYPE_SSIZE_T)
60 #if defined(HTYPE_GID_T)
63 #if defined(HTYPE_NLINK_T)
66 #if defined(HTYPE_UID_T)
69 #if defined(HTYPE_CC_T)
72 #if defined(HTYPE_SPEED_T)
75 #if defined(HTYPE_TCFLAG_T)
78 #if defined(HTYPE_RLIM_T)
84 #if defined(HTYPE_NLINK_T)
87 #if defined(HTYPE_UID_T)
90 #if defined(HTYPE_GID_T)
107 import NHC.PosixTypes
116 #ifdef __GLASGOW_HASKELL__
130 #if defined(HTYPE_DEV_T)
131 ARITHMETIC_TYPE(CDev,tyConCDev,"CDev",HTYPE_DEV_T)
133 #if defined(HTYPE_INO_T)
134 INTEGRAL_TYPE(CIno,tyConCIno,"CIno",HTYPE_INO_T)
136 #if defined(HTYPE_MODE_T)
137 INTEGRAL_TYPE(CMode,tyConCMode,"CMode",HTYPE_MODE_T)
139 #if defined(HTYPE_OFF_T)
140 INTEGRAL_TYPE(COff,tyConCOff,"COff",HTYPE_OFF_T)
142 #if defined(HTYPE_PID_T)
143 INTEGRAL_TYPE(CPid,tyConCPid,"CPid",HTYPE_PID_T)
146 #if defined(HTYPE_SSIZE_T)
147 INTEGRAL_TYPE(CSsize,tyConCSsize,"CSsize",HTYPE_SSIZE_T)
150 #if defined(HTYPE_GID_T)
151 INTEGRAL_TYPE(CGid,tyConCGid,"CGid",HTYPE_GID_T)
153 #if defined(HTYPE_NLINK_T)
154 INTEGRAL_TYPE(CNlink,tyConCNlink,"CNlink",HTYPE_NLINK_T)
157 #if defined(HTYPE_UID_T)
158 INTEGRAL_TYPE(CUid,tyConCUid,"CUid",HTYPE_UID_T)
160 #if defined(HTYPE_CC_T)
161 ARITHMETIC_TYPE(CCc,tyConCCc,"CCc",HTYPE_CC_T)
163 #if defined(HTYPE_SPEED_T)
164 ARITHMETIC_TYPE(CSpeed,tyConCSpeed,"CSpeed",HTYPE_SPEED_T)
166 #if defined(HTYPE_TCFLAG_T)
167 INTEGRAL_TYPE(CTcflag,tyConCTcflag,"CTcflag",HTYPE_TCFLAG_T)
169 #if defined(HTYPE_RLIM_T)
170 INTEGRAL_TYPE(CRLim,tyConCRlim,"CRLim",HTYPE_RLIM_T)
173 -- ToDo: blksize_t, clockid_t, blkcnt_t, fsblkcnt_t, fsfilcnt_t, id_t, key_t
174 -- suseconds_t, timer_t, useconds_t
176 -- Make an Fd type rather than using CInt everywhere
177 INTEGRAL_TYPE(Fd,tyConFd,"Fd",CInt)
179 -- nicer names, and backwards compatibility with POSIX library:
180 #if defined(HTYPE_NLINK_T)
181 type LinkCount = CNlink
183 #if defined(HTYPE_UID_T)
186 #if defined(HTYPE_GID_T)
190 #endif /* !__NHC__ */
192 type ByteCount = CSize
193 type ClockTick = CClock
194 type EpochTime = CTime
197 type FileMode = CMode
198 type ProcessID = CPid
199 type FileOffset = COff
200 type ProcessGroupID = CPid