]>
Commit | Line | Data |
---|---|---|
2aa62f2b | 1 | /* $NetBSD: ansi.h,v 1.7 2006/10/04 13:51:59 tnozaki Exp $ */\r |
2 | \r | |
3 | /*\r | |
4 | * Copyright (c) 1990, 1993\r | |
5 | * The Regents of the University of California. All rights reserved.\r | |
6 | *\r | |
7 | * Redistribution and use in source and binary forms, with or without\r | |
8 | * modification, are permitted provided that the following conditions\r | |
9 | * are met:\r | |
10 | * 1. Redistributions of source code must retain the above copyright\r | |
11 | * notice, this list of conditions and the following disclaimer.\r | |
12 | * 2. Redistributions in binary form must reproduce the above copyright\r | |
13 | * notice, this list of conditions and the following disclaimer in the\r | |
14 | * documentation and/or other materials provided with the distribution.\r | |
15 | * 3. Neither the name of the University nor the names of its contributors\r | |
16 | * may be used to endorse or promote products derived from this software\r | |
17 | * without specific prior written permission.\r | |
18 | *\r | |
19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r | |
20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r | |
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r | |
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r | |
23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r | |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r | |
29 | * SUCH DAMAGE.\r | |
30 | *\r | |
31 | * from: @(#)ansi.h 8.2 (Berkeley) 1/4/94\r | |
32 | */\r | |
33 | \r | |
34 | #ifndef _ANSI_H_\r | |
35 | #define _ANSI_H_\r | |
36 | \r | |
37 | #include <sys/cdefs.h>\r | |
38 | \r | |
39 | #include <machine/int_types.h>\r | |
40 | \r | |
41 | /*\r | |
42 | * Types which are fundamental to the implementation and may appear in\r | |
43 | * more than one standard header are defined here. Standard headers\r | |
44 | * then use:\r | |
45 | * #ifdef _BSD_SIZE_T_\r | |
46 | * typedef _BSD_SIZE_T_ size_t;\r | |
47 | * #undef _BSD_SIZE_T_\r | |
48 | * #endif\r | |
49 | */\r | |
50 | #ifdef __ELF__\r | |
51 | #define _BSD_CLOCK_T_ unsigned int /* clock() */\r | |
52 | #define _BSD_PTRDIFF_T_ long int /* ptr1 - ptr2 */\r | |
53 | #define _BSD_SIZE_T_ unsigned long int /* sizeof() */\r | |
54 | #define _BSD_SSIZE_T_ long int /* byte count or error */\r | |
55 | #define _BSD_TIME_T_ int /* time() */\r | |
56 | #else\r | |
57 | #define _BSD_CLOCK_T_ unsigned long /* clock() */\r | |
58 | #define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */\r | |
59 | #define _BSD_SIZE_T_ unsigned int /* sizeof() */\r | |
60 | #define _BSD_SSIZE_T_ int /* byte count or error */\r | |
61 | #define _BSD_TIME_T_ long /* time() */\r | |
62 | #endif\r | |
63 | #if __GNUC_PREREQ__(2, 96)\r | |
64 | #define _BSD_VA_LIST_ __builtin_va_list /* GCC built-in type */\r | |
65 | #else\r | |
66 | #define _BSD_VA_LIST_ char * /* va_list */\r | |
67 | #endif\r | |
68 | #define _BSD_CLOCKID_T_ int /* clockid_t */\r | |
69 | #define _BSD_TIMER_T_ int /* timer_t */\r | |
70 | #define _BSD_SUSECONDS_T_ int /* suseconds_t */\r | |
71 | #define _BSD_USECONDS_T_ unsigned int /* useconds_t */\r | |
72 | \r | |
73 | /*\r | |
74 | * NOTE: rune_t is not covered by ANSI nor other standards, and should not\r | |
75 | * be instantiated outside of lib/libc/locale. use wchar_t.\r | |
76 | *\r | |
77 | * Runes (wchar_t) is declared to be an ``int'' instead of the more natural\r | |
78 | * ``unsigned long'' or ``long''. Two things are happening here. It is not\r | |
79 | * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,\r | |
80 | * it looks like 10646 will be a 31 bit standard. This means that if your\r | |
81 | * ints cannot hold 32 bits, you will be in trouble. The reason an int was\r | |
82 | * chosen over a long is that the is*() and to*() routines take ints (says\r | |
83 | * ANSI C), but they use _RUNE_T_ instead of int. By changing it here, you\r | |
84 | * lose a bit of ANSI conformance, but your programs will still work.\r | |
85 | * \r | |
86 | * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type. When wchar_t\r | |
87 | * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains\r | |
88 | * defined for ctype.h.\r | |
89 | */\r | |
90 | #define _BSD_WCHAR_T_ int /* wchar_t */\r | |
91 | #define _BSD_WINT_T_ int /* wint_t */\r | |
92 | #define _BSD_RUNE_T_ int /* rune_t */\r | |
93 | #define _BSD_WCTRANS_T_ void * /* wctrans_t */\r | |
94 | #define _BSD_WCTYPE_T_ void * /* wctype_t */\r | |
95 | \r | |
96 | /*\r | |
97 | * mbstate_t is an opaque object to keep conversion state, during multibyte\r | |
98 | * stream conversions. The content must not be referenced by user programs.\r | |
99 | */\r | |
100 | typedef union {\r | |
101 | __int64_t __mbstateL; /* for alignment */\r | |
102 | char __mbstate8[128];\r | |
103 | } __mbstate_t;\r | |
104 | #define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */\r | |
105 | \r | |
106 | #endif /* _ANSI_H_ */\r |