int\r
EFIAPI\r
da_ConOpen(\r
+ IN DeviceNode *DevNode,\r
IN struct __filedes *filp,\r
- IN void *DevInstance,\r
+ IN int DevInstance,\r
IN CHAR16 *Path,\r
- IN CHAR16 *Flags\r
+ IN CHAR16 *MPath\r
);\r
\r
__END_DECLS\r
**/\r
RETURN_STATUS\r
EFIAPI\r
-ParsePath( const char *path, wchar_t **FullPath, DeviceNode **DevNode, int *Which);\r
+ParsePath( const char *path, wchar_t **FullPath, DeviceNode **DevNode, int *Which, wchar_t **MapPath);\r
\r
/** Process a wide character string representing a Mapping Path and extract the instance number.\r
\r
EFIAPI\r
PathAlias(wchar_t *Path, DeviceNode **Node);\r
\r
+/**\r
+ Parses a normalized wide character path and returns a pointer to the entry\r
+ following the last \. If a \ is not found in the path the return value will\r
+ be the same as the input value. All error conditions return NULL.\r
+\r
+ The behavior when passing in a path that has not been normalized is undefined.\r
+\r
+ @param Path - A pointer to a wide character string containing a path to a\r
+ directory or a file.\r
+\r
+ @return Pointer to the file name or terminal directory. NULL if an error is\r
+ detected.\r
+**/\r
+wchar_t *\r
+EFIAPI\r
+GetFileNameFromPath(\r
+ const wchar_t *Path\r
+ );\r
+\r
__END_DECLS\r
\r
#endif /* __DEV_UTILITY_H__ */\r
these libraries have been tested with. Changing this configuration may\r
produce code that will not build or may not run. Change at your own risk.\r
\r
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2011, 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
- http://opensource.org/licenses/bsd-license.php.\r
+ http://opensource.org/licenses/bsd-license.\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
#define _IEEE_LIBM 1\r
\r
#undef WITH_RUNE\r
+\r
+#if defined(__GNUC__)\r
+ #define REAL_LONG_DOUBLE_SUPPORT 1\r
+#endif\r
+\r
+/* Define these if the associated file exists. */\r
+//#define HAVE_NBTOOL_CONFIG_H\r
+\r
+/* Define these if StdLib provides the functionality as opposed to a "compatibility" library */\r
+\r
+//#define HAVE_GETOPT\r
+//#define HAVE_BASENAME\r
+//#define HAVE_FFS\r
+//#define HAVE_GETTIMEOFDAY\r
+//#define HAVE_SETPROGNAME 0\r
+//#define HAVE_STRLCPY\r
+//#define HAVE_STRLCAT\r
+//#define HAVE_DIRNAME\r
+#define HAVE_MKSTEMP\r
+#define HAVE_SNPRINTF\r
+#define HAVE_VSNPRINTF\r
+\r
+//#define USE_8BIT_CHARS\r
#include <limits.h>\r
#include <signal.h>\r
#include <time.h>\r
+#include <setjmp.h>\r
\r
#include <kfile.h>\r
#include <Device/Device.h>\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
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
void Efi2Tm( EFI_TIME *ET, struct tm *BT);\r
time_t Efi2Time( EFI_TIME *EfiBDtime);\r
\r
+int ffs(int x);\r
+\r
__END_DECLS\r
This structure must be a multiple of 8 bytes in length.\r
*/\r
struct __filedes {\r
+ off_t f_offset; /* current position in file */\r
const struct fileops *f_ops;\r
void *devdata; /* Device-specific data */\r
- off_t f_offset; /* current position in file */\r
- UINT32 f_flag; /* see fcntl.h */\r
- UINT32 f_iflags; // 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
+ UINT32 f_flag; /* see fcntl.h */\r
+ UINT32 f_iflags; // In use if non-zero\r
UINT16 MyFD; // Which FD this is.\r
UINT16 Reserved_1; // Force this structure to be a multiple of 8-bytes in length\r
};\r
\r
/* Type of all Device-specific handler's open routines. */\r
typedef\r
- int (EFIAPI *FO_OPEN) (struct __filedes *FD, void *IP, wchar_t *Path, wchar_t *Flags);\r
+ int (EFIAPI *FO_OPEN) (struct _Device_Node *This, struct __filedes *FD,\r
+ int Instance, wchar_t *Path, wchar_t *MPath);\r
\r
#define FILE_IS_USABLE(fp) (((fp)->f_iflags & \\r
(FIF_WANTCLOSE|FIF_LARVAL)) == 0)\r
fnullop_* Does nothing and returns success.\r
fbadop_* Does nothing and returns EPERM\r
*/\r
-int fnullop_fcntl (struct __filedes *filp, UINT32 Cmd, void *p3, void *p4);\r
-short fnullop_poll (struct __filedes *filp, short Events);\r
-int fnullop_flush (struct __filedes *filp);\r
-\r
-int fbadop_stat (struct __filedes *filp, struct stat *StatBuf, void *Buf);\r
-int fbadop_ioctl (struct __filedes *filp, ULONGN Cmd, void *argp);\r
-int fbadop_delete (struct __filedes *filp);\r
-int fbadop_rmdir (struct __filedes *filp);\r
-int fbadop_mkdir (const char *path, __mode_t perms);\r
-int fbadop_rename (const char *from, const char *to);\r
+int EFIAPI fnullop_fcntl (struct __filedes *filp, UINT32 Cmd, void *p3, void *p4);\r
+short EFIAPI fnullop_poll (struct __filedes *filp, short Events);\r
+int EFIAPI fnullop_flush (struct __filedes *filp);\r
+\r
+int EFIAPI fbadop_stat (struct __filedes *filp, struct stat *StatBuf, void *Buf);\r
+int EFIAPI fbadop_ioctl (struct __filedes *filp, ULONGN Cmd, void *argp);\r
+int EFIAPI fbadop_delete (struct __filedes *filp);\r
+int EFIAPI fbadop_rmdir (struct __filedes *filp);\r
+int EFIAPI fbadop_mkdir (const char *path, __mode_t perms);\r
+int EFIAPI fbadop_rename (const char *from, const char *to);\r
\r
__END_DECLS\r
\r
#include <sys/EfiCdefs.h>\r
\r
#ifndef __lint__\r
+#define ftello _ftello\r
+#define getcontext _getcontext\r
+#define getenv_r _getenv_r\r
+#define strtof _strtof\r
+#define strtoimax _strtoimax\r
+#define strtold _strtold\r
+#define strtoll _strtoll\r
+#define strtoull _strtoull\r
+#define strtoumax _strtoumax\r
+\r
+#if 0\r
#define brk _brk\r
#define catclose _catclose\r
#define catgets _catgets\r
#endif /* _REENTRANT */\r
#define fork _fork\r
#define fseeko _fseeko\r
-#define ftello _ftello\r
-#define getcontext _getcontext\r
-#define getenv_r _getenv_r\r
-//#define inet_aton _inet_aton\r
-//#define inet_pton _inet_pton\r
+#define inet_aton _inet_aton\r
+#define inet_pton _inet_pton\r
#define pipe _pipe\r
#define sbrk _sbrk\r
-//#define strerror_r _strerror_r\r
+#define strerror_r _strerror_r\r
#define strlcat _strlcat\r
#define strlcpy _strlcpy\r
-#define strtof _strtof\r
-#define strtoimax _strtoimax\r
-#define strtold _strtold\r
-#define strtoll _strtoll\r
-#define strtoull _strtoull\r
-#define strtoumax _strtoumax\r
#define sys_errlist _sys_errlist\r
#define sys_nerr _sys_nerr\r
#define sys_siglist _sys_siglist\r
#define warn _warn\r
#define warnx _warnx\r
\r
-#if 0\r
//#ifdef __weak_alias\r
#define MD2Data _MD2Data\r
#define MD2End _MD2End\r
#define ftrylockfile _ftrylockfile\r
#define funlockfile _funlockfile\r
#define fnmatch _fnmatch\r
-#define fparseln _fparseln\r
#define fpgetmask _fpgetmask\r
#define fpgetround _fpgetround\r
#define fpgetsticky _fpgetsticky\r