]>
Commit | Line | Data |
---|---|---|
8dbae30d | 1 | /** @file\r |
2 | <Todo: Add file description>\r | |
3 | \r | |
4 | Copyright (c) 2007 - 2008, Intel Corporation. <BR>\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | \r | |
16 | \r | |
17 | /**\r | |
18 | Converts binary buffer to Unicode string.\r | |
19 | At a minimum, any blob of data could be represented as a hex string.\r | |
20 | \r | |
21 | @param Str Pointer to the string.\r | |
22 | @param HexStringBufferLength Length in bytes of buffer to hold the hex string.\r | |
23 | Includes tailing '\0' character. If routine return\r | |
24 | with EFI_SUCCESS, containing length of hex string\r | |
25 | buffer. If routine return with\r | |
26 | EFI_BUFFER_TOO_SMALL, containg length of hex\r | |
27 | string buffer desired.\r | |
28 | @param Buf Buffer to be converted from.\r | |
29 | @param Len Length in bytes of the buffer to be converted.\r | |
30 | \r | |
31 | @retval EFI_SUCCESS Routine success.\r | |
32 | @retval EFI_BUFFER_TOO_SMALL The hex string buffer is too small.\r | |
33 | \r | |
34 | **/\r | |
35 | EFI_STATUS\r | |
36 | R8_BufToHexString (\r | |
37 | IN OUT CHAR16 *Str,\r | |
38 | IN OUT UINTN *HexStringBufferLength,\r | |
39 | IN UINT8 *Buf,\r | |
40 | IN UINTN Len\r | |
41 | )\r | |
42 | ;\r | |
43 | \r | |
44 | \r | |
45 | \r | |
46 | \r | |
47 | /**\r | |
48 | Converts Unicode string to binary buffer.\r | |
49 | The conversion may be partial.\r | |
50 | The first character in the string that is not hex digit stops the conversion.\r | |
51 | At a minimum, any blob of data could be represented as a hex string.\r | |
52 | \r | |
53 | @param Buf Pointer to buffer that receives the data.\r | |
54 | @param Len Length in bytes of the buffer to hold converted\r | |
55 | data. If routine return with EFI_SUCCESS,\r | |
56 | containing length of converted data. If routine\r | |
57 | return with EFI_BUFFER_TOO_SMALL, containg length\r | |
58 | of buffer desired.\r | |
59 | @param Str String to be converted from.\r | |
60 | @param ConvertedStrLen Length of the Hex String consumed.\r | |
61 | \r | |
62 | @retval EFI_SUCCESS Routine Success.\r | |
63 | @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold converted data.\r | |
64 | \r | |
65 | **/\r | |
66 | EFI_STATUS\r | |
67 | R8_HexStringToBuf (\r | |
68 | IN OUT UINT8 *Buf,\r | |
69 | IN OUT UINTN *Len,\r | |
70 | IN CHAR16 *Str,\r | |
71 | OUT UINTN *ConvertedStrLen OPTIONAL\r | |
72 | )\r | |
73 | ;\r | |
74 | \r | |
75 | /**\r | |
76 | Determines if a Unicode character is a hexadecimal digit.\r | |
77 | The test is case insensitive.\r | |
78 | \r | |
79 | @param Digit Pointer to byte that receives the value of the hex\r | |
80 | character.\r | |
81 | @param Char Unicode character to test.\r | |
82 | \r | |
83 | @retval TRUE If the character is a hexadecimal digit.\r | |
84 | @retval FALSE Otherwise.\r | |
85 | \r | |
86 | **/\r | |
87 | BOOLEAN\r | |
88 | R8_IsHexDigit (\r | |
89 | OUT UINT8 *Digit,\r | |
90 | IN CHAR16 Char\r | |
91 | )\r | |
92 | ;\r | |
93 | \r |