FileHandleWrappers.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /** @file
  2. EFI_FILE_PROTOCOL wrappers for other items (Like Environment Variables, StdIn, StdOut, StdErr, etc...)
  3. Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _SHELL_FILE_HANDLE_WRAPPERS_HEADER_
  7. #define _SHELL_FILE_HANDLE_WRAPPERS_HEADER_
  8. typedef struct {
  9. LIST_ENTRY Link;
  10. CHAR16 *Buffer;
  11. } SHELL_LINE_LIST;
  12. typedef struct {
  13. UINTN LogCount;
  14. SHELL_LINE_LIST *Log;
  15. } SHELL_LINE_LOG;
  16. ///
  17. /// FILE styte interfaces for StdIn.
  18. ///
  19. extern EFI_FILE_PROTOCOL FileInterfaceStdIn;
  20. ///
  21. /// FILE styte interfaces for StdOut.
  22. ///
  23. extern EFI_FILE_PROTOCOL FileInterfaceStdOut;
  24. ///
  25. /// FILE styte interfaces for StdErr.
  26. ///
  27. extern EFI_FILE_PROTOCOL FileInterfaceStdErr;
  28. ///
  29. /// FILE style interface for NUL file.
  30. ///
  31. extern EFI_FILE_PROTOCOL FileInterfaceNulFile;
  32. /**
  33. Creates a EFI_FILE_PROTOCOL (almost) object for using to access
  34. environment variables through file operations.
  35. @param EnvName The name of the Environment Variable to be operated on.
  36. @retval NULL Memory could not be allocated.
  37. @return other a pointer to an EFI_FILE_PROTOCOL structure
  38. **/
  39. EFI_FILE_PROTOCOL *
  40. CreateFileInterfaceEnv (
  41. CONST CHAR16 *EnvName
  42. );
  43. /**
  44. Creates a EFI_FILE_PROTOCOL (almost) object for using to access
  45. a file entirely in memory through file operations.
  46. @param[in] Unicode TRUE if the data is UNICODE, FALSE otherwise.
  47. @retval NULL Memory could not be allocated.
  48. @return other a pointer to an EFI_FILE_PROTOCOL structure
  49. **/
  50. EFI_FILE_PROTOCOL *
  51. CreateFileInterfaceMem (
  52. IN CONST BOOLEAN Unicode
  53. );
  54. /**
  55. Creates a EFI_FILE_PROTOCOL (almost) object for using to access
  56. a file entirely with unicode awareness through file operations.
  57. @param[in] Template The pointer to the handle to start with.
  58. @param[in] Unicode TRUE if the data is UNICODE, FALSE otherwise.
  59. @retval NULL Memory could not be allocated.
  60. @return other a pointer to an EFI_FILE_PROTOCOL structure
  61. **/
  62. EFI_FILE_PROTOCOL *
  63. CreateFileInterfaceFile (
  64. IN CONST EFI_FILE_PROTOCOL *Template,
  65. IN CONST BOOLEAN Unicode
  66. );
  67. #endif //_SHELL_FILE_HANDLE_WRAPPERS_HEADER_