]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | The header <limits.h> defines several macros that expand to various limits and\r | |
3 | parameters of the standard integer types.\r | |
4 | \r | |
5 | The values given below are constant expressions suitable for\r | |
6 | use in #if preprocessing directives. Except for CHAR_BIT and\r | |
7 | MB_LEN_MAX, they have the same\r | |
8 | type as would an expression that is an object of the corresponding type\r | |
9 | converted according to the integer promotions.\r | |
10 | \r | |
11 | Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r | |
12 | This program and the accompanying materials are licensed and made available under\r | |
13 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
14 | The full text of the license may be found at\r | |
15 | http://opensource.org/licenses/bsd-license.\r | |
16 | \r | |
17 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
18 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
19 | **/\r | |
20 | #ifndef _LIMITS_H\r | |
21 | #define _LIMITS_H\r | |
22 | #include <sys/EfiCdefs.h>\r | |
23 | #include <Library/PcdLib.h>\r | |
24 | \r | |
25 | /* Get the architecturally defined limits for this compilation unit. */\r | |
26 | #include <machine/limits.h>\r | |
27 | \r | |
28 | /* Define the values required by the ISO/IEC 9899 Specification. */\r | |
29 | \r | |
30 | /** Maximum number of bytes in a multibyte character, for any supported locale. **/\r | |
31 | #define MB_LEN_MAX 4 /* UTF-8 can require up to 4 bytes */\r | |
32 | \r | |
33 | /** Number of bits comprising the smallest object that is not a bit-field (byte). **/\r | |
34 | #define CHAR_BIT __CHAR_BIT\r | |
35 | \r | |
36 | /** Minimum value for an object of type signed char. **/\r | |
37 | #define SCHAR_MIN __SCHAR_MIN\r | |
38 | \r | |
39 | /** Maximum value for an object of type signed char. **/\r | |
40 | #define SCHAR_MAX __SCHAR_MAX\r | |
41 | \r | |
42 | /** Maximum value for an object of type unsigned char. **/\r | |
43 | #define UCHAR_MAX __UCHAR_MAX\r | |
44 | \r | |
45 | #ifdef __CHAR_UNSIGNED__\r | |
46 | /** Maximum value for an object of type char. **/\r | |
47 | #define CHAR_MAX UCHAR_MAX\r | |
48 | /** Minimum value for an object of type char. **/\r | |
49 | #define CHAR_MIN 0\r | |
50 | #else\r | |
51 | /** Maximum value for an object of type char. **/\r | |
52 | #define CHAR_MAX SCHAR_MAX\r | |
53 | /** Minimum value for an object of type char. **/\r | |
54 | #define CHAR_MIN SCHAR_MIN\r | |
55 | #endif\r | |
56 | \r | |
57 | /** Minimum value for an object of type short int. **/\r | |
58 | #define SHRT_MIN __SHRT_MIN\r | |
59 | \r | |
60 | /** Maximum value for an object of type short int. **/\r | |
61 | #define SHRT_MAX __SHRT_MAX\r | |
62 | \r | |
63 | /** Maximum value for an object of type unsigned short int. **/\r | |
64 | #define USHRT_MAX __USHRT_MAX\r | |
65 | \r | |
66 | /** Minimum value for an object of type int. **/\r | |
67 | #define INT_MIN __INT_MIN\r | |
68 | \r | |
69 | /** Maximum value for an object of type int. **/\r | |
70 | #define INT_MAX __INT_MAX\r | |
71 | \r | |
72 | /** Maximum value for an object of type unsigned int. **/\r | |
73 | #define UINT_MAX __UINT_MAX\r | |
74 | \r | |
75 | /** Minimum value for an object of type long int. **/\r | |
76 | #define LONG_MIN __LONG_MIN\r | |
77 | \r | |
78 | /** Maximum value for an object of type long int. **/\r | |
79 | #define LONG_MAX __LONG_MAX\r | |
80 | \r | |
81 | /** Maximum value for an object of type unsigned long int. **/\r | |
82 | #define ULONG_MAX __ULONG_MAX\r | |
83 | \r | |
84 | /** Minimum value for an object of type long long int. **/\r | |
85 | #define LLONG_MIN __LLONG_MIN\r | |
86 | \r | |
87 | /** Maximum value for an object of type long long int. **/\r | |
88 | #define LLONG_MAX __LLONG_MAX\r | |
89 | \r | |
90 | /** Maximum value for an object of type unsigned long long int. **/\r | |
91 | #define ULLONG_MAX __ULLONG_MAX\r | |
92 | \r | |
93 | /* Object limits used in the Standard Libraries */\r | |
94 | #if (PcdGet32(PcdMaximumAsciiStringLength) > 0)\r | |
95 | /** Maximum length of an arbitrary "narrow-character" string. **/\r | |
96 | #define ASCII_STRING_MAX PcdGet32(PcdMaximumAsciiStringLength)\r | |
97 | #else\r | |
98 | /** Maximum length of an arbitrary "narrow-character" string. **/\r | |
99 | #define ASCII_STRING_MAX 256\r | |
100 | #endif\r | |
101 | \r | |
102 | #if (PcdGet32(PcdMaximumUnicodeStringLength) > 0)\r | |
103 | /** Maximum length of an arbitrary "wide-character" string. **/\r | |
104 | #define UNICODE_STRING_MAX PcdGet32(PcdMaximumUnicodeStringLength)\r | |
105 | #else\r | |
106 | /** Maximum length of an arbitrary "wide-character" string. **/\r | |
107 | #define UNICODE_STRING_MAX 512\r | |
108 | #endif\r | |
109 | \r | |
110 | /* Limits for BSD Compatibility */\r | |
111 | #define NL_TEXTMAX 2048\r | |
112 | \r | |
113 | #include <sys/syslimits.h>\r | |
114 | \r | |
115 | #endif /* _LIMITS_H */\r |