Chameleon

Chameleon Svn Source Tree

Root/trunk/i386/include/i386/_types.h

1/*
2 * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28#ifndef_BSD_I386__TYPES_H_
29#define_BSD_I386__TYPES_H_
30
31/*
32 * This header file contains integer types. It's intended to also contain
33 * flotaing point and other arithmetic types, as needed, later.
34 */
35
36#ifdef __GNUC__
37typedef __signed char__int8_t;
38#else/* !__GNUC__ */
39typedef char__int8_t;
40#endif/* !__GNUC__ */
41typedef unsigned char__uint8_t;
42typedefshort__int16_t;
43typedefunsigned short__uint16_t;
44typedef int__int32_t;
45typedef unsigned int__uint32_t;
46typedef long long__int64_t;
47typedef unsigned long long__uint64_t;
48
49typedef long__darwin_intptr_t;
50typedef unsigned int__darwin_natural_t;
51
52/*
53 * The rune type below is declared to be an ``int'' instead of the more natural
54 * ``unsigned long'' or ``long''. Two things are happening here. It is not
55 * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
56 * it looks like 10646 will be a 31 bit standard. This means that if your
57 * ints cannot hold 32 bits, you will be in trouble. The reason an int was
58 * chosen over a long is that the is*() and to*() routines take ints (says
59 * ANSI C), but they use __darwin_ct_rune_t instead of int. By changing it
60 * here, you lose a bit of ANSI conformance, but your programs will still
61 * work.
62 *
63 * NOTE: rune_t is not covered by ANSI nor other standards, and should not
64 * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
65 * rune_t must be the same type. Also wint_t must be no narrower than
66 * wchar_t, and should also be able to hold all members of the largest
67 * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
68 */
69
70typedef int__darwin_ct_rune_t;/* ct_rune_t */
71
72/*
73 * mbstate_t is an opaque object to keep conversion state, during multibyte
74 * stream conversions. The content must not be referenced by user programs.
75 */
76typedef union {
77char__mbstate8[128];
78long long_mbstateL;/* for alignment */
79} __mbstate_t;
80
81typedef __mbstate_t__darwin_mbstate_t;/* mbstate_t */
82
83#if defined(__GNUC__) && defined(__PTRDIFF_TYPE__)
84typedef __PTRDIFF_TYPE____darwin_ptrdiff_t;/* ptr1 - ptr2 */
85#else
86typedef int__darwin_ptrdiff_t;/* ptr1 - ptr2 */
87#endif /* __GNUC__ */
88
89#if defined(__GNUC__) && defined(__SIZE_TYPE__)
90typedef __SIZE_TYPE____darwin_size_t;/* sizeof() */
91#else
92typedef unsigned long__darwin_size_t;/* sizeof() */
93#endif
94
95#if (__GNUC__ > 2)
96typedef __builtin_va_list__darwin_va_list;/* va_list */
97#else
98typedef void *__darwin_va_list;/* va_list */
99#endif
100
101#if defined(__GNUC__) && defined(__WCHAR_TYPE__)
102typedef __WCHAR_TYPE____darwin_wchar_t;/* wchar_t */
103#else
104typedef __darwin_ct_rune_t__darwin_wchar_t;/* wchar_t */
105#endif
106
107typedef __darwin_wchar_t__darwin_rune_t;/* rune_t */
108
109#if defined(__GNUC__) && defined(__WINT_TYPE__)
110typedef __WINT_TYPE____darwin_wint_t;/* wint_t */
111#else
112typedef __darwin_ct_rune_t__darwin_wint_t;/* wint_t */
113#endif
114
115typedef unsigned long__darwin_clock_t;/* clock() */
116typedef __uint32_t__darwin_socklen_t;/* socklen_t (duh) */
117typedef long__darwin_ssize_t;/* byte count or error */
118typedef long__darwin_time_t;/* time() */
119
120#endif/* _BSD_I386__TYPES_H_ */
121

Archive Download this file

Revision: 881