]>
Commit | Line | Data |
---|---|---|
d2b4564b | 1 | /** @file\r |
2 | Provides interface to shell functionality for shell commands and applications.\r | |
3 | \r | |
583448b4 | 4 | (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r |
ba0014b9 | 5 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
56ba3746 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
d2b4564b | 7 | \r |
8 | **/\r | |
9 | \r | |
a1d4bfcc | 10 | #ifndef _UEFI_SHELL_LIB_INTERNAL_H_\r |
252d9457 | 11 | #define _UEFI_SHELL_LIB_INTERNAL_H_\r |
12 | \r | |
b3011f40 | 13 | #include <Uefi.h>\r |
14 | \r | |
15 | #include <Guid/FileInfo.h>\r | |
16 | \r | |
17 | #include <Protocol/SimpleFileSystem.h>\r | |
18 | #include <Protocol/LoadedImage.h>\r | |
19 | #include <Protocol/EfiShellInterface.h>\r | |
20 | #include <Protocol/EfiShellEnvironment2.h>\r | |
28165f24 RN |
21 | #include <Protocol/Shell.h>\r |
22 | #include <Protocol/ShellParameters.h>\r | |
583448b4 | 23 | #include <Protocol/UnicodeCollation.h>\r |
b3011f40 | 24 | \r |
25 | #include <Library/UefiBootServicesTableLib.h>\r | |
26 | #include <Library/BaseLib.h>\r | |
27 | #include <Library/BaseMemoryLib.h>\r | |
28 | #include <Library/DebugLib.h>\r | |
29 | #include <Library/MemoryAllocationLib.h>\r | |
30 | #include <Library/DevicePathLib.h>\r | |
31 | #include <Library/PcdLib.h>\r | |
32 | #include <Library/FileHandleLib.h>\r | |
33 | #include <Library/PrintLib.h>\r | |
34 | #include <Library/UefiLib.h>\r | |
35 | #include <Library/HiiLib.h>\r | |
36 | #include <Library/ShellLib.h>\r | |
37 | \r | |
d2b4564b | 38 | typedef struct {\r |
47d20b54 MK |
39 | EFI_SHELL_GET_FILE_INFO GetFileInfo;\r |
40 | EFI_SHELL_SET_FILE_INFO SetFileInfo;\r | |
41 | EFI_SHELL_READ_FILE ReadFile;\r | |
42 | EFI_SHELL_WRITE_FILE WriteFile;\r | |
43 | EFI_SHELL_CLOSE_FILE CloseFile;\r | |
44 | EFI_SHELL_DELETE_FILE DeleteFile;\r | |
45 | EFI_SHELL_GET_FILE_POSITION GetFilePosition;\r | |
46 | EFI_SHELL_SET_FILE_POSITION SetFilePosition;\r | |
47 | EFI_SHELL_FLUSH_FILE FlushFile;\r | |
48 | EFI_SHELL_GET_FILE_SIZE GetFileSize;\r | |
d2b4564b | 49 | } FILE_HANDLE_FUNCTION_MAP;\r |
252d9457 | 50 | \r |
51 | /**\r | |
52 | Function to determin if an entire string is a valid number.\r | |
53 | \r | |
54 | If Hex it must be preceeded with a 0x or has ForceHex, set TRUE.\r | |
55 | \r | |
56 | @param[in] String The string to evaluate.\r | |
57 | @param[in] ForceHex TRUE - always assume hex.\r | |
58 | @param[in] StopAtSpace TRUE to halt upon finding a space, FALSE to keep going.\r | |
658bf43e | 59 | @param[in] TimeNumbers TRUE to allow numbers with ":", FALSE otherwise.\r |
252d9457 | 60 | \r |
61 | @retval TRUE It is all numeric (dec/hex) characters.\r | |
62 | @retval FALSE There is a non-numeric character.\r | |
63 | **/\r | |
64 | BOOLEAN\r | |
252d9457 | 65 | InternalShellIsHexOrDecimalNumber (\r |
66 | IN CONST CHAR16 *String,\r | |
67 | IN CONST BOOLEAN ForceHex,\r | |
658bf43e | 68 | IN CONST BOOLEAN StopAtSpace,\r |
69 | IN CONST BOOLEAN TimeNumbers\r | |
252d9457 | 70 | );\r |
71 | \r | |
0960ba17 QS |
72 | /**\r |
73 | Cleans off all the quotes in the string.\r | |
74 | \r | |
75 | @param[in] OriginalString pointer to the string to be cleaned.\r | |
ba0014b9 LG |
76 | @param[out] CleanString The new string with all quotes removed.\r |
77 | Memory allocated in the function and free\r | |
0960ba17 QS |
78 | by caller.\r |
79 | \r | |
80 | @retval EFI_SUCCESS The operation was successful.\r | |
81 | **/\r | |
82 | EFI_STATUS\r | |
0960ba17 | 83 | InternalShellStripQuotes (\r |
47d20b54 MK |
84 | IN CONST CHAR16 *OriginalString,\r |
85 | OUT CHAR16 **CleanString\r | |
0960ba17 QS |
86 | );\r |
87 | \r | |
252d9457 | 88 | #endif\r |