summaryrefslogtreecommitdiff
path: root/ShellPkg/Include
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-16 00:23:19 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-16 00:23:19 +0000
commitb1f95a06ca1a66ad15b3d8843fb4c7563c5350d2 (patch)
treecf88e0c20fe3952951914456198608b58c471aa1 /ShellPkg/Include
parent14e96c2996a138b22f544da4d7921782ef85e51e (diff)
downloadedk2-b1f95a06ca1a66ad15b3d8843fb4c7563c5350d2.zip
edk2-b1f95a06ca1a66ad15b3d8843fb4c7563c5350d2.tar.gz
edk2-b1f95a06ca1a66ad15b3d8843fb4c7563c5350d2.tar.bz2
Updating with new functions and adding "C" style entrypoint library with example application.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8564 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Include')
-rw-r--r--ShellPkg/Include/Library/FileHandleLib.h78
-rw-r--r--ShellPkg/Include/Library/ShellCEntryLib.h32
-rw-r--r--ShellPkg/Include/Library/ShellLib.h38
-rw-r--r--ShellPkg/Include/Protocol/EfiShell.h2
4 files changed, 142 insertions, 8 deletions
diff --git a/ShellPkg/Include/Library/FileHandleLib.h b/ShellPkg/Include/Library/FileHandleLib.h
index 3d2bbd1..8547fd2 100644
--- a/ShellPkg/Include/Library/FileHandleLib.h
+++ b/ShellPkg/Include/Library/FileHandleLib.h
@@ -12,13 +12,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#include <Uefi.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-
/**
This function will retrieve the information about the file for the handle
specified and store it in allocated pool memory.
@@ -328,4 +321,75 @@ EFIAPI
FileHandleGetSize (
IN EFI_FILE_HANDLE FileHandle,
OUT UINT64 *Size
+ );
+
+/**
+ Function to get a full filename given a EFI_FILE_HANDLE somewhere lower on the
+ directory 'stack'.
+
+ if Handle is NULL, return EFI_INVALID_PARAMETER
+
+ @param[in] Handle Handle to the Directory or File to create path to.
+ @param[out] FullFileName pointer to pointer to generated full file name. It
+ is the responsibility of the caller to free this memory
+ with a call to FreePool().
+ @retval EFI_SUCCESS the operation was sucessful and the FullFileName is valid.
+ @retval EFI_INVALID_PARAMETER Handle was NULL.
+ @retval EFI_INVALID_PARAMETER FullFileName was NULL.
+ @retval EFI_OUT_OF_MEMORY a memory allocation failed.
+**/
+EFI_STATUS
+EFIAPI
+FileHandleGetFileName (
+ IN CONST EFI_FILE_HANDLE Handle,
+ OUT CHAR16 **FullFileName
+ );
+
+/**
+ Function to read a single line (up to but not including the \n) from a file.
+
+ @param[in] Handle FileHandle to read from
+ @param[in][out] Buffer pointer to buffer to read into
+ @param[in][out] Size pointer to number of bytes in buffer
+ @param[in[ Truncate if TRUE then allows for truncation of the line to fit.
+ if FALSE will reset the position to the begining of the
+ line if the buffer is not large enough.
+
+ @retval EFI_SUCCESS the operation was sucessful. the line is stored in
+ Buffer. (Size was NOT updated)
+ @retval EFI_INVALID_PARAMETER Handle was NULL.
+ @retval EFI_INVALID_PARAMETER Buffer was NULL.
+ @retval EFI_INVALID_PARAMETER Size was NULL.
+ @retval EFI_BUFFER_TOO_SMALL Size was not enough space to store the line.
+ Size was updated to minimum space required.
+ @sa FileHandleRead
+**/
+EFI_STATUS
+EFIAPI
+FileHandleReadLine(
+ IN EFI_FILE_HANDLE Handle,
+ IN OUT VOID *Buffer,
+ IN OUT UINTN *Size,
+ IN BOOLEAN Truncate
+ );
+
+/**
+ function to write a line of unicode text to a file.
+
+ if Handle is NULL, ASSERT.
+ if Buffer is NULL, do nothing. (return SUCCESS)
+
+ @param[in] Handle FileHandle to write to
+ @param[in] Buffer Buffer to write
+
+ @retval EFI_SUCCESS the data was written.
+ @retval other failure.
+
+ @sa FileHandleWrite
+**/
+EFI_STATUS
+EFIAPI
+FileHandleWriteLine(
+ IN EFI_FILE_HANDLE Handle,
+ IN CHAR16 *Buffer
); \ No newline at end of file
diff --git a/ShellPkg/Include/Library/ShellCEntryLib.h b/ShellPkg/Include/Library/ShellCEntryLib.h
new file mode 100644
index 0000000..762c95b
--- /dev/null
+++ b/ShellPkg/Include/Library/ShellCEntryLib.h
@@ -0,0 +1,32 @@
+/** @file
+ Provides application point extension for "C" style main funciton
+
+Copyright (c) 2006 - 2009, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+/**
+ Intermediate entry point for the application that will in turn call into the "C"
+ style main function.
+
+ this application must have a function like:
+ INT32
+ EFIAPI
+ main(
+ UINTN Argc,
+ CHAR16 **Argv
+ );
+**/
+EFI_STATUS
+EFIAPI
+ShellCEntry(
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ ); \ No newline at end of file
diff --git a/ShellPkg/Include/Library/ShellLib.h b/ShellPkg/Include/Library/ShellLib.h
index 1a9ef5a..f0998d8 100644
--- a/ShellPkg/Include/Library/ShellLib.h
+++ b/ShellPkg/Include/Library/ShellLib.h
@@ -749,4 +749,42 @@ EFIAPI
ShellInitialize (
);
+/**
+ Print at a specific location on the screen.
+
+ This function will move the cursor to a given screen location, print the specified string,
+ and return the cursor to the original locaiton.
+
+ If -1 is specified for either the Row or Col the current screen location for BOTH
+ will be used and the cursor's position will not be moved back to an original location.
+
+ if either Row or Col is out of range for the current console, then ASSERT
+ if Format is NULL, then ASSERT
+
+ In addition to the standard %-based flags as supported by UefiLib Print() this supports
+ the following additional flags:
+ %N - Set output attribute to normal
+ %H - Set output attribute to highlight
+ %E - Set output attribute to error
+ %B - Set output attribute to blue color
+ %V - Set output attribute to green color
+
+ Note: The background color is controlled by the shell command cls.
+
+ @param[in] Row the row to print at
+ @param[in] Col the column to print at
+ @param[in] Format the format string
+
+ @return the number of characters printed to the screen
+**/
+
+UINTN
+EFIAPI
+ShellPrintEx(
+ IN INT32 Col OPTIONAL,
+ IN INT32 Row OPTIONAL,
+ IN CONST CHAR16 *Format,
+ ...
+ );
+
#endif // __SHELL_LIB__ \ No newline at end of file
diff --git a/ShellPkg/Include/Protocol/EfiShell.h b/ShellPkg/Include/Protocol/EfiShell.h
index 67306bb..967bdc5 100644
--- a/ShellPkg/Include/Protocol/EfiShell.h
+++ b/ShellPkg/Include/Protocol/EfiShell.h
@@ -501,7 +501,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_GET_HELP_TEXT) (
IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Sections,
+ IN CONST CHAR16 *Sections OPTIONAL,
OUT CHAR16 **HelpText
);