/** @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
+#include <setjmp.h>\r
+\r
+#include <kfile.h>\r
+#include <Device/Device.h>\r
+\r
+#include "Device/Console.h"\r
\r
/* ################## Type Declarations ################################# */\r
\r
** 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
\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
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
char ASasctime[ASCTIME_BUFLEN]; // Only modified by asctime\r
\r
+ jmp_buf MainExit; ///< Save environment used for implementing _Exit()\r
+ int ExitValue; ///< Value being returned by _Exit()\r
+\r
BOOLEAN aborting; // Ensures cleanup function only called once when aborting.\r
};\r
\r