]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Changes so that Argv points to narrow-character versions of the command-line arguments.
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 30 Jul 2011 00:25:54 +0000 (00:25 +0000)
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 30 Jul 2011 00:25:54 +0000 (00:25 +0000)
Fix "long double" handling and differences between MSFT and GCC compilers.
Fix compliance issues with ISO/IEC 9899:199409
New Function declarations:
setenv(), fparseln(), GetFileNameFromPath(), rename()

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12060 6f19259b-4bc3-4df7-8a09-765794883524

StdLibPrivateInternalFiles/Include/Device/Console.h
StdLibPrivateInternalFiles/Include/Device/Device.h
StdLibPrivateInternalFiles/Include/LibConfig.h
StdLibPrivateInternalFiles/Include/MainData.h
StdLibPrivateInternalFiles/Include/extern.h
StdLibPrivateInternalFiles/Include/kfile.h
StdLibPrivateInternalFiles/Include/namespace.h

index 6f6566048515cc4941ca60b452a39b7dbfd9d65f..e97ee3fd2c693a313b17e75fb3a571ed4af92fdb 100644 (file)
@@ -51,10 +51,11 @@ __BEGIN_DECLS
 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
index 68eade05239d487af6eed4b436441369ea2eba90..cf2053d8b3efabd84a864cebe5352d2c70480aef 100644 (file)
@@ -127,7 +127,7 @@ NormalizePath( const char *path);
 **/\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
@@ -192,6 +192,25 @@ wchar_t *
 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
index 67f49c244bedfd96be5d726d2c087c3f3566f5e6..d925ac3258b231c9f610ec425600b912a7ae8b46 100644 (file)
@@ -8,11 +8,11 @@
   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
index b4b071a0805111a6bce759ec9557b46ead2d4057..fcb28e3255bea545829e3811f9784dedf7219b5a 100644 (file)
@@ -18,6 +18,7 @@
 #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
@@ -74,7 +75,6 @@ struct  __MainData {
   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
@@ -88,6 +88,9 @@ struct  __MainData {
   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
index 14e6fa04da2d0c5639115d25e72989983a3d5c24..ff37d1c0a4b9377632356f37caa55e49d3a97574 100644 (file)
@@ -66,4 +66,6 @@ int vsnprintf_ss(char * __restrict, size_t, const char * __restrict,
 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
index 845b7d908e845d994ce2d458210c859863ef6bbd..c83b07b1a86b10f94f6890000fdc615500ffbbd4 100644 (file)
@@ -79,14 +79,14 @@ struct _Device_Node;
     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
@@ -130,7 +130,8 @@ typedef struct {
 \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
@@ -153,16 +154,16 @@ int   fdcreate    (CHAR16 *, UINT32, UINT32, BOOLEAN, VOID *, const struct fileo
       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
index 038e402cc8c61d50f421f1116ad00b48089b3825..67666fc999f7e328fb4c442bb5407716dd5e7c19 100644 (file)
 #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
@@ -79,7 +81,6 @@
 #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