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