2 INI configuration parsing library.
4 The INI file format is:
11 1) SectionName is an ASCII string. The valid format is [A-Za-z0-9_]+
12 2) EntryName is an ASCII string. The valid format is [A-Za-z0-9_]+
14 3.1) an ASCII String. The valid format is [A-Za-z0-9_]+
15 3.2) a GUID. The valid format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, where x is [A-Fa-f0-9]
16 3.3) a decimal value. The valid format is [0-9]+
17 3.4) a hexadecimal value. The valid format is 0x[A-Fa-f0-9]+
18 4) '#' or ';' can be used as comment at anywhere.
19 5) TAB(0x20) or SPACE(0x9) can be used as separator.
20 6) LF(\n, 0xA) or CR(\r, 0xD) can be used as line break.
22 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
23 SPDX-License-Identifier: BSD-2-Clause-Patent
28 #ifndef __INI_PARSING_LIB_H__
29 #define __INI_PARSING_LIB_H__
32 Open an INI config file and return a context.
34 @param[in] DataBuffer Config raw file buffer.
35 @param[in] BufferSize Size of raw buffer.
37 @return Config data buffer is opened and context is returned.
38 @retval NULL No enough memory is allocated.
39 @retval NULL Config data buffer is invalid.
49 Get section entry string value.
51 @param[in] Context INI Config file context.
52 @param[in] SectionName Section name.
53 @param[in] EntryName Section entry name.
54 @param[out] EntryValue Point to the got entry string value.
56 @retval EFI_SUCCESS Section entry string value is got.
57 @retval EFI_NOT_FOUND Section is not found.
61 GetStringFromDataFile (
63 IN CHAR8
*SectionName
,
65 OUT CHAR8
**EntryValue
69 Get section entry GUID value.
71 @param[in] Context INI Config file context.
72 @param[in] SectionName Section name.
73 @param[in] EntryName Section entry name.
74 @param[out] Guid Point to the got GUID value.
76 @retval EFI_SUCCESS Section entry GUID value is got.
77 @retval EFI_NOT_FOUND Section is not found.
83 IN CHAR8
*SectionName
,
89 Get section entry decimal UINTN value.
91 @param[in] Context INI Config file context.
92 @param[in] SectionName Section name.
93 @param[in] EntryName Section entry name.
94 @param[out] Data Point to the got decimal UINTN value.
96 @retval EFI_SUCCESS Section entry decimal UINTN value is got.
97 @retval EFI_NOT_FOUND Section is not found.
101 GetDecimalUintnFromDataFile (
103 IN CHAR8
*SectionName
,
109 Get section entry hexadecimal UINTN value.
111 @param[in] Context INI Config file context.
112 @param[in] SectionName Section name.
113 @param[in] EntryName Section entry name.
114 @param[out] Data Point to the got hexadecimal UINTN value.
116 @retval EFI_SUCCESS Section entry hexadecimal UINTN value is got.
117 @retval EFI_NOT_FOUND Section is not found.
121 GetHexUintnFromDataFile (
123 IN CHAR8
*SectionName
,
129 Get section entry hexadecimal UINT64 value.
131 @param[in] Context INI Config file context.
132 @param[in] SectionName Section name.
133 @param[in] EntryName Section entry name.
134 @param[out] Data Point to the got hexadecimal UINT64 value.
136 @retval EFI_SUCCESS Section entry hexadecimal UINT64 value is got.
137 @retval EFI_NOT_FOUND Section is not found.
141 GetHexUint64FromDataFile (
143 IN CHAR8
*SectionName
,
149 Close an INI config file and free the context.
151 @param[in] Context INI Config file context.