TianoCore EDK2 master
Loading...
Searching...
No Matches
ShellManParser.h File Reference

Go to the source code of this file.

Functions

EFI_STATUS ProcessManFile (IN CONST CHAR16 *ManFileName, IN CONST CHAR16 *Command, IN CONST CHAR16 *Sections OPTIONAL, OUT CHAR16 **BriefDesc, OUT CHAR16 **HelpText)
 
EFI_STATUS ManFileFindSections (IN SHELL_FILE_HANDLE Handle, IN CONST CHAR16 *Sections, OUT CHAR16 **HelpText, OUT UINTN *HelpSize, IN BOOLEAN Ascii)
 

Detailed Description

Provides interface to shell MAN file parser.

Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file ShellManParser.h.

Function Documentation

◆ ManFileFindSections()

EFI_STATUS ManFileFindSections ( IN SHELL_FILE_HANDLE  Handle,
IN CONST CHAR16 *  Sections,
OUT CHAR16 **  HelpText,
OUT UINTN HelpSize,
IN BOOLEAN  Ascii 
)

parses through the MAN file specified by SHELL_FILE_HANDLE and returns the detailed help for any sub section specified in the comma separated list of sections provided. If the end of the file or a .TH section is found then return.

Upon a successful return the caller is responsible to free the memory in *HelpText

Parameters
[in]HandleFileHandle to read from
[in]Sectionsname of command's sub sections to find
[out]HelpTextpointer to pointer to string where text goes.
[out]HelpSizepointer to size of allocated HelpText (may be updated)
[in]AsciiTRUE if the file is ASCII, FALSE otherwise.
Return values
EFI_OUT_OF_RESOURCESa memory allocation failed.
EFI_SUCCESSthe section was found and its description stored in an allocated buffer.

Parses through the MAN file specified by SHELL_FILE_HANDLE and returns the detailed help for any sub section specified in the comma separated list of sections provided. If the end of the file or a .TH section is found then return.

Upon a successful return the caller is responsible to free the memory in *HelpText

Parameters
[in]HandleFileHandle to read from
[in]Sectionsname of command's sub sections to find
[out]HelpTextpointer to pointer to string where text goes.
[out]HelpSizepointer to size of allocated HelpText (may be updated)
[in]AsciiTRUE if the file is ASCII, FALSE otherwise.
Return values
EFI_OUT_OF_RESOURCESa memory allocation failed.
EFI_SUCCESSthe section was found and its description stored in an allocated buffer.

Definition at line 208 of file ShellManParser.c.

◆ ProcessManFile()

EFI_STATUS ProcessManFile ( IN CONST CHAR16 *  ManFileName,
IN CONST CHAR16 *  Command,
IN CONST CHAR16 *Sections  OPTIONAL,
OUT CHAR16 **  BriefDesc,
OUT CHAR16 **  HelpText 
)

This function returns the help information for the specified command. The help text will be parsed from a UEFI Shell manual page. (see UEFI Shell 2.0 Appendix B)

If Sections is specified, then each section name listed will be compared in a casesensitive manner, to the section names described in Appendix B. If the section exists, it will be appended to the returned help text. If the section does not exist, no information will be returned. If Sections is NULL, then all help text information available will be returned.

if BriefDesc is NULL, then the breif description will not be savedd separately, but placed first in the main HelpText.

Parameters
[in]ManFileNamePoints to the NULL-terminated UEFI Shell MAN file name.
[in]CommandPoints to the NULL-terminated UEFI Shell command name.
[in]SectionsPoints to the NULL-terminated comma-delimited section names to return. If NULL, then all sections will be returned.
[out]BriefDescOn return, points to a callee-allocated buffer containing brief description text.
[out]HelpTextOn return, points to a callee-allocated buffer containing all specified help text.
Return values
EFI_SUCCESSThe help text was returned.
EFI_OUT_OF_RESOURCESThe necessary buffer could not be allocated to hold the returned help text.
EFI_INVALID_PARAMETERHelpText is NULL
EFI_NOT_FOUNDThere is no help text available for Command.