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