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 heximal 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 This program and the accompanying materials
24 are licensed and made available under the terms and conditions of the BSD License
25 which accompanies this distribution. The full text of the license may be found at
26 http://opensource.org/licenses/bsd-license.php
28 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
29 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
34 #ifndef __INI_PARSING_LIB_H__
35 #define __INI_PARSING_LIB_H__
38 Open an INI config file and return a context.
40 @param[in] DataBuffer Config raw file buffer.
41 @param[in] BufferSize Size of raw buffer.
43 @return Config data buffer is opened and context is returned.
44 @retval NULL No enough memory is allocated.
45 @retval NULL Config data buffer is invalid.
55 Get section entry string value.
57 @param[in] Context INI Config file context.
58 @param[in] SectionName Section name.
59 @param[in] EntryName Section entry name.
60 @param[out] EntryValue Point to the got entry string value.
62 @retval EFI_SUCCESS Section entry string value is got.
63 @retval EFI_NOT_FOUND Section is not found.
67 GetStringFromDataFile (
69 IN CHAR8
*SectionName
,
71 OUT CHAR8
**EntryValue
75 Get section entry GUID value.
77 @param[in] Context INI Config file context.
78 @param[in] SectionName Section name.
79 @param[in] EntryName Section entry name.
80 @param[out] Guid Point to the got GUID value.
82 @retval EFI_SUCCESS Section entry GUID value is got.
83 @retval EFI_NOT_FOUND Section is not found.
89 IN CHAR8
*SectionName
,
95 Get section entry decimal UINTN value.
97 @param[in] Context INI Config file context.
98 @param[in] SectionName Section name.
99 @param[in] EntryName Section entry name.
100 @param[out] Data Point to the got decimal UINTN value.
102 @retval EFI_SUCCESS Section entry decimal UINTN value is got.
103 @retval EFI_NOT_FOUND Section is not found.
107 GetDecimalUintnFromDataFile (
109 IN CHAR8
*SectionName
,
115 Get section entry heximal UINTN value.
117 @param[in] Context INI Config file context.
118 @param[in] SectionName Section name.
119 @param[in] EntryName Section entry name.
120 @param[out] Data Point to the got heximal UINTN value.
122 @retval EFI_SUCCESS Section entry heximal UINTN value is got.
123 @retval EFI_NOT_FOUND Section is not found.
127 GetHexUintnFromDataFile (
129 IN CHAR8
*SectionName
,
135 Get section entry heximal UINT64 value.
137 @param[in] Context INI Config file context.
138 @param[in] SectionName Section name.
139 @param[in] EntryName Section entry name.
140 @param[out] Data Point to the got heximal UINT64 value.
142 @retval EFI_SUCCESS Section entry heximal UINT64 value is got.
143 @retval EFI_NOT_FOUND Section is not found.
147 GetHexUint64FromDataFile (
149 IN CHAR8
*SectionName
,
155 Close an INI config file and free the context.
157 @param[in] Context INI Config file context.