]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Provides interface to shell MAN file parser.\r | |
3 | \r | |
4 | Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
6 | \r | |
7 | **/\r | |
8 | \r | |
9 | #ifndef _SHELL_MAN_FILE_PARSER_HEADER_\r | |
10 | #define _SHELL_MAN_FILE_PARSER_HEADER_\r | |
11 | \r | |
12 | /**\r | |
13 | This function returns the help information for the specified command. The help text\r | |
14 | will be parsed from a UEFI Shell manual page. (see UEFI Shell 2.0 Appendix B)\r | |
15 | \r | |
16 | If Sections is specified, then each section name listed will be compared in a casesensitive\r | |
17 | manner, to the section names described in Appendix B. If the section exists,\r | |
18 | it will be appended to the returned help text. If the section does not exist, no\r | |
19 | information will be returned. If Sections is NULL, then all help text information\r | |
20 | available will be returned.\r | |
21 | \r | |
22 | if BriefDesc is NULL, then the breif description will not be savedd separately,\r | |
23 | but placed first in the main HelpText.\r | |
24 | \r | |
25 | @param[in] ManFileName Points to the NULL-terminated UEFI Shell MAN file name.\r | |
26 | @param[in] Command Points to the NULL-terminated UEFI Shell command name.\r | |
27 | @param[in] Sections Points to the NULL-terminated comma-delimited\r | |
28 | section names to return. If NULL, then all\r | |
29 | sections will be returned.\r | |
30 | @param[out] BriefDesc On return, points to a callee-allocated buffer\r | |
31 | containing brief description text.\r | |
32 | @param[out] HelpText On return, points to a callee-allocated buffer\r | |
33 | containing all specified help text.\r | |
34 | \r | |
35 | @retval EFI_SUCCESS The help text was returned.\r | |
36 | @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the\r | |
37 | returned help text.\r | |
38 | @retval EFI_INVALID_PARAMETER HelpText is NULL\r | |
39 | @retval EFI_NOT_FOUND There is no help text available for Command.\r | |
40 | **/\r | |
41 | EFI_STATUS\r | |
42 | ProcessManFile (\r | |
43 | IN CONST CHAR16 *ManFileName,\r | |
44 | IN CONST CHAR16 *Command,\r | |
45 | IN CONST CHAR16 *Sections OPTIONAL,\r | |
46 | OUT CHAR16 **BriefDesc,\r | |
47 | OUT CHAR16 **HelpText\r | |
48 | );\r | |
49 | \r | |
50 | /**\r | |
51 | parses through the MAN file specified by SHELL_FILE_HANDLE and returns the\r | |
52 | detailed help for any sub section specified in the comma separated list of\r | |
53 | sections provided. If the end of the file or a .TH section is found then\r | |
54 | return.\r | |
55 | \r | |
56 | Upon a successful return the caller is responsible to free the memory in *HelpText\r | |
57 | \r | |
58 | @param[in] Handle FileHandle to read from\r | |
59 | @param[in] Sections name of command's sub sections to find\r | |
60 | @param[out] HelpText pointer to pointer to string where text goes.\r | |
61 | @param[out] HelpSize pointer to size of allocated HelpText (may be updated)\r | |
62 | @param[in] Ascii TRUE if the file is ASCII, FALSE otherwise.\r | |
63 | \r | |
64 | @retval EFI_OUT_OF_RESOURCES a memory allocation failed.\r | |
65 | @retval EFI_SUCCESS the section was found and its description stored in\r | |
66 | an allocated buffer.\r | |
67 | **/\r | |
68 | EFI_STATUS\r | |
69 | ManFileFindSections (\r | |
70 | IN SHELL_FILE_HANDLE Handle,\r | |
71 | IN CONST CHAR16 *Sections,\r | |
72 | OUT CHAR16 **HelpText,\r | |
73 | OUT UINTN *HelpSize,\r | |
74 | IN BOOLEAN Ascii\r | |
75 | );\r | |
76 | \r | |
77 | #endif //_SHELL_MAN_FILE_PARSER_HEADER_\r |