]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Application/Shell/ShellManParser.h
ShellBinPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / ShellPkg / Application / Shell / ShellManParser.h
CommitLineData
a405b86d 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 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#ifndef _SHELL_MAN_FILE_PARSER_HEADER_\r
16#define _SHELL_MAN_FILE_PARSER_HEADER_\r
17\r
18/**\r
19 This function returns the help information for the specified command. The help text\r
20 will be parsed from a UEFI Shell manual page. (see UEFI Shell 2.0 Appendix B)\r
21\r
22 If Sections is specified, then each section name listed will be compared in a casesensitive\r
23 manner, to the section names described in Appendix B. If the section exists,\r
24 it will be appended to the returned help text. If the section does not exist, no\r
25 information will be returned. If Sections is NULL, then all help text information\r
26 available will be returned.\r
27\r
28 if BriefDesc is NULL, then the breif description will not be savedd seperatly,\r
29 but placed first in the main HelpText.\r
30\r
31 @param[in] ManFileName Points to the NULL-terminated UEFI Shell MAN file name.\r
32 @param[in] Command Points to the NULL-terminated UEFI Shell command name.\r
33 @param[in] Sections Points to the NULL-terminated comma-delimited\r
34 section names to return. If NULL, then all\r
35 sections will be returned.\r
36 @param[out] BriefDesc On return, points to a callee-allocated buffer\r
37 containing brief description text.\r
38 @param[out] HelpText On return, points to a callee-allocated buffer\r
39 containing all specified help text.\r
40\r
41 @retval EFI_SUCCESS The help text was returned.\r
42 @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the\r
43 returned help text.\r
44 @retval EFI_INVALID_PARAMETER HelpText is NULL\r
45 @retval EFI_NOT_FOUND There is no help text available for Command.\r
46**/\r
47EFI_STATUS\r
a405b86d 48ProcessManFile(\r
49 IN CONST CHAR16 *ManFileName,\r
50 IN CONST CHAR16 *Command,\r
51 IN CONST CHAR16 *Sections OPTIONAL,\r
52 OUT CHAR16 **BriefDesc,\r
53 OUT CHAR16 **HelpText\r
54 );\r
55\r
56/**\r
57 parses through the MAN file specified by SHELL_FILE_HANDLE and returns the\r
58 detailed help for any sub section specified in the comma seperated list of\r
59 sections provided. If the end of the file or a .TH section is found then\r
60 return.\r
61\r
62 Upon a sucessful return the caller is responsible to free the memory in *HelpText\r
63\r
64 @param[in] Handle FileHandle to read from\r
65 @param[in] Sections name of command's sub sections to find\r
66 @param[out] HelpText pointer to pointer to string where text goes.\r
67 @param[out] HelpSize pointer to size of allocated HelpText (may be updated)\r
68 @param[in] Ascii TRUE if the file is ASCII, FALSE otherwise.\r
69\r
70 @retval EFI_OUT_OF_RESOURCES a memory allocation failed.\r
71 @retval EFI_SUCCESS the section was found and its description sotred in\r
72 an alloceted buffer.\r
73**/\r
74EFI_STATUS\r
a405b86d 75ManFileFindSections(\r
76 IN SHELL_FILE_HANDLE Handle,\r
77 IN CONST CHAR16 *Sections,\r
78 OUT CHAR16 **HelpText,\r
79 OUT UINTN *HelpSize,\r
80 IN BOOLEAN Ascii\r
81 );\r
82\r
83#endif //_SHELL_MAN_FILE_PARSER_HEADER_\r
84\r