KallistiOS  2.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
_types.h
Go to the documentation of this file.
1 /** \file sys/_types.h
2  \brief Internal typedefs.
3 
4  This file contains internal typedefs required by libc. You probably
5  shouldn't use any of these in your code. Most of these are copied from
6  newlib's %sys/_types.h.
7 */
8 
9 #ifndef _SYS__TYPES_H
10 #define _SYS__TYPES_H
11 
12 #include <sys/lock.h>
13 
14 // This part copied from newlib's sys/_types.h.
15 #ifndef __off_t_defined
16 /** \brief File offset type. */
17 typedef long _off_t;
18 #endif
19 
20 #ifndef __dev_t_defined
21 /** \brief Device ID type. */
22 typedef short __dev_t;
23 #endif
24 
25 #ifndef __uid_t_defined
26 /** \brief User ID type. */
27 typedef unsigned short __uid_t;
28 #endif
29 #ifndef __gid_t_defined
30 /** \brief Group ID type. */
31 typedef unsigned short __gid_t;
32 #endif
33 
34 #ifndef __off64_t_defined
35 /** \brief 64-bit file offset type. */
36 __extension__ typedef long long _off64_t;
37 #endif
38 
39 #ifndef __fpos_t_defined
40 /** \brief File position type. */
41 typedef long _fpos_t;
42 #endif
43 
44 #ifdef __LARGE64_FILES
45 #ifndef __fpos64_t_defined
46 /** \brief 64-bit file position type. */
47 typedef _off64_t _fpos64_t;
48 #endif
49 #endif
50 
51 #if defined(__INT_MAX__) && __INT_MAX__ == 2147483647
52 /** \brief Signed size type. */
53 typedef int _ssize_t;
54 #else
55 typedef long _ssize_t;
56 #endif
57 
58 /** \cond */
59 #define __need_wint_t
60 #include <stddef.h>
61 /** \endcond */
62 
63 #ifndef __mbstate_t_defined
64 /** \brief Conversion state information.
65  \headerfile sys/_types.h
66 */
67 typedef struct {
68  int __count;
69  union {
70  wint_t __wch;
71  unsigned char __wchb[4];
72  } __value; /* Value so far. */
73 } _mbstate_t;
74 #endif
75 
76 #ifndef __flock_t_defined
77 /** \brief File lock type. */
78 typedef __newlib_recursive_lock_t _flock_t;
79 #endif
80 
81 #ifndef __iconv_t_defined
82 /** \brief Iconv descriptor type. */
83 typedef void *_iconv_t;
84 #endif
85 
86 
87 // This part inserted to fix newlib brokenness.
88 /** \brief Size of an fd_set. */
89 #define FD_SETSIZE 1024
90 
91 /* The architecture should define the macro BYTE_ORDER in <arch/types.h> to
92  equal one of these macros for code that looks for these BSD-style macros. */
93 /** \brief Little Endian test macro */
94 #define LITTLE_ENDIAN 1234
95 
96 /** \brief Big Endian test macro */
97 #define BIG_ENDIAN 4321
98 
99 /** \brief PDP Endian test macro */
100 #define PDP_ENDIAN 3412
101 
102 // And this is for old KOS source compatability.
103 #include <arch/types.h>
104 
105 // Include stuff to make pthreads work as well.
106 #include <sys/_pthread.h>
107 
108 #endif /* _SYS__TYPES_H */