]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiUiLib.h
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Dxe / Include / EfiUiLib.h
CommitLineData
3eb9473e 1/*++\r
2\r
3e99020d 3Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
4ea9375a 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
12Module Name:\r
13 EfiUiLib.h\r
14\r
15Abstract:\r
16 Collection of usefull UI functions.\r
17\r
18Revision History:\r
19\r
20--*/\r
21\r
22#ifndef _EFI_UI_LIB_H_\r
23#define _EFI_UI_LIB_H_\r
24\r
25#include "Tiano.h"\r
26#include "TianoTypes.h"\r
27#include "EfiDriverLib.h"\r
28\r
29CHAR16 *\r
30StrHzToString (\r
31 OUT CHAR16 *String,\r
32 IN UINT64 Val\r
33 )\r
34/*++\r
35\r
36Routine Description:\r
37 Converts frequency in Hz to Unicode string. \r
38 Three significant digits are delivered. Used for processor info display.\r
39\r
40Arguments:\r
41 String - string that will contain the frequency.\r
42 Val - value to convert, minimum is 100000 i.e., 0.1 MHz.\r
43\r
44Returns:\r
45 String that contains the frequency.\r
46\r
47--*/\r
48;\r
49\r
50CHAR16 *\r
51StrBytesToString (\r
52 OUT CHAR16 *String,\r
53 IN UINT64 Val\r
54 )\r
55/*++\r
56\r
57Routine Description:\r
58 Converts size in bytes to Unicode string.\r
59 Used for memory/cache size display.\r
60\r
61Arguments:\r
62 String - string that will contain the value\r
63 Val - value to convert in bytes\r
64\r
65Returns:\r
66 String that contains the value.\r
67\r
68--*/\r
69;\r
70\r
71CHAR16 *\r
72StrVersionToString (\r
73 OUT CHAR16 *String,\r
74 IN UINT8 Version\r
75 )\r
76/*++\r
77\r
78Routine Description:\r
79 Converts 8 bit version value to Unicode string.\r
80 The upper nibble contains the upper part, the lower nibble contains the minor part.\r
81 The output format is <major>.<minor>.\r
82\r
83Arguments:\r
84 String - string that will contain the version value\r
85 Version - Version value to convert\r
86 \r
87Returns:\r
88 String that contains the version value.\r
89\r
90--*/\r
91;\r
92\r
93CHAR16 *\r
94StrMacToString (\r
95 OUT CHAR16 *String,\r
96 IN EFI_MAC_ADDRESS *MacAddr,\r
97 IN UINT32 AddrSize\r
98 )\r
99/*++\r
100\r
101Routine Description:\r
102 Converts MAC address to Unicode string.\r
103 The value is 64-bit and the resulting string will be 12\r
104 digit hex number in pairs of digits separated by dashes.\r
105\r
106Arguments:\r
107 String - string that will contain the value\r
108 MacAddr - MAC address to convert\r
109 AddrSize - Size of address\r
110 \r
111Returns:\r
112 String that contains the value.\r
113\r
114--*/\r
115;\r
116\r
117CHAR16 *\r
118StrIp4AdrToString (\r
119 OUT CHAR16 *String,\r
120 IN EFI_IPv4_ADDRESS *Ip4Addr\r
121 )\r
122/*++\r
123\r
124Routine Description:\r
125 Converts IP v4 address to Unicode string.\r
126 The value is 64-bit and the resulting string will\r
127 be four decimal values 0-255 separated by dots.\r
128\r
129Arguments:\r
130 String - string that will contain the value\r
131 Ip4Addr - IP v4 address to convert from\r
132\r
133Returns:\r
134\r
135 String that contain the value\r
136\r
137--*/\r
138;\r
139\r
140EFI_STATUS\r
141StrStringToIp4Adr (\r
142 OUT EFI_IPv4_ADDRESS *Ip4Addr,\r
143 IN CHAR16 *String\r
144 )\r
145/*++\r
146\r
147Routine Description:\r
148 Parses and converts Unicode string to IP v4 address.\r
149 The value will 64-bit.\r
150 The string must be four decimal values 0-255 separated by dots.\r
151 The string is parsed and format verified.\r
152\r
153Arguments:\r
154 Ip4Addr - pointer to the variable to store the value to\r
155 String - string that contains the value to parse and convert\r
156\r
157Returns:\r
158 EFI_SUCCESS - if successful\r
159 EFI_INVALID_PARAMETER - if String contains invalid IP v4 format\r
160\r
161--*/\r
162;\r
163\r
164CHAR16 *\r
165Ascii2Unicode (\r
166 OUT CHAR16 *UnicodeStr,\r
167 IN CHAR8 *AsciiStr\r
168 )\r
169/*++\r
170\r
171Routine Description:\r
172 Converts ASCII characters to Unicode.\r
173\r
174Arguments:\r
175 UnicodeStr - the Unicode string to be written to. The buffer must be large enough.\r
176 AsciiStr - The ASCII string to be converted.\r
177\r
178Returns:\r
179 The address to the Unicode string - same as UnicodeStr.\r
180\r
181--*/\r
182;\r
183\r
184CHAR8 *\r
185Unicode2Ascii (\r
186 OUT CHAR8 *AsciiStr,\r
187 IN CHAR16 *UnicodeStr\r
188 )\r
189/*++\r
190\r
191Routine Description:\r
192 Converts ASCII characters to Unicode.\r
193 Assumes that the Unicode characters are only these defined in the ASCII set.\r
194\r
195Arguments:\r
196 AsciiStr - The ASCII string to be written to. The buffer must be large enough.\r
197 UnicodeStr - the Unicode string to be converted.\r
198\r
199Returns:\r
200 The address to the ASCII string - same as AsciiStr.\r
201\r
202--*/\r
203;\r
204\r
3e99020d
LG
205EFI_STATUS\r
206EfiStringToValue (\r
207 OUT UINT64 *Val,\r
208 IN CHAR16 *String,\r
209 OUT UINT8 *EndIdx OPTIONAL\r
210 )\r
211/*++\r
212\r
213Routine Description:\r
214 Parses and converts Unicode string to decimal value.\r
215 The returned value is 64-bit.\r
216 The string is expected in decimal format,\r
217 the string is parsed and format verified.\r
218\r
219Arguments:\r
220 Val - pointer to the variable to store the value to\r
221 String - string that contains the value to parse and convert\r
222 EndIdx - index on which the parsing stopped. It points to the\r
223 first character that was not part of the returned Val.\r
224 It's valid only if the function returns success.\r
225 It's optional and it could be NULL.\r
226\r
227Returns:\r
228 EFI_SUCCESS - if successful\r
229 EFI_INVALID_PARAMETER - if String is in unexpected format\r
230\r
231--*/\r
232;\r
233\r
3eb9473e 234#endif\r