AppPkg/.../Python-2.7.10: AppPkg.dsc, pyconfig.h, PyMod-2.7.10

Apply UEFI-specific changes to files to make them equivalent to the Python 2.7.2 versions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <edk2-lists@mc2research.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>

---
 AppPkg/AppPkg.dsc                                  |   5 +-
 .../Python/Python-2.7.10/Ia32/pyconfig.h           |  93 ++++++++----
 .../Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py       |  30 +++-
 .../Python/Python-2.7.10/PyMod-2.7.10/Lib/os.py    |  35 ++++-
 .../Python/Python-2.7.10/PyMod-2.7.10/Lib/pydoc.py |  17 +++
 .../Python/Python-2.7.10/PyMod-2.7.10/Lib/site.py  | 165 ++++++---------------
 .../Python-2.7.10/PyMod-2.7.10/Modules/_sre.c      | 150 ++++++++++---------
 .../Python-2.7.10/PyMod-2.7.10/Modules/addrinfo.h  | 101 +++++++------
 .../PyMod-2.7.10/Modules/errnomodule.c             |  57 ++++++-
 .../PyMod-2.7.10/Modules/expat/expat_external.h    |   4 +-
 .../Python-2.7.10/PyMod-2.7.10/Modules/getpath.c   | 143 +++++-------------
 .../Python-2.7.10/PyMod-2.7.10/Modules/main.c      |  61 ++++----
 .../PyMod-2.7.10/Modules/selectmodule.c            |  43 ++++--
 .../PyMod-2.7.10/Modules/zlib/gzguts.h             |  10 +-
 .../PyMod-2.7.10/Modules/zlib/zutil.h              |  11 +-
 .../PyMod-2.7.10/Objects/longobject.c              |  14 +-
 .../PyMod-2.7.10/Objects/stringlib/localeutil.h    |  17 ++-
 .../PyMod-2.7.10/Python/getcopyright.c             |  24 ++-
 .../Python-2.7.10/PyMod-2.7.10/Python/marshal.c    |  21 ++-
 .../Python-2.7.10/PyMod-2.7.10/Python/random.c     |  32 +++-
 .../Python/Python-2.7.10/X64/pyconfig.h            |  63 ++++++--
 21 files changed, 640 insertions(+), 456 deletions(-)


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19462 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Daryl McDaniel 2015-12-23 00:15:45 +00:00 committed by darylm503
parent 5285ac3eba
commit d11973f1ca
21 changed files with 634 additions and 450 deletions

View File

@ -126,9 +126,12 @@
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80400040 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80400040
} }
#### Un-comment the following line to build Python. #### Un-comment the following line to build Python 2.7.2.
# AppPkg/Applications/Python/PythonCore.inf # AppPkg/Applications/Python/PythonCore.inf
#### Un-comment the following line to build Python 2.7.10.
# AppPkg/Applications/Python/Python-2.7.10/Python2710.inf
#### Un-comment the following line to build Lua. #### Un-comment the following line to build Lua.
# AppPkg/Applications/Lua/Lua.inf # AppPkg/Applications/Lua/Lua.inf

View File

@ -1,6 +1,7 @@
/** @file /** @file
Manually generated Python Configuration file for EDK II. Manually generated Python Configuration file for EDK II.
Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR> Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution. the terms and conditions of the BSD License that accompanies this distribution.
@ -67,6 +68,9 @@
/* Define to 1 if you have the 'alarm' function. */ /* Define to 1 if you have the 'alarm' function. */
#undef HAVE_ALARM #undef HAVE_ALARM
/* Define to 1 if you have the <alloca.h> header file. */
#undef HAVE_ALLOCA_H
/* Define this if your time.h defines altzone. */ /* Define this if your time.h defines altzone. */
#undef HAVE_ALTZONE #undef HAVE_ALTZONE
@ -109,6 +113,9 @@
/* define to 1 if your sem_getvalue is broken. */ /* define to 1 if your sem_getvalue is broken. */
#define HAVE_BROKEN_SEM_GETVALUE 1 #define HAVE_BROKEN_SEM_GETVALUE 1
/* Define if 'unsetenv' does not return an int. */
#undef HAVE_BROKEN_UNSETENV
/* Define this if you have the type _Bool. */ /* Define this if you have the type _Bool. */
#define HAVE_C99_BOOL 1 #define HAVE_C99_BOOL 1
@ -170,10 +177,10 @@
/* Define to 1 if you have the device macros. */ /* Define to 1 if you have the device macros. */
#undef HAVE_DEVICE_MACROS #undef HAVE_DEVICE_MACROS
/* Define if we have /dev/ptc. */ /* Define to 1 if you have the /dev/ptc device file. */
#undef HAVE_DEV_PTC #undef HAVE_DEV_PTC
/* Define if we have /dev/ptmx. */ /* Define to 1 if you have the /dev/ptmx device file. */
#undef HAVE_DEV_PTMX #undef HAVE_DEV_PTMX
/* Define to 1 if you have the <direct.h> header file. */ /* Define to 1 if you have the <direct.h> header file. */
@ -274,11 +281,11 @@
#undef HAVE_GAMMA #undef HAVE_GAMMA
/* Define if we can use gcc inline assembler to get and set x87 control word /* Define if we can use gcc inline assembler to get and set x87 control word
*/ */
#if defined(__GNUC__) #if defined(__GNUC__)
#define HAVE_GCC_ASM_FOR_X87 1 #define HAVE_GCC_ASM_FOR_X87 1
#else #else
#undef HAVE_GCC_ASM_FOR_X87 #undef HAVE_GCC_ASM_FOR_X87
#endif #endif
/* Define if you have the getaddrinfo function. */ /* Define if you have the getaddrinfo function. */
@ -290,6 +297,9 @@
/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */ /* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
#undef HAVE_GETC_UNLOCKED #undef HAVE_GETC_UNLOCKED
/* Define to 1 if you have the 'getentropy' function. */
#undef HAVE_GETENTROPY
/* Define to 1 if you have the 'getgroups' function. */ /* Define to 1 if you have the 'getgroups' function. */
#undef HAVE_GETGROUPS #undef HAVE_GETGROUPS
@ -383,6 +393,12 @@
/* Define to 1 if you have the 'initgroups' function. */ /* Define to 1 if you have the 'initgroups' function. */
#undef HAVE_INITGROUPS #undef HAVE_INITGROUPS
/* Define if your compiler provides int32_t. */
#undef HAVE_INT32_T
/* Define if your compiler provides int64_t. */
#undef HAVE_INT64_T
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1 #define HAVE_INTTYPES_H 1
@ -479,6 +495,9 @@
/* Define to 1 if you have the 'mktime' function. */ /* Define to 1 if you have the 'mktime' function. */
#define HAVE_MKTIME 1 #define HAVE_MKTIME 1
/* Define to 1 if you have the 'mmap' function. */
#undef HAVE_MMAP
/* Define to 1 if you have the 'mremap' function. */ /* Define to 1 if you have the 'mremap' function. */
#undef HAVE_MREMAP #undef HAVE_MREMAP
@ -524,6 +543,9 @@
/* Define if you have GNU PTH threads. */ /* Define if you have GNU PTH threads. */
#undef HAVE_PTH #undef HAVE_PTH
/* Define to 1 if you have the 'pthread_atfork' function. */
#undef HAVE_PTHREAD_ATFORK
/* Defined for Solaris 2.6 bug in pthread header. */ /* Defined for Solaris 2.6 bug in pthread header. */
#undef HAVE_PTHREAD_DESTRUCTOR #undef HAVE_PTHREAD_DESTRUCTOR
@ -542,6 +564,9 @@
/* Define to 1 if you have the 'putenv' function. */ /* Define to 1 if you have the 'putenv' function. */
#undef HAVE_PUTENV #undef HAVE_PUTENV
/* Define if the libcrypto has RAND_egd */
#undef HAVE_RAND_EGD
/* Define to 1 if you have the 'readlink' function. */ /* Define to 1 if you have the 'readlink' function. */
#undef HAVE_READLINK #undef HAVE_READLINK
@ -679,22 +704,22 @@
#define HAVE_STDARG_PROTOTYPES 1 #define HAVE_STDARG_PROTOTYPES 1
/* Define to 1 if you have the <stdint.h> header file. */ /* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */ /* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1 #define HAVE_STDLIB_H 1
/* Define to 1 if you have the 'strdup' function. */ /* Define to 1 if you have the 'strdup' function. */
#define HAVE_STRDUP 1 #define HAVE_STRDUP 1
/* Define to 1 if you have the 'strftime' function. */ /* Define to 1 if you have the 'strftime' function. */
#define HAVE_STRFTIME 1 #define HAVE_STRFTIME 1
/* Define to 1 if you have the <strings.h> header file. */ /* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H #undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */ /* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
/* Define to 1 if you have the <stropts.h> header file. */ /* Define to 1 if you have the <stropts.h> header file. */
#undef HAVE_STROPTS_H #undef HAVE_STROPTS_H
@ -717,6 +742,12 @@
/* Define to 1 if 'st_rdev' is a member of 'struct stat'. */ /* Define to 1 if 'st_rdev' is a member of 'struct stat'. */
#undef HAVE_STRUCT_STAT_ST_RDEV #undef HAVE_STRUCT_STAT_ST_RDEV
/* Define to 1 if 'st_dev' is a member of 'struct stat'. */
#undef HAVE_STRUCT_STAT_ST_DEV
/* Define to 1 if 'st_ino' is a member of 'struct stat'. */
#undef HAVE_STRUCT_STAT_ST_INO
/* Define to 1 if 'tm_zone' is a member of 'struct tm'. */ /* Define to 1 if 'tm_zone' is a member of 'struct tm'. */
#undef HAVE_STRUCT_TM_TM_ZONE #undef HAVE_STRUCT_TM_TM_ZONE
@ -769,13 +800,13 @@
#undef HAVE_SYS_NDIR_H #undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/param.h> header file. */ /* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1 #define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/poll.h> header file. */ /* Define to 1 if you have the <sys/poll.h> header file. */
#define HAVE_SYS_POLL_H 1 #define HAVE_SYS_POLL_H 1
/* Define to 1 if you have the <sys/resource.h> header file. */ /* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1 #define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/select.h> header file. */ /* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1 #define HAVE_SYS_SELECT_H 1
@ -787,7 +818,7 @@
#undef HAVE_SYS_STATVFS_H #undef HAVE_SYS_STATVFS_H
/* Define to 1 if you have the <sys/stat.h> header file. */ /* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1 #define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/termio.h> header file. */ /* Define to 1 if you have the <sys/termio.h> header file. */
#undef HAVE_SYS_TERMIO_H #undef HAVE_SYS_TERMIO_H
@ -796,10 +827,10 @@
#undef HAVE_SYS_TIMES_H #undef HAVE_SYS_TIMES_H
/* Define to 1 if you have the <sys/time.h> header file. */ /* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1 #define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */ /* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/un.h> header file. */ /* Define to 1 if you have the <sys/un.h> header file. */
#undef HAVE_SYS_UN_H #undef HAVE_SYS_UN_H
@ -820,7 +851,7 @@
#undef HAVE_TCSETPGRP #undef HAVE_TCSETPGRP
/* Define to 1 if you have the 'tempnam' function. */ /* Define to 1 if you have the 'tempnam' function. */
#define HAVE_TEMPNAM 1 #define HAVE_TEMPNAM 1
/* Define to 1 if you have the <termios.h> header file. */ /* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H #undef HAVE_TERMIOS_H
@ -841,10 +872,10 @@
#undef HAVE_TIMES #undef HAVE_TIMES
/* Define to 1 if you have the 'tmpfile' function. */ /* Define to 1 if you have the 'tmpfile' function. */
#define HAVE_TMPFILE 1 #define HAVE_TMPFILE 1
/* Define to 1 if you have the 'tmpnam' function. */ /* Define to 1 if you have the 'tmpnam' function. */
#define HAVE_TMPNAM 1 #define HAVE_TMPNAM 1
/* Define to 1 if you have the 'tmpnam_r' function. */ /* Define to 1 if you have the 'tmpnam_r' function. */
#undef HAVE_TMPNAM_R #undef HAVE_TMPNAM_R
@ -863,8 +894,14 @@
/* Define this if you have tcl and TCL_UTF_MAX==6 */ /* Define this if you have tcl and TCL_UTF_MAX==6 */
#undef HAVE_UCS4_TCL #undef HAVE_UCS4_TCL
/* Define if your compiler provides uint32_t. */
#undef HAVE_UINT32_T
/* Define if your compiler provides uint64_t. */
#undef HAVE_UINT64_T
/* Define to 1 if the system has the type 'uintptr_t'. */ /* Define to 1 if the system has the type 'uintptr_t'. */
#define HAVE_UINTPTR_T 1 #define HAVE_UINTPTR_T 1
/* Define to 1 if you have the 'uname' function. */ /* Define to 1 if you have the 'uname' function. */
#undef HAVE_UNAME #undef HAVE_UNAME
@ -932,22 +969,22 @@
#undef MVWDELCH_IS_EXPRESSION #undef MVWDELCH_IS_EXPRESSION
/* Define to the address where bug reports for this package should be sent. */ /* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "edk2-devel@lists.sourceforge.net" #define PACKAGE_BUGREPORT "edk2-devel@lists.01.org"
/* Define to the full name of this package. */ /* Define to the full name of this package. */
#define PACKAGE_NAME "EDK II Python Package" #define PACKAGE_NAME "EDK II Python 2.7.10 Package"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "EDK II Python Package V0.8" #define PACKAGE_STRING "EDK II Python 2.7.10 Package V0.1"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "EADK_Python" #define PACKAGE_TARNAME "EADK_Python"
/* Define to the home page for this package. */ /* Define to the home page for this package. */
#define PACKAGE_URL "http://edk2.tianocore.org/toolkit/python" #define PACKAGE_URL "http://edk2.tianocore.org/"
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "V0.8" #define PACKAGE_VERSION "V0.1"
/* Define if POSIX semaphores aren't enabled on your system */ /* Define if POSIX semaphores aren't enabled on your system */
#define POSIX_SEMAPHORES_NOT_ENABLED 1 #define POSIX_SEMAPHORES_NOT_ENABLED 1
@ -1043,7 +1080,7 @@
#define SIZEOF__BOOL 1 #define SIZEOF__BOOL 1
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Define if you can safely include both <sys/select.h> and <sys/time.h> /* Define if you can safely include both <sys/select.h> and <sys/time.h>
(which you can't on SCO ODT 3.0). */ (which you can't on SCO ODT 3.0). */
@ -1156,13 +1193,14 @@
/* This must be defined on some systems to enable large file support. */ /* This must be defined on some systems to enable large file support. */
#undef _LARGEFILE_SOURCE #undef _LARGEFILE_SOURCE
/* This must be defined on AIX systems to enable large file support. */
#undef _LARGE_FILES
/* Define to 1 if on MINIX. */ /* Define to 1 if on MINIX. */
#undef _MINIX #undef _MINIX
/* Define on NetBSD to activate all library features */ /* Define on NetBSD to activate all library features */
#ifndef _NETBSD_SOURCE #define _NETBSD_SOURCE 1
#define _NETBSD_SOURCE 1
#endif
/* Define _OSF_SOURCE to get the makedev macro. */ /* Define _OSF_SOURCE to get the makedev macro. */
#undef _OSF_SOURCE #undef _OSF_SOURCE
@ -1260,3 +1298,4 @@
//#undef volatile //#undef volatile
#endif /*Py_PYCONFIG_H*/ #endif /*Py_PYCONFIG_H*/

View File

@ -1,5 +1,18 @@
# Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version. # Module 'ntpath' -- common operations on WinNT/Win95 and UEFI pathnames.
#
# Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
# Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials are licensed and made available under
# the terms and conditions of the BSD License that accompanies this distribution.
# The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
"""Common pathname manipulations, WindowsNT/95 and UEFI version.
Instead of importing this module directly, import os and refer to this Instead of importing this module directly, import os and refer to this
module as os.path. module as os.path.
@ -93,6 +106,9 @@ def join(path, *paths):
# Split a path in a drive specification (a drive letter followed by a # Split a path in a drive specification (a drive letter followed by a
# colon) and the path specification. # colon) and the path specification.
# It is always true that drivespec + pathspec == p # It is always true that drivespec + pathspec == p
# NOTE: for UEFI (and even Windows) you can have multiple characters to the left
# of the ':' for the device or drive spec. This is reflected in the modifications
# to splitdrive() and splitunc().
def splitdrive(p): def splitdrive(p):
"""Split a pathname into drive/UNC sharepoint and relative path specifiers. """Split a pathname into drive/UNC sharepoint and relative path specifiers.
Returns a 2-tuple (drive_or_unc, path); either part may be empty. Returns a 2-tuple (drive_or_unc, path); either part may be empty.
@ -130,8 +146,10 @@ def splitdrive(p):
if index2 == -1: if index2 == -1:
index2 = len(p) index2 = len(p)
return p[:index2], p[index2:] return p[:index2], p[index2:]
if normp[1] == ':': index = p.find(':')
return p[:2], p[2:] if index != -1:
index = index + 1
return p[:index], p[index:]
return '', p return '', p
# Parse UNC paths # Parse UNC paths
@ -143,8 +161,8 @@ def splitunc(p):
using backslashes). unc+rest is always the input path. using backslashes). unc+rest is always the input path.
Paths containing drive letters never have an UNC part. Paths containing drive letters never have an UNC part.
""" """
if p[1:2] == ':': if ':' in p:
return '', p # Drive letter present return '', p # Drive letter or device name present
firstTwo = p[0:2] firstTwo = p[0:2]
if firstTwo == '//' or firstTwo == '\\\\': if firstTwo == '//' or firstTwo == '\\\\':
# is a UNC path: # is a UNC path:

View File

@ -1,9 +1,22 @@
r"""OS routines for NT or Posix depending on what system we're on.
# Module 'os' -- OS routines for NT, Posix, or UEFI depending on what system we're on.
#
# Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
# Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials are licensed and made available under
# the terms and conditions of the BSD License that accompanies this distribution.
# The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
r"""OS routines for NT, Posix, or UEFI depending on what system we're on.
This exports: This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc. - all functions from edk2, posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is one of the modules posixpath, or ntpath - os.path is one of the modules uefipath, posixpath, or ntpath
- os.name is 'posix', 'nt', 'os2', 'ce' or 'riscos' - os.name is 'edk2', 'posix', 'nt', 'os2', 'ce' or 'riscos'
- os.curdir is a string representing the current directory ('.' or ':') - os.curdir is a string representing the current directory ('.' or ':')
- os.pardir is a string representing the parent directory ('..' or '::') - os.pardir is a string representing the parent directory ('..' or '::')
- os.sep is the (or a most common) pathname separator ('/' or ':' or '\\') - os.sep is the (or a most common) pathname separator ('/' or ':' or '\\')
@ -113,6 +126,20 @@ elif 'riscos' in _names:
__all__.extend(_get_exports_list(riscos)) __all__.extend(_get_exports_list(riscos))
del riscos del riscos
elif 'edk2' in _names:
name = 'edk2'
linesep = '\n'
from edk2 import *
try:
from edk2 import _exit
except ImportError:
pass
import ntpath as path
import edk2
__all__.extend(_get_exports_list(edk2))
del edk2
else: else:
raise ImportError, 'no os specific module found' raise ImportError, 'no os specific module found'

View File

@ -1,5 +1,18 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: latin-1 -*- # -*- coding: latin-1 -*-
# Module 'pydoc' -- Generate Python documentation in HTML or text for interactive use.
#
# Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
# Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials are licensed and made available under
# the terms and conditions of the BSD License that accompanies this distribution.
# The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
"""Generate Python documentation in HTML or text for interactive use. """Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online In the Python interpreter, do "from pydoc import help" to provide online
@ -1385,12 +1398,16 @@ def getpager():
if 'PAGER' in os.environ: if 'PAGER' in os.environ:
if sys.platform == 'win32': # pipes completely broken in Windows if sys.platform == 'win32': # pipes completely broken in Windows
return lambda text: tempfilepager(plain(text), os.environ['PAGER']) return lambda text: tempfilepager(plain(text), os.environ['PAGER'])
elif sys.platform == 'uefi':
return lambda text: tempfilepager(plain(text), os.environ['PAGER'])
elif os.environ.get('TERM') in ('dumb', 'emacs'): elif os.environ.get('TERM') in ('dumb', 'emacs'):
return lambda text: pipepager(plain(text), os.environ['PAGER']) return lambda text: pipepager(plain(text), os.environ['PAGER'])
else: else:
return lambda text: pipepager(text, os.environ['PAGER']) return lambda text: pipepager(text, os.environ['PAGER'])
if os.environ.get('TERM') in ('dumb', 'emacs'): if os.environ.get('TERM') in ('dumb', 'emacs'):
return plainpager return plainpager
if sys.platform == 'uefi':
return plainpager
if sys.platform == 'win32' or sys.platform.startswith('os2'): if sys.platform == 'win32' or sys.platform.startswith('os2'):
return lambda text: tempfilepager(plain(text), 'more <') return lambda text: tempfilepager(plain(text), 'more <')
if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0: if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:

View File

@ -4,18 +4,18 @@
* This module is automatically imported during initialization. * * This module is automatically imported during initialization. *
**************************************************************** ****************************************************************
This is a UEFI-specific version of site.py.
In earlier versions of Python (up to 1.5a3), scripts or modules that In earlier versions of Python (up to 1.5a3), scripts or modules that
needed to use site-specific modules would place ``import site'' needed to use site-specific modules would place ``import site''
somewhere near the top of their code. Because of the automatic somewhere near the top of their code. Because of the automatic
import, this is no longer necessary (but code that does it still import, this is no longer necessary (but code that does it still
works). works).
This will append site-specific paths to the module search path. On This will append site-specific paths to the module search path. It starts with sys.prefix and
Unix (including Mac OSX), it starts with sys.prefix and
sys.exec_prefix (if different) and appends sys.exec_prefix (if different) and appends
lib/python<version>/site-packages as well as lib/site-python. lib/python<version>/site-packages as well as lib/site-python.
On other platforms (such as Windows), it tries each of the The
prefixes directly, as well as with lib/site-packages appended. The
resulting directories, if they exist, are appended to sys.path, and resulting directories, if they exist, are appended to sys.path, and
also inspected for path configuration files. also inspected for path configuration files.
@ -27,7 +27,7 @@ sys.path more than once. Blank lines and lines beginning with
'#' are skipped. Lines starting with 'import' are executed. '#' are skipped. Lines starting with 'import' are executed.
For example, suppose sys.prefix and sys.exec_prefix are set to For example, suppose sys.prefix and sys.exec_prefix are set to
/usr/local and there is a directory /usr/local/lib/python2.5/site-packages /Efi/StdLib and there is a directory /Efi/StdLib/lib/python27.10/site-packages
with three subdirectories, foo, bar and spam, and two path with three subdirectories, foo, bar and spam, and two path
configuration files, foo.pth and bar.pth. Assume foo.pth contains the configuration files, foo.pth and bar.pth. Assume foo.pth contains the
following: following:
@ -44,8 +44,8 @@ and bar.pth contains:
Then the following directories are added to sys.path, in this order: Then the following directories are added to sys.path, in this order:
/usr/local/lib/python2.5/site-packages/bar /Efi/StdLib/lib/python27.10/site-packages/bar
/usr/local/lib/python2.5/site-packages/foo /Efi/StdLib/lib/python27.10/site-packages/foo
Note that bletch is omitted because it doesn't exist; bar precedes foo Note that bletch is omitted because it doesn't exist; bar precedes foo
because bar.pth comes alphabetically before foo.pth; and spam is because bar.pth comes alphabetically before foo.pth; and spam is
@ -56,6 +56,15 @@ named sitecustomize, which can perform arbitrary additional
site-specific customizations. If this import fails with an site-specific customizations. If this import fails with an
ImportError exception, it is silently ignored. ImportError exception, it is silently ignored.
Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
""" """
import sys import sys
@ -67,7 +76,7 @@ import traceback
PREFIXES = [sys.prefix, sys.exec_prefix] PREFIXES = [sys.prefix, sys.exec_prefix]
# Enable per user site-packages directory # Enable per user site-packages directory
# set it to False to disable the feature or True to force the feature # set it to False to disable the feature or True to force the feature
ENABLE_USER_SITE = None ENABLE_USER_SITE = False
# for distutils.commands.install # for distutils.commands.install
# These values are initialized by the getuserbase() and getusersitepackages() # These values are initialized by the getuserbase() and getusersitepackages()
@ -246,12 +255,6 @@ def getusersitepackages():
from sysconfig import get_path from sysconfig import get_path
import os import os
if sys.platform == 'darwin':
from sysconfig import get_config_var
if get_config_var('PYTHONFRAMEWORK'):
USER_SITE = get_path('purelib', 'osx_framework_user')
return USER_SITE
USER_SITE = get_path('purelib', '%s_user' % os.name) USER_SITE = get_path('purelib', '%s_user' % os.name)
return USER_SITE return USER_SITE
@ -261,11 +264,11 @@ def addusersitepackages(known_paths):
Each user has its own python directory with site-packages in the Each user has its own python directory with site-packages in the
home directory. home directory.
""" """
# get the per user site-package path
# this call will also make sure USER_BASE and USER_SITE are set
user_site = getusersitepackages()
if ENABLE_USER_SITE and os.path.isdir(user_site): if ENABLE_USER_SITE and os.path.isdir(user_site):
# get the per user site-package path
# this call will also make sure USER_BASE and USER_SITE are set
user_site = getusersitepackages()
addsitedir(user_site, known_paths) addsitedir(user_site, known_paths)
return known_paths return known_paths
@ -285,25 +288,16 @@ def getsitepackages():
continue continue
seen.add(prefix) seen.add(prefix)
if sys.platform in ('os2emx', 'riscos'): ix = sys.version.find(' ')
sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) if ix != -1:
elif os.sep == '/': micro = sys.version[4:ix]
sitepackages.append(os.path.join(prefix, "lib",
"python" + sys.version[:3],
"site-packages"))
sitepackages.append(os.path.join(prefix, "lib", "site-python"))
else: else:
sitepackages.append(prefix) micro = '0'
sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
if sys.platform == "darwin": sitepackages.append(os.path.join(prefix, "lib",
# for framework builds *only* we add the standard Apple "python" + sys.version[0] + sys.version[2] + '.' + micro,
# locations. "site-packages"))
from sysconfig import get_config_var sitepackages.append(os.path.join(prefix, "lib", "site-python"))
framework = get_config_var("PYTHONFRAMEWORK")
if framework:
sitepackages.append(
os.path.join("/Library", framework,
sys.version[:3], "site-packages"))
return sitepackages return sitepackages
def addsitepackages(known_paths): def addsitepackages(known_paths):
@ -315,20 +309,20 @@ def addsitepackages(known_paths):
return known_paths return known_paths
def setBEGINLIBPATH(): def setBEGINLIBPATH():
"""The OS/2 EMX port has optional extension modules that do double duty """The UEFI port has optional extension modules that do double duty
as DLLs (and must use the .DLL file extension) for other extensions. as DLLs (even though they have .efi file extensions) for other extensions.
The library search path needs to be amended so these will be found The library search path needs to be amended so these will be found
during module import. Use BEGINLIBPATH so that these are at the start during module import. Use BEGINLIBPATH so that these are at the start
of the library search path. of the library search path.
""" """
dllpath = os.path.join(sys.prefix, "Lib", "lib-dynload") dllpath = os.path.join(sys.prefix, "Lib", "lib-dynload")
libpath = os.environ['BEGINLIBPATH'].split(';') libpath = os.environ['BEGINLIBPATH'].split(os.path.pathsep)
if libpath[-1]: if libpath[-1]:
libpath.append(dllpath) libpath.append(dllpath)
else: else:
libpath[-1] = dllpath libpath[-1] = dllpath
os.environ['BEGINLIBPATH'] = ';'.join(libpath) os.environ['BEGINLIBPATH'] = os.path.pathsep.join(libpath)
def setquit(): def setquit():
@ -338,12 +332,7 @@ def setquit():
The repr of each object contains a hint at how it works. The repr of each object contains a hint at how it works.
""" """
if os.sep == ':': eof = 'Ctrl-D (i.e. EOF)'
eof = 'Cmd-Q'
elif os.sep == '\\':
eof = 'Ctrl-Z plus Return'
else:
eof = 'Ctrl-D (i.e. EOF)'
class Quitter(object): class Quitter(object):
def __init__(self, name): def __init__(self, name):
@ -426,12 +415,7 @@ class _Printer(object):
def setcopyright(): def setcopyright():
"""Set 'copyright' and 'credits' in __builtin__""" """Set 'copyright' and 'credits' in __builtin__"""
__builtin__.copyright = _Printer("copyright", sys.copyright) __builtin__.copyright = _Printer("copyright", sys.copyright)
if sys.platform[:4] == 'java': __builtin__.credits = _Printer("credits", """\
__builtin__.credits = _Printer(
"credits",
"Jython is maintained by the Jython developers (www.jython.org).")
else:
__builtin__.credits = _Printer("credits", """\
Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
for supporting Python development. See www.python.org for more information.""") for supporting Python development. See www.python.org for more information.""")
here = os.path.dirname(os.__file__) here = os.path.dirname(os.__file__)
@ -457,21 +441,6 @@ class _Helper(object):
def sethelper(): def sethelper():
__builtin__.help = _Helper() __builtin__.help = _Helper()
def aliasmbcs():
"""On Windows, some default encodings are not provided by Python,
while they are always available as "mbcs" in each locale. Make
them usable by aliasing to "mbcs" in such a case."""
if sys.platform == 'win32':
import locale, codecs
enc = locale.getdefaultlocale()[1]
if enc.startswith('cp'): # "cp***" ?
try:
codecs.lookup(enc)
except LookupError:
import encodings
encodings._cache[enc] = encodings._unknown
encodings.aliases.aliases[enc] = 'mbcs'
def setencoding(): def setencoding():
"""Set the string encoding used by the Unicode implementation. The """Set the string encoding used by the Unicode implementation. The
default is 'ascii', but if you're willing to experiment, you can default is 'ascii', but if you're willing to experiment, you can
@ -529,16 +498,11 @@ def main():
ENABLE_USER_SITE = check_enableusersite() ENABLE_USER_SITE = check_enableusersite()
known_paths = addusersitepackages(known_paths) known_paths = addusersitepackages(known_paths)
known_paths = addsitepackages(known_paths) known_paths = addsitepackages(known_paths)
if sys.platform == 'os2emx':
setBEGINLIBPATH()
setquit() setquit()
setcopyright() setcopyright()
sethelper() sethelper()
aliasmbcs()
setencoding() setencoding()
execsitecustomize() execsitecustomize()
if ENABLE_USER_SITE:
execusercustomize()
# Remove sys.setdefaultencoding() so that users cannot change the # Remove sys.setdefaultencoding() so that users cannot change the
# encoding after initialization. The test for presence is needed when # encoding after initialization. The test for presence is needed when
# this module is run as a script, because this code is executed twice. # this module is run as a script, because this code is executed twice.
@ -549,52 +513,19 @@ main()
def _script(): def _script():
help = """\ help = """\
%s [--user-base] [--user-site] %s
Without arguments print some useful information Path elements are normally separated by '%s'.
With arguments print the value of USER_BASE and/or USER_SITE separated
by '%s'.
Exit codes with --user-base or --user-site:
0 - user site directory is enabled
1 - user site directory is disabled by user
2 - uses site directory is disabled by super user
or for security reasons
>2 - unknown error
""" """
args = sys.argv[1:]
if not args:
print "sys.path = ["
for dir in sys.path:
print " %r," % (dir,)
print "]"
print "USER_BASE: %r (%s)" % (USER_BASE,
"exists" if os.path.isdir(USER_BASE) else "doesn't exist")
print "USER_SITE: %r (%s)" % (USER_SITE,
"exists" if os.path.isdir(USER_SITE) else "doesn't exist")
print "ENABLE_USER_SITE: %r" % ENABLE_USER_SITE
sys.exit(0)
buffer = [] print "sys.path = ["
if '--user-base' in args: for dir in sys.path:
buffer.append(USER_BASE) print " %r," % (dir,)
if '--user-site' in args: print "]"
buffer.append(USER_SITE)
if buffer: import textwrap
print os.pathsep.join(buffer) print textwrap.dedent(help % (sys.argv[0], os.pathsep))
if ENABLE_USER_SITE: sys.exit(0)
sys.exit(0)
elif ENABLE_USER_SITE is False:
sys.exit(1)
elif ENABLE_USER_SITE is None:
sys.exit(2)
else:
sys.exit(3)
else:
import textwrap
print textwrap.dedent(help % (sys.argv[0], os.pathsep))
sys.exit(10)
if __name__ == '__main__': if __name__ == '__main__':
_script() _script()

View File

@ -2,6 +2,16 @@
* Secret Labs' Regular Expression Engine * Secret Labs' Regular Expression Engine
* *
* regular expression matching engine * regular expression matching engine
Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
* *
* partial history: * partial history:
* 1999-10-24 fl created (based on existing template matcher code) * 1999-10-24 fl created (based on existing template matcher code)
@ -34,6 +44,10 @@
* other compatibility work. * other compatibility work.
*/ */
/* Get rid of these macros to prevent collisions between EFI and Python in this file. */
#undef RETURN_ERROR
#undef RETURN_SUCCESS
#ifndef SRE_RECURSIVE #ifndef SRE_RECURSIVE
static char copyright[] = static char copyright[] =
@ -84,7 +98,7 @@ static char copyright[] =
/* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma optimize("agtw", on) /* doesn't seem to make much difference... */ #pragma optimize("gt", on) /* doesn't seem to make much difference... */
#pragma warning(disable: 4710) /* who cares if functions are not inlined ;-) */ #pragma warning(disable: 4710) /* who cares if functions are not inlined ;-) */
/* fastest possible local call under MSVC */ /* fastest possible local call under MSVC */
#define LOCAL(type) static __inline type __fastcall #define LOCAL(type) static __inline type __fastcall
@ -2147,8 +2161,8 @@ pattern_findall(PatternObject* self, PyObject* args, PyObject* kw)
#endif #endif
} }
if (PyErr_Occurred()) if (PyErr_Occurred())
goto error; goto error;
if (status <= 0) { if (status <= 0) {
if (status == 0) if (status == 0)
@ -2284,8 +2298,8 @@ pattern_split(PatternObject* self, PyObject* args, PyObject* kw)
#endif #endif
} }
if (PyErr_Occurred()) if (PyErr_Occurred())
goto error; goto error;
if (status <= 0) { if (status <= 0) {
if (status == 0) if (status == 0)
@ -2381,10 +2395,10 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string,
b = bint; b = bint;
if (ptr) { if (ptr) {
if (b == 1) { if (b == 1) {
literal = sre_literal_template((unsigned char *)ptr, n); literal = sre_literal_template((unsigned char *)ptr, n);
} else { } else {
#if defined(HAVE_UNICODE) #if defined(HAVE_UNICODE)
literal = sre_uliteral_template((Py_UNICODE *)ptr, n); literal = sre_uliteral_template((Py_UNICODE *)ptr, n);
#endif #endif
} }
} else { } else {
@ -2436,8 +2450,8 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string,
#endif #endif
} }
if (PyErr_Occurred()) if (PyErr_Occurred())
goto error; goto error;
if (status <= 0) { if (status <= 0) {
if (status == 0) if (status == 0)
@ -2655,20 +2669,20 @@ PyDoc_STRVAR(pattern_doc, "Compiled regular expression objects");
static PyMethodDef pattern_methods[] = { static PyMethodDef pattern_methods[] = {
{"match", (PyCFunction) pattern_match, METH_VARARGS|METH_KEYWORDS, {"match", (PyCFunction) pattern_match, METH_VARARGS|METH_KEYWORDS,
pattern_match_doc}, pattern_match_doc},
{"search", (PyCFunction) pattern_search, METH_VARARGS|METH_KEYWORDS, {"search", (PyCFunction) pattern_search, METH_VARARGS|METH_KEYWORDS,
pattern_search_doc}, pattern_search_doc},
{"sub", (PyCFunction) pattern_sub, METH_VARARGS|METH_KEYWORDS, {"sub", (PyCFunction) pattern_sub, METH_VARARGS|METH_KEYWORDS,
pattern_sub_doc}, pattern_sub_doc},
{"subn", (PyCFunction) pattern_subn, METH_VARARGS|METH_KEYWORDS, {"subn", (PyCFunction) pattern_subn, METH_VARARGS|METH_KEYWORDS,
pattern_subn_doc}, pattern_subn_doc},
{"split", (PyCFunction) pattern_split, METH_VARARGS|METH_KEYWORDS, {"split", (PyCFunction) pattern_split, METH_VARARGS|METH_KEYWORDS,
pattern_split_doc}, pattern_split_doc},
{"findall", (PyCFunction) pattern_findall, METH_VARARGS|METH_KEYWORDS, {"findall", (PyCFunction) pattern_findall, METH_VARARGS|METH_KEYWORDS,
pattern_findall_doc}, pattern_findall_doc},
#if PY_VERSION_HEX >= 0x02020000 #if PY_VERSION_HEX >= 0x02020000
{"finditer", (PyCFunction) pattern_finditer, METH_VARARGS, {"finditer", (PyCFunction) pattern_finditer, METH_VARARGS,
pattern_finditer_doc}, pattern_finditer_doc},
#endif #endif
{"scanner", (PyCFunction) pattern_scanner, METH_VARARGS}, {"scanner", (PyCFunction) pattern_scanner, METH_VARARGS},
{"__copy__", (PyCFunction) pattern_copy, METH_NOARGS}, {"__copy__", (PyCFunction) pattern_copy, METH_NOARGS},
@ -2692,28 +2706,28 @@ statichere PyTypeObject Pattern_Type = {
(destructor)pattern_dealloc, /*tp_dealloc*/ (destructor)pattern_dealloc, /*tp_dealloc*/
0, /* tp_print */ 0, /* tp_print */
0, /* tp_getattrn */ 0, /* tp_getattrn */
0, /* tp_setattr */ 0, /* tp_setattr */
0, /* tp_compare */ 0, /* tp_compare */
0, /* tp_repr */ 0, /* tp_repr */
0, /* tp_as_number */ 0, /* tp_as_number */
0, /* tp_as_sequence */ 0, /* tp_as_sequence */
0, /* tp_as_mapping */ 0, /* tp_as_mapping */
0, /* tp_hash */ 0, /* tp_hash */
0, /* tp_call */ 0, /* tp_call */
0, /* tp_str */ 0, /* tp_str */
0, /* tp_getattro */ 0, /* tp_getattro */
0, /* tp_setattro */ 0, /* tp_setattro */
0, /* tp_as_buffer */ 0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */ Py_TPFLAGS_DEFAULT, /* tp_flags */
pattern_doc, /* tp_doc */ pattern_doc, /* tp_doc */
0, /* tp_traverse */ 0, /* tp_traverse */
0, /* tp_clear */ 0, /* tp_clear */
0, /* tp_richcompare */ 0, /* tp_richcompare */
offsetof(PatternObject, weakreflist), /* tp_weaklistoffset */ offsetof(PatternObject, weakreflist), /* tp_weaklistoffset */
0, /* tp_iter */ 0, /* tp_iter */
0, /* tp_iternext */ 0, /* tp_iternext */
pattern_methods, /* tp_methods */ pattern_methods, /* tp_methods */
pattern_members, /* tp_members */ pattern_members, /* tp_members */
}; };
static int _validate(PatternObject *self); /* Forward */ static int _validate(PatternObject *self); /* Forward */
@ -3756,9 +3770,9 @@ static PyTypeObject Match_Type = {
0, /* tp_weaklistoffset */ 0, /* tp_weaklistoffset */
0, /* tp_iter */ 0, /* tp_iter */
0, /* tp_iternext */ 0, /* tp_iternext */
match_methods, /* tp_methods */ match_methods, /* tp_methods */
match_members, /* tp_members */ match_members, /* tp_members */
match_getset, /* tp_getset */ match_getset, /* tp_getset */
}; };
static PyObject* static PyObject*
@ -3909,7 +3923,7 @@ static PyMethodDef scanner_methods[] = {
#define SCAN_OFF(x) offsetof(ScannerObject, x) #define SCAN_OFF(x) offsetof(ScannerObject, x)
static PyMemberDef scanner_members[] = { static PyMemberDef scanner_members[] = {
{"pattern", T_OBJECT, SCAN_OFF(pattern), READONLY}, {"pattern", T_OBJECT, SCAN_OFF(pattern), READONLY},
{NULL} /* Sentinel */ {NULL} /* Sentinel */
}; };
@ -3918,31 +3932,31 @@ statichere PyTypeObject Scanner_Type = {
0, "_" SRE_MODULE ".SRE_Scanner", 0, "_" SRE_MODULE ".SRE_Scanner",
sizeof(ScannerObject), 0, sizeof(ScannerObject), 0,
(destructor)scanner_dealloc, /*tp_dealloc*/ (destructor)scanner_dealloc, /*tp_dealloc*/
0, /* tp_print */ 0, /* tp_print */
0, /* tp_getattr */ 0, /* tp_getattr */
0, /* tp_setattr */ 0, /* tp_setattr */
0, /* tp_reserved */ 0, /* tp_reserved */
0, /* tp_repr */ 0, /* tp_repr */
0, /* tp_as_number */ 0, /* tp_as_number */
0, /* tp_as_sequence */ 0, /* tp_as_sequence */
0, /* tp_as_mapping */ 0, /* tp_as_mapping */
0, /* tp_hash */ 0, /* tp_hash */
0, /* tp_call */ 0, /* tp_call */
0, /* tp_str */ 0, /* tp_str */
0, /* tp_getattro */ 0, /* tp_getattro */
0, /* tp_setattro */ 0, /* tp_setattro */
0, /* tp_as_buffer */ 0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */ Py_TPFLAGS_DEFAULT, /* tp_flags */
0, /* tp_doc */ 0, /* tp_doc */
0, /* tp_traverse */ 0, /* tp_traverse */
0, /* tp_clear */ 0, /* tp_clear */
0, /* tp_richcompare */ 0, /* tp_richcompare */
0, /* tp_weaklistoffset */ 0, /* tp_weaklistoffset */
0, /* tp_iter */ 0, /* tp_iter */
0, /* tp_iternext */ 0, /* tp_iternext */
scanner_methods, /* tp_methods */ scanner_methods, /* tp_methods */
scanner_members, /* tp_members */ scanner_members, /* tp_members */
0, /* tp_getset */ 0, /* tp_getset */
}; };
static PyObject* static PyObject*
@ -4000,7 +4014,7 @@ PyMODINIT_FUNC init_sre(void)
m = Py_InitModule("_" SRE_MODULE, _functions); m = Py_InitModule("_" SRE_MODULE, _functions);
if (m == NULL) if (m == NULL)
return; return;
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
x = PyInt_FromLong(SRE_MAGIC); x = PyInt_FromLong(SRE_MAGIC);

View File

@ -1,4 +1,13 @@
/* /** @file
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
* All rights reserved. * All rights reserved.
* *
@ -25,7 +34,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ **/
#ifndef HAVE_GETADDRINFO #ifndef HAVE_GETADDRINFO
@ -123,49 +132,51 @@
#endif /* !HAVE_GETNAMEINFO */ #endif /* !HAVE_GETNAMEINFO */
#ifndef HAVE_ADDRINFO #ifndef _SYS_SOCKET_H_
struct addrinfo { #ifndef HAVE_ADDRINFO
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ struct addrinfo {
int ai_family; /* PF_xxx */ int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
int ai_socktype; /* SOCK_xxx */ int ai_family; /* PF_xxx */
int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ int ai_socktype; /* SOCK_xxx */
size_t ai_addrlen; /* length of ai_addr */ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
char *ai_canonname; /* canonical name for hostname */ size_t ai_addrlen; /* length of ai_addr */
struct sockaddr *ai_addr; /* binary address */ char *ai_canonname; /* canonical name for hostname */
struct addrinfo *ai_next; /* next structure in linked list */ struct sockaddr *ai_addr; /* binary address */
}; struct addrinfo *ai_next; /* next structure in linked list */
#endif /* !HAVE_ADDRINFO */ };
#endif /* !HAVE_ADDRINFO */
#ifndef HAVE_SOCKADDR_STORAGE #ifndef HAVE_SOCKADDR_STORAGE
/* /*
* RFC 2553: protocol-independent placeholder for socket addresses * RFC 2553: protocol-independent placeholder for socket addresses
*/ */
#define _SS_MAXSIZE 128 #define _SS_MAXSIZE 128
#ifdef HAVE_LONG_LONG #ifdef HAVE_LONG_LONG
#define _SS_ALIGNSIZE (sizeof(PY_LONG_LONG)) #define _SS_ALIGNSIZE (sizeof(PY_LONG_LONG))
#else #else
#define _SS_ALIGNSIZE (sizeof(double)) #define _SS_ALIGNSIZE (sizeof(double))
#endif /* HAVE_LONG_LONG */ #endif /* HAVE_LONG_LONG */
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(u_char) * 2) #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(u_char) * 2)
#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(u_char) * 2 - \ #define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(u_char) * 2 - \
_SS_PAD1SIZE - _SS_ALIGNSIZE) _SS_PAD1SIZE - _SS_ALIGNSIZE)
struct sockaddr_storage { struct sockaddr_storage {
#ifdef HAVE_SOCKADDR_SA_LEN #ifdef HAVE_SOCKADDR_SA_LEN
unsigned char ss_len; /* address length */ unsigned char ss_len; /* address length */
unsigned char ss_family; /* address family */ unsigned char ss_family; /* address family */
#else #else
unsigned short ss_family; /* address family */ unsigned short ss_family; /* address family */
#endif /* HAVE_SOCKADDR_SA_LEN */ #endif /* HAVE_SOCKADDR_SA_LEN */
char __ss_pad1[_SS_PAD1SIZE]; char __ss_pad1[_SS_PAD1SIZE];
#ifdef HAVE_LONG_LONG #ifdef HAVE_LONG_LONG
PY_LONG_LONG __ss_align; /* force desired structure storage alignment */ PY_LONG_LONG __ss_align; /* force desired structure storage alignment */
#else #else
double __ss_align; /* force desired structure storage alignment */ double __ss_align; /* force desired structure storage alignment */
#endif /* HAVE_LONG_LONG */ #endif /* HAVE_LONG_LONG */
char __ss_pad2[_SS_PAD2SIZE]; char __ss_pad2[_SS_PAD2SIZE];
}; };
#endif /* !HAVE_SOCKADDR_STORAGE */ #endif /* !HAVE_SOCKADDR_STORAGE */
#endif /* _SYS_SOCKET_H_ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -1,5 +1,14 @@
/* Errno module
/* Errno module */ Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*/
#include "Python.h" #include "Python.h"
@ -783,8 +792,52 @@ initerrno(void)
#ifdef WSAN #ifdef WSAN
inscode(d, ds, de, "WSAN", WSAN, "Error WSAN"); inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");
#endif #endif
/* These symbols are added for EDK II support. */
#ifdef EMINERRORVAL
inscode(d, ds, de, "EMINERRORVAL", EMINERRORVAL, "Lowest valid error value");
#endif
#ifdef ENOTSUP #ifdef ENOTSUP
inscode(d, ds, de, "ENOTSUP", ENOTSUP, "Operation not supported"); inscode(d, ds, de, "ENOTSUP", ENOTSUP, "Operation not supported");
#endif
#ifdef EBADRPC
inscode(d, ds, de, "EBADRPC", EBADRPC, "RPC struct is bad");
#endif
#ifdef ERPCMISMATCH
inscode(d, ds, de, "ERPCMISMATCH", ERPCMISMATCH, "RPC version wrong");
#endif
#ifdef EPROGUNAVAIL
inscode(d, ds, de, "EPROGUNAVAIL", EPROGUNAVAIL, "RPC prog. not avail");
#endif
#ifdef EPROGMISMATCH
inscode(d, ds, de, "EPROGMISMATCH", EPROGMISMATCH, "Program version wrong");
#endif
#ifdef EPROCUNAVAIL
inscode(d, ds, de, "EPROCUNAVAIL", EPROCUNAVAIL, "Bad procedure for program");
#endif
#ifdef EFTYPE
inscode(d, ds, de, "EFTYPE", EFTYPE, "Inappropriate file type or format");
#endif
#ifdef EAUTH
inscode(d, ds, de, "EAUTH", EAUTH, "Authentication error");
#endif
#ifdef ENEEDAUTH
inscode(d, ds, de, "ENEEDAUTH", ENEEDAUTH, "Need authenticator");
#endif
#ifdef ECANCELED
inscode(d, ds, de, "ECANCELED", ECANCELED, "Operation canceled");
#endif
#ifdef ENOATTR
inscode(d, ds, de, "ENOATTR", ENOATTR, "Attribute not found");
#endif
#ifdef EDOOFUS
inscode(d, ds, de, "EDOOFUS", EDOOFUS, "Programming Error");
#endif
#ifdef EBUFSIZE
inscode(d, ds, de, "EBUFSIZE", EBUFSIZE, "Buffer too small to hold result");
#endif
#ifdef EMAXERRORVAL
inscode(d, ds, de, "EMAXERRORVAL", EMAXERRORVAL, "One more than the highest defined error value");
#endif #endif
Py_DECREF(de); Py_DECREF(de);

View File

@ -9,7 +9,9 @@
/* Namespace external symbols to allow multiple libexpat version to /* Namespace external symbols to allow multiple libexpat version to
co-exist. */ co-exist. */
#include "pyexpatns.h" #if !defined(UEFI_C_SOURCE)
#include "pyexpatns.h"
#endif
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
#define XML_USE_MSC_EXTENSIONS 1 #define XML_USE_MSC_EXTENSIONS 1

View File

@ -1,8 +1,19 @@
/** @file /** @file
Return the initial module search path. Return the initial module search path.
This file is based upon the Modules/getpath.c file from the Python distribution
but has had everything not exactly necessary for operation on EDK II stripped
out.
Search in specified locations for the associated Python libraries. Search in specified locations for the associated Python libraries.
For the EDK II, UEFI, implementation of Python, PREFIX and EXEC_PREFIX
are set as follows:
PREFIX = /Efi/StdLib
EXEC_PREFIX = PREFIX
The volume is assumed to be the current volume when Python was started.
Py_GetPath returns module_search_path. Py_GetPath returns module_search_path.
Py_GetPrefix returns PREFIX Py_GetPrefix returns PREFIX
Py_GetExec_Prefix returns PREFIX Py_GetExec_Prefix returns PREFIX
@ -11,16 +22,13 @@
These are built dynamically so that the proper volume name can be prefixed These are built dynamically so that the proper volume name can be prefixed
to the paths. to the paths.
For the EDK II, UEFI, implementation of Python, PREFIX and EXEC_PREFIX The following final paths (for Python 2.7.10) are assumed:
are set as follows:
PREFIX = /Efi/StdLib
EXEC_PREFIX = PREFIX
The following final paths are assumed:
/Efi/Tools/Python.efi The Python executable. /Efi/Tools/Python.efi The Python executable.
/Efi/StdLib/lib/python.VERSION The platform independent Python modules. /Efi/StdLib/lib/python27.10 The version dependent Python modules.
/Efi/StdLib/lib/python.VERSION/dynalib Dynamically loadable Python extension modules. /Efi/StdLib/lib/python.27 The version independent Python modules.
/Efi/StdLib/lib/python27.10/lib-dynload Dynamically loadable Python extension modules.
Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR> Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution. the terms and conditions of the BSD License that accompanies this distribution.
@ -34,13 +42,12 @@
#include <osdefs.h> #include <osdefs.h>
#include <ctype.h> #include <ctype.h>
#ifdef __cplusplus #define SIFY_I( x ) #x
extern "C" { #define SIFY( y ) SIFY_I( y )
#endif
/* VERSION must be at least two characters long. */ /* VERSION must be at least two characters long. */
#ifndef VERSION #ifndef VERSION
#define VERSION "27" #define VERSION SIFY(PY_MAJOR_VERSION) SIFY(PY_MINOR_VERSION)
#endif #endif
#ifndef VPATH #ifndef VPATH
@ -61,20 +68,19 @@
#endif #endif
#ifndef LIBPYTHON #ifndef LIBPYTHON
#define LIBPYTHON "lib/python." VERSION #define LIBPYTHON "lib/python" VERSION "." SIFY(PY_MICRO_VERSION)
#endif #endif
#ifndef PYTHONPATH #ifndef PYTHONPATH
#ifdef HAVE_ENVIRONMENT_OPS #define PYTHONPATH LIBPYTHON
#define PYTHONPATH PREFIX LIBPYTHON sDELIM \
EXEC_PREFIX LIBPYTHON "/lib-dynload"
#else
#define PYTHONPATH LIBPYTHON
#endif
#endif #endif
#ifndef LANDMARK #ifndef LANDMARK
#define LANDMARK "os.py" #define LANDMARK "os.py"
#endif
#ifdef __cplusplus
extern "C" {
#endif #endif
static char prefix[MAXPATHLEN+1]; static char prefix[MAXPATHLEN+1];
@ -94,11 +100,7 @@ static char volume_name[32] = { 0 };
static int static int
is_sep(char ch) is_sep(char ch)
{ {
#ifdef ALTSEP
return ch == SEP || ch == ALTSEP; return ch == SEP || ch == ALTSEP;
#else
return ch == SEP;
#endif
} }
/** Reduce a path by its last element. /** Reduce a path by its last element.
@ -117,77 +119,6 @@ reduce(char *dir)
dir[i] = '\0'; dir[i] = '\0';
} }
#ifndef UEFI_C_SOURCE
/** Does filename point to a file and not directory?
@param[in] filename The fully qualified path to the object to test.
@retval 0 Filename was not found, or is a directory.
@retval 1 Filename refers to a regular file.
**/
static int
isfile(char *filename)
{
struct stat buf;
if (stat(filename, &buf) != 0) {
return 0;
}
//if (!S_ISREG(buf.st_mode))
if (S_ISDIR(buf.st_mode)) {
return 0;
}
return 1;
}
/** Determine if filename refers to a Python module.
A Python module is indicated if the file exists, or if the file with
'o' or 'c' appended exists.
@param[in] filename The fully qualified path to the object to test.
@retval 0
**/
static int
ismodule(char *filename)
{
if (isfile(filename)) {
//if (Py_VerboseFlag) PySys_WriteStderr("%s[%d]: file = \"%s\"\n", __func__, __LINE__, filename);
return 1;
}
/* Check for the compiled version of prefix. */
if (strlen(filename) < MAXPATHLEN) {
strcat(filename, Py_OptimizeFlag ? "o" : "c");
if (isfile(filename)) {
return 1;
}
}
return 0;
}
/** Does filename point to a directory?
@param[in] filename The fully qualified path to the object to test.
@retval 0 Filename was not found, or is not a regular file.
@retval 1 Filename refers to a directory.
**/
static int
isdir(char *filename)
{
struct stat buf;
if (stat(filename, &buf) != 0)
return 0;
if (!S_ISDIR(buf.st_mode))
return 0;
return 1;
}
#endif /* UEFI_C_SOURCE */
/** Determine if a path is absolute, or not. /** Determine if a path is absolute, or not.
An absolute path consists of a volume name, "VOL:", followed by a rooted path, An absolute path consists of a volume name, "VOL:", followed by a rooted path,
"/path/elements". If both of these components are present, the path is absolute. "/path/elements". If both of these components are present, the path is absolute.
@ -466,7 +397,7 @@ calculate_path(void)
char *pythonpath = PYTHONPATH; char *pythonpath = PYTHONPATH;
char *rtpypath = Py_GETENV("PYTHONPATH"); char *rtpypath = Py_GETENV("PYTHONPATH");
//char *home = Py_GetPythonHome(); //char *home = Py_GetPythonHome();
char *path = getenv("PATH"); char *path = getenv("path");
char *prog = Py_GetProgramName(); char *prog = Py_GetProgramName();
char argv0_path[MAXPATHLEN+1]; char argv0_path[MAXPATHLEN+1];
char zip_path[MAXPATHLEN+1]; char zip_path[MAXPATHLEN+1];
@ -531,9 +462,9 @@ calculate_path(void)
This is the full path to the platform independent libraries. This is the full path to the platform independent libraries.
########################################################################### */ ########################################################################### */
strncpy(prefix, volume_name, MAXPATHLEN); strncpy(prefix, volume_name, MAXPATHLEN);
joinpath(prefix, PREFIX); joinpath(prefix, PREFIX);
joinpath(prefix, lib_python); joinpath(prefix, lib_python);
/* ########################################################################### /* ###########################################################################
Build the FULL path to the zipped-up Python library. Build the FULL path to the zipped-up Python library.
@ -551,10 +482,10 @@ calculate_path(void)
Build the FULL path to dynamically loadable libraries. Build the FULL path to dynamically loadable libraries.
########################################################################### */ ########################################################################### */
strncpy(exec_prefix, volume_name, MAXPATHLEN); strncpy(exec_prefix, volume_name, MAXPATHLEN); // "fs0:"
joinpath(exec_prefix, EXEC_PREFIX); joinpath(exec_prefix, EXEC_PREFIX); // "fs0:/Efi/StdLib"
joinpath(exec_prefix, lib_python); joinpath(exec_prefix, lib_python); // "fs0:/Efi/StdLib/lib/python.27"
joinpath(exec_prefix, "lib-dynload"); joinpath(exec_prefix, "lib-dynload"); // "fs0:/Efi/StdLib/lib/python.27/lib-dynload"
/* ########################################################################### /* ###########################################################################
Build the module search path. Build the module search path.
@ -573,9 +504,9 @@ calculate_path(void)
strcpy(prefix, volume_name); strcpy(prefix, volume_name);
} }
bufsz = strlen(prefix); bufsz = strlen(prefix);
if(prefix[bufsz-1] == ':') { if(prefix[bufsz-1] == ':') { // if prefix consists solely of a volume_name
prefix[bufsz] = SEP; prefix[bufsz] = SEP; // then append SEP indicating the root directory
prefix[bufsz+1] = 0; prefix[bufsz+1] = 0; // and ensure the new string is terminated
} }
/* Calculate size of return buffer. /* Calculate size of return buffer.

View File

@ -1,4 +1,8 @@
/* Python interpreter main program */ /** @file
Python interpreter main program.
Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
**/
#include "Python.h" #include "Python.h"
#include "osdefs.h" #include "osdefs.h"
@ -40,7 +44,7 @@ static char **orig_argv;
static int orig_argc; static int orig_argc;
/* command line options */ /* command line options */
#define BASE_OPTS "3bBc:dEhiJm:OQ:RsStuUvVW:xX?" #define BASE_OPTS "#3bBc:dEhiJm:OQ:sStuUvVW:xX?"
#ifndef RISCOS #ifndef RISCOS
#define PROGRAM_OPTS BASE_OPTS #define PROGRAM_OPTS BASE_OPTS
@ -59,6 +63,7 @@ static char *usage_line =
/* Long usage message, split into parts < 512 bytes */ /* Long usage message, split into parts < 512 bytes */
static char *usage_1 = "\ static char *usage_1 = "\
Options and arguments (and corresponding environment variables):\n\ Options and arguments (and corresponding environment variables):\n\
-# : alias stderr to stdout for platforms without STDERR output.\n\
-B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x\n\ -B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x\n\
-c cmd : program passed in as string (terminates option list)\n\ -c cmd : program passed in as string (terminates option list)\n\
-d : debug output from parser; also PYTHONDEBUG=x\n\ -d : debug output from parser; also PYTHONDEBUG=x\n\
@ -71,9 +76,6 @@ static char *usage_2 = "\
-m mod : run library module as a script (terminates option list)\n\ -m mod : run library module as a script (terminates option list)\n\
-O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\ -O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\
-OO : remove doc-strings in addition to the -O optimizations\n\ -OO : remove doc-strings in addition to the -O optimizations\n\
-R : use a pseudo-random salt to make hash() values of various types be\n\
unpredictable between separate invocations of the interpreter, as\n\
a defense against denial-of-service attacks\n\
-Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n\ -Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n\
-s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\ -s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\
-S : don't imply 'import site' on initialization\n\ -S : don't imply 'import site' on initialization\n\
@ -102,15 +104,9 @@ PYTHONPATH : '%c'-separated list of directories prefixed to the\n\
static char *usage_5 = "\ static char *usage_5 = "\
PYTHONHOME : alternate <prefix> directory (or <prefix>%c<exec_prefix>).\n\ PYTHONHOME : alternate <prefix> directory (or <prefix>%c<exec_prefix>).\n\
The default module search path uses %s.\n\ The default module search path uses %s.\n\
PYTHONCASEOK : ignore case in 'import' statements (Windows).\n\ PYTHONCASEOK : ignore case in 'import' statements (UEFI default).\n\
PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n\ PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n\
"; ";
static char *usage_6 = "\
PYTHONHASHSEED: if this variable is set to 'random', the effect is the same\n\
as specifying the -R option: a random value is used to seed the hashes of\n\
str, bytes and datetime objects. It can also be set to an integer\n\
in the range [0,4294967295] to get hash values with a predictable seed.\n\
";
static int static int
@ -127,7 +123,6 @@ usage(int exitcode, char* program)
fputs(usage_3, f); fputs(usage_3, f);
fprintf(f, usage_4, DELIM); fprintf(f, usage_4, DELIM);
fprintf(f, usage_5, DELIM, PYTHONHOMEHELP); fprintf(f, usage_5, DELIM, PYTHONHOMEHELP);
fputs(usage_6, f);
} }
#if defined(__VMS) #if defined(__VMS)
if (exitcode == 0) { if (exitcode == 0) {
@ -251,6 +246,7 @@ Py_Main(int argc, char **argv)
int help = 0; int help = 0;
int version = 0; int version = 0;
int saw_unbuffered_flag = 0; int saw_unbuffered_flag = 0;
int saw_pound_flag = 0;
PyCompilerFlags cf; PyCompilerFlags cf;
cf.cf_flags = 0; cf.cf_flags = 0;
@ -266,26 +262,27 @@ Py_Main(int argc, char **argv)
(including -W and -X options). */ (including -W and -X options). */
_PyOS_opterr = 0; /* prevent printing the error in 1st pass */ _PyOS_opterr = 0; /* prevent printing the error in 1st pass */
while ((c = _PyOS_GetOpt(argc, argv, PROGRAM_OPTS)) != EOF) { while ((c = _PyOS_GetOpt(argc, argv, PROGRAM_OPTS)) != EOF) {
if (c == 'm' || c == 'c') { if (c == 'm' || c == 'c') {
/* -c / -m is the last option: following arguments are /* -c / -m is the last option: following arguments are
not interpreter options. */ not interpreter options. */
break; break;
} }
switch (c) { switch (c) {
case '#':
if (saw_pound_flag == 0) {
if(freopen("stdout:", "w", stderr) == NULL) {
puts("ERROR: Unable to reopen stderr as an alias to stdout!");
}
saw_pound_flag = 0xFF;
}
break;
case 'E': case 'E':
Py_IgnoreEnvironmentFlag++; Py_IgnoreEnvironmentFlag++;
break; break;
case 'R': default:
Py_HashRandomizationFlag++; break;
break; }
}
} }
/* The variable is only tested for existence here; _PyRandom_Init will
check its value further. */
if (!Py_HashRandomizationFlag &&
(p = Py_GETENV("PYTHONHASHSEED")) && *p != '\0')
Py_HashRandomizationFlag = 1;
_PyRandom_Init(); _PyRandom_Init();
PySys_ResetWarnOptions(); PySys_ResetWarnOptions();
@ -426,7 +423,7 @@ Py_Main(int argc, char **argv)
PySys_AddWarnOption(_PyOS_optarg); PySys_AddWarnOption(_PyOS_optarg);
break; break;
case 'R': case '#':
/* Already handled above */ /* Already handled above */
break; break;

View File

@ -1,9 +1,20 @@
/* select - Module containing unix select(2) call. /* @file
Under Unix, the file descriptors are small integers. select - Module containing unix select(2) call.
Under Win32, select only exists for sockets, and sockets may Under Unix, the file descriptors are small integers.
have any value except INVALID_SOCKET. Under Win32, select only exists for sockets, and sockets may
Under BeOS, we suffer the same dichotomy as Win32; sockets can be anything have any value except INVALID_SOCKET.
>= 0. Under BeOS, we suffer the same dichotomy as Win32; sockets can be anything
>= 0.
Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*/ */
#include "Python.h" #include "Python.h"
@ -107,7 +118,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
v = PyObject_AsFileDescriptor( o ); v = PyObject_AsFileDescriptor( o );
if (v == -1) goto finally; if (v == -1) goto finally;
#if defined(_MSC_VER) #if defined(_MSC_VER) && !defined(UEFI_C_SOURCE)
max = 0; /* not used for Win32 */ max = 0; /* not used for Win32 */
#else /* !_MSC_VER */ #else /* !_MSC_VER */
if (!_PyIsSelectable_fd(v)) { if (!_PyIsSelectable_fd(v)) {
@ -1236,17 +1247,17 @@ static PyTypeObject kqueue_queue_Type;
* kevent is not standard and its members vary across BSDs. * kevent is not standard and its members vary across BSDs.
*/ */
#if !defined(__OpenBSD__) #if !defined(__OpenBSD__)
# define IDENT_TYPE T_UINTPTRT # define IDENT_TYPE T_UINTPTRT
# define IDENT_CAST Py_intptr_t # define IDENT_CAST Py_intptr_t
# define DATA_TYPE T_INTPTRT # define DATA_TYPE T_INTPTRT
# define DATA_FMT_UNIT INTPTRT_FMT_UNIT # define DATA_FMT_UNIT INTPTRT_FMT_UNIT
# define IDENT_AsType PyLong_AsUintptr_t # define IDENT_AsType PyLong_AsUintptr_t
#else #else
# define IDENT_TYPE T_UINT # define IDENT_TYPE T_UINT
# define IDENT_CAST int # define IDENT_CAST int
# define DATA_TYPE T_INT # define DATA_TYPE T_INT
# define DATA_FMT_UNIT "i" # define DATA_FMT_UNIT "i"
# define IDENT_AsType PyLong_AsUnsignedLong # define IDENT_AsType PyLong_AsUnsignedLong
#endif #endif
/* Unfortunately, we can't store python objects in udata, because /* Unfortunately, we can't store python objects in udata, because
@ -1298,7 +1309,7 @@ kqueue_event_init(kqueue_event_Object *self, PyObject *args, PyObject *kwds)
if (PyLong_Check(pfd) if (PyLong_Check(pfd)
#if IDENT_TYPE == T_UINT #if IDENT_TYPE == T_UINT
&& PyLong_AsUnsignedLong(pfd) <= UINT_MAX && PyLong_AsUnsignedLong(pfd) <= UINT_MAX
#endif #endif
) { ) {
self->e.ident = IDENT_AsType(pfd); self->e.ident = IDENT_AsType(pfd);

View File

@ -1,4 +1,5 @@
/* gzguts.h -- zlib internal header definitions for gz* operations /* gzguts.h -- zlib internal header definitions for gz* operations
* Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
* Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
@ -31,7 +32,7 @@
# include <stddef.h> # include <stddef.h>
#endif #endif
#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) #if (defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)) && !defined(UEFI_C_SOURCE)
# include <io.h> # include <io.h>
#endif #endif
@ -42,6 +43,11 @@
# define close _close # define close _close
#endif #endif
// Needed to get the declarations for open, read, write, close
#ifdef UEFI_C_SOURCE
# include <unistd.h>
#endif
#ifdef NO_DEFLATE /* for compatibility with old definition */ #ifdef NO_DEFLATE /* for compatibility with old definition */
# define NO_GZCOMPRESS # define NO_GZCOMPRESS
#endif #endif
@ -99,7 +105,7 @@
Microsoft more than a decade later!), _snprintf does not guarantee null Microsoft more than a decade later!), _snprintf does not guarantee null
termination of the result -- however this is only used in gzlib.c where termination of the result -- however this is only used in gzlib.c where
the result is assured to fit in the space provided */ the result is assured to fit in the space provided */
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(UEFI_C_SOURCE)
# define snprintf _snprintf # define snprintf _snprintf
#endif #endif

View File

@ -1,7 +1,10 @@
/* zutil.h -- internal interface and configuration of the compression library /** @file
zutil.h -- internal interface and configuration of the compression library
Copyright (C) 2015, Daryl McDaniel.<BR>
* Copyright (C) 1995-2013 Jean-loup Gailly. * Copyright (C) 1995-2013 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ **/
/* WARNING: this file should *not* be used by applications. It is /* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is part of the implementation of the compression library and is
@ -21,7 +24,7 @@
#include "zlib.h" #include "zlib.h"
#if defined(STDC) && !defined(Z_SOLO) #if defined(UEFI_C_SOURCE) || (defined(STDC) && !defined(Z_SOLO))
# if !(defined(_WIN32_WCE) && defined(_MSC_VER)) # if !(defined(_WIN32_WCE) && defined(_MSC_VER))
# include <stddef.h> # include <stddef.h>
# endif # endif
@ -149,7 +152,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define fdopen(fd,mode) NULL /* No fdopen() */ # define fdopen(fd,mode) NULL /* No fdopen() */
#endif #endif
#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX #if !defined(UEFI_C_SOURCE) && (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined(__INTERIX)
# if defined(_WIN32_WCE) # if defined(_WIN32_WCE)
# define fdopen(fd,mode) NULL /* No fdopen() */ # define fdopen(fd,mode) NULL /* No fdopen() */
# ifndef _PTRDIFF_T_DEFINED # ifndef _PTRDIFF_T_DEFINED

View File

@ -1,4 +1,15 @@
/* Long (arbitrary precision) integer object implementation */ /** @file
Long (arbitrary precision) integer object implementation.
Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
/* XXX The functional organization of this file is terrible */ /* XXX The functional organization of this file is terrible */
@ -24,6 +35,7 @@
*/ */
#define FIVEARY_CUTOFF 8 #define FIVEARY_CUTOFF 8
#undef ABS
#define ABS(x) ((x) < 0 ? -(x) : (x)) #define ABS(x) ((x) < 0 ? -(x) : (x))
#undef MIN #undef MIN

View File

@ -1,10 +1,25 @@
/* stringlib: locale related helpers implementation */ /** @file
stringlib: locale related helpers implementation.
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef STRINGLIB_LOCALEUTIL_H #ifndef STRINGLIB_LOCALEUTIL_H
#define STRINGLIB_LOCALEUTIL_H #define STRINGLIB_LOCALEUTIL_H
#include <locale.h> #include <locale.h>
// Prevent conflicts with EFI
#undef MAX
#undef MIN
#define MAX(x, y) ((x) < (y) ? (y) : (x)) #define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) < (y) ? (x) : (y)) #define MIN(x, y) ((x) < (y) ? (x) : (y))

View File

@ -1,9 +1,27 @@
/* Return the copyright string. This is updated manually. */ /** @file
Return the copyright string. This is updated manually.
Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "Python.h" #include "Python.h"
static char cprt[] = static char cprt[] =
"\ "\
Copyright (c) 2015 Daryl McDaniel.\n\
All Rights Reserved.\n\
\n\
Copyright (c) 2010-2014 Intel Corporation.\n\
All Rights Reserved.\n\
\n\
Copyright (c) 2001-2015 Python Software Foundation.\n\ Copyright (c) 2001-2015 Python Software Foundation.\n\
All Rights Reserved.\n\ All Rights Reserved.\n\
\n\ \n\
@ -19,5 +37,5 @@ All Rights Reserved.";
const char * const char *
Py_GetCopyright(void) Py_GetCopyright(void)
{ {
return cprt; return cprt;
} }

View File

@ -1,8 +1,18 @@
/** @file
Write Python objects to files and read them back.
This is intended for writing and reading compiled Python code only;
a true persistent storage facility would be much harder, since
it would have to take circular links and sharing into account.
/* Write Python objects to files and read them back. Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
This is intended for writing and reading compiled Python code only; This program and the accompanying materials are licensed and made available under
a true persistent storage facility would be much harder, since the terms and conditions of the BSD License that accompanies this distribution.
it would have to take circular links and sharing into account. */ The full text of the license may be found at
http://opensource.org/licenses/bsd-license.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#define PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN
@ -11,6 +21,7 @@
#include "code.h" #include "code.h"
#include "marshal.h" #include "marshal.h"
#undef ABS
#define ABS(x) ((x) < 0 ? -(x) : (x)) #define ABS(x) ((x) < 0 ? -(x) : (x))
/* High water mark to determine when the marshalled object is dangerously deep /* High water mark to determine when the marshalled object is dangerously deep

View File

@ -1,3 +1,15 @@
/** @file
Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "Python.h" #include "Python.h"
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
#include <windows.h> #include <windows.h>
@ -153,8 +165,12 @@ vms_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
static struct { static struct {
int fd; int fd;
#ifdef HAVE_STRUCT_STAT_ST_DEV
dev_t st_dev; dev_t st_dev;
#endif
#ifdef HAVE_STRUCT_STAT_ST_INO
ino_t st_ino; ino_t st_ino;
#endif
} urandom_cache = { -1 }; } urandom_cache = { -1 };
/* Read size bytes from /dev/urandom into buffer. /* Read size bytes from /dev/urandom into buffer.
@ -167,7 +183,7 @@ dev_urandom_noraise(unsigned char *buffer, Py_ssize_t size)
assert (0 < size); assert (0 < size);
fd = open("/dev/urandom", O_RDONLY); fd = open("/dev/urandom", O_RDONLY, 0);
if (fd < 0) if (fd < 0)
Py_FatalError("Failed to open /dev/urandom"); Py_FatalError("Failed to open /dev/urandom");
@ -204,8 +220,14 @@ dev_urandom_python(char *buffer, Py_ssize_t size)
if (urandom_cache.fd >= 0) { if (urandom_cache.fd >= 0) {
/* Does the fd point to the same thing as before? (issue #21207) */ /* Does the fd point to the same thing as before? (issue #21207) */
if (fstat(urandom_cache.fd, &st) if (fstat(urandom_cache.fd, &st)
#ifdef HAVE_STRUCT_STAT_ST_DEV
|| st.st_dev != urandom_cache.st_dev || st.st_dev != urandom_cache.st_dev
|| st.st_ino != urandom_cache.st_ino) { #endif
#ifdef HAVE_STRUCT_STAT_ST_INO
|| st.st_ino != urandom_cache.st_ino
#endif
)
{
/* Something changed: forget the cached fd (but don't close it, /* Something changed: forget the cached fd (but don't close it,
since it probably points to something important for some since it probably points to something important for some
third-party code). */ third-party code). */
@ -216,7 +238,7 @@ dev_urandom_python(char *buffer, Py_ssize_t size)
fd = urandom_cache.fd; fd = urandom_cache.fd;
else { else {
Py_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
fd = open("/dev/urandom", O_RDONLY); fd = open("/dev/urandom", O_RDONLY, 0);
Py_END_ALLOW_THREADS Py_END_ALLOW_THREADS
if (fd < 0) if (fd < 0)
{ {
@ -250,8 +272,12 @@ dev_urandom_python(char *buffer, Py_ssize_t size)
} }
else { else {
urandom_cache.fd = fd; urandom_cache.fd = fd;
#ifdef HAVE_STRUCT_STAT_ST_DEV
urandom_cache.st_dev = st.st_dev; urandom_cache.st_dev = st.st_dev;
#endif
#ifdef HAVE_STRUCT_STAT_ST_INO
urandom_cache.st_ino = st.st_ino; urandom_cache.st_ino = st.st_ino;
#endif
} }
} }
} }

View File

@ -1,6 +1,7 @@
/** @file /** @file
Manually generated Python Configuration file for EDK II. Manually generated Python Configuration file for EDK II.
Copyright (c) 2015, Daryl McDaniel. All rights reserved.<BR>
Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR> Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution. the terms and conditions of the BSD License that accompanies this distribution.
@ -67,6 +68,9 @@
/* Define to 1 if you have the 'alarm' function. */ /* Define to 1 if you have the 'alarm' function. */
#undef HAVE_ALARM #undef HAVE_ALARM
/* Define to 1 if you have the <alloca.h> header file. */
#undef HAVE_ALLOCA_H
/* Define this if your time.h defines altzone. */ /* Define this if your time.h defines altzone. */
#undef HAVE_ALTZONE #undef HAVE_ALTZONE
@ -109,6 +113,9 @@
/* define to 1 if your sem_getvalue is broken. */ /* define to 1 if your sem_getvalue is broken. */
#define HAVE_BROKEN_SEM_GETVALUE 1 #define HAVE_BROKEN_SEM_GETVALUE 1
/* Define if 'unsetenv' does not return an int. */
#undef HAVE_BROKEN_UNSETENV
/* Define this if you have the type _Bool. */ /* Define this if you have the type _Bool. */
#define HAVE_C99_BOOL 1 #define HAVE_C99_BOOL 1
@ -170,10 +177,10 @@
/* Define to 1 if you have the device macros. */ /* Define to 1 if you have the device macros. */
#undef HAVE_DEVICE_MACROS #undef HAVE_DEVICE_MACROS
/* Define if we have /dev/ptc. */ /* Define to 1 if you have the /dev/ptc device file. */
#undef HAVE_DEV_PTC #undef HAVE_DEV_PTC
/* Define if we have /dev/ptmx. */ /* Define to 1 if you have the /dev/ptmx device file. */
#undef HAVE_DEV_PTMX #undef HAVE_DEV_PTMX
/* Define to 1 if you have the <direct.h> header file. */ /* Define to 1 if you have the <direct.h> header file. */
@ -274,11 +281,11 @@
#undef HAVE_GAMMA #undef HAVE_GAMMA
/* Define if we can use gcc inline assembler to get and set x87 control word /* Define if we can use gcc inline assembler to get and set x87 control word
*/ */
#if defined(__GNUC__) #if defined(__GNUC__)
#define HAVE_GCC_ASM_FOR_X87 1 #define HAVE_GCC_ASM_FOR_X87 1
#else #else
#undef HAVE_GCC_ASM_FOR_X87 #undef HAVE_GCC_ASM_FOR_X87
#endif #endif
/* Define if you have the getaddrinfo function. */ /* Define if you have the getaddrinfo function. */
@ -290,6 +297,9 @@
/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */ /* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
#undef HAVE_GETC_UNLOCKED #undef HAVE_GETC_UNLOCKED
/* Define to 1 if you have the 'getentropy' function. */
#undef HAVE_GETENTROPY
/* Define to 1 if you have the 'getgroups' function. */ /* Define to 1 if you have the 'getgroups' function. */
#undef HAVE_GETGROUPS #undef HAVE_GETGROUPS
@ -383,6 +393,12 @@
/* Define to 1 if you have the 'initgroups' function. */ /* Define to 1 if you have the 'initgroups' function. */
#undef HAVE_INITGROUPS #undef HAVE_INITGROUPS
/* Define if your compiler provides int32_t. */
#undef HAVE_INT32_T
/* Define if your compiler provides int64_t. */
#undef HAVE_INT64_T
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1 #define HAVE_INTTYPES_H 1
@ -479,6 +495,9 @@
/* Define to 1 if you have the 'mktime' function. */ /* Define to 1 if you have the 'mktime' function. */
#define HAVE_MKTIME 1 #define HAVE_MKTIME 1
/* Define to 1 if you have the 'mmap' function. */
#undef HAVE_MMAP
/* Define to 1 if you have the 'mremap' function. */ /* Define to 1 if you have the 'mremap' function. */
#undef HAVE_MREMAP #undef HAVE_MREMAP
@ -524,6 +543,9 @@
/* Define if you have GNU PTH threads. */ /* Define if you have GNU PTH threads. */
#undef HAVE_PTH #undef HAVE_PTH
/* Define to 1 if you have the 'pthread_atfork' function. */
#undef HAVE_PTHREAD_ATFORK
/* Defined for Solaris 2.6 bug in pthread header. */ /* Defined for Solaris 2.6 bug in pthread header. */
#undef HAVE_PTHREAD_DESTRUCTOR #undef HAVE_PTHREAD_DESTRUCTOR
@ -542,6 +564,9 @@
/* Define to 1 if you have the 'putenv' function. */ /* Define to 1 if you have the 'putenv' function. */
#undef HAVE_PUTENV #undef HAVE_PUTENV
/* Define if the libcrypto has RAND_egd */
#undef HAVE_RAND_EGD
/* Define to 1 if you have the 'readlink' function. */ /* Define to 1 if you have the 'readlink' function. */
#undef HAVE_READLINK #undef HAVE_READLINK
@ -717,6 +742,12 @@
/* Define to 1 if 'st_rdev' is a member of 'struct stat'. */ /* Define to 1 if 'st_rdev' is a member of 'struct stat'. */
#undef HAVE_STRUCT_STAT_ST_RDEV #undef HAVE_STRUCT_STAT_ST_RDEV
/* Define to 1 if 'st_dev' is a member of 'struct stat'. */
#undef HAVE_STRUCT_STAT_ST_DEV
/* Define to 1 if 'st_ino' is a member of 'struct stat'. */
#undef HAVE_STRUCT_STAT_ST_INO
/* Define to 1 if 'tm_zone' is a member of 'struct tm'. */ /* Define to 1 if 'tm_zone' is a member of 'struct tm'. */
#undef HAVE_STRUCT_TM_TM_ZONE #undef HAVE_STRUCT_TM_TM_ZONE
@ -863,6 +894,12 @@
/* Define this if you have tcl and TCL_UTF_MAX==6 */ /* Define this if you have tcl and TCL_UTF_MAX==6 */
#undef HAVE_UCS4_TCL #undef HAVE_UCS4_TCL
/* Define if your compiler provides uint32_t. */
#undef HAVE_UINT32_T
/* Define if your compiler provides uint64_t. */
#undef HAVE_UINT64_T
/* Define to 1 if the system has the type 'uintptr_t'. */ /* Define to 1 if the system has the type 'uintptr_t'. */
#define HAVE_UINTPTR_T 1 #define HAVE_UINTPTR_T 1
@ -932,22 +969,22 @@
#undef MVWDELCH_IS_EXPRESSION #undef MVWDELCH_IS_EXPRESSION
/* Define to the address where bug reports for this package should be sent. */ /* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "edk2-devel@lists.sourceforge.net" #define PACKAGE_BUGREPORT "edk2-devel@lists.01.org"
/* Define to the full name of this package. */ /* Define to the full name of this package. */
#define PACKAGE_NAME "EDK II Python Package" #define PACKAGE_NAME "EDK II Python 2.7.10 Package"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "EDK II Python Package V0.8" #define PACKAGE_STRING "EDK II Python 2.7.10 Package V0.1"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "EADK_Python" #define PACKAGE_TARNAME "EADK_Python"
/* Define to the home page for this package. */ /* Define to the home page for this package. */
#define PACKAGE_URL "http://edk2.tianocore.org/toolkit/python" #define PACKAGE_URL "http://edk2.tianocore.org/"
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "V0.8" #define PACKAGE_VERSION "V0.1"
/* Define if POSIX semaphores aren't enabled on your system */ /* Define if POSIX semaphores aren't enabled on your system */
#define POSIX_SEMAPHORES_NOT_ENABLED 1 #define POSIX_SEMAPHORES_NOT_ENABLED 1
@ -1160,13 +1197,14 @@
/* This must be defined on some systems to enable large file support. */ /* This must be defined on some systems to enable large file support. */
#undef _LARGEFILE_SOURCE #undef _LARGEFILE_SOURCE
/* This must be defined on AIX systems to enable large file support. */
#undef _LARGE_FILES
/* Define to 1 if on MINIX. */ /* Define to 1 if on MINIX. */
#undef _MINIX #undef _MINIX
/* Define on NetBSD to activate all library features */ /* Define on NetBSD to activate all library features */
#ifndef _NETBSD_SOURCE #define _NETBSD_SOURCE 1
#define _NETBSD_SOURCE 1
#endif
/* Define _OSF_SOURCE to get the makedev macro. */ /* Define _OSF_SOURCE to get the makedev macro. */
#undef _OSF_SOURCE #undef _OSF_SOURCE
@ -1264,3 +1302,4 @@
//#undef volatile //#undef volatile
#endif /*Py_PYCONFIG_H*/ #endif /*Py_PYCONFIG_H*/