]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/Include/limits.h
Update or add comments to files and functions for use by Doxygen.
[mirror_edk2.git] / StdLib / Include / limits.h
CommitLineData
2aa62f2b 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 shall be replaced by constant expressions suitable for\r
6 use in #if preprocessing directives. Moreover, except for CHAR_BIT and\r
7 MB_LEN_MAX, the following shall be replaced by expressions that 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. Their implementation-defined\r
10 values shall be equal or greater in magnitude (absolute value) to those\r
11 documented, with the same sign.\r
12\r
13 If the value of an object of type char is treated as a signed integer when\r
14 used in an expression, the value of CHAR_MIN shall be the same as that of\r
15 SCHAR_MIN and the value of CHAR_MAX shall be the same as that of SCHAR_MAX.\r
16 Otherwise, the value of CHAR_MIN shall be 0 and the value of CHAR_MAX shall\r
17 be the same as that of UCHAR_MAX.)\r
18 The value UCHAR_MAX shall equal 2^(CHAR_BIT - 1).\r
19\r
20 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
21 This program and the accompanying materials are licensed and made available under\r
22 the terms and conditions of the BSD License that accompanies this distribution.\r
23 The full text of the license may be found at\r
24 http://opensource.org/licenses/bsd-license.php.\r
25\r
26 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
27 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
28\r
29**/\r
30#ifndef _LIMITS_H\r
31#define _LIMITS_H\r
32#include <sys/EfiCdefs.h>\r
33#include <Library/PcdLib.h>\r
34\r
35/* Get the architecturally defined limits for this compilation unit. */\r
36#include <machine/limits.h>\r
37\r
38/* Define the values required by Specification. */\r
39\r
40/** maximum number of bytes in a multibyte character, for any supported locale **/\r
41#define MB_LEN_MAX 2 /* 16-bit UTC-2 */\r
42\r
43/** Number of bits for smallest object that is not a bit-field (byte). **/\r
44#define CHAR_BIT __CHAR_BIT\r
45\r
46/** minimum value for an object of type signed char **/\r
47#define SCHAR_MIN __SCHAR_MIN\r
48\r
49/** maximum value for an object of type signed char **/\r
50#define SCHAR_MAX __SCHAR_MAX\r
51\r
52/** maximum value for an object of type unsigned char **/\r
53#define UCHAR_MAX __UCHAR_MAX\r
54\r
55#ifdef __CHAR_UNSIGNED__\r
56 /** maximum value for an object of type char **/\r
57 #define CHAR_MAX UCHAR_MAX\r
58 /** minimum value for an object of type char **/\r
59 #define CHAR_MIN 0\r
60#else\r
61 /** maximum value for an object of type char **/\r
62 #define CHAR_MAX SCHAR_MAX\r
63 /** minimum value for an object of type char **/\r
64 #define CHAR_MIN SCHAR_MIN\r
65#endif\r
66\r
67/** minimum value for an object of type short int **/\r
68#define SHRT_MIN __SHRT_MIN\r
69\r
70/** maximum value for an object of type short int **/\r
71#define SHRT_MAX __SHRT_MAX\r
72\r
73/** maximum value for an object of type unsigned short int **/\r
74#define USHRT_MAX __USHRT_MAX\r
75\r
76/** minimum value for an object of type int **/\r
77#define INT_MIN __INT_MIN\r
78\r
79/** maximum value for an object of type int **/\r
80#define INT_MAX __INT_MAX\r
81\r
82/** maximum value for an object of type unsigned int **/\r
83#define UINT_MAX __UINT_MAX\r
84\r
85/** minimum value for an object of type long int **/\r
86#define LONG_MIN __LONG_MIN\r
87\r
88/** maximum value for an object of type long int **/\r
89#define LONG_MAX __LONG_MAX\r
90\r
91/** maximum value for an object of type unsigned long int **/\r
92#define ULONG_MAX __ULONG_MAX\r
93\r
94/** minimum value for an object of type long long int **/\r
95#define LLONG_MIN __LLONG_MIN\r
96\r
97/** maximum value for an object of type long long int **/\r
98#define LLONG_MAX __LLONG_MAX\r
99\r
100/** maximum value for an object of type unsigned long long int **/\r
101#define ULLONG_MAX __ULLONG_MAX\r
102\r
103/* Object limits used in the Standard Libraries */\r
104#if (PcdGet32(PcdMaximumAsciiStringLength) > 0)\r
105 #define ASCII_STRING_MAX PcdGet32(PcdMaximumAsciiStringLength)\r
106#else\r
107 #define ASCII_STRING_MAX 256\r
108#endif\r
109\r
110#if (PcdGet32(PcdMaximumUnicodeStringLength) > 0)\r
111 #define UNICODE_STRING_MAX PcdGet32(PcdMaximumUnicodeStringLength)\r
112#else\r
113 #define UNICODE_STRING_MAX 512\r
114#endif\r
115\r
116/* Limits for BSD Compatibility */\r
117#define NL_TEXTMAX 2048\r
118#include <sys/syslimits.h>\r
119\r
120#endif /* _LIMITS_H */\r