]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / RegularExpressionDxe / RegularExpressionDxe.h
CommitLineData
27b5bf5d 1/** @file\r
14b0e578
CS
2 EFI_REGULAR_EXPRESSION_PROTOCOL Header File.\r
3\r
0af8e57c 4 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
d1102dba 5\r
14b0e578
CS
6 This program and the accompanying materials are licensed and made available\r
7 under the terms and conditions of the BSD License that accompanies this\r
8 distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php.\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
12 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
27b5bf5d 13\r
14b0e578
CS
14**/\r
15\r
27b5bf5d
DB
16#ifndef __REGULAR_EXPRESSIONDXE_H__\r
17#define __REGULAR_EXPRESSIONDXE_H__\r
18\r
14b0e578
CS
19#include "Oniguruma/oniguruma.h"\r
20\r
21#include <Uefi.h>\r
22#include <Protocol/RegularExpressionProtocol.h>\r
23#include <Library/UefiBootServicesTableLib.h>\r
24#include <Library/BaseMemoryLib.h>\r
25#include <Library/MemoryAllocationLib.h>\r
26#include <Library/DebugLib.h>\r
27#include <Library/BaseLib.h>\r
28\r
14b0e578
CS
29/**\r
30 Checks if the input string matches to the regular expression pattern.\r
31\r
27b5bf5d
DB
32 @param This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance.\r
33 Type EFI_REGULAR_EXPRESSION_PROTOCOL is defined in Section\r
34 XYZ.\r
35\r
36 @param String A pointer to a NULL terminated string to match against the\r
37 regular expression string specified by Pattern.\r
38\r
39 @param Pattern A pointer to a NULL terminated string that represents the\r
40 regular expression.\r
41\r
42 @param SyntaxType A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the\r
43 regular expression syntax type to use. May be NULL in which\r
44 case the function will use its default regular expression\r
45 syntax type.\r
46\r
47 @param Result On return, points to TRUE if String fully matches against\r
48 the regular expression Pattern using the regular expression\r
49 SyntaxType. Otherwise, points to FALSE.\r
50\r
51 @param Captures A Pointer to an array of EFI_REGEX_CAPTURE objects to receive\r
52 the captured groups in the event of a match. The full\r
53 sub-string match is put in Captures[0], and the results of N\r
54 capturing groups are put in Captures[1:N]. If Captures is\r
55 NULL, then this function doesn't allocate the memory for the\r
56 array and does not build up the elements. It only returns the\r
57 number of matching patterns in CapturesCount. If Captures is\r
58 not NULL, this function returns a pointer to an array and\r
59 builds up the elements in the array. CapturesCount is also\r
60 updated to the number of matching patterns found. It is the\r
61 caller's responsibility to free the memory pool in Captures\r
62 and in each CapturePtr in the array elements.\r
63\r
64 @param CapturesCount On output, CapturesCount is the number of matching patterns\r
14b0e578
CS
65 found in String. Zero means no matching patterns were found\r
66 in the string.\r
67\r
68 @retval EFI_SUCCESS The regular expression string matching\r
69 completed successfully.\r
70 @retval EFI_UNSUPPORTED The regular expression syntax specified by\r
71 SyntaxType is not supported by this driver.\r
72 @retval EFI_DEVICE_ERROR The regular expression string matching\r
73 failed due to a hardware or firmware error.\r
74 @retval EFI_INVALID_PARAMETER String, Pattern, Result, or CapturesCountis\r
75 NULL.\r
76\r
77**/\r
78EFI_STATUS\r
79EFIAPI\r
80RegularExpressionMatch (\r
81 IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,\r
82 IN CHAR16 *String,\r
83 IN CHAR16 *Pattern,\r
84 IN EFI_REGEX_SYNTAX_TYPE *SyntaxType, OPTIONAL\r
85 OUT BOOLEAN *Result,\r
86 OUT EFI_REGEX_CAPTURE **Captures, OPTIONAL\r
87 OUT UINTN *CapturesCount\r
88 );\r
89\r
90/**\r
91 Returns information about the regular expression syntax types supported\r
92 by the implementation.\r
93\r
27b5bf5d
DB
94 @param This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL\r
95 instance.\r
14b0e578 96\r
27b5bf5d
DB
97 @param RegExSyntaxTypeListSize On input, the size in bytes of RegExSyntaxTypeList.\r
98 On output with a return code of EFI_SUCCESS, the\r
99 size in bytes of the data returned in\r
100 RegExSyntaxTypeList. On output with a return code\r
101 of EFI_BUFFER_TOO_SMALL, the size of\r
102 RegExSyntaxTypeList required to obtain the list.\r
14b0e578 103\r
27b5bf5d
DB
104 @param RegExSyntaxTypeList A caller-allocated memory buffer filled by the\r
105 driver with one EFI_REGEX_SYNTAX_TYPE element\r
106 for each supported Regular expression syntax\r
107 type. The list must not change across multiple\r
108 calls to the same driver. The first syntax\r
109 type in the list is the default type for the\r
110 driver.\r
14b0e578
CS
111\r
112 @retval EFI_SUCCESS The regular expression syntax types list\r
113 was returned successfully.\r
114 @retval EFI_UNSUPPORTED The service is not supported by this driver.\r
115 @retval EFI_DEVICE_ERROR The list of syntax types could not be\r
116 retrieved due to a hardware or firmware error.\r
117 @retval EFI_BUFFER_TOO_SMALL The buffer RegExSyntaxTypeList is too small\r
118 to hold the result.\r
119 @retval EFI_INVALID_PARAMETER RegExSyntaxTypeListSize is NULL\r
120\r
121**/\r
122EFI_STATUS\r
123EFIAPI\r
124RegularExpressionGetInfo (\r
125 IN EFI_REGULAR_EXPRESSION_PROTOCOL *This,\r
126 IN OUT UINTN *RegExSyntaxTypeListSize,\r
127 OUT EFI_REGEX_SYNTAX_TYPE *RegExSyntaxTypeList\r
128 );\r
129\r
27b5bf5d 130#endif\r