]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLibInternal.h
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BasePrintLib / PrintLibInternal.h
CommitLineData
3eb9473e 1/*++\r
2 \r
2c7e5c2f
HT
3Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12\r
13Module Name:\r
14\r
15 PrintLibInternal.h\r
16 \r
17Abstract: \r
18\r
19 Print Library.\r
20\r
21--*/\r
22\r
23#ifndef __PRINT_LIB_INTERNAL_H__\r
24#define __PRINT_LIB_INTERNAL_H__\r
25\r
26#include "EdkIIGlueBase.h"\r
27\r
28//\r
29// Print primitives\r
30//\r
31//#define LEFT_JUSTIFY 0x01\r
32#define PREFIX_SIGN 0x02\r
33#define PREFIX_BLANK 0x04\r
34//#define COMMA_TYPE 0x08\r
35#define LONG_TYPE 0x10\r
36//#define PREFIX_ZERO 0x20\r
37#define OUTPUT_UNICODE 0x40\r
38//#define RADIX_HEX 0x80\r
39#define FORMAT_UNICODE 0x100\r
40#define PAD_TO_WIDTH 0x200\r
41#define ARGUMENT_UNICODE 0x400\r
42#define PRECISION 0x800\r
43#define ARGUMENT_REVERSED 0x1000\r
44\r
45//\r
46// Record date and time information\r
47//\r
48typedef struct {\r
49 UINT16 Year;\r
50 UINT8 Month;\r
51 UINT8 Day;\r
52 UINT8 Hour;\r
53 UINT8 Minute;\r
54 UINT8 Second;\r
55 UINT8 Pad1;\r
56 UINT32 Nanosecond;\r
57 INT16 TimeZone;\r
58 UINT8 Daylight;\r
59 UINT8 Pad2;\r
60} TIME;\r
61\r
62/**\r
63 Worker function that produces a Null-terminated string in an output buffer \r
64 based on a Null-terminated format string and a VA_LIST argument list.\r
65\r
66 VSPrint function to process format and place the results in Buffer. Since a \r
67 VA_LIST is used this rountine allows the nesting of Vararg routines. Thus \r
68 this is the main print working routine.\r
69\r
70 @param Buffer Character buffer to print the results of the parsing\r
71 of Format into.\r
72 @param BufferSize Maximum number of characters to put into buffer.\r
73 @param Flags Intial flags value.\r
74 Can only have FORMAT_UNICODE and OUTPUT_UNICODE set.\r
75 @param Format Null-terminated format string.\r
76 @param Marker Vararg list consumed by processing Format.\r
77\r
78 @return Number of characters printed not including the Null-terminator.\r
79\r
80**/\r
81UINTN\r
82BasePrintLibVSPrint (\r
83 OUT CHAR8 *Buffer,\r
84 IN UINTN BufferSize,\r
85 IN UINTN Flags,\r
86 IN CONST CHAR8 *Format,\r
87 IN VA_LIST Marker\r
88 );\r
89\r
90/**\r
91 Worker function that produces a Null-terminated string in an output buffer \r
92 based on a Null-terminated format string and variable argument list.\r
93\r
94 VSPrint function to process format and place the results in Buffer. Since a \r
95 VA_LIST is used this rountine allows the nesting of Vararg routines. Thus \r
96 this is the main print working routine\r
97\r
98 @param Buffer Character buffer to print the results of the parsing\r
99 of Format into.\r
100 @param BufferSize Maximum number of characters to put into buffer.\r
101 Zero means no limit.\r
102 @param Flags Intial flags value.\r
103 Can only have FORMAT_UNICODE and OUTPUT_UNICODE set\r
104 @param FormatString Null-terminated format string.\r
105\r
106 @return Number of characters printed.\r
107\r
108**/\r
109UINTN\r
110BasePrintLibSPrint (\r
111 OUT CHAR8 *Buffer,\r
112 IN UINTN BufferSize,\r
113 IN UINTN Flags,\r
114 IN CONST CHAR8 *FormatString,\r
115 ...\r
116 );\r
117\r
118/**\r
119 Internal function that places the character into the Buffer.\r
120\r
121 Internal function that places ASCII or Unicode character into the Buffer.\r
122\r
123 @param Buffer Buffer to place the Unicode or ASCII string.\r
124 @param EndBuffer The end of the input Buffer. No characters will be\r
125 placed after that. \r
126 @param Length Count of character to be placed into Buffer.\r
127 @param Character Character to be placed into Buffer.\r
128 @param Increment Character increment in Buffer.\r
129\r
130 @return Number of characters printed.\r
131\r
132**/\r
133CHAR8 *\r
134BasePrintLibFillBuffer (\r
135 CHAR8 *Buffer,\r
136 CHAR8 *EndBuffer,\r
137 INTN Length,\r
138 UINTN Character,\r
139 INTN Increment\r
140 );\r
141\r
142/**\r
143 Internal function that convert a decimal number to a string in Buffer.\r
144\r
145 Print worker function that convert a decimal number to a string in Buffer.\r
146\r
147 @param Buffer Location to place the Unicode or ASCII string of Value.\r
148 @param Value Value to convert to a Decimal or Hexidecimal string in Buffer.\r
149 @param Radix Radix of the value\r
150\r
151 @return Number of characters printed.\r
152\r
153**/\r
154UINTN\r
155EFIAPI\r
156BasePrintLibValueToString (\r
157 IN OUT CHAR8 *Buffer, \r
158 IN INT64 Value, \r
159 IN UINTN Radix\r
160 );\r
161\r
162/**\r
163 Internal function that converts a decimal value to a Null-terminated string.\r
164 \r
165 Converts the decimal number specified by Value to a Null-terminated \r
166 string specified by Buffer containing at most Width characters.\r
167 If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.\r
168 The total number of characters placed in Buffer is returned.\r
169 If the conversion contains more than Width characters, then only the first\r
170 Width characters are returned, and the total number of characters \r
171 required to perform the conversion is returned.\r
172 Additional conversion parameters are specified in Flags. \r
173 The Flags bit LEFT_JUSTIFY is always ignored.\r
174 All conversions are left justified in Buffer.\r
175 If Width is 0, PREFIX_ZERO is ignored in Flags.\r
176 If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r
177 are inserted every 3rd digit starting from the right.\r
178 If Value is < 0, then the fist character in Buffer is a '-'.\r
179 If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, \r
180 then Buffer is padded with '0' characters so the combination of the optional '-' \r
181 sign character, '0' characters, digit characters for Value, and the Null-terminator\r
182 add up to Width characters.\r
183\r
184 If Buffer is NULL, then ASSERT().\r
185 If unsupported bits are set in Flags, then ASSERT().\r
186 If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r
187\r
188 @param Buffer Pointer to the output buffer for the produced Null-terminated\r
189 string.\r
190 @param Flags The bitmask of flags that specify left justification, zero pad,\r
191 and commas.\r
192 @param Value The 64-bit signed value to convert to a string.\r
193 @param Width The maximum number of characters to place in Buffer, not including\r
194 the Null-terminator.\r
195 @param Increment Character increment in Buffer.\r
196 \r
197 @return Total number of characters required to perform the conversion.\r
198\r
199**/\r
200UINTN\r
201BasePrintLibConvertValueToString (\r
202 IN OUT CHAR8 *Buffer,\r
203 IN UINTN Flags,\r
204 IN INT64 Value,\r
205 IN UINTN Width,\r
206 IN UINTN Increment\r
207 );\r
208\r
209#endif\r