]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLibPrivateInternalFiles/Include/MainData.h
Add device abstraction code for the UEFI Console and UEFI Shell-based file systems.
[mirror_edk2.git] / StdLibPrivateInternalFiles / Include / MainData.h
index 7788cb8310b6d52d8a7d7302eaa2aa0db74ac64e..b4b071a0805111a6bce759ec9557b46ead2d4057 100644 (file)
@@ -1,24 +1,28 @@
 /** @file\r
   Global data for the program environment.\r
 \r
-  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials are licensed and made available under\r
-  the terms and conditions of the BSD License that accompanies this distribution.\r
-  The full text of the license may be found at\r
+  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials are licensed and made available\r
+  under the terms and conditions of the BSD License which accompanies this\r
+  distribution.  The full text of the license may be found at\r
   http://opensource.org/licenses/bsd-license.php.\r
 \r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 **/\r
 #include  <Uefi.h>\r
-#include  <Library/ShellLib.h>\r
 \r
+#include  <stdio.h>\r
+#include  <stdlib.h>\r
+#include  <sys/types.h>\r
 #include  <limits.h>\r
 #include  <signal.h>\r
-#include  <stdlib.h>\r
-#include  <stdio.h>\r
 #include  <time.h>\r
-#include  "Efi/Console.h"\r
+\r
+#include  <kfile.h>\r
+#include  <Device/Device.h>\r
+\r
+#include  "Device/Console.h"\r
 \r
 /* ##################  Type Declarations  ################################# */\r
 \r
@@ -52,28 +56,25 @@ typedef void            __xithandler_t(void);
 ** three explicit spaces, two explicit colons, a newline,\r
 ** and a trailing ASCII nul).\r
 */\r
-#define ASCTIME_BUFLEN  (3 * 2 + 5 * INT_STRLEN_MAXIMUM(int) + 3 + 2 + 1 + 1)\r
-\r
-struct  __filedes {\r
-  EFI_FILE_HANDLE   FileHandle;\r
-  UINT32            State;        // In use if non-zero\r
-  int               Oflags;       // From the open call\r
-  int               Omode;        // From the open call\r
-  int               RefCount;     // Reference count of opens\r
-  int               SocProc;      // Placeholder: socket owner process or process group.\r
-  UINT16            MyFD;         // Which FD this is.\r
-};\r
+#define ASCTIME_BUFLEN  ((2 * 3) + (5 * INT_STRLEN_MAXIMUM(int)) + 3 + 2 + 1 + 1)\r
+\r
+struct __filedes;   /* Forward Reference */\r
+struct stat;        /* Forward Reference so I don't have to include <stat.h> */\r
 \r
 struct  __MainData {\r
   // File descriptors\r
   struct __filedes  fdarray[OPEN_MAX];\r
   // Low-level File abstractions for the stdin, stdout, stderr streams\r
-  ConInstance       StdIo[3];\r
+  ConInstance      *StdIo[3];\r
 \r
   // Signal Handlers\r
   __sighandler_t    *sigarray[SIG_LAST];      // Pointers to signal handlers\r
 \r
-  void (*cleanup)(void);   // Cleanup Function Pointer\r
+  char              *NArgV[ARGC_MAX];         // Narrow character argv array\r
+  char              *NCmdLine;                // Narrow character version of command line arguments.\r
+\r
+  void (*cleanup)(void);        // Stdio Cleanup Function Pointer\r
+  void (*FinalCleanup)(void);   // Function to free this structure and cleanup before exit.\r
 \r
   __xithandler_t   *atexit_handler[ATEXIT_MAX];  // Array of handlers for atexit.\r
   clock_t           AppStartTime;                // Set in Main.c and used for time.h\r
@@ -81,6 +82,7 @@ struct  __MainData {
   int               num_atexit;                  ///< Number of registered atexit handlers.\r
 \r
   CHAR16            UString[UNICODE_STRING_MAX];\r
+  CHAR16            UString2[UNICODE_STRING_MAX];\r
   struct tm         BDTime;                       // Broken-down time structure for localtime.\r
   EFI_TIME          TimeBuffer;                   // Used by <time.h>mk\r
   char              ASgetenv[ASCII_STRING_MAX];   // Only modified by getenv\r