ConsoleWrappers.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /** @file
  2. Function definitions for shell simple text in and out on top of file handles.
  3. (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
  4. Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef _SHELL_CONSOLE_WRAPPERS_HEADER_
  8. #define _SHELL_CONSOLE_WRAPPERS_HEADER_
  9. /**
  10. Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a
  11. SHELL_FILE_HANDLE to support redirecting input from a file.
  12. @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use.
  13. @param[in] HandleLocation The pointer of a location to copy handle with protocol to.
  14. @retval NULL There was insufficient memory available.
  15. @return A pointer to the allocated protocol structure;
  16. **/
  17. EFI_SIMPLE_TEXT_INPUT_PROTOCOL *
  18. CreateSimpleTextInOnFile (
  19. IN SHELL_FILE_HANDLE FileHandleToUse,
  20. IN EFI_HANDLE *HandleLocation
  21. );
  22. /**
  23. Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a
  24. SHELL_FILE_HANDLE to support redirecting input from a file.
  25. @param[in] SimpleTextIn The pointer to the SimpleTextIn to close.
  26. @retval EFI_SUCCESS The object was closed.
  27. **/
  28. EFI_STATUS
  29. CloseSimpleTextInOnFile (
  30. IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *SimpleTextIn
  31. );
  32. /**
  33. Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a
  34. SHELL_FILE_HANDLE to support redirecting output from a file.
  35. @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use.
  36. @param[in] HandleLocation The pointer of a location to copy handle with protocol to.
  37. @param[in] OriginalProtocol The pointer to the original output protocol for pass thru of functions.
  38. @retval NULL There was insufficient memory available.
  39. @return A pointer to the allocated protocol structure;
  40. **/
  41. EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *
  42. CreateSimpleTextOutOnFile (
  43. IN SHELL_FILE_HANDLE FileHandleToUse,
  44. IN EFI_HANDLE *HandleLocation,
  45. IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *OriginalProtocol
  46. );
  47. /**
  48. Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a
  49. SHELL_FILE_HANDLE to support redirecting output from a file.
  50. @param[in] SimpleTextOut The pointer to the SimpleTextOUT to close.
  51. @retval EFI_SUCCESS The object was closed.
  52. **/
  53. EFI_STATUS
  54. CloseSimpleTextOutOnFile (
  55. IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut
  56. );
  57. #endif //_SHELL_CONSOLE_WRAPPERS_HEADER_