debian/0000755000000000000000000000000012245445345007176 5ustar debian/pypy-doc.doc-base0000644000000000000000000000047312215550224012333 0ustar Document: pypy Title: PyPy Documentation Abstract: PyPy is a fast, compliant alternative implementation of the Python language. Section: Programming/Python Format: HTML Index: /usr/share/doc/pypy-doc/html/index.html Files: /usr/share/doc/pypy-doc/html/*.html Format: Text Files: /usr/share/doc/pypy-doc/rst/*.txt debian/pypy-tk.prerm0000644000000000000000000000055612241452340011655 0ustar #!/bin/sh set -e case "$1" in remove) if which pypyclean >/dev/null 2>&1; then pypyclean /usr/lib/pypy/lib_pypy/_tkinter fi ;; deconfigure|upgrade) ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 # vim:set et ts=4 sw=4: debian/python-pypy.sandbox.manpages0000644000000000000000000000003612215550224014655 0ustar build-docs/man/pypy-sandbox.1 debian/pypy.dirs0000644000000000000000000000004512215550224011047 0ustar /usr/local/lib/pypy2.7/dist-packages debian/python-pypy.sandbox.install0000644000000000000000000000015312241437663014542 0ustar debian/scripts/pypy-sandbox /usr/bin pypy/goal/pypy-c-sandbox /usr/lib/pypy-sandbox debian/source/0000755000000000000000000000000012215550224010464 5ustar debian/source/format0000644000000000000000000000001412215550224011672 0ustar 3.0 (quilt) debian/pypy.links0000644000000000000000000000004712215550224011230 0ustar /usr/lib/pypy/bin/pypy-c /usr/bin/pypy debian/pypy.prerm0000644000000000000000000000046112241722435011241 0ustar #!/bin/sh set -e case "$1" in remove|deconfigure|upgrade) pypyclean /usr/lib/pypy/lib-python /usr/lib/pypy/lib_pypy ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 # vim:set et ts=4 sw=4: debian/changelog0000644000000000000000000003523512245445326011057 0ustar pypy (2.2.1+dfsg-1) unstable; urgency=low * New upstream bugfix release. - Fixes a ref-counting bug in socket. * Drop build-dep on execstack. Doesn't appear to be necessary any more (and doesn't work on all achitectures). -- Stefano Rivera Wed, 27 Nov 2013 11:41:10 -0800 pypy (2.2.0+dfsg-1) unstable; urgency=low * New upstream release. * Refresh patches. * Add new upstream copyright holders to debian/copyright. * Drop test_bootstrap-path patch, applied upstream. * pypy{clean,compile}: Perform a logical and instead of or, when -p and a directory are specified (matching pycompile semantics). * Disable JIT on armel. ARMv5 isn't supported. * Drop build-dep on valgrind on armel. It's no longer a supported platform for valgrind (Closes: #729141). * Bump debian/compat to 9, for executable dh_install scripts. * Split the stdlib test suite into a new binary package: pypy-lib-testsuite. * Split the _tkinter module into a new binary package: pypy-tk. * Run pypyclean on the stdlib before upgrading. -- Stefano Rivera Sat, 16 Nov 2013 23:05:19 +0000 pypy (2.1.0+dfsg-3) unstable; urgency=low * The wildcard for ARM is any-arm. * Build the syslog cffi module in lib_pypy. -- Stefano Rivera Thu, 12 Sep 2013 10:33:55 +0200 pypy (2.1.0+dfsg-2) unstable; urgency=low * Disable continuation on all architectures except x86 and ARM (requires porting). -- Stefano Rivera Tue, 10 Sep 2013 17:10:34 +0200 pypy (2.1.0+dfsg-1) unstable; urgency=low * New upstream release. - The ARM JIT is now supported and enabled. - Several bug fixes and performance improvements. * Refresh patches. * Drop patches, applied/superseded upstream: - shared-ffi - distutils-cflags - gnukfreebsd - l2-cache-detection * Add pypycompile and pypyclean scripts for dh_pypy packages. - Use for byte-compiling the stdlib. * Build cffi module for tkinter. * Patch: test_bootstrap-path - avoid a spurious test failure when TMPDIR is set to inside the source tree. * Add /usr/lib/pypy/runtime.d, so that module re-byte-compilation can be triggered on minor version updates. As we only have one pypy version installed concurrently, only .rtupdate is supported. -- Stefano Rivera Sun, 01 Sep 2013 09:35:58 +0200 pypy (2.0.2+dfsg-4) unstable; urgency=low * Relax the RAM check on kfreebsd-amd64, which currently has 3GB buildds. -- Stefano Rivera Fri, 28 Jun 2013 01:12:07 +0200 pypy (2.0.2+dfsg-3) unstable; urgency=low * Let dh_usrlocal handle the empty directories in /usr/local, and create them with dh_installdirs. (Closes: #713958) * Use a more conservative RAM requirement on x86. (Closes: #713787) -- Stefano Rivera Mon, 24 Jun 2013 18:44:22 +0200 pypy (2.0.2+dfsg-2) unstable; urgency=low * Create empty directories in /usr/local * Fix a bug in l2-cache-detection on sparc, causing FTBFS due to the interpreter aborting on startup. -- Stefano Rivera Sun, 23 Jun 2013 23:07:54 +0200 pypy (2.0.2+dfsg-1) unstable; urgency=low * New upstream bug-fix release. - mainly fatal errors or crashes in the stdlib, and a JIT bug around foreign functions calls in multi-threaded programs. * Refresh patches. * Drop docs-version patch. * Clean up after cffi tests. * so_reuseport: Avoid test failures on machines without SO_REUSEPORT support. * gnukfreebsd: Add the GNUkFreebsd platform descriptions that were accidentally deleted upstream. * Drop B-D on python-greenlet, unneeded. * l2-cache-detection: Add L2 cache size detection code for non-x86 architectures. * Bullet pypy's description to make it more readable. Thanks Jonas Smedegaard. (Closes: #709091) * Disable ARM JIT until declared stable by upstream. -- Stefano Rivera Fri, 24 May 2013 01:08:28 +0200 pypy (2.0.0+dfsg-1) unstable; urgency=low * New upstream release (Closes: #698524) * Upload to unstable. * Refresh patches. * Update copyright. * Drop patches, applied/superseded upstream: - test_telnetlib-deadlock - test_subprocess - ignore-paddd - issue670664 - fpic-archs - gnukfreebsd-link-rt * Patches: - pep3147-core: Drop validation of .py filenames. This is behaviour is now expected in tests. - pep3147-stdlib: Use cached_from_source in added tests. - distutils-install-layout: Let pydoc handle dist-packages the same as site-packages. - shared-ffi: Don't static link with libffi. - docs-version: Update docs versions for 2.0 final. - distutils-cflags: Build cffi modules when CFLAGS contains a space. * Export TERM=dumb for lib-python tests (if not already in the environment). Required by test_readline. * Build-Depend on procps, for test_signal. * Build-Depend on netbase, for test_socket. * Build-Depend on libsqlite3-dev, _sqlite3 (which now uses CFFI). * Build with JIT on ARM. * Use valgrind headers on mips, now that they are available there. * Update paths for the rpython-pypy split. * Rename python-pypy.translator.sandbox -> python-pypy.sandbox, following the pypy-rpython split. * cffi is now bundled in the stdlib: - Move _cffi shared libraries out of __pycache__, and put them in the pypy binary package. - Provides pypy-cffi. * Byte-compile lib_pypy, too. * Bumped Standards-Version to 3.9.4, no changes needed. * Build-Depend on python-greenlet, enabling stackless builds on, sparc and sparc64, now that it's available there. Blacklist sh4. * Use valgrind headers on mipsel, now that they are available. -- Stefano Rivera Fri, 10 May 2013 20:15:26 +0200 pypy (1.9+dfsg-2) experimental; urgency=low * Redirect translation output to stdout. Buildds don't watch stderr for checking timeouts. * Do enforce the RAM check on Ubuntu, for non-primary-archive builds. -- Stefano Rivera Thu, 12 Jul 2012 21:51:31 -0600 pypy (1.9+dfsg-1) experimental; urgency=low * New upstream release. * Refresh patches. * Update patches for the removal of lib-python/modified-2.7. * Drop patches, applied upstream: - ignore-shufps - pypy-help * Apply patches applied in python2.7 2.7.3~rc2-2: - pypirc-secure: CVE-2011-4944, distutils creates ~/.pypirc insecurely. - xdg-gvfs-open: Use xdg-open/gvfs-open in webbrowser. * Moved RAM check and translation options generation into shell scripts in debian/scripts. They were getting unwieldy in debian/rules. * Updated machine-readable copyright Format to 1.0. - Removed mentions of lib-python/modified-2.7. * Bumped Standards-Version to 3.9.3, no changes needed. * Use valgrind headers on ppc64 and s390x, now that they are available there. * Don't enforce the RAM check on Ubuntu. * Patch ignore-paddd: Update ignored operations in trackinggcroot, as our gcc4.7 produces paddd on i386. -- Stefano Rivera Tue, 19 Jun 2012 14:42:45 +0200 pypy (1.8+dfsg-2) experimental; urgency=low * Build the sandboxed PyPy with -O2, not -O3 or -Ojit. Sandboxed pypy can't be built with profile-guided optimisations. - Use generational gc, now that we aren't using the JIT. * Patch gnukfreebsd-link-rt: Link with -lrt on GNU/kFreeBSD. -- Stefano Rivera Sat, 18 Feb 2012 09:28:14 +0200 pypy (1.8+dfsg-1) experimental; urgency=low * New upstream release. * Refresh patches. * Drop patches, applied upstream: - compiler-flags - docs-version - hardcoded-nursery-size - test_ssl-errno0 - test_unix_socket_connect - big-endian-test_codecs - big-endian-clibffi - kfreebsd-glibc - kfreebsd-test-hangs * Build manpage from upstream docs. * Patch doc-envvars: Update manpage, to include environment variables. * Patch fpic-archs: Build shared libraries with -fPIC on arm and mips. * Patch pypy-help: Make --help not crash. * Update copyright contributors and years. * pep3147-core: Assert the absence of nulls (assert_str0) on the pathnames provided in make_compiled_pathname and make_source_pathname. * Build sandboxed pypy: python-pypy.translator.sandbox - Patch ignore-shufps: Fix build failure. - Patch sandbox-bin: Change pypy_interact's --help to name it pypy-sandbox - Patch sandbox-dependencies: Reduce the amount of pypy source that pypy-sandobx needs. - Patch sandbox-manpage: pypy-sandbox manpage. - B-D on python (>= 2.6.6-11~) for dh_python2 with .pyinstall support. * Run translations and tests with unbuffered I/O, to combat build timeouts. - Lower build-time RAM requirement to 1.4G. -- Stefano Rivera Tue, 14 Feb 2012 15:10:21 +0200 pypy (1.7+dfsg-6) experimental; urgency=low * Restrict architectures to linux-any and kfreebsd-any. Not yet ported to hurd. * Include swap in the RAM calculation on s390*. * Forwarded many patches upstream. * Drop user-prefix patch, and adjust distutils-install-layout patch and package install layout to match. * Update manpage, to include environment variables. -- Stefano Rivera Mon, 06 Feb 2012 16:50:16 +0200 pypy (1.7+dfsg-5) experimental; urgency=low * Revert memory requirement bump. Timeout was unrelated. * kfreebsd: - Patch plat-gnkfreebsd: Add gnukfreebsd9 platform. - Patch kfreebsd-glibc: Adjust platform checks to be aware of the difference between gnkfreebsd and freebsd. - Patch kfreebsd-test-hangs: Skip tests that deadlock. -- Stefano Rivera Sun, 22 Jan 2012 02:20:06 +0200 pypy (1.7+dfsg-4) experimental; urgency=low * Really upload to experimental. * Patches: - big-endian-test_codecs: Add big endian test case to test_utf16_encode_decode. - big-endian-clibffi: Correctly handle ushort, ubyte, byte, and char types in clibffi on big endian. - kfreebsd-glibc: Don't attempt to link to libcompat. Link with libdl. * Bump memory requirement to 2100 MiB (32-bit), to avoid timeout on caballero (4G, ia64). * kfreebsd: - Enable JIT. - Augment, rather than replace, compiler flags from the environment. * Don't fail without execstack. -- Stefano Rivera Mon, 16 Jan 2012 01:10:27 +0200 pypy (1.7+dfsg-3) experimental; urgency=low * Add pypy.1 manpage. * Don't BD on greenlet on architectures which it's known not to be ported to. * Don't BD on execstack on non-linux. * Suppress stdlib bytecompilation output. * Avoid timeout during build, by running make ourselves. PyPy buffers all make output, until it completes. -- Stefano Rivera Sat, 14 Jan 2012 17:48:30 +0200 pypy (1.7+dfsg-2) experimental; urgency=low * Fix architecture dependant only builds. * Remove spurious copyright newline. -- Stefano Rivera Mon, 09 Jan 2012 15:52:29 +0200 pypy (1.7+dfsg-1) experimental; urgency=low * Re-introduce package in experimental. * New upstream version. * New packaging: - Drop rpython development bits from pypy-dev. - Drop pypy-stackless: Now part of the default configuration. * Incorporate all useful stdlib patches from python2.7 * PEP3147 support -- Stefano Rivera Mon, 09 Jan 2012 13:32:00 +0200 pypy (1.0.0-svn55443-1) unstable; urgency=low * New upstream snapshot. - Doesn't hardcode libc6.so.6; fixes FTBFS on ia64 (Closes: #440331) * Don't build pypy-stackless on platforms the greenlet module has not been ported to. (Closes: #475868) * Run tests after build on request by upstream. -- Chris Lamb Sat, 31 May 2008 18:50:58 +0100 pypy (1.0.0-svn51288-1) unstable; urgency=low * New upstream release. (Closes: #459118) * New maintainer. (Closes: #455734) * Bump debhelper compatibility version. * Refresh and tidy package descriptions. * Tidy debian/configure.py, debian/rules, Lintian overrides. * Add pypy(1), py.py(1), pypy-translate(1), jscompile(1) and pypy-stackless(1) manpages. * Add get-orig-source target in debian/rules. * Use quilt to manage Thiemo Seufer's MIPS and MIPSEL patch. * Use PyPy-specific temporary directory prefixes. (Closes: #452851) -- Chris Lamb Tue, 05 Feb 2008 13:26:11 +0000 pypy (1.0.0-svn51091-1) unstable; urgency=low * New upstream svn snapshot, fixing 64bit build (closes: #462008) -- Alexandre Fayolle Mon, 28 Jan 2008 09:40:48 +0100 pypy (1.0.0-svn50146-2) unstable; urgency=low * Added missing build dependency on zlib1g-dev (closes: #460696) -- Alexandre Fayolle Mon, 14 Jan 2008 18:15:32 +0100 pypy (1.0.0-svn50146-1) unstable; urgency=low * Acknowledge NMU (closes: #431197) * Apply Yaroslav Hachenko's patch to use more recent svn snapshot, and enable threading support (closes: #458953) * Apply Thiemo Seufer's patch to enable mips and mipsel support (closes: #459520) * Added build dep on procps (closes: #444652) * Bumped up standards to 3.7.3 * Note that pypy is currently under ITA: I lack time to properly follow upstream developments, and all patches and NMU's are welcome. If you'd like to adopt pypy, just send me an email to notify me and jump for it. Offers to co-maintain are welcome too. Thanks. -- Alexandre Fayolle Mon, 14 Jan 2008 09:46:11 +0100 pypy (1.0.0-3.1) unstable; urgency=low * Non-maintainer upload. * Disable build of upstream removed logic object space. Remove pypy-logic package. (closes: #442060) * Move build output away from /tmp. (closes: #452850) * Move compile step out of the main translation. This reduces the memory footprint by one third. -- Bastian Blank Tue, 27 Nov 2007 12:08:06 +0000 pypy (1.0.0-3) unstable; urgency=low * Use more conservative options for platforms for which support is uncertain * Enable check of available memory during configuration * Packages are once again arch: any -- Alexandre.Fayolle Wed, 18 Jul 2007 12:57:28 +0200 pypy (1.0.0-2) unstable; urgency=low * Updated debian/copyright (Closes: #423603) * Removed support for archs not supported upstream (Closes: #426265, #423725) * Adds missing conftest.py (Closes: #428539) -- Alexandre.Fayolle Thu, 28 Jun 2007 12:25:53 +0200 pypy (1.0.0-1) unstable; urgency=low * Fixed debian/copyright and reupload (Closes: #326892) * New upstream release -- Alexandre Fayolle Fri, 13 Apr 2007 09:33:09 +0200 pypy (0.99.0-1) experimental; urgency=low * Initial release (Closes: #326892) -- Alexandre Fayolle Mon, 19 Feb 2007 10:47:33 +0100 debian/pypy.postinst.in0000644000000000000000000000333212241775104012405 0ustar #!/bin/sh set -e hook() { local action old new hook=$1 action=$2 old_v=$3 new_v=$4 old=pypy new=pypy echo "running pypy $action hooks for $new_v" for script in /usr/lib/pypy/runtime.d/*."$hook"; do [ -x "$script" ] || continue if ! "$script" "$action" "$old" "$new"; then echo >&2 "error running pypy $action hook $(basename "$script")" return 1 fi done } bc_stdlib() { pypycompile /usr/lib/pypy/lib-python /usr/lib/pypy/lib_pypy \ -X '.*/test/bad(syntax|_coding).*\.py' \ -X '.*/tests/data/py3_test_grammar\.py' } case "$1" in configure) if [ -n "$2" ] && dpkg --compare-versions "$2" le 2.2; then # We weren't running pypyclean in prerm in versions before 2.2 pypyclean /usr/lib/pypy/lib-python /usr/lib/pypy/lib_pypy fi bc_stdlib old_version=$(echo $2 | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/') new_version=$(echo #VERSION# | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/') if [ "$old_version" != "$new_version" ]; then hook rtupdate rtupdate "$old_version" "$new_version" || exit 4 hook rtupdate post-rtupdate "$old_version" "$new_version" || exit 5 fi ;; triggered) opts="" # Has the stdlib vanished? if find /usr/lib/pypy/lib-python -name '*.py' | grep -q '.*'; then bc_stdlib else pypyclean /usr/lib/pypy/lib-python /usr/lib/pypy/lib_pypy fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 # vim:set et ts=4 sw=4: debian/scripts/0000755000000000000000000000000012243773515010666 5ustar debian/scripts/pypy-sandbox0000755000000000000000000000035012215550224013234 0ustar #!/usr/bin/python import os import sys import pypy.sandbox basedir = os.path.dirname(pypy.sandbox.__file__) # Find our embedded rpython bits sys.path.insert(0, basedir) fn = os.path.join(basedir, 'pypy_interact.py') execfile(fn) debian/scripts/pypyclean0000755000000000000000000000775412222056366012630 0ustar #!/usr/bin/pypy import argparse import collections import itertools import os import shutil import subprocess import sys def abort(message): print >> sys.stderr, message sys.exit(1) def package_modules(package): '''Iterate through all python modules in an install Debian package''' p = subprocess.Popen(('dpkg', '-L', package), stdout=subprocess.PIPE, stderr=subprocess.PIPE) files, stderr = p.communicate() if p.returncode != 0: abort('Unable to list files in %s. Is it installed?' % package) for fn in files.splitlines(): if fn.endswith('.py'): yield fn def find_modules(root): '''Iterate through all python modules in directory tree root''' if os.path.isfile(root): yield root return for dirpath, dirnames, filenames in os.walk(root): for fn in filenames: if fn.endswith('.py'): yield os.path.join(dirpath, fn) def clean_modules(modules, verbose): '''Remove all .pyc files for every module specified''' clean = collections.defaultdict(list) for module in modules: dir_, basename = os.path.split(module) clean[dir_].append(os.path.splitext(basename)[0]) for dir_, basenames in clean.iteritems(): pycache = os.path.join(dir_, '__pycache__') if not os.path.exists(pycache): continue empty = True for fn in os.listdir(pycache): if fn.endswith('.pyc') and fn.rsplit('.', 2)[0] in basenames: if verbose: print "Removing %s" % os.path.join(pycache, fn) os.unlink(os.path.join(pycache, fn)) else: empty = False if empty: if verbose: print "Pruning %s" % pycache os.rmdir(pycache) def clean_directories(directories, verbose): '''Indiscriminately remove __pycache__ directories''' for root in directories: for dirpath, dirnames, filenames in os.walk(root): for dir_ in dirnames: if dir_ == '__pycache__': if verbose: print "Removing %s" % os.path.join(dirpath, dir_) shutil.rmtree(os.path.join(dirpath, dir_)) def main(): parser = argparse.ArgumentParser( description='Remove byte-compiled files for a package') parser.add_argument('-p', '--package', metavar='PACKAGE', action='append', default=[], help='Debian package to byte-compile ' '(may be specified multiple times)') parser.add_argument('directory', nargs='*', help='Directory tree (or file) to byte-compile') parser.add_argument('-v', '--verbose', action='store_true', help='Be more verbose') parser.add_argument('-q', '--quiet', action='store_true', help='Be quiet') args = parser.parse_args() if not (args.package or args.directory): parser.error('Either a package or a directory must be specified') if args.quiet and args.verbose: parser.error('--quiet and --verbose cannot both be specified') modules_p = set(itertools.chain(*( package_modules(package) for package in args.package))) modules_d = set(itertools.chain(*( find_modules(dir_) for dir_ in args.directory))) if args.package and args.directory: modules = modules_d & modules_p elif args.package: modules = modules_p else: # Split files from directories, so that we can completely clean any # specified directories. modules = set() directories = set() for fn in args.directory: if os.path.isfile(fn) and fn.endswith('.py'): modules.add(fn) else: directories.add(fn) clean_directories(directories, args.verbose) clean_modules(modules, args.verbose) if __name__ == '__main__': main() # vim: ft=python debian/scripts/pypycompile0000755000000000000000000000666712222054727013177 0ustar #!/usr/bin/pypy import argparse import itertools import os import re import py_compile import subprocess import sys def abort(message): print >> sys.stderr, message sys.exit(1) def package_modules(package): '''Iterate through all python modules in an install Debian package''' p = subprocess.Popen(('dpkg', '-L', package), stdout=subprocess.PIPE, stderr=subprocess.PIPE) files, stderr = p.communicate() if p.returncode != 0: abort('Unable to list files in %s. Is it installed?' % package) for fn in files.splitlines(): if fn.endswith('.py'): yield fn def find_modules(root): '''Iterate through all python modules in directory tree root''' if os.path.isfile(root): yield root return for dirpath, dirnames, filenames in os.walk(root): for fn in filenames: if fn.endswith('.py'): yield os.path.join(dirpath, fn) def main(): parser = argparse.ArgumentParser( description='Byte-compile Python source files in a package, for PyPy') parser.add_argument('-p', '--package', metavar='PACKAGE', action='append', default=[], help='Debian package to byte-compile ' '(may be specified multiple times)') parser.add_argument('directory', nargs='*', help='Directory tree (or file) to byte-compile') parser.add_argument('-X', '--exclude', metavar='REGEXPR', action='append', default=[], type=re.compile, help='Exclude items that match given REGEXPR ' '(may be specified multiple times)') parser.add_argument('-v', '--verbose', action='store_true', help='Be more verbose') parser.add_argument('-q', '--quiet', action='store_true', help='Be quiet') parser.add_argument('-V', metavar='VRANGE', dest='vrange', help=argparse.SUPPRESS) parser.add_argument('-O', action='store_true', dest='pyo', help=argparse.SUPPRESS) args = parser.parse_args() if not (args.package or args.directory): parser.error('Either a package or a directory must be specified') if args.quiet and args.verbose: parser.error('--quiet and --verbose cannot both be specified') if args.vrange: print >> sys.stderr, '-V is ignored in pypycompile' if args.pyo: print >> sys.stderr, '-O is ignored in pypycompile' modules_p = set(itertools.chain(*( package_modules(package) for package in args.package))) modules_d = set(itertools.chain(*( find_modules(dir_) for dir_ in args.directory))) if args.package and args.directory: modules = modules_d & modules_p else: modules = modules_d | modules_p modules = filter(lambda module: not any(pattern.match(module) for pattern in args.exclude), modules) for module in modules: if args.verbose: print 'Byte-compiling %s' % module try: py_compile.compile(module, doraise=True) except py_compile.PyCompileError as e: if not args.quiet: print >> sys.stderr, ('Failed to byte-compile %s: %s' % (module, e.msg)) if __name__ == '__main__': main() # vim: ft=python debian/scripts/memory-check.sh0000755000000000000000000000332512215550224013600 0ustar #!/bin/sh # Determine if we have enough RAM # PyPy upstream claims it needs at least 2GiB on 32bit and 4GiB on 64bit # (pointers dominate the memory) set -e -u # We don't enforce this on Ubuntu, which has less minority architectures. if dpkg-vendor --derives-from Ubuntu; then # Only get out of jail free on the primary archive buildds # Do the RAM check for PPA builds if grep -q '^Purpose: *PRIMARY' /CurrentlyBuilding; then exit 0 fi fi # Memory we will require on 32-bit archs # This estimate is on the low side, we'll be spilling over into swap, but # should still be able to build within a couple of days. REQ_32_MEM=1400 # x86 has JIT enabled (which will need more) and machines with >= 4GB of RAM # aren't rare, so let's be a little more conservative (c.f. #713787) # (except kfreebsd-amd64 which currently has 3GB buildds, sigh) if dpkg-architecture -iany-i386 || dpkg-architecture -ilinux-amd64; then REQ_32_MEM=2000 fi MEM=$(sed -rne 's/^MemTotal: *([0-9]+) kB$$/\1/p' /proc/meminfo) MEM=$((MEM / 1024)) SWAP=$(sed -rne 's/^SwapTotal: *([0-9]+) kB$$/\1/p' /proc/meminfo) SWAP=$((SWAP / 1024)) BITS=$(dpkg-architecture -qDEB_HOST_ARCH_BITS) if [ $BITS -ge 64 ]; then REQ_MEM=$(($REQ_32_MEM * 2)) else REQ_MEM=$REQ_32_MEM fi echo "PyPy requires >= $REQ_MEM MiB of RAM to build (on a $BITS-bit machine)." echo "This machine has $MEM MiB of RAM." if dpkg-architecture -qDEB_BUILD_ARCH | grep -q s390; then MEM=$(($MEM + $SWAP)) echo "Counting the $SWAP MiB of swap too, as s390 apparently has very fast swap." fi if [ $REQ_MEM -lt $MEM ]; then echo "Assuming we have enough RAM to build." else echo "You probably don't have enough RAM to build PyPy in any reasonable amount of time." >&2 echo "Aborting" >&2 exit 1 fi debian/scripts/translate.sh0000755000000000000000000000307712223764000013214 0ustar #!/bin/sh # Determine the translation options and translate set -e -u usage() { name=$(basename $0) echo <&2 usage exit 1 ;; esac shift done RPYOPTS="--batch --source" TARGETOPTS="" OPT=3 ROOTFINDER=shadowstack if echo "$DEB_BUILD_OPTIONS" | egrep -q '\bnoopt\b'; then OPT=0 elif [ $SANDBOX -gt 0 ]; then OPT=2 elif dpkg-architecture -iany-i386; then OPT=jit ROOTFINDER=asmgcc #RPYOPTS="$RPYOPTS --jit-backend=x86-without-sse2" elif dpkg-architecture -iany-arm; then # No JIT support for ARMv5 if ! dpkg-architecture -elinux-armel; then OPT=jit fi ROOTFINDER=shadowstack elif dpkg-architecture -iany-amd64; then OPT=jit ROOTFINDER=asmgcc fi RPYOPTS="$RPYOPTS --opt=$OPT" if [ $SANDBOX -gt 0 ]; then RPYOPTS="$RPYOPTS --sandbox --gc=generation" ROOTFINDER=shadowstack fi if [ $OPT = "mem" -o $OPT = "jit" -o $OPT = 2 -o $OPT = 3 ]; then RPYOPTS="$RPYOPTS --gcrootfinder=$ROOTFINDER" fi CONTINUATION=0 if dpkg-architecture -iany-i386 \ || dpkg-architecture -iany-amd64 \ || dpkg-architecture -iany-arm; then CONTINUATION=1 fi if [ $CONTINUATION -eq 0 ]; then TARGETOPTS="$TARGETOPTS --withoutmod-_continuation" fi set -x cd pypy/goal exec "$PYTHON" -u ../../rpython/bin/rpython $RPYOPTS targetpypystandalone $TARGETOPTS 2>&1 debian/control0000644000000000000000000001126712244444402010600 0ustar Source: pypy Section: python Priority: extra Maintainer: Stefano Rivera Build-Depends: debhelper (>= 9), libbz2-dev, libexpat1-dev, libffi-dev, libncurses-dev, libsqlite3-dev, libssl-dev, netbase, pkg-config, procps, python (>= 2.6.6-11~), python-docutils, python-sphinx (>= 1.0.7+dfsg), python2.7-dev, tcl-dev, tk-dev, valgrind [amd64 armhf i386 mips mipsel powerpc ppc64 s390x], zlib1g-dev Build-Depends-Indep: graphviz Standards-Version: 3.9.4 Homepage: http://pypy.org/ Vcs-Git: git://anonscm.debian.org/collab-maint/pypy.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/pypy.git Package: pypy Architecture: kfreebsd-any linux-any Depends: pypy-lib (= ${source:Version}), ${misc:Depends}, ${shlibs:Depends} Breaks: pypy-dev (<< ${source:Version}) Suggests: pypy-doc, pypy-tk (= ${binary:Version}) Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends} Description: fast alternative implementation of Python - PyPy interpreter PyPy is a fast, compliant alternative implementation of the Python language (2.7). It has several advantages and distinct features: * Speed: thanks to its Just-in-Time compiler (on x86), Python programs often run faster on PyPy. * Memory usage: large, memory-hungry Python programs might end up taking less space than they do in CPython. * Compatibility: PyPy is highly compatible with existing Python code. It supports ctypes and can run popular Python libraries like twisted and django. * Stackless: PyPy supports stackless mode on x86, providing micro-threads for massive concurrency. . This package contains the PyPy interpreter. Package: pypy-tk Architecture: kfreebsd-any linux-any Depends: ${misc:Depends}, ${shlibs:Depends}, pypy (= ${binary:Version}) Replaces: pypy-lib (<< 2.2) Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends} Description: Tkinter module for PyPy (an alternative Python interpreter) A module for writing portable GUI applications with PyPy using Tk. Also known as Tkinter. . PyPy is a fast, compliant alternative implementation of the Python language (2.7). Package: python-pypy.sandbox Architecture: kfreebsd-any linux-any Depends: pypy-lib (= ${source:Version}), ${misc:Depends}, ${python:Depends}, ${shlibs:Depends} Suggests: python-py Replaces: python-pypy.translator.sandbox (<< 2.0~beta2+hg61648) Breaks: python-pypy.translator.sandbox (<< 2.0~beta2+hg61648) Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends} Description: sandboxed PyPy interpreter A version of PyPy that runs fully "virtualized", where an external process controls all input/output. This is a secure sandbox, it is safe to run any untrusted Python code with it. The Python code cannot see or modify any local file except via interaction with the external process. . PyPy is a fast, compliant alternative implementation of the Python language (2.7). Package: pypy-lib Architecture: all Depends: ${misc:Depends} Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends} Provides: pypy-cffi Description: standard library for PyPy (an alternative Python interpreter) The PyPy standard library. This is a combination of modules, copied directly from cpython, modified cpython modules, and modules entirely re-implemented (usually in pure Python, where they are C extensions in cpython). . PyPy is a fast, compliant alternative implementation of the Python language (2.7). Package: pypy-lib-testsuite Architecture: all Depends: pypy-lib (= ${source:Version}), ${misc:Depends} Replaces: pypy-lib (<< 2.2) Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends} Description: standard library test suite for PyPy (an alternative Python interpreter) The complete test suite for the PyPy standard library. . PyPy is a fast, compliant alternative implementation of the Python language (2.7). Package: pypy-doc Section: doc Architecture: all Depends: ${misc:Depends}, ${sphinxdoc:Depends} Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends} Suggests: python-doc Description: developer Documentation for PyPy (an alternative Python interpreter) The Developer documentation for PyPy. This mostly covers the internals of PyPy, and development of PyPy itself. . PyPy is a fast, compliant alternative implementation of the Python language (2.7). Package: pypy-dev Architecture: all Depends: pypy (>= ${source:Version}), ${misc:Depends} Pre-Depends: dpkg (>= 1.15.6~), ${misc:Pre-Depends} Description: header files for PyPy (an alternative Python interpreter) Header files for compiling cpython C extension modules for use with PyPy. Note that pure Python modules will probably perform better. . PyPy supports a subset of cpython's C API through its CPyExt subsystem. . PyPy is a fast, compliant alternative implementation of the Python language (2.7). debian/TODO0000644000000000000000000000161112241444417007660 0ustar * Triage and fix/skip all test failures * Stop embedding expat strings * Add a way to disable network tests. ATM they fail silently, so this isn't a big priority * Look at importing distutils-sysconfig.diff from cpython, if it's needed. * Forward patches to PyPy upstream: - pep3147-* * Provide an option for i386 machines without SSE2. PyPy upstream claims SSE2 is vital for performance and we can't disable it for i386, we should provide both SSE2-enabled and legacy binaries. The JIT with out SSE2 is currently broken... * Work out the details for module packages supporting pypy. * Package rpython - Figure out where to put rpython/_cache - Stop writing things into rpytohn/translator/c/src * Porting: - _continutation needs a single function ported to each architecture. Mostly copy-paste from python-greenlet, but slightly different API. * Multi-Arch: - config cache - headers debian/pypy-lib.lintian-overrides0000644000000000000000000000012112215550224014303 0ustar # We intentionally set all shebangs to pypy pypy-lib binary: unusual-interpreter debian/pypy-lib.install0000755000000000000000000000152412241446442012333 0ustar #!/bin/sh set -euf cat << EOF debian/runtime.d /usr/lib/pypy lib-python/conftest.py /usr/lib/pypy/lib-python lib-python/stdlib-version.* /usr/lib/pypy/lib-python lib-python/2.7/test/__init__.py /usr/lib/pypy/lib-python/2.7/test lib-python/2.7/test/pystone.py /usr/lib/pypy/lib-python/2.7/test lib-python/2.7/test/regrtest.py /usr/lib/pypy/lib-python/2.7/test lib-python/2.7/test/test_support.py /usr/lib/pypy/lib-python/2.7/test site-packages/README /usr/lib/pypy/dist-packages EOF find lib_pypy -type f \ ! '(' -path '*/ctypes_config_cache/_*_.py' -a ! -name __init__.py ')' \ ! -path '*/__pycache__/*' \ ! -path '*/_tkinter/*' \ -printf '%p\t/usr/lib/pypy/%h\n' find lib-python/2.7 -type f \ ! '(' -path '*/test/*' -o -path '*/tests/*' ')' \ -printf '%p\t/usr/lib/pypy/%h\n' debian/pypy.install0000755000000000000000000000067412241446326011575 0ustar #!/bin/sh set -euf cat << EOF debian/scripts/pypyclean /usr/bin debian/scripts/pypycompile /usr/bin include/pypy_*.h /usr/lib/pypy/include lib_pypy/__pycache__/_cffi_*.so /usr/lib/pypy/lib_pypy pypy/goal/pypy-c /usr/lib/pypy/bin EOF find lib_pypy/ctypes_config_cache -type f -name '_*_.py' ! -name __init__.py \ | sed 's,$, /usr/lib/pypy/lib_pypy/ctypes_config_cache,' debian/pypy-doc.docs0000644000000000000000000000002012215550224011572 0ustar build-docs/html debian/pypy-tk.postinst0000644000000000000000000000046312241452300012404 0ustar #!/bin/sh set -e case "$1" in configure) pypycompile /usr/lib/pypy/lib_pypy/_tkinter ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 # vim:set et ts=4 sw=4: debian/pypy-tk.install0000644000000000000000000000021112241446404012166 0ustar lib_pypy/_tkinter/*.py /usr/lib/pypy/lib_pypy/_tkinter lib_pypy/_tkinter/__pycache__/_cffi_*.so /usr/lib/pypy/lib_pypy debian/runtime.d/0000755000000000000000000000000012215550224011071 5ustar debian/runtime.d/public_modules.rtupdate0000755000000000000000000000045512215550224015660 0ustar #! /bin/sh set -e if [ "$1" = rtupdate ]; then if which pypyclean >/dev/null 2>&1; then pypyclean /usr/lib/pypy/dist-packages fi if which pypycompile >/dev/null 2>&1; then pypycompile /usr/lib/pypy/dist-packages else echo >&2 "pypycompile not found in $(basename $0) hook." exit 1 fi fi debian/pypy.manpages0000644000000000000000000000002612215550224011700 0ustar build-docs/man/pypy.1 debian/copyright0000644000000000000000000011511012241444351011120 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: PyPy Source: https://bitbucket.org/pypy/pypy/ Comment: Some files included in the upstream tarball are non-free. The following files have been removed for the Debian version of this package: lib-python/*2.7/distutils/command/*.exe: Unnecessary Windows binaries Files: * Copyright: 2003-2013, Armin Rigo Maciej Fijalkowski Carl Friedrich Bolz Antonio Cuni Amaury Forgeot d'Arc Samuele Pedroni Alex Gaynor Michael Hudson David Schneider Holger Krekel Christian Tismer Hakan Ardo Benjamin Peterson Matti Picus Philip Jenvey Anders Chrigstrom Brian Kearns Eric van Riet Paap Richard Emslie Alexander Schremmer Wim Lavrijsen Dan Villiom Podlaski Christiansen Manuel Jacob Lukas Diekmann Sven Hager Anders Lehmann Aurelien Campeas Niklaus Haldimann Ronan Lamy Camillo Bruni Laura Creighton Toon Verwaest Leonardo Santagada Seo Sanghyeon Justin Peel Ronny Pfannschmidt David Edelsohn Anders Hammarquist Jakub Gustak Guido Wesdorp Lawrence Oluyede Bartosz Skowron Daniel Roberts Niko Matsakis Adrien Di Mascio Ludovic Aubry Alexander Hesse Jacob Hallen Romain Guillebert Jason Creighton Alex Martelli Michal Bendowski Jan de Mooij Michael Foord Stephan Diehl Stefan Schwarzer Valentino Volonghi Tomek Meka Patrick Maupin stian Bob Ippolito Bruno Gola Jean-Paul Calderone Timo Paulssen Alexandre Fayolle Simon Burton Marius Gedminas John Witulski Greg Price Dario Bertini Mark Pearse Simon Cross Konstantin Lopuhin Andreas Stührk Jean-Philippe St. Pierre Guido van Rossum Pavel Vinogradov Paul deGrandis Ilya Osadchiy Adrian Kuhn Boris Feigin tav Georg Brandl Bert Freudenberg Stian Andreassen Stefano Rivera Wanja Saatkamp Gerald Klix Mike Blume Taavi Burns Oscar Nierstrasz David Malcolm Eugene Oden Henry Mason Preston Timmons Jeff Terrace David Ripton Dusty Phillips Lukas Renggli Guenter Jantzen Tobias Oberstein Remi Meier Ned Batchelder Amit Regmi Ben Young Nicolas Chauvat Andrew Durdin Michael Schneider Nicholas Riley Jason Chu Igor Trindade Oliveira Jeremy Thurgood Rocco Moretti Gintautas Miliauskas Michael Twomey Lucian Branescu Mihaila Tim Felgentreff Tyler Wade Gabriel Lavoie Olivier Dormond Jared Grubb Karl Bartel Brian Dorsey Victor Stinner Stuart Williams Jasper Schulz Toby Watson Antoine Pitrou Aaron Iles Michael Cheng Justas Sadzevicius Gasper Zejn Neil Shepperd Mikael Schönenberg Elmo Mäntynen Tobias Pape Jonathan David Riehl Stanislaw Halik Anders Qvist Chirag Jadwani Beatrice During Alex Perry Vincent Legoll Alan McIntyre Alexander Sedov Corbin Simpson Christopher Pope Laurence Tratt Guillebert Romain Christian Tismer Dan Stromberg Stefano Parmesan Christian Hudon Alexis Daboville Jens-Uwe Mager Carl Meyer Karl Ramm Pieter Zieschang Gabriel Paweł Piotr Przeradowski Andrew Dalke Sylvain Thenault Nathan Taylor Vladimir Kryachko Jacek Generowicz Alejandro J. Cura Jacob Oscarson Travis Francis Athougies Kristjan Valur Jonsson Neil Blakey-Milner Lutz Paelike Lucio Torre Lars Wassermann Henrik Vendelbo Dan Buch Miguel de Val Borro Artur Lisiecki Sergey Kishchenko Ignas Mikalajunas Christoph Gerum Martin Blais Lene Wagner Tomo Cocoa Andrews Medina roberto@goyle William Leslie Bobby Impollonia timo@eistee.fritz.box Andrew Thompson Yusei Tahara Roberto De Ioris Juan Francisco Cantero Hurtado Godefroid Chappelle Joshua Gilbert Dan Colish Christopher Armstrong Michael Hudson-Doyle Anders Sigfridsson Yasir Suhail Floris Bruynooghe Akira Li Gustavo Niemeyer Stephan Busemann Anna Katrina Dominguez Christian Muirhead James Lan shoma hosaka Daniel Neuhäuser Buck Golemon Konrad Delong Dinu Gherman Chris Lambacher coolbutuseless@gmail.com Jim Baker Rodrigo Araújo Armin Ronacher Brett Cannon yrttyr Zooko Wilcox-O Hearn Tomer Chachamu Christopher Groskopf opassembler.py Antony Lee Jim Hunziker Markus Unterwaditzer Even Wiik Thomassen jbs soareschen Flavio Percoco Kristoffer Kleine yasirs Michael Chermside Anna Ravencroft Andrew Chambers Julien Phalip Dan Loewenherz . Heinrich-Heine University, Germany Open End AB (formerly AB Strakt), Sweden merlinux GmbH, Germany tismerysoft GmbH, Germany Logilab Paris, France DFKI GmbH, Germany Impara, Germany Change Maker, Sweden University of California Berkeley, USA Google Inc. King's College London License: Expat Files: lib_pypy/cffi/_pycparser/* Copyright: 2008-2012, Eli Bendersky License: BSD-3-Bendersky Files: lib_pypy/cffi/_pycparser/ply/* Copyright: 2001-2012, David M. Beazley (Dabeaz LLC) License: BSD-3-Dabeaz Files: lib-python/2.7/* Copyright: 2001-2011, Python Software Foundation License: Python-2.0 Files: lib_pypy/_sqlite3.py lib-python/2.7/sqlite3/* Copyright: 2007-2008, Gerhard Häring License: Zlib Files: lib-python/2.7/asynchat.py Copyright: 1996, Sam Rushing License: MIT-Rushing Files: lib-python/2.7/bsddb/__init__.py lib-python/2.7/bsddb/db.py Copyright: 1999-2001, Digital Creations, Fredericksburg Andrew Kuchling License: BSD-3-DigitalCreations Files: lib-python/2.7/bsddb/dbobj.py lib-python/2.7/bsddb/dbshelve.py lib-python/2.7/bsddb/dbtables.py lib-python/2.7/bsddb/dbutils.py lib-python/2.7/bsddb/test/test_dbtables.py Copyright: 1997-2001, Total Control Software 2000-2001, Autonomous Zone Industries 2002, Gregory P. Smith License: bsddb This is free software. You may use this software for any purpose including modification/redistribution, so long as this header remains intact and that you do not claim any rights of ownership or authorship of this software. This software has been tested, but no warranty is expressed or implied. Files: lib-python/2.7/compiler/transformer.py Copyright: 1997-1998, Greg Stein License: BSD-2-generic Files: lib-python/2.7/Cookie.py Copyright: 2000, Timothy O'Malley License: MIT-OMalley Files: lib-python/2.7/lib-tk/turtle.py Copyright: 2006-2010, Gregor Lingl License: Zlib Files: lib-python/2.7/optparse.py Copyright: 2001-2006, Gregory P. Ward. 2002-2006, Python Software Foundation. License: BSD-3-generic Files: lib-python/2.7/profile.py lib-python/2.7/pstats.py Copyright: Disney Enterprises, Inc. License: Apache-2.0 Files: lib-python/2.7/logging/* lib-python/2.7/test/test_logging.py Copyright: 2001-2010 by Vinay Sajip License: MIT-Sajip Files: lib-python/2.7/multiprocessing/* Copyright: 2006-2008, R Oudkerk License: BSD-3-generic Files: lib-python/2.7/tarfile.py Copyright: 2002, Lars Gustäbel License: Expat Files: lib-python/2.7/test/test_epoll.py Copyright: 2001-2006, Twisted Matrix Laboratories. License: Expat Files: lib-python/2.7/trace.py Copyright: 2000, Mojam Media, Inc. 1999, Bioreason, Inc. 1995-1997, Automatrix, Inc. 1991-1995, Stichting Mathematisch Centrum License: trace Permission to use, copy, modify, and distribute this Python software and its associated documentation for any purpose without fee is hereby granted, provided that the above copyright notice appears in all copies, and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of neither Automatrix, Bioreason or Mojam Media be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Files: lib-python/2.7/unittest/__init__.py Copyright: 1999-2003, Steve Purcell 2003-2010, Python Software Foundation License: BSD-pyunit Files: lib-python/2.7/uu.py Copyright: 1994, Lance Ellinghouse License: MIT-Ellinghouse Files: lib-python/2.7/xmlrpclib.py Copyright: 1999-2002, Secret Labs AB 1999-2002, Fredrik Lundh License: MIT-SecretLabs Files: pypy/interpreter/astcompiler/tools/spark.py Copyright: 1998-2002, John Aycock License: Expat Files: lib-python/2.7/sre_*.py pypy/module/cpyext/test/sre*.h pypy/module/cpyext/test/_sre.c Copyright: 1997-2002 by Secret Labs AB License: Python-2.0 Files: rpython/rlib/unicodedata/*.txt Copyright: 1991-2005 Unicode, Inc. License: Unicode-Data Files: rpython/tool/progressbar.py rpython/tool/terminal.py Copyright: 2009, Nadia Alramli License: BSD-undefined Stated to be a BSD licence, but the licence body isn't included Files: rpython/translator/c/src/dtoa.c Copyright: 1991-2001, Lucent Technologies License: MIT-Lucent Files: rpython/translator/c/src/ll_math.c Copyright: 1993, by Sun Microsystems, Inc. License: SunPro-Attribution Developed at SunPro, a Sun Microsystems, Inc. business. Permission to use, copy, modify, and distribute this software is freely granted, provided that this notice is preserved. Files: rpython/translator/c/src/libffi_msvc/* Copyright: 1996-2003, Red Hat, Inc 2002, Bo Thorsen 2001, John Beniton 2002, Ranjit Mathew 2002, Roger Sayle License: Expat Files: rpython/rlib/parsing/test/pcre_test_7.py rpython/rlib/parsing/test/test_pcre_regtest.py Copyright: 2007-2008, Google Inc. 1997-2008, University of Cambridge License: BSD-3-Cambridge-Google Files: rpython/rlib/rsre/rsre_char.py Copyright: 2005, Nik Haldimann License: Expat Files: dotviewer/font/* Copyright: 2008, The Android Open Source Project License: Apache-2.0 Files: debian/* Copyright: 2011-2012, Stefano Rivera License: Expat License: Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language overning permissions and limitations under the License. . On Debian systems, the Apache 2.0 license can be found in /usr/share/common-licenses/Apache-2.0. License: BSD-2-generic Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 SUCH DAMAGE. License: BSD-3-generic Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 SUCH DAMAGE. License: BSD-3-Cambridge-Google Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of Cambridge nor the name of Google Inc. nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 SUCH DAMAGE. License: BSD-3-DigitalCreations Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: o Redistributions of source code must retain the above copyright notice, this list of conditions, and the disclaimer that follows. o Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. o Neither the name of Digital Creations nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS AND CONTRIBUTORS *AS IS* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL CREATIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 SUCH DAMAGE. License: BSD-3-Bendersky Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Eli Bendersky nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 SUCH DAMAGE. License: BSD-3-Dabeaz All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . * Neither the name of the David Beazley or Dabeaz LLC may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 SUCH DAMAGE. License: BSD-pyunit This module is free software, and you may redistribute it and/or modify it under the same terms as Python itself, so long as this copyright message and disclaimer are retained in their original form. . IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. License: MIT-Ellinghouse Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Lance Ellinghouse not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. License: MIT-Lucent Permission to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software. . THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. License: MIT-OMalley Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Timothy O'Malley not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. . Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. License: MIT-Rushing Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Sam Rushing not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. . SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. License: MIT-Sajip Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Vinay Sajip not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. License: MIT-SecretLabs By obtaining, using, and/or copying this software and/or its associated documentation, you agree that you have read, understood, and will comply with the following terms and conditions: . Permission to use, copy, modify, and distribute this software and its associated documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies, and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Secret Labs AB or the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. . SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. License: Python-2.0 PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 -------------------------------------------- 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or Organization ("Licensee") accessing and otherwise using this software ("Python") in source or binary form and its associated documentation. . 2. Subject to the terms and conditions of this License Agreement, PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation; All Rights Reserved" are retained in Python alone or in any derivative version prepared by Licensee. . 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python. . 4. PSF is making Python available to Licensee on an "AS IS" basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. . 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. . 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. . 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between PSF and Licensee. This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using Python, Licensee agrees to be bound by the terms and conditions of this License Agreement. . BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 ------------------------------------------- . BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 . 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the Individual or Organization ("Licensee") accessing and otherwise using this software in source or binary form and its associated documentation ("the Software"). . 2. Subject to the terms and conditions of this BeOpen Python License Agreement, BeOpen hereby grants Licensee a non-exclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use the Software alone or in any derivative version, provided, however, that the BeOpen Python License is retained in the Software, alone or in any derivative version prepared by Licensee. . 3. BeOpen is making the Software available to Licensee on an "AS IS" basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. . 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. . 5. This License Agreement will automatically terminate upon a material breach of its terms and conditions. . 6. This License Agreement shall be governed by and interpreted in all respects by the law of the State of California, excluding conflict of law provisions. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between BeOpen and Licensee. This License Agreement does not grant permission to use BeOpen trademarks or trade names in a trademark sense to endorse or promote products or services of Licensee, or any third party. As an exception, the "BeOpen Python" logos available at http://www.pythonlabs.com/logos.html may be used according to the permissions granted on that web page. . 7. By copying, installing or otherwise using the software, Licensee agrees to be bound by the terms and conditions of this License Agreement. . CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 --------------------------------------- 1. This LICENSE AGREEMENT is between the Corporation for National Research Initiatives, having an office at 1895 Preston White Drive, Reston, VA 20191 ("CNRI"), and the Individual or Organization ("Licensee") accessing and otherwise using Python 1.6.1 software in source or binary form and its associated documentation. . 2. Subject to the terms and conditions of this License Agreement, CNRI hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python 1.6.1 alone or in any derivative version, provided, however, that CNRI's License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) 1995-2001 Corporation for National Research Initiatives; All Rights Reserved" are retained in Python 1.6.1 alone or in any derivative version prepared by Licensee. Alternately, in lieu of CNRI's License Agreement, Licensee may substitute the following text (omitting the quotes): "Python 1.6.1 is made available subject to the terms and conditions in CNRI's License Agreement. This Agreement together with Python 1.6.1 may be located on the Internet using the following unique, persistent identifier (known as a handle): 1895.22/1013. This Agreement may also be obtained from a proxy server on the Internet using the following URL: http://hdl.handle.net/1895.22/1013". . 3. In the event Licensee prepares a derivative work that is based on or incorporates Python 1.6.1 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python 1.6.1. . 4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. . 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. . 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. . 7. This License Agreement shall be governed by the federal intellectual property law of the United States, including without limitation the federal copyright law, and, to the extent such U.S. federal law does not apply, by the law of the Commonwealth of Virginia, excluding Virginia's conflict of law provisions. Notwithstanding the foregoing, with regard to derivative works based on Python 1.6.1 that incorporate non-separable material that was previously distributed under the GNU General Public License (GPL), the law of the Commonwealth of Virginia shall govern this License Agreement only as to issues arising under or with respect to Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between CNRI and Licensee. This License Agreement does not grant permission to use CNRI trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. . 8. By clicking on the "ACCEPT" button where indicated, or by copying, installing or otherwise using Python 1.6.1, Licensee agrees to be bound by the terms and conditions of this License Agreement. . ACCEPT . CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 -------------------------------------------------- . Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The Netherlands. All rights reserved. . Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Stichting Mathematisch Centrum or CWI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. . STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. License: Unicode-Data Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that (a) the above copyright notice(s) and this permission notice appear with all copies of the Data Files or Software, (b) both the above copyright notice(s) and this permission notice appear in associated documentation, and (c) there is clear notice in each modified Data File or in the Software as well as in the documentation associated with the Data File(s) or Software that the data or software has been modified. . THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. . Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder. . Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be registered in some jurisdictions. All other trademarks and registered trademarks mentioned herein are the property of their respective owners. License: Zlib This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. . Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. debian/pypy-doc.links0000644000000000000000000000010212215550224011763 0ustar /usr/share/doc/pypy-doc/html/_sources /usr/share/doc/pypy-doc/rst debian/pypy-dev.install0000755000000000000000000000014412241444370012336 0ustar #!/bin/sh set -euf find include -name '*.h' ! -name 'pypy_*.h' \ -printf '%p\t/usr/lib/pypy/%h\n' debian/python-pypy.sandbox.pyinstall0000644000000000000000000000155012215550224015103 0ustar pypy/sandbox/pypy_interact.py pypy/sandbox/__init__.py pypy/__init__.py # Hacky hacky embedding lib_pypy/_marshal.py pypy.sandbox lib_pypy/marshal.py pypy.sandbox rpython/__init__.py pypy.sandbox.rpython rpython/translator/__init__.py pypy.sandbox.rpython.translator rpython/translator/sandbox/sandlib.py pypy.sandbox.rpython.translator.sandbox rpython/translator/sandbox/vfs.py pypy.sandbox.rpython.translator.sandbox rpython/translator/sandbox/__init__.py pypy.sandbox.rpython.translator.sandbox rpython/tool/__init__.py pypy.sandbox.rpython.tool rpython/tool/ansi_print.py pypy.sandbox.rpython.tool rpython/tool/ansi_mandelbrot.py pypy.sandbox.rpython.tool rpython/tool/killsubprocess.py pypy.sandbox.rpython.tool debian/rules0000755000000000000000000001041412244444402010246 0ustar #!/usr/bin/make -f PYTHON=python2.7 # Take advantage of PyPy if it's installed #PYTHON=$(shell command -v pypy > /dev/null && echo pypy || echo python2.7) # PyPy doesn't harden well, and handles opt and debug itself BUILDFLAGS_ENV := DEB_BUILD_MAINT_OPTIONS=hardening=-stackprotector,-fortify BUILDFLAGS_ENV += DEB_CFLAGS_MAINT_STRIP="-O0 -O1 -O2 -O3 -Os -Ofast -g" export CFLAGS = $(shell $(BUILDFLAGS_ENV) dpkg-buildflags --get CFLAGS) export LDFLAGS = $(shell $(BUILDFLAGS_ENV) dpkg-buildflags --get LDFLAGS) export PYPY_USESSION_BASENAME := debian ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) SUB_MAKEFLAGS = -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) endif # dh_python2 is used for pypy-sandbox %: dh $@ --with python2,sphinxdoc override_dh_auto_configure: debian/scripts/memory-check.sh override_dh_auto_build-arch: pypy/goal/pypy-c pypy/goal/pypy-c-sandbox $(MAKE) -C pypy/doc man BUILDDIR=$(CURDIR)/build-docs # Build cffi modules pypy/goal/pypy-c -c 'import _sqlite3, _curses, _tkinter.tklib, syslog' override_dh_auto_build-indep: $(MAKE) -C pypy/doc html BUILDDIR=$(CURDIR)/build-docs pypy/goal/pypy-%: export TMPDIR = $(CURDIR)/build-tmp pypy/goal/pypy-%: C_SRC_DIR = $(TMPDIR)/usession-$(PYPY_USESSION_BASENAME)-0/testing_1 pypy/goal/pypy-%: rm -rf $(TMPDIR) mkdir $(TMPDIR) debian/scripts/translate.sh --python $(PYTHON) $$(echo $@ | grep -q sandbox && echo --sandbox) # PyPy captures all make output, so we call it ourselves, to avoid timeouts: $(MAKE) -C $(C_SRC_DIR) $(SUB_MAKEFLAGS) cp $(C_SRC_DIR)/pypy-c $@ ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) override_dh_auto_test: export TMPDIR = $(CURDIR)/build-tests-tmp override_dh_auto_test: export HOME = $(TMPDIR) override_dh_auto_test: rm -rf $(TMPDIR) build-tests mkdir $(TMPDIR) build-tests # Test failures currently ignored PYTHONPATH=. $(PYTHON) -u testrunner/runner.py \ --logfile=build-tests/pytest-A.log \ --config=pypy/pytest-A.cfg \ --root=pypy || true TERM=$${TERM:-dumb} $(PYTHON) -u pypy/test_all.py \ --pypy=pypy/goal/pypy-c \ --resultlog=build-tests/lib-python.log \ lib-python || true pypy/goal/pypy-c -u pypy/test_all.py \ --resultlog=build-tests/pypy-c.log \ pypy/module/pypyjit/test_pypy_c || true endif override_dh_auto_install: # Upstream provides no install script override_dh_fixperms-indep: find debian/pypy-lib debian/pypy-lib-testsuite debian/pypy-tk \ -name '*.pyc' -delete find debian/pypy-lib debian/pypy-lib-testsuite debian/pypy-tk \ -name '__pycache__' -delete # Don't need these, and lintian will make a noise about them find debian/pypy-lib \( -name 'regen' -o -name '*.bat' -o -name 'fetch_*' \) -delete # Remove empty directories, because pypyclean will find debian/pypy-lib*/usr/lib/pypy/lib-python -type d -empty -delete # Nothing in the stdlib should be executable chmod -R a-x+X debian/pypy-lib*/usr/lib/pypy/lib* # Fix interpreters find debian/pypy-lib debian/pypy-lib-testsuite debian/pypy-tk \ -name '*.py' -print0 \ | xargs -0 sed -i -e '1s|^#!.*python.*|#!/usr/bin/pypy|' dh_fixperms -i override_dh_sphinxdoc-arch: # dh_sphinxdoc doesn't fail silently when there are no docs override_dh_compress: dh_compress -X.inv -X.txt override_dh_python2: dh_python2 -p python-pypy.sandbox override_dh_installdeb: set -e; for maintscript in preinst postinst; do \ sed 's/#VERSION#/$(VER)/g' debian/pypy.$$maintscript.in \ > debian/pypy.$$maintscript; \ done dh_installdeb override_dh_builddeb: dh_builddeb -- -Zxz HG_REPO ?= https://bitbucket.org/pypy/pypy REV=$(shell dpkg-parsechangelog | sed -rne 's,^Version: .*hg([0-9]+).*,\1,p') VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: (.+)\+dfsg-.*,\1,p') get-packaged-orig-source: @echo "You can build this from a local repo by supplying the HG_REPO variable" rm -rf pypy-$(VER).orig hg clone $(HG_REPO) pypy-$(VER).orig ifeq (,$(REV)) cd pypy-$(VER).orig && hg up -r release-$(VER) else cd pypy-$(VER).orig && hg up -r $(REV) endif rm -rf pypy-$(VER).orig/.hg* rm pypy-$(VER).orig/lib-python/*2.7/distutils/command/*.exe tar -cJ --owner root --group root --mode a+rX \ -f pypy_$(VER)+dfsg.orig.tar.xz pypy-$(VER).orig rm -rf pypy-$(VER).orig debian/watch0000644000000000000000000000026612215550224010221 0ustar version=3 # To repack, run debian/rules get-packaged-orig-source opts=dversionmangle=s/\+dfsg// \ https://bitbucket.org/pypy/pypy/downloads/ /pypy/pypy/get/release-([0-9.]+).tar.gz debian/pypy-lib-testsuite.install0000755000000000000000000000052012241444371014354 0ustar #!/bin/sh set -euf # Some bits of the test suite (that are used by other packages) # are in the main stdlib package find lib-python -type f \ '(' -path '*/test/*' -o -path '*/tests/*' ')' \ ! '(' -path '*/test/__init__.py' -o -name pystone.py \ -o -name regrtest.py -o -name test_support.py ')' \ -printf '%p\t/usr/lib/pypy/%h\n' debian/pypy-lib-testsuite.prerm0000644000000000000000000000054412241444371014036 0ustar #!/bin/sh set -e case "$1" in remove) if which pypyclean >/dev/null 2>&1; then pypyclean -p pypy-lib-testsuite fi ;; deconfigure|upgrade) ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 # vim:set et ts=4 sw=4: debian/pypy.preinst.in0000644000000000000000000000170412215550224012202 0ustar #!/bin/sh set -e hook() { local action old new hook=$1 action=$2 old_v=$3 new_v=$4 old=pypy new=pypy echo "running pypy $action hooks for $new_v" for script in /usr/lib/pypy/runtime.d/*."$hook"; do [ -x "$script" ] || continue if ! "$script" "$action" "$old" "$new"; then echo >&2 "error running pypy $action hook $(basename "$script")" return 1 fi done } case "$1" in upgrade) old_version=$(echo $2 | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/') new_version=$(echo #VERSION# | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/') if [ "$old_version" != "$new_version" ]; then hook rtupdate pre-rtupdate "$old_version" "$new_version" || exit 3 fi ;; install|abort-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 # vim:set et ts=4 sw=4: debian/pypy-lib.prerm0000644000000000000000000000057612215550224012010 0ustar #!/bin/sh set -e case "$1" in remove) if which pypyclean >/dev/null 2>&1; then pypyclean /usr/lib/pypy/lib-python /usr/lib/pypy/lib_pypy fi ;; deconfigure|upgrade) ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 # vim:set et ts=4 sw=4: debian/pypy.triggers0000644000000000000000000000004212215550224011731 0ustar interest /usr/lib/pypy/lib-python debian/patches/0000755000000000000000000000000012241450511010610 5ustar debian/patches/site-builddir0000644000000000000000000000261212215550224013277 0ustar Description: Don't add ./build to sys.path. This was only useful for working with an uninstalled cpython. Moved out of site.py in upstream cPython: http://bugs.python.org/issue9589 Author: Matthias Klose Origin: cpython Debian packaging Last-Update: 2013-02-23 --- a/lib-python/2.7/site.py +++ b/lib-python/2.7/site.py @@ -124,19 +124,6 @@ sys.path[:] = L return known_paths -# XXX This should not be part of site.py, since it is needed even when -# using the -S option for Python. See http://www.python.org/sf/586680 -def addbuilddir(): - """Append ./build/lib. in case we're running in the build dir - (especially for Guido :-)""" - from sysconfig import get_platform - s = "build/lib.%s-%.3s" % (get_platform(), sys.version) - if hasattr(sys, 'gettotalrefcount'): - s += '-pydebug' - s = os.path.join(os.path.dirname(sys.path.pop()), s) - sys.path.append(s) - - def _init_pathinfo(): """Return a set containing all existing directory entries from sys.path""" d = set() @@ -574,9 +561,6 @@ import_builtin_stuff() abs_paths() known_paths = removeduppaths() - if (os.name == "posix" and sys.path and - os.path.basename(sys.path[-1]) == "Modules"): - addbuilddir() if ENABLE_USER_SITE is None: ENABLE_USER_SITE = check_enableusersite() known_paths = addusersitepackages(known_paths) debian/patches/test_termios0000644000000000000000000000122112215550224013253 0ustar Description: Support bulds on older aufs Under aufs on squeeze, tcgetattr can return EINVAL instead of ENOTTY See https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=2771 Forwarded: not-needed Author: Stefano Rivera Last-Update: 2013-02-23 --- a/pypy/module/termios/test/test_termios.py +++ b/pypy/module/termios/test/test_termios.py @@ -140,7 +140,7 @@ fd = os.open('.', 0) try: exc = raises(termios.error, termios.tcgetattr, fd) - assert exc.value.args[0] == errno.ENOTTY + assert exc.value.args[0] in (errno.ENOTTY, errno.EINVAL) finally: os.close(fd) debian/patches/webbrowser0000644000000000000000000000227712215550224012727 0ustar Description: Recognize other browsers: www-browser, x-www-browser, iceweasel, iceape. Author: Matthias Klose Origin: Debian cpython packaging Last-Update: 2011-12-19 --- a/lib-python/2.7/webbrowser.py +++ b/lib-python/2.7/webbrowser.py @@ -449,9 +449,13 @@ if "KDE_FULL_SESSION" in os.environ and _iscommand("kfmclient"): register("kfmclient", Konqueror, Konqueror("kfmclient")) + if _iscommand("x-www-browser"): + register("x-www-browser", None, BackgroundBrowser("x-www-browser")) + # The Mozilla/Netscape browsers for browser in ("mozilla-firefox", "firefox", "mozilla-firebird", "firebird", + "iceweasel", "iceape", "seamonkey", "mozilla", "netscape"): if _iscommand(browser): register(browser, None, Mozilla(browser)) @@ -489,6 +493,8 @@ # Also try console browsers if os.environ.get("TERM"): + if _iscommand("www-browser"): + register("www-browser", None, GenericBrowser("www-browser")) # The Links/elinks browsers if _iscommand("links"): register("links", None, GenericBrowser("links")) debian/patches/series0000644000000000000000000000074512241450214012033 0ustar # PyPy Packaging version-info noise # Upstream features pep3147-core pep3147-stdlib pep3147-issue11254 # Upstream bugs test_fsync-eatmydata test_termios so_reuseport # from python2.7 ctypes-arm distutils-link locale-module multiprocessing-typos platform-lsbrelease site-builddir webbrowser pypirc-secure xdg-gvfs-open plat-gnukfreebsd plat-linux2-differences # Debian layout distutils-install-layout langpack-gettext tkinter-import sandbox-dependencies sandbox-bin sandbox-manpage debian/patches/pep3147-core0000644000000000000000000007176212241171057012606 0ustar Description: PEP3147 support. Tests modified from Barry Warsaw's PEP3147 cpython support Author: Stefano Rivera Forwarded: no Last-Update: 2013-02-23 --- a/pypy/config/pypyoption.py +++ b/pypy/config/pypyoption.py @@ -170,6 +170,11 @@ cmdline="--soabi", default=None), + StrOption("magic_tag", + "Tag to differentiate .pyc files for different Python interpreters", + cmdline="--magic_tag", + default=None), + BoolOption("honor__builtins__", "Honor the __builtins__ key of a module dictionary", default=False), --- a/pypy/module/imp/__init__.py +++ b/pypy/module/imp/__init__.py @@ -17,6 +17,9 @@ 'get_suffixes': 'interp_imp.get_suffixes', 'get_magic': 'interp_imp.get_magic', + 'get_tag': 'interp_imp.get_tag', + 'cache_from_source': 'interp_imp.cache_from_source', + 'source_from_cache': 'interp_imp.source_from_cache', 'find_module': 'interp_imp.find_module', 'load_module': 'interp_imp.load_module', 'load_source': 'interp_imp.load_source', --- a/pypy/module/imp/importing.py +++ b/pypy/module/imp/importing.py @@ -11,7 +11,7 @@ from pypy.interpreter.baseobjspace import W_Root from pypy.interpreter.eval import Code from pypy.interpreter.pycode import PyCode -from rpython.rlib import streamio, jit +from rpython.rlib import rstring, streamio, jit from rpython.rlib.streamio import StreamErrors from rpython.rlib.objectmodel import we_are_translated, specialize from pypy.module.sys.version import PYPY_VERSION @@ -31,6 +31,7 @@ SO = '.pyd' if _WIN32 else '.so' DEFAULT_SOABI = 'pypy-%d%d' % PYPY_VERSION[:2] +DEFAULT_MAGIC_TAG = 'pypy-%d%d' % PYPY_VERSION[:2] @specialize.memo() def get_so_extension(space): @@ -555,6 +556,7 @@ w = space.wrap space.sys.setmodule(w_mod) space.setattr(w_mod, w('__file__'), space.wrap(filename)) + space.setattr(w_mod, w('__cached__'), space.w_None) space.setattr(w_mod, w('__doc__'), space.w_None) if pkgdir is not None: space.setattr(w_mod, w('__path__'), space.newlist([w(pkgdir)])) @@ -856,6 +858,65 @@ return default_magic +def get_pyc_tag(space): + """Return the tag used in __pycache__ filenames""" + # XXX CPython testing hack: use the default + if not we_are_translated(): + return DEFAULT_MAGIC_TAG + + if space.config.objspace.magic_tag is not None: + magic_tag = space.config.objspace.magic_tag + else: + magic_tag = DEFAULT_MAGIC_TAG + return magic_tag + +def make_compiled_pathname(space, pathname): + """ + The PEP 3147 path to the byte-compiled file associated with the source path + """ + pathname = rstring.assert_str0(pathname) + + index = pathname.rfind(os.sep) + if index < 0: + pycachedir = '__pycache__' + basename = pathname + else: + pycachedir = pathname[:index + 1] + '__pycache__' + basename = pathname[index + 1:] + + index = basename.rfind('.') + if index > 0: + basename = basename[:index + 1] + + filename = basename + get_pyc_tag(space) + '.pyc' + cpathname = os.path.join(pycachedir, filename) + return cpathname + +def make_source_pathname(space, cpathname): + """ + Given the path to a PEP 3147 file name, return the associated source code + file path. + """ + cpathname = rstring.assert_str0(cpathname) + + index = cpathname.rfind(os.sep) + if index < 0: + raise OperationError(space.w_ValueError, space.wrap( + "Not a PEP 3147 pyc path: %s" % cpathname)) + pycachedir = cpathname[:index] + filename = cpathname[index + 1:] + + index = pycachedir.rfind(os.sep) + extension = '.' + get_pyc_tag(space) + '.pyc' + ext_index = len(filename) - len(extension) + if (index < 0 or pycachedir[index + 1:] != '__pycache__' + or not filename.endswith(extension) + or ext_index < 0): + raise OperationError(space.w_ValueError, space.wrap( + "Not a PEP 3147 pyc path: %s" % cpathname)) + basedir = pycachedir[:index] + basename = filename[:ext_index] + return os.path.join(basedir, basename + '.py') def parse_source_module(space, pathname, source): """ Parse a source file and return the corresponding code object """ @@ -882,7 +943,7 @@ if space.config.objspace.usepycfiles: src_stat = os.fstat(fd) - cpathname = pathname + 'c' + cpathname = make_compiled_pathname(space, pathname) mtime = int(src_stat[stat.ST_MTIME]) mode = src_stat[stat.ST_MODE] stream = check_compiled_module(space, cpathname, mtime) @@ -898,7 +959,7 @@ code_w = read_compiled_module(space, cpathname, stream.readall()) finally: stream.close() - space.setattr(w_mod, w('__file__'), w(cpathname)) + space.setattr(w_mod, w('__file__'), w(pathname)) else: code_w = parse_source_module(space, pathname, source) @@ -914,6 +975,7 @@ if optimize >= 2: code_w.remove_docstrings(space) + space.setattr(w_mod, w('__cached__'), w(cpathname)) update_code_filenames(space, code_w, pathname) exec_code_module(space, w_mod, code_w) @@ -1048,6 +1110,19 @@ raise #print "Problem while marshalling %s, skipping" % cpathname return + + # Create PEP3147 __pycache__ dir if necessary + index = cpathname.rfind(os.sep) + if index < 0: + return + pycachedir = cpathname[:index] + if not os.path.isdir(pycachedir): + mode = src_mode | 0755 + try: + os.mkdir(pycachedir, mode) + except OSError: + return + # # Careful here: we must not crash nor leave behind something that looks # too much like a valid pyc file but really isn't one. --- a/pypy/module/imp/interp_imp.py +++ b/pypy/module/imp/interp_imp.py @@ -32,6 +32,18 @@ d = x & 0xff return space.wrap(chr(a) + chr(b) + chr(c) + chr(d)) +def get_tag(space): + return space.wrap(importing.get_pyc_tag(space)) + +@unwrap_spec(path=str) +def cache_from_source(space, path, w_debug_override=None): + # w_debug_override is ignored, pypy doesn't support __debug__ + return space.wrap(importing.make_compiled_pathname(space, path)) + +@unwrap_spec(path=str) +def source_from_cache(space, path): + return space.wrap(importing.make_source_pathname(space, path)) + def get_file(space, w_file, filename, filemode): if space.is_none(w_file): try: --- a/pypy/module/imp/test/test_app.py +++ b/pypy/module/imp/test/test_app.py @@ -148,6 +148,7 @@ def test_rewrite_pyc_check_code_name(self): # This one is adapted from cpython's Lib/test/test_import.py + from imp import cache_from_source from os import chmod from os.path import join from sys import modules, path @@ -157,6 +158,7 @@ import sys code_filename = sys._getframe().f_code.co_filename module_filename = __file__ + module_bytefilename = __cached__ constant = 1 def func(): pass @@ -168,7 +170,7 @@ file_name = join(dir_name, module_name + '.py') with open(file_name, "wb") as f: f.write(code) - compiled_name = file_name + ("c" if __debug__ else "o") + compiled_name = cache_from_source(file_name) chmod(file_name, 0777) # Setup @@ -186,7 +188,8 @@ try: # Ensure proper results assert mod != orig_module - assert mod.module_filename == compiled_name + assert mod.module_filename == file_name + assert mod.module_bytefilename == compiled_name assert mod.code_filename == file_name assert mod.func_filename == file_name finally: --- a/pypy/module/imp/test/test_import.py +++ b/pypy/module/imp/test/test_import.py @@ -8,7 +8,7 @@ from pypy.tool.option import make_config from pypy.tool.pytest.objspace import maketestobjspace import pytest -import sys, os +import shutil, sys, os import tempfile, marshal from pypy.module.imp import importing @@ -93,12 +93,18 @@ # create compiled/x.py and a corresponding pyc file p = setuppkg("compiled", x = "x = 84") + try: + p.mkdir('__pycache__') + except py.error.EEXIST: + pass + cpathname = p.join('__pycache__').join( + 'x.' + importing.get_pyc_tag(space) + '.pyc') if conftest.option.runappdirect: import marshal, stat, struct, os, imp code = py.code.Source(p.join("x.py").read()).compile() s3 = marshal.dumps(code) s2 = struct.pack("i", os.stat(str(p.join("x.py")))[stat.ST_MTIME]) - p.join("x.pyc").write(imp.get_magic() + s2 + s3, mode='wb') + cpathname.write(imp.get_magic() + s2 + s3, mode='wb') else: w = space.wrap w_modname = w("compiled.x") @@ -113,8 +119,9 @@ stream.close() if space.config.objspace.usepycfiles: # also create a lone .pyc file - p.join('lone.pyc').write(p.join('x.pyc').read(mode='rb'), - mode='wb') + + p.join(importing.make_compiled_pathname(space, 'lone.py') + ).write(cpathname.read(mode='rb'), mode='wb') # create a .pyw file p = setuppkg("windows", x = "x = 78") @@ -718,6 +725,8 @@ class TestPycStuff: # ___________________ .pyc related stuff _________________ + def setup_class(cls): + cls.tag = importing.get_pyc_tag(cls.space) def test_check_compiled_module(self): space = self.space @@ -859,7 +868,8 @@ ret = space.int_w(w_ret) assert ret == 42 - cpathname = udir.join('test.pyc') + cpathname = importing.make_compiled_pathname(space, 'test.py') + cpathname = udir.join(cpathname) assert cpathname.check() cpathname.remove() @@ -877,7 +887,8 @@ write_pyc=False) finally: stream.close() - cpathname = udir.join('test.pyc') + cpathname = importing.make_compiled_pathname(space, 'test.py') + cpathname = udir.join(cpathname) assert not cpathname.check() def test_load_source_module_dont_write_bytecode(self): @@ -897,7 +908,8 @@ space.setattr(space.sys, space.wrap('dont_write_bytecode'), space.w_False) stream.close() - cpathname = udir.join('test.pyc') + cpathname = importing.make_compiled_pathname(space, 'test.py') + cpathname = udir.join(cpathname) assert not cpathname.check() def test_load_source_module_syntaxerror(self): @@ -917,7 +929,8 @@ pass stream.close() - cpathname = udir.join('test.pyc') + cpathname = importing.make_compiled_pathname(space, 'test.py') + cpathname = udir.join(cpathname) assert not cpathname.check() def test_load_source_module_importerror(self): @@ -938,7 +951,8 @@ stream.close() # And the .pyc has been generated - cpathname = udir.join('test.pyc') + cpathname = importing.make_compiled_pathname(space, 'test.py') + cpathname = udir.join(cpathname) assert cpathname.check() def test_write_compiled_module(self): @@ -955,7 +969,8 @@ pycode = w_ret assert type(pycode) is pypy.interpreter.pycode.PyCode - cpathname = str(udir.join('cpathname.pyc')) + cpathname = importing.make_compiled_pathname(space, 'cpathname.py') + cpathname = str(udir.join(cpathname)) mode = 0777 mtime = 12345 importing.write_compiled_module(space, @@ -1027,6 +1042,271 @@ finally: stream.close() + def test_make_compiled_pathname(self): + # Given the path to a .py file, return the path to its PEP 3147 + # defined .pyc file (i.e. under __pycache__). + cpathname = importing.make_compiled_pathname(self.space, + '/foo/bar/baz/qux.py') + expected = '/foo/bar/baz/__pycache__/qux.%s.pyc' % self.tag + assert cpathname == expected + + def test_make_compiled_pathname_cwd(self): + cpathname = importing.make_compiled_pathname(self.space, 'foo.py') + expected = os.sep.join(('__pycache__', 'foo.%s.pyc' % self.tag)) + assert cpathname == expected + + @pytest.mark.skipif('os.altsep is None') + def test_altsep_make_compiled_pathname(self): + # Windows path and PEP 3147. + cpathname = importing.make_compiled_pathname(self.space, + '\\foo\\bar\\baz\\qux.py') + expected = '\\foo\\bar\\baz\\__pycache__\\qux.%s.pyc' % self.tag + assert cpathname == expected + + @pytest.mark.skipif('os.altsep is None') + def test_altsep_and_sep_make_compiled_pathname(self): + # Windows path and PEP 3147 where altsep is right of sep. + cpathname = importing.make_compiled_pathname(self.space, + '\\foo\\bar/baz\\qux.py') + expected = '\\foo\\bar/baz\\__pycache__\\qux.%s.pyc' % self.tag + assert cpathname == expected + + @pytest.mark.skipif('os.altsep is None') + def test_sep_altsep_and_sep_make_compiled_pathname(self): + # Windows path and PEP 3147 where sep is right of altsep. + cpathname = importing.make_compiled_pathname(self.space, + '\\foo\\bar\\baz/qux.py') + expected = '\\foo\\bar\\baz/__pycache__/qux.%s.pyc' % self.tag + assert cpathname == expected + + def test_make_source_pathname(self): + # Given the path to a PEP 3147 defined .pyc file, return the path to + # its source. This tests the good path. + pathname = importing.make_source_pathname(self.space, + '/foo/bar/baz/__pycache__/qux.%s.pyc' % self.tag) + assert pathname == '/foo/bar/baz/qux.py' + + def test_make_source_pathname_bad_path(self): + # When the path to a pyc file is not in PEP 3147 format, a ValueError + # is raised. + try: + importing.make_source_pathname(self.space, '/foo/bar/bazqux.pyc') + except OperationError, e: + if not e.match(self.space, self.space.w_ValueError): + raise + else: + raise Exception("Should have raised ValueError") + + def test_make_source_pathname_no_slash(self): + # No slashes at all in path -> ValueError + try: + importing.make_source_pathname(self.space, 'foo.%s.pyc' % self.tag) + except OperationError, e: + if not e.match(self.space, self.space.w_ValueError): + raise + else: + raise Exception("Should have raised ValueError") + + def test_make_source_pathname_too_few_dots(self): + # Too few dots in final path component -> ValueError + try: + importing.make_source_pathname(self.space, '__pycache__/foo.pyc') + except OperationError, e: + if not e.match(self.space, self.space.w_ValueError): + raise + else: + raise Exception("Should have raised ValueError") + + def test_make_source_pathname_too_many_dots(self): + # Too many dots in final path component -> ValueError + pathname = '__pycache__/foo.%s.foo.pyc' % self.tag + try: + importing.make_source_pathname(self.space, pathname) + except OperationError, e: + if not e.match(self.space, self.space.w_ValueError): + raise + else: + raise Exception("Should have raised ValueError") + + def test_make_source_pathname_no__pycache__(self): + # Another problem with the path -> ValueError + pathname = '/foo/bar/foo.%s.foo.pyc' % self.tag + try: + importing.make_source_pathname(self.space, pathname) + except OperationError, e: + if not e.match(self.space, self.space.w_ValueError): + raise + else: + raise Exception("Should have raised ValueError") + + +class AppTestPEP3147Pyc(object): + def test_package___file__(self): + import os, sys, shutil + # Test that a package's __file__ points to the right source directory. + try: + os.mkdir('pep3147') + sys.path.insert(0, os.curdir) + # Touch the __init__.py file. + with open('pep3147/__init__.py', 'w'): + pass + m = __import__('pep3147') + # Ensure we load the pyc file. + del sys.modules['pep3147'] + m = __import__('pep3147') + assert m.__file__ == os.sep.join(('.', 'pep3147', '__init__.py')) + finally: + if sys.path[0] == os.curdir: + del sys.path[0] + shutil.rmtree('pep3147') + + +class AppTestPycache(object): + # Test the various PEP 3147 related behaviors. + + def setup_class(cls): + space = cls.space + + cls.module = '_app_test_pycache' + cls.filename = cls.module + '.py' + cls.w_module = space.wrap(cls.module) + cls.w_filename = space.wrap(cls.filename) + cls.w_tag = space.wrap(importing.get_pyc_tag(space)) + + def setup_method(cls, method): + if os.path.exists('__pycache__'): + shutil.rmtree('__pycache__') + if os.path.exists(cls.filename): + os.unlink(cls.filename) + + with open(cls.filename, 'w') as fp: + print >> fp, '# This is a test file written by test_import.py' + + def teardown_method(cls, method): + if os.path.exists('__pycache__'): + shutil.rmtree('__pycache__') + if os.path.exists(cls.filename): + os.unlink(cls.filename) + + def test_import_pyc_path(self): + import sys, os + sys.path.insert(0, '.') + try: + assert not os.path.exists('__pycache__') + __import__(self.module) + assert os.path.exists('__pycache__') + assert os.path.exists(os.path.join( + '__pycache__', '%s.%s.pyc' % (self.module, self.tag))) + finally: + del sys.path[0] + sys.modules.pop(self.module, None) + + @pytest.mark.skipif('os.name != "posix"') + def test_unwritable_directory(self): + # When the umask causes the new __pycache__ directory to be + # unwritable, the import still succeeds but no .pyc file is written. + import os, sys + sys.path.insert(0, '.') + try: + oldmask = os.umask(0222) + try: + __import__(self.module) + finally: + os.umask(oldmask) + assert os.path.exists('__pycache__') + assert not os.path.exists(os.path.join( + '__pycache__', '%s.%s.pyc' % (self.module, self.tag))) + finally: + del sys.path[0] + sys.modules.pop(self.module, None) + + def test_missing_source(self): + # With PEP 3147 cache layout, removing the source but leaving the pyc + # file does not satisfy the import. + import imp, os, sys + sys.path.insert(0, '.') + try: + __import__(self.module) + pyc_file = imp.cache_from_source(self.filename) + assert os.path.exists(pyc_file) + os.remove(self.filename) + del sys.modules[self.module] + try: + __import__(self.module) + except ImportError: + pass + else: + raise "Expected ImportError to be raised" + finally: + del sys.path[0] + sys.modules.pop(self.module, None) + + def test___cached__(self): + # Modules now also have an __cached__ that points to the pyc file. + import imp, os, sys + sys.path.insert(0, '.') + try: + m = __import__(self.module) + pyc_file = imp.cache_from_source(self.filename) + assert m.__cached__ == os.path.join(os.curdir, pyc_file) + finally: + del sys.path[0] + sys.modules.pop(self.module, None) + + def test_package___cached__(self): + # Like test___cached__ but for packages. + import imp, os, shutil, sys + sys.path.insert(0, '.') + try: + os.mkdir('_test_pep3147') + # Touch the __init__.py + with open(os.path.join('_test_pep3147', '__init__.py'), 'w'): + pass + with open(os.path.join('_test_pep3147', 'foo.py'), 'w'): + pass + m = __import__('_test_pep3147.foo') + init_pyc = imp.cache_from_source( + os.path.join('_test_pep3147', '__init__.py')) + assert m.__cached__ == os.path.join(os.curdir, init_pyc) + foo_pyc = imp.cache_from_source(os.path.join('_test_pep3147', + 'foo.py')) + assert (sys.modules['_test_pep3147.foo'].__cached__ + == os.path.join(os.curdir, foo_pyc)) + finally: + shutil.rmtree('_test_pep3147') + del sys.path[0] + sys.modules.pop('_test_pep3147.foo', None) + sys.modules.pop('_test_pep3147', None) + + def test_package___cached___from_pyc(self): + # Like test___cached__ but ensuring __cached__ when imported from a + # PEP 3147 pyc file. + import imp, os, shutil, sys + sys.path.insert(0, '.') + try: + os.mkdir('_test_pep3147') + # Touch the __init__.py + with open(os.path.join('_test_pep3147', '__init__.py'), 'w'): + pass + with open(os.path.join('_test_pep3147', 'foo.py'), 'w'): + pass + m = __import__('_test_pep3147.foo') + del sys.modules['_test_pep3147.foo'] + del sys.modules['_test_pep3147'] + m = __import__('_test_pep3147.foo') + init_pyc = imp.cache_from_source( + os.path.join('_test_pep3147', '__init__.py')) + assert m.__cached__ == os.path.join(os.curdir, init_pyc) + foo_pyc = imp.cache_from_source(os.path.join('_test_pep3147', + 'foo.py')) + assert (sys.modules['_test_pep3147.foo'].__cached__ + == os.path.join(os.curdir, foo_pyc)) + finally: + shutil.rmtree('_test_pep3147') + del sys.path[0] + sys.modules.pop('_test_pep3147.foo', None) + sys.modules.pop('_test_pep3147', None) + def test_PYTHONPATH_takes_precedence(space): if sys.platform == "win32": @@ -1284,17 +1564,18 @@ def test_import_possibly_from_pyc(self): from compiled import x + assert x.__file__.endswith('x.py') if self.usepycfiles: - assert x.__file__.endswith('x.pyc') + assert x.__cached__.endswith('.pyc') else: - assert x.__file__.endswith('x.py') + assert x.__cached__ is None try: from compiled import lone except ImportError: - assert not self.lonepycfiles, "should have found 'lone.pyc'" + assert not self.lonepycfiles, "should have found 'lone.TAG.pyc'" else: - assert self.lonepycfiles, "should not have found 'lone.pyc'" - assert lone.__file__.endswith('lone.pyc') + assert self.lonepycfiles, "should not have found 'lone.TAG.pyc'" + assert lone.__cached__.endswith('.pyc') class AppTestNoLonePycFile(AppTestNoPycFile): spaceconfig = { @@ -1302,12 +1583,6 @@ "objspace.lonepycfiles": False } -class AppTestLonePycFile(AppTestNoPycFile): - spaceconfig = { - "objspace.usepycfiles": True, - "objspace.lonepycfiles": True - } - class AppTestMultithreadedImp(object): spaceconfig = dict(usemodules=['thread', 'rctime']) --- a/pypy/interpreter/mixedmodule.py +++ b/pypy/interpreter/mixedmodule.py @@ -141,6 +141,7 @@ assert '__file__' not in loaders if cls.expose__file__attribute: loaders['__file__'] = cls.get__file__ + loaders['__cached__'] = cls.get__cached__ if '__doc__' not in loaders: loaders['__doc__'] = cls.get__doc__ @@ -176,6 +177,10 @@ get__file__ = classmethod(get__file__) + def get__cached__(cls, space): + return space.w_None + get__cached__ = classmethod(get__cached__) + def get__doc__(cls, space): return space.wrap(cls.__doc__) get__doc__ = classmethod(get__doc__) --- a/pypy/module/zipimport/test/test_undocumented.py +++ b/pypy/module/zipimport/test/test_undocumented.py @@ -31,12 +31,11 @@ Clears zipimport._zip_directory_cache. """ - import zipimport, os, shutil, zipfile, py_compile + import zipimport, os, shutil, zipfile, py_compile, imp example_code = 'attr = None' TESTFN = '@test' zipimport._zip_directory_cache.clear() zip_path = TESTFN + '.zip' - bytecode_suffix = 'c'# if __debug__ else 'o' zip_file = zipfile.ZipFile(zip_path, 'w') for path in created_paths: if os.sep in path: @@ -53,13 +52,13 @@ zip_file.write(code_path) if bytecode: py_compile.compile(code_path, doraise=True) - zip_file.write(code_path + bytecode_suffix) + bytecode_path = imp.cache_from_source(code_path) + zip_file.write(bytecode_path) zip_file.close() return os.path.abspath(zip_path) def w_cleanup_zipfile(self, created_paths): - import os, shutil - bytecode_suffix = 'c'# if __debug__ else 'o' + import os, shutil, imp zip_path = '@test.zip' for path in created_paths: if os.sep in path: @@ -67,9 +66,17 @@ if os.path.exists(directory): shutil.rmtree(directory) else: - for suffix in ('.py', '.py' + bytecode_suffix): - if os.path.exists(path + suffix): - os.unlink(path + suffix) + source_file = path + '.py' + if os.path.exists(source_file): + os.unlink(source_file) + bytecode_file = imp.cache_from_source(source_file) + if os.path.exists(bytecode_file): + os.unlink(bytecode_file) + try: + os.rmdir(os.path.dirname(bytecode_file)) + except OSError: + pass + os.unlink(zip_path) def test_inheritance(self): --- a/pypy/doc/interpreter.rst +++ b/pypy/doc/interpreter.rst @@ -245,6 +245,7 @@ * ``__doc__`` the docstring of the module * ``__file__`` the source filename from which this module was instantiated +* ``__cached__`` the filename for the byte-compiled cache of this module * ``__path__`` state used for relative imports Apart from the basic Module used for importing --- a/pypy/interpreter/main.py +++ b/pypy/interpreter/main.py @@ -44,6 +44,7 @@ space.setitem(w_globals, w('__builtins__'), space.builtin) if filename is not None: space.setitem(w_globals, w('__file__'), w(filename)) + space.setitem(w_globals, w('__cached__'), space.w_None) retval = pycode.exec_code(space, w_globals, w_globals) if eval: --- a/pypy/interpreter/test/test_main.py +++ b/pypy/interpreter/test/test_main.py @@ -13,6 +13,12 @@ main() """ +test__file__code = """ +assert __file__ is not None +assert __cached__ is None +print len('hello world') +""" + # On module test we want to ensure that the called module __name__ is # '__main__' and argv is set as expected. testmodulecode = """ @@ -39,12 +45,14 @@ assert capturefn.read(mode='rU') == expected_output testfn = udir.join('tmp_hello_world.py') +test__file__fn = udir.join('test__file__.py') testmodule = 'tmp_hello_module' testpackage = 'tmp_package' class TestMain: def setup_class(cls): testfn.write(testcode, 'w') + test__file__fn.write(test__file__code, 'w') udir.join(testmodule + '.py').write(testmodulecode, 'w') udir.ensure(testpackage, '__init__.py') udir.join(testpackage, testmodule + '.py').write(testmodulecode, 'w') @@ -78,3 +86,6 @@ testmodule, ['hello world']) checkoutput(self.space, testresultoutput, main.run_module, testpackage + '.' + testmodule, ['hello world']) + + def test__file__file(self): + checkoutput(self.space, testresultoutput, main.run_file, str(test__file__fn)) --- a/pypy/interpreter/app_main.py +++ b/pypy/interpreter/app_main.py @@ -632,6 +632,7 @@ # on the command-line. filename = sys.argv[0] mainmodule.__file__ = filename + mainmodule.__cached__ = None sys.path.insert(0, sys.pypy_resolvedirof(filename)) # assume it's a pyc file only if its name says so. # CPython goes to great lengths to detect other cases debian/patches/ctypes-arm0000644000000000000000000000316012215550224012622 0ustar Description: armhf support Workaround the presentce of hard-float in ldconfig -p output Also, handle the wide variety of ARM unames Author: Loïc Minier Bug-Ubuntu: https://bugs.launchpad.net/bugs/898172 Bug-cpython: http://bugs.python.org/issue13508 Last-Update: 2011-12-19 --- a/lib-python/2.7/ctypes/util.py +++ b/lib-python/2.7/ctypes/util.py @@ -184,16 +184,27 @@ def _findSoname_ldconfig(name): import struct + # XXX this code assumes that we know all unames and that a single + # ABI is supported per uname; instead we should find what the + # ABI is (e.g. check ABI of current process) or simply ask libc + # to load the library for us + uname = os.uname()[4] + # ARM has a variety of unames, e.g. armv7l + if uname.startswith("arm"): + uname = "arm" if struct.calcsize('l') == 4: - machine = os.uname()[4] + '-32' + machine = uname + '-32' else: - machine = os.uname()[4] + '-64' + machine = uname + '-64' mach_map = { 'x86_64-64': 'libc6,x86-64', 'ppc64-64': 'libc6,64bit', 'sparc64-64': 'libc6,64bit', 's390x-64': 'libc6,64bit', 'ia64-64': 'libc6,IA-64', + # this actually breaks on biarch or multiarch as the first + # library wins; uname doesn't tell us which ABI we're using + 'arm-32': 'libc6(,hard-float)?', } abi_type = mach_map.get(machine, 'libc6') debian/patches/sandbox-manpage0000644000000000000000000000360712241171175013613 0ustar Description: Manpage for pypy-sandbox Author: Stefano Rivera Forwarded: no Last-Update: 2012-02-14 --- /dev/null +++ b/pypy/doc/man/pypy-sandbox.1.rst @@ -0,0 +1,50 @@ +============== + pypy-sandbox +============== + +SYNOPSIS +======== + +``pypy-sandbox`` [*options*] +[``--`` ``-c`` *cmd*\ \|\ ``--`` ``-m`` *mod*\ \|\ *file.py*\ \|\ ``-``\ ] +[*arg*\ ...] + +DESCRIPTION +=========== + +``pypy-sandbox`` is a wrapper around a "virtualized" version of PyPy, +where an external process controls all input/output. +This is a secure sandbox, it is safe to run any untrusted Python code +with it. +The Python code cannot see or modify any local file except via +interaction with the external process. + +Any options after a ``--`` will be passed on to the wrapped +sandbox-enabled PyPy. +It supports the same options as the regular ``pypy``\ (1). + +OPTIONS +======= + +--tmp *DIR* + The real directory that corresponds to the virtual ``/tmp``, + which is the virtual current dir (and is read-only). + +--heapsize *N* + Limit memory usage to *N* bytes, or kilo- mega- giga-bytes + with the ``k``, ``m`` or ``g`` suffix respectively. + +--timeout *N* + Limit execution time to N (real-time) seconds. + +--log *FILE* + Log all user input into the *FILE*. + +--verbose + Log all proxied system calls. + Requires ``python-py`` to be installed. + +SEE ALSO +======== + +**pypy**\ (1), **python**\ (1) --- a/pypy/doc/commandline_ref.rst +++ b/pypy/doc/commandline_ref.rst @@ -8,3 +8,4 @@ :maxdepth: 1 man/pypy.1.rst + man/pypy-sandbox.1.rst --- a/pypy/doc/conf.py +++ b/pypy/doc/conf.py @@ -202,6 +202,9 @@ man_pages = [ ('man/pypy.1', 'pypy', u'fast, compliant alternative implementation of the Python language', + u'The PyPy Project', 1), + ('man/pypy-sandbox.1', 'pypy-sandbox', + u'Interact with a sandboxed PyPy subprocess', u'The PyPy Project', 1) ] debian/patches/pep3147-issue112540000644000000000000000000002710112215550224013365 0ustar Description: PEP3147 distutils patches Backported from cpython Origin: cpython, http://hg.python.org/cpython/rev/27a36b05caed Origin: cpython, http://hg.python.org/cpython/rev/651e84363001 Origin: cpython, http://hg.python.org/cpython/rev/ea926dff958f Bug-cpython: http://bugs.python.org/issue11254 Author: Jeff Ramnani Author: Éric Araujo Author: Stefano Rivera Last-Update: 2011-12-20 --- a/lib-python/2.7/distutils/command/build_py.py +++ b/lib-python/2.7/distutils/command/build_py.py @@ -5,6 +5,7 @@ __revision__ = "$Id$" import os +import imp import sys from glob import glob @@ -313,9 +314,11 @@ outputs.append(filename) if include_bytecode: if self.compile: - outputs.append(filename + "c") + outputs.append(imp.cache_from_source(filename, + debug_override=True)) if self.optimize > 0: - outputs.append(filename + "o") + outputs.append(imp.cache_from_source(filename, + debug_override=False)) outputs += [ os.path.join(build_dir, filename) --- a/lib-python/2.7/distutils/command/install_lib.py +++ b/lib-python/2.7/distutils/command/install_lib.py @@ -6,6 +6,7 @@ __revision__ = "$Id$" import os +import imp import sys from distutils.core import Command @@ -169,9 +170,11 @@ if ext != PYTHON_SOURCE_EXTENSION: continue if self.compile: - bytecode_files.append(py_file + "c") + bytecode_files.append(imp.cache_from_source( + py_file, debug_override=True)) if self.optimize > 0: - bytecode_files.append(py_file + "o") + bytecode_files.append(imp.cache_from_source( + py_file, debug_override=False)) return bytecode_files --- a/lib-python/2.7/distutils/tests/test_build_py.py +++ b/lib-python/2.7/distutils/tests/test_build_py.py @@ -2,7 +2,7 @@ import os import sys -import StringIO +import imp import unittest from distutils.command.build_py import build_py @@ -59,17 +59,16 @@ files = os.listdir(pkgdest) self.assertIn("__init__.py", files) self.assertIn("README.txt", files) + pycache_dir = os.path.join(pkgdest, "__pycache__") + pyc_files = os.listdir(pycache_dir) # XXX even with -O, distutils writes pyc, not pyo; bug? if sys.dont_write_bytecode: - self.assertNotIn("__init__.pyc", files) + self.assertNotIn("__init__.%s.pyc" % imp.get_tag(), pyc_files) else: - self.assertIn("__init__.pyc", files) + self.assertIn("__init__.%s.pyc" % imp.get_tag(), pyc_files) def test_empty_package_dir(self): - # See SF 1668596/1720897. - cwd = os.getcwd() - - # create the distribution files. + # See bugs #1668596/#1720897 sources = self.mkdtemp() open(os.path.join(sources, "__init__.py"), "w").close() @@ -78,30 +77,55 @@ open(os.path.join(testdir, "testfile"), "w").close() os.chdir(sources) - old_stdout = sys.stdout - sys.stdout = StringIO.StringIO() + dist = Distribution({"packages": ["pkg"], + "package_dir": {"pkg": ""}, + "package_data": {"pkg": ["doc/*"]}}) + # script_name need not exist, it just need to be initialized + dist.script_name = os.path.join(sources, "setup.py") + dist.script_args = ["build"] + dist.parse_command_line() try: - dist = Distribution({"packages": ["pkg"], - "package_dir": {"pkg": ""}, - "package_data": {"pkg": ["doc/*"]}}) - # script_name need not exist, it just need to be initialized - dist.script_name = os.path.join(sources, "setup.py") - dist.script_args = ["build"] - dist.parse_command_line() - - try: - dist.run_commands() - except DistutilsFileError: - self.fail("failed package_data test when package_dir is ''") - finally: - # Restore state. - os.chdir(cwd) - sys.stdout = old_stdout + dist.run_commands() + except DistutilsFileError: + self.fail("failed package_data test when package_dir is ''") + + @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') + def test_byte_compile(self): + project_dir, dist = self.create_dist(py_modules=['boiledeggs']) + os.chdir(project_dir) + self.write_file('boiledeggs.py', 'import antigravity') + cmd = build_py(dist) + cmd.compile = 1 + cmd.build_lib = 'here' + cmd.finalize_options() + cmd.run() + + found = os.listdir(cmd.build_lib) + self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py']) + found = os.listdir(os.path.join(cmd.build_lib, '__pycache__')) + self.assertEqual(found, ['boiledeggs.%s.pyc' % imp.get_tag()]) + + @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') + def test_byte_compile_optimized(self): + project_dir, dist = self.create_dist(py_modules=['boiledeggs']) + os.chdir(project_dir) + self.write_file('boiledeggs.py', 'import antigravity') + cmd = build_py(dist) + cmd.compile = 0 + cmd.optimize = 1 + cmd.build_lib = 'here' + cmd.finalize_options() + cmd.run() + + found = os.listdir(cmd.build_lib) + self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py']) + found = os.listdir(os.path.join(cmd.build_lib, '__pycache__')) + self.assertEqual(sorted(found), ['boiledeggs.%s.pyo' % imp.get_tag()]) def test_dont_write_bytecode(self): # makes sure byte_compile is not used - pkg_dir, dist = self.create_dist() + dist = self.create_dist()[1] cmd = build_py(dist) cmd.compile = 1 cmd.optimize = 1 --- a/lib-python/2.7/distutils/tests/test_install_lib.py +++ b/lib-python/2.7/distutils/tests/test_install_lib.py @@ -1,6 +1,7 @@ """Tests for distutils.command.install_data.""" import os import sys +import imp import unittest from distutils.command.install_lib import install_lib @@ -15,7 +16,7 @@ unittest.TestCase): def test_finalize_options(self): - pkg_dir, dist = self.create_dist() + dist = self.create_dist()[1] cmd = install_lib(dist) cmd.finalize_options() @@ -44,49 +45,62 @@ @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile not enabled') def test_byte_compile(self): - pkg_dir = self._setup_byte_compile() - if sys.flags.optimize < 1: - self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyc'))) - else: - self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyo'))) + project_dir, dist = self.create_dist() + os.chdir(project_dir) + cmd = install_lib(dist) + cmd.compile = cmd.optimize = 1 + + f = os.path.join(project_dir, 'foo.py') + self.write_file(f, '# python file') + cmd.byte_compile([f]) + pyc_file = imp.cache_from_source('foo.py', debug_override=True) + pyo_file = imp.cache_from_source('foo.py', debug_override=False) + self.assertTrue(os.path.exists(pyc_file)) + self.assertTrue(os.path.exists(pyo_file)) def test_get_outputs(self): - pkg_dir, dist = self.create_dist() + project_dir, dist = self.create_dist() + os.chdir(project_dir) + os.mkdir('spam') cmd = install_lib(dist) # setting up a dist environment cmd.compile = cmd.optimize = 1 - cmd.install_dir = pkg_dir - f = os.path.join(pkg_dir, 'foo.py') - self.write_file(f, '# python file') - cmd.distribution.py_modules = [pkg_dir] + cmd.install_dir = self.mkdtemp() + f = os.path.join(project_dir, 'spam', '__init__.py') + self.write_file(f, '# python package') cmd.distribution.ext_modules = [Extension('foo', ['xxx'])] - cmd.distribution.packages = [pkg_dir] + cmd.distribution.packages = ['spam'] cmd.distribution.script_name = 'setup.py' - # get_output should return 4 elements - self.assertTrue(len(cmd.get_outputs()) >= 2) + # get_outputs should return 4 elements: spam/__init__.py, .pyc and + # .pyo, foo.import-tag-abiflags.so / foo.pyd + outputs = cmd.get_outputs() + self.assertEqual(len(outputs), 4, outputs) def test_get_inputs(self): - pkg_dir, dist = self.create_dist() + project_dir, dist = self.create_dist() + os.chdir(project_dir) + os.mkdir('spam') cmd = install_lib(dist) # setting up a dist environment cmd.compile = cmd.optimize = 1 - cmd.install_dir = pkg_dir - f = os.path.join(pkg_dir, 'foo.py') - self.write_file(f, '# python file') - cmd.distribution.py_modules = [pkg_dir] + cmd.install_dir = self.mkdtemp() + f = os.path.join(project_dir, 'spam', '__init__.py') + self.write_file(f, '# python package') cmd.distribution.ext_modules = [Extension('foo', ['xxx'])] - cmd.distribution.packages = [pkg_dir] + cmd.distribution.packages = ['spam'] cmd.distribution.script_name = 'setup.py' - # get_input should return 2 elements - self.assertEqual(len(cmd.get_inputs()), 2) + # get_inputs should return 2 elements: spam/__init__.py and + # foo.import-tag-abiflags.so / foo.pyd + inputs = cmd.get_inputs() + self.assertEqual(len(inputs), 2, inputs) def test_dont_write_bytecode(self): # makes sure byte_compile is not used - pkg_dir, dist = self.create_dist() + dist = self.create_dist()[1] cmd = install_lib(dist) cmd.compile = 1 cmd.optimize = 1 --- a/lib-python/2.7/distutils/util.py +++ b/lib-python/2.7/distutils/util.py @@ -6,7 +6,11 @@ __revision__ = "$Id$" -import sys, os, string, re +import os +import re +import imp +import sys +import string from distutils.errors import DistutilsPlatformError from distutils.dep_util import newer from distutils.spawn import spawn @@ -426,9 +430,9 @@ verbose=1, dry_run=0, direct=None): """Byte-compile a collection of Python source files to either .pyc - or .pyo files in the same directory. 'py_files' is a list of files - to compile; any files that don't end in ".py" are silently skipped. - 'optimize' must be one of the following: + or .pyo files in a __pycache__ subdirectory. 'py_files' is a list + of files to compile; any files that don't end in ".py" are silently + skipped. 'optimize' must be one of the following: 0 - don't optimize (generate .pyc) 1 - normal optimization (like "python -O") 2 - extra optimization (like "python -OO") @@ -540,7 +544,10 @@ # Terminology from the py_compile module: # cfile - byte-compiled file # dfile - purported source filename (same as 'file' by default) - cfile = file + (__debug__ and "c" or "o") + if optimize >= 0: + cfile = imp.cache_from_source(file, debug_override=not optimize) + else: + cfile = imp.cache_from_source(file) dfile = file if prefix: if file[:len(prefix)] != prefix: debian/patches/distutils-install-layout0000644000000000000000000003021312215550224015540 0ustar Description: distutils: Add an option --install-layout=deb This option: - installs into $prefix/dist-packages instead of $prefix/site-packages. - doesn't encode the python version into the egg name. Based on cpython Debian packaging Author: Matthias Klose Author: Stefano Rivera Last-Update: 2013-02-23 --- a/lib-python/2.7/distutils/command/install.py +++ b/lib-python/2.7/distutils/command/install.py @@ -90,6 +90,20 @@ 'scripts': '$base/bin', 'data' : '$base', }, + 'pypy-deb': { + 'purelib': '$base/dist-packages', + 'platlib': '$base/dist-packages', + 'headers': '$base/include', + 'scripts': '$base/bin', + 'data' : '$base', + }, + 'pypy-local': { + 'purelib': '$base/../../local/lib/pypy$py_version_short/dist-packages', + 'platlib': '$base/../../local/lib/pypy$py_version_short/dist-packages', + 'headers': '$base/../../local/include', + 'scripts': '$base/../../local/bin', + 'data' : '$base/../../local', + }, } # The keys to an installation scheme; if any new types of files are to be @@ -161,6 +175,9 @@ ('record=', None, "filename in which to record list of installed files"), + + ('install-layout=', None, + "installation layout to choose (known values: deb, unix)"), ] boolean_options = ['compile', 'force', 'skip-build', 'user'] @@ -175,6 +192,7 @@ self.exec_prefix = None self.home = None self.user = 0 + self.prefix_option = None # These select only the installation base; it's up to the user to # specify the installation scheme (currently, that means supplying @@ -196,6 +214,9 @@ self.install_userbase = USER_BASE self.install_usersite = USER_SITE + # enable custom installation, known values: deb + self.install_layout = None + self.compile = None self.optimize = None @@ -428,6 +449,7 @@ self.install_base = self.install_platbase = self.home self.select_scheme("unix_home") else: + self.prefix_option = self.prefix if self.prefix is None: if self.exec_prefix is not None: raise DistutilsOptionError, \ @@ -442,7 +464,25 @@ self.install_base = self.prefix self.install_platbase = self.exec_prefix - self.select_scheme("unix_prefix") + if self.install_layout: + if self.install_layout.lower() in ['deb']: + self.select_scheme("pypy-deb") + elif self.install_layout.lower() in ['posix', 'unix']: + self.select_scheme("unix_prefix") + else: + raise DistutilsOptionError( + "unknown value for --install-layout") + elif ((self.prefix_option + and not os.path.normpath(self.prefix).startswith( + '/usr/local/')) + or 'PYTHONUSERBASE' in os.environ + or 'real_prefix' in sys.__dict__): + self.select_scheme("unix_prefix") + else: + if os.path.normpath(self.prefix).startswith('/usr/local/'): + self.select_scheme("pypy-deb") + else: + self.select_scheme("pypy-local") # finalize_unix () @@ -475,7 +515,7 @@ def select_scheme (self, name): # it's the caller's problem if they supply a bad name! if (hasattr(sys, 'pypy_version_info') and - not name.endswith(('_user', '_home'))): + not (name.endswith(('_user', '_home')) or name.startswith('pypy'))): name = 'pypy' scheme = INSTALL_SCHEMES[name] for key in SCHEME_KEYS: --- a/lib-python/2.7/distutils/command/install_egg_info.py +++ b/lib-python/2.7/distutils/command/install_egg_info.py @@ -14,18 +14,38 @@ description = "Install package's PKG-INFO metadata as an .egg-info file" user_options = [ ('install-dir=', 'd', "directory to install to"), + ('install-layout', None, "custom installation layout"), ] def initialize_options(self): self.install_dir = None + self.install_layout = None + self.prefix_option = None def finalize_options(self): self.set_undefined_options('install_lib',('install_dir','install_dir')) - basename = "%s-%s-py%s.egg-info" % ( - to_filename(safe_name(self.distribution.get_name())), - to_filename(safe_version(self.distribution.get_version())), - sys.version[:3] - ) + self.set_undefined_options('install',('install_layout','install_layout')) + self.set_undefined_options('install',('prefix_option','prefix_option')) + if self.install_layout: + if not self.install_layout.lower() in ['deb', 'unix']: + raise DistutilsOptionError( + "unknown value for --install-layout") + no_pyver = (self.install_layout.lower() == 'deb') + elif self.prefix_option: + no_pyver = False + else: + no_pyver = True + if no_pyver: + basename = "%s-%s.egg-info" % ( + to_filename(safe_name(self.distribution.get_name())), + to_filename(safe_version(self.distribution.get_version())) + ) + else: + basename = "%s-%s-py%s.egg-info" % ( + to_filename(safe_name(self.distribution.get_name())), + to_filename(safe_version(self.distribution.get_version())), + sys.version[:3] + ) self.target = os.path.join(self.install_dir, basename) self.outputs = [self.target] --- a/lib-python/2.7/distutils/sysconfig_pypy.py +++ b/lib-python/2.7/distutils/sysconfig_pypy.py @@ -49,11 +49,15 @@ If 'prefix' is supplied, use it instead of sys.prefix or sys.exec_prefix -- i.e., ignore 'plat_specific'. """ + is_default_prefix = not prefix or os.path.normpath(prefix).startswith(('/usr/lib/pypy')) if prefix is None: prefix = PREFIX if standard_lib: return os.path.join(prefix, "lib-python", get_python_version()) - return os.path.join(prefix, 'site-packages') + if is_default_prefix and 'PYTHONUSERBASE' not in os.environ and 'real_prefix' not in sys.__dict__: + return os.path.join(prefix, 'dist-packages') + else: + return os.path.join(prefix, 'site-packages') _config_vars = None --- a/lib-python/2.7/site.py +++ b/lib-python/2.7/site.py @@ -12,13 +12,18 @@ This will append site-specific paths to the module search path. On Unix (including Mac OSX), it starts with sys.prefix and -sys.exec_prefix (if different) and appends -lib/python/site-packages as well as lib/site-python. +sys.exec_prefix (if different) and appends dist-packages. On other platforms (such as Windows), it tries each of the prefixes directly, as well as with lib/site-packages appended. The resulting directories, if they exist, are appended to sys.path, and also inspected for path configuration files. +For Debian and derivatives, this sys.path is augmented with directories +for packages distributed within the distribution. Local addons go +into /usr/local/lib/pypy/dist-packages, Debian addons +install into /usr/{lib,share}/pypy/dist-packages. +/usr/lib/pypy/site-packages is not used. + A path configuration file is a file whose name has the form .pth; its contents are additional directories (one per line) to be added to sys.path. Non-existing directories (or @@ -276,6 +281,13 @@ if ENABLE_USER_SITE and os.path.isdir(user_site): addsitedir(user_site, known_paths) + if ENABLE_USER_SITE: + for dist_libdir in ("local/lib", "lib"): + user_site = os.path.join(USER_BASE, dist_libdir, + "pypy" + sys.version[:3], + "dist-packages") + if os.path.isdir(user_site): + addsitedir(user_site, known_paths) return known_paths def getsitepackages(): @@ -300,6 +312,8 @@ elif is_pypy: from distutils.sysconfig import get_python_lib sitedir = get_python_lib(standard_lib=False, prefix=prefix) + sitepackages.append(sitedir.replace('lib/pypy', 'local/lib/' + 'pypy' + sys.version[:3])) sitepackages.append(sitedir) elif os.sep == '/': sitepackages.append(os.path.join(prefix, "lib", --- a/lib-python/2.7/sysconfig.py +++ b/lib-python/2.7/sysconfig.py @@ -36,6 +36,26 @@ 'scripts': '{base}/bin', 'data' : '{base}', }, + 'pypy-deb': { + 'stdlib': '{base}/lib-python', + 'platstdlib': '{base}/lib-python', + 'purelib': '{base}/lib-python', + 'platlib': '{base}/lib-python', + 'include': '{base}/include', + 'platinclude': '{base}/include', + 'scripts': '{base}/bin', + 'data' : '{base}', + }, + 'pypy-local': { + 'stdlib': '{base}/../../local/lib/pypy{py_version_short}/lib-python', + 'platstdlib': '{base}/../../local/lib/pypy{py_version_short}/lib-python', + 'purelib': '{base}/../../local/lib/pypy{py_version_short}/lib-python', + 'platlib': '{base}/../../local/lib/pypy{py_version_short}/lib-python', + 'include': '{base}/../../local/include', + 'platinclude': '{base}/../../local/include', + 'scripts': '{base}/../../local/bin', + 'data' : '{base}/../../local', + }, 'nt': { 'stdlib': '{base}/Lib', 'platstdlib': '{base}/Lib', @@ -169,7 +189,11 @@ def _get_default_scheme(): if '__pypy__' in sys.builtin_module_names: - return 'pypy' + # the default scheme for posix on Debian/Ubuntu is pypy-local + # FIXME: return dist-packages/posix_prefix only for + # is_default_prefix and 'PYTHONUSERBASE' not in os.environ and 'real_prefix' not in sys.__dict__ + # is_default_prefix = not prefix or os.path.normpath(prefix) in ('/usr', '/usr/local') + return 'pypy-local' elif os.name == 'posix': # the default scheme for posix is posix_prefix return 'posix_prefix' @@ -252,7 +276,8 @@ else: inc_dir = _PROJECT_BASE else: - inc_dir = get_path('platinclude') + inc_dir = get_path('platinclude', 'pypy-deb').replace("/../../local/", + "/", 1) return os.path.join(inc_dir, 'pyconfig.h') def get_scheme_names(): --- a/lib-python/2.7/test/test_sysconfig.py +++ b/lib-python/2.7/test/test_sysconfig.py @@ -244,7 +244,8 @@ def test_get_scheme_names(self): wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'osx_framework_user', - 'posix_home', 'posix_prefix', 'posix_user', 'pypy') + 'posix_home', 'posix_prefix', 'posix_user', 'pypy', + 'pypy-deb', 'pypy-local') self.assertEqual(get_scheme_names(), wanted) def test_symlink(self): --- a/lib-python/2.7/test/test_site.py +++ b/lib-python/2.7/test/test_site.py @@ -229,7 +229,7 @@ wanted = os.path.join('xoxo', 'Lib', 'site-packages') self.assertEqual(dirs[0], wanted) elif '__pypy__' in sys.builtin_module_names: - self.assertEquals(len(dirs), 1) + self.assertEquals(len(dirs), 2) wanted = os.path.join('xoxo', 'site-packages') self.assertEquals(dirs[0], wanted) elif (sys.platform == "darwin" and --- a/lib-python/2.7/pydoc.py +++ b/lib-python/2.7/pydoc.py @@ -360,6 +360,7 @@ 'marshal', 'posix', 'signal', 'sys', 'thread', 'zipimport') or (file.startswith(basedir) and + not file.startswith(os.path.join(basedir, 'dist-packages')) and not file.startswith(os.path.join(basedir, 'site-packages')))) and object.__name__ not in ('xml.etree', 'test.pydoc_mod')): if docloc.startswith("http://"): debian/patches/multiprocessing-typos0000644000000000000000000000131512215550224015141 0ustar Description: Fix typos in the multiprocessing module. Bug-Debian: http://bugs.debian.org/559574 Bug-multiprocessing: http://code.google.com/p/python-multiprocessing/issues/detail?id=23 Author: Jakub Wilk Last-Update: 2011-12-19 --- a/lib-python/2.7/multiprocessing/synchronize.py +++ b/lib-python/2.7/multiprocessing/synchronize.py @@ -226,7 +226,7 @@ num_waiters = (self._sleeping_count._semlock._get_value() - self._woken_count._semlock._get_value()) except Exception: - num_waiters = 'unkown' + num_waiters = 'unknown' return '' % (self._lock, num_waiters) def wait(self, timeout=None): debian/patches/noise0000644000000000000000000000104412215550224011652 0ustar Description: Always draw mandelbrots, so we don't get timed out Forwarded: not-needed Author: Stefano Rivera Last-Update: 2013-02-23 --- a/rpython/tool/ansi_print.py +++ b/rpython/tool/ansi_print.py @@ -26,7 +26,7 @@ self.kw_to_color.update(kw_to_color) self.file = file self.fancy = True - self.isatty = getattr(sys.stderr, 'isatty', lambda: False) + self.isatty = lambda: True if self.fancy and self.isatty(): self.mandelbrot_driver = Driver() else: debian/patches/plat-gnukfreebsd0000644000000000000000000023577612215550224014017 0ustar Description: DLFCN.py for kfreebsd Author: Jakub Wilk Origin: Debian cpython packaging Bug-Debian: http://bugs.debian.org/593818 Last-Update: 2011-12-21 --- /dev/null +++ b/lib-python/2.7/plat-gnukfreebsd7/IN.py @@ -0,0 +1,809 @@ +# Generated by h2py from /usr/include/netinet/in.h +_NETINET_IN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 200809L +_XOPEN_SOURCE = 700 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_ATFILE_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +__USE_ISOC95 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 200112L +_POSIX_C_SOURCE = 200809L +__USE_POSIX_IMPLICITLY = 1 +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN2K8 = 1 +_ATFILE_SOURCE = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K8 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_ATFILE = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__USE_FORTIFY_LEVEL = 2 +__USE_FORTIFY_LEVEL = 1 +__USE_FORTIFY_LEVEL = 0 + +# Included from bits/predefs.h +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 11 +__GLIBC_HAVE_LONG_LONG = 1 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __NTH(fct): return fct + +def __NTH(fct): return fct + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) + +def __bos0(ptr): return __builtin_object_size (ptr, 0) + +def __warnattr(msg): return __attribute__((__warning__ (msg))) + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + + +# Included from bits/wordsize.h +__WORDSIZE = 32 +__LDBL_COMPAT = 1 +def __LDBL_REDIR_DECL(name): return \ + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 +__USE_EXTERN_INLINES_IN_LIBC = 1 + +# Included from gnu/stubs.h + +# Included from stdint.h +_STDINT_H = 1 + +# Included from bits/wchar.h +_BITS_WCHAR_H = 1 +__WCHAR_MAX = (2147483647) +__WCHAR_MIN = (-__WCHAR_MAX - 1) +def __INT64_C(c): return c ## L + +def __UINT64_C(c): return c ## UL + +def __INT64_C(c): return c ## LL + +def __UINT64_C(c): return c ## ULL + +INT8_MIN = (-128) +INT16_MIN = (-32767-1) +INT32_MIN = (-2147483647-1) +INT64_MIN = (-__INT64_C(9223372036854775807)-1) +INT8_MAX = (127) +INT16_MAX = (32767) +INT32_MAX = (2147483647) +INT64_MAX = (__INT64_C(9223372036854775807)) +UINT8_MAX = (255) +UINT16_MAX = (65535) +UINT64_MAX = (__UINT64_C(18446744073709551615)) +INT_LEAST8_MIN = (-128) +INT_LEAST16_MIN = (-32767-1) +INT_LEAST32_MIN = (-2147483647-1) +INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_LEAST8_MAX = (127) +INT_LEAST16_MAX = (32767) +INT_LEAST32_MAX = (2147483647) +INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_LEAST8_MAX = (255) +UINT_LEAST16_MAX = (65535) +UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) +INT_FAST8_MIN = (-128) +INT_FAST16_MIN = (-9223372036854775807L-1) +INT_FAST32_MIN = (-9223372036854775807L-1) +INT_FAST16_MIN = (-2147483647-1) +INT_FAST32_MIN = (-2147483647-1) +INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_FAST8_MAX = (127) +INT_FAST16_MAX = (9223372036854775807L) +INT_FAST32_MAX = (9223372036854775807L) +INT_FAST16_MAX = (2147483647) +INT_FAST32_MAX = (2147483647) +INT_FAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_FAST8_MAX = (255) +UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) +INTPTR_MIN = (-9223372036854775807L-1) +INTPTR_MAX = (9223372036854775807L) +INTPTR_MIN = (-2147483647-1) +INTPTR_MAX = (2147483647) +INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) +INTMAX_MAX = (__INT64_C(9223372036854775807)) +UINTMAX_MAX = (__UINT64_C(18446744073709551615)) +PTRDIFF_MIN = (-9223372036854775807L-1) +PTRDIFF_MAX = (9223372036854775807L) +PTRDIFF_MIN = (-2147483647-1) +PTRDIFF_MAX = (2147483647) +SIG_ATOMIC_MIN = (-2147483647-1) +SIG_ATOMIC_MAX = (2147483647) +WCHAR_MIN = __WCHAR_MIN +WCHAR_MAX = __WCHAR_MAX +def INT8_C(c): return c + +def INT16_C(c): return c + +def INT32_C(c): return c + +def INT64_C(c): return c ## L + +def INT64_C(c): return c ## LL + +def UINT8_C(c): return c + +def UINT16_C(c): return c + +def UINT32_C(c): return c ## U + +def UINT64_C(c): return c ## UL + +def UINT64_C(c): return c ## ULL + +def INTMAX_C(c): return c ## L + +def UINTMAX_C(c): return c ## UL + +def INTMAX_C(c): return c ## LL + +def UINTMAX_C(c): return c ## ULL + + +# Included from sys/socket.h +_SYS_SOCKET_H = 1 + +# Included from sys/uio.h +_SYS_UIO_H = 1 +from TYPES import * + +# Included from bits/uio.h +_BITS_UIO_H = 1 +from TYPES import * +UIO_MAXIOV = 1024 + +# Included from bits/sigset.h +_SIGSET_H_types = 1 +_SIGSET_H_fns = 1 +def __sigword(sig): return (((sig) - 1) >> 5) + +def __sigemptyset(set): return \ + +def __sigfillset(set): return \ + +def __sigisemptyset(set): return \ + + +# Included from bits/socket.h +__BITS_SOCKET_H = 1 + +# Included from limits.h +_LIBC_LIMITS_H_ = 1 +MB_LEN_MAX = 16 +_LIMITS_H = 1 +CHAR_BIT = 8 +SCHAR_MIN = (-128) +SCHAR_MAX = 127 +UCHAR_MAX = 255 +CHAR_MIN = 0 +CHAR_MAX = UCHAR_MAX +CHAR_MIN = SCHAR_MIN +CHAR_MAX = SCHAR_MAX +SHRT_MIN = (-32768) +SHRT_MAX = 32767 +USHRT_MAX = 65535 +INT_MAX = 2147483647 +LONG_MAX = 9223372036854775807L +LONG_MAX = 2147483647L +LONG_MIN = (-LONG_MAX - 1L) + +# Included from bits/posix1_lim.h +_BITS_POSIX1_LIM_H = 1 +_POSIX_AIO_LISTIO_MAX = 2 +_POSIX_AIO_MAX = 1 +_POSIX_ARG_MAX = 4096 +_POSIX_CHILD_MAX = 25 +_POSIX_CHILD_MAX = 6 +_POSIX_DELAYTIMER_MAX = 32 +_POSIX_HOST_NAME_MAX = 255 +_POSIX_LINK_MAX = 8 +_POSIX_LOGIN_NAME_MAX = 9 +_POSIX_MAX_CANON = 255 +_POSIX_MAX_INPUT = 255 +_POSIX_MQ_OPEN_MAX = 8 +_POSIX_MQ_PRIO_MAX = 32 +_POSIX_NAME_MAX = 14 +_POSIX_NGROUPS_MAX = 8 +_POSIX_NGROUPS_MAX = 0 +_POSIX_OPEN_MAX = 20 +_POSIX_OPEN_MAX = 16 +_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX +_POSIX_PATH_MAX = 256 +_POSIX_PIPE_BUF = 512 +_POSIX_RE_DUP_MAX = 255 +_POSIX_RTSIG_MAX = 8 +_POSIX_SEM_NSEMS_MAX = 256 +_POSIX_SEM_VALUE_MAX = 32767 +_POSIX_SIGQUEUE_MAX = 32 +_POSIX_SSIZE_MAX = 32767 +_POSIX_STREAM_MAX = 8 +_POSIX_SYMLINK_MAX = 255 +_POSIX_SYMLOOP_MAX = 8 +_POSIX_TIMER_MAX = 32 +_POSIX_TTY_NAME_MAX = 9 +_POSIX_TZNAME_MAX = 6 +_POSIX_QLIMIT = 1 +_POSIX_HIWAT = _POSIX_PIPE_BUF +_POSIX_UIO_MAXIOV = 16 +_POSIX_CLOCKRES_MIN = 20000000 + +# Included from bits/local_lim.h + +# Included from sys/syslimits.h +ARG_MAX = 262144 +CHILD_MAX = 40 +LINK_MAX = 32767 +MAX_CANON = 255 +MAX_INPUT = 255 +NAME_MAX = 255 +NGROUPS_MAX = 1023 +OPEN_MAX = 64 +PATH_MAX = 1024 +PIPE_BUF = 512 +IOV_MAX = 1024 +_POSIX_THREAD_KEYS_MAX = 128 +PTHREAD_KEYS_MAX = 1024 +_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 +PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS +_POSIX_THREAD_THREADS_MAX = 64 +PTHREAD_THREADS_MAX = 1024 +AIO_PRIO_DELTA_MAX = 20 +PTHREAD_STACK_MIN = 16384 +TIMER_MAX = 256 +DELAYTIMER_MAX = 2147483647 +SSIZE_MAX = LONG_MAX +NGROUPS_MAX = 8 + +# Included from bits/posix2_lim.h +_BITS_POSIX2_LIM_H = 1 +_POSIX2_BC_BASE_MAX = 99 +_POSIX2_BC_DIM_MAX = 2048 +_POSIX2_BC_SCALE_MAX = 99 +_POSIX2_BC_STRING_MAX = 1000 +_POSIX2_COLL_WEIGHTS_MAX = 2 +_POSIX2_EXPR_NEST_MAX = 32 +_POSIX2_LINE_MAX = 2048 +_POSIX2_RE_DUP_MAX = 255 +_POSIX2_CHARCLASS_NAME_MAX = 14 +BC_BASE_MAX = _POSIX2_BC_BASE_MAX +BC_DIM_MAX = _POSIX2_BC_DIM_MAX +BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX +BC_STRING_MAX = _POSIX2_BC_STRING_MAX +COLL_WEIGHTS_MAX = 255 +EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX +LINE_MAX = _POSIX2_LINE_MAX +CHARCLASS_NAME_MAX = 2048 +RE_DUP_MAX = (0x7fff) + +# Included from bits/xopen_lim.h +_XOPEN_LIM_H = 1 + +# Included from bits/stdio_lim.h +L_tmpnam = 20 +TMP_MAX = 238328 +FILENAME_MAX = 1024 +L_ctermid = 9 +L_cuserid = 9 +FOPEN_MAX = 64 +IOV_MAX = 1024 +_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV +NL_ARGMAX = _POSIX_ARG_MAX +NL_LANGMAX = _POSIX2_LINE_MAX +NL_MSGMAX = INT_MAX +NL_NMAX = INT_MAX +NL_SETMAX = INT_MAX +NL_TEXTMAX = INT_MAX +NZERO = 20 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 32 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 64 +LONG_BIT = 32 + +# Included from bits/types.h +_BITS_TYPES_H = 1 +__S32_TYPE = int +__SWORD_TYPE = int +__SLONG32_TYPE = int + +# Included from bits/typesizes.h +_BITS_TYPESIZES_H = 1 +__PID_T_TYPE = __S32_TYPE +__CLOCK_T_TYPE = __S32_TYPE +__SWBLK_T_TYPE = __S32_TYPE +__CLOCKID_T_TYPE = __S32_TYPE +__TIMER_T_TYPE = __S32_TYPE +__SSIZE_T_TYPE = __SWORD_TYPE +__FD_SETSIZE = 1024 +PF_UNSPEC = 0 +PF_LOCAL = 1 +PF_UNIX = PF_LOCAL +PF_FILE = PF_LOCAL +PF_INET = 2 +PF_IMPLINK = 3 +PF_PUP = 4 +PF_CHAOS = 5 +PF_NS = 6 +PF_ISO = 7 +PF_OSI = PF_ISO +PF_ECMA = 8 +PF_DATAKIT = 9 +PF_CCITT = 10 +PF_SNA = 11 +PF_DECnet = 12 +PF_DLI = 13 +PF_LAT = 14 +PF_HYLINK = 15 +PF_APPLETALK = 16 +PF_ROUTE = 17 +PF_LINK = 18 +PF_XTP = 19 +PF_COIP = 20 +PF_CNT = 21 +PF_RTIP = 22 +PF_IPX = 23 +PF_SIP = 24 +PF_PIP = 25 +PF_ISDN = 26 +PF_KEY = 27 +PF_INET6 = 28 +PF_NATM = 29 +PF_ATM = 30 +PF_HDRCMPLT = 31 +PF_NETGRAPH = 32 +PF_MAX = 33 +AF_UNSPEC = PF_UNSPEC +AF_LOCAL = PF_LOCAL +AF_UNIX = PF_UNIX +AF_FILE = PF_FILE +AF_INET = PF_INET +AF_IMPLINK = PF_IMPLINK +AF_PUP = PF_PUP +AF_CHAOS = PF_CHAOS +AF_NS = PF_NS +AF_ISO = PF_ISO +AF_OSI = PF_OSI +AF_ECMA = PF_ECMA +AF_DATAKIT = PF_DATAKIT +AF_CCITT = PF_CCITT +AF_SNA = PF_SNA +AF_DECnet = PF_DECnet +AF_DLI = PF_DLI +AF_LAT = PF_LAT +AF_HYLINK = PF_HYLINK +AF_APPLETALK = PF_APPLETALK +AF_ROUTE = PF_ROUTE +AF_LINK = PF_LINK +pseudo_AF_XTP = PF_XTP +AF_COIP = PF_COIP +AF_CNT = PF_CNT +pseudo_AF_RTIP = PF_RTIP +AF_IPX = PF_IPX +AF_SIP = PF_SIP +pseudo_AF_PIP = PF_PIP +AF_ISDN = PF_ISDN +AF_E164 = AF_ISDN +pseudo_AF_KEY = PF_KEY +AF_INET6 = PF_INET6 +AF_NATM = PF_NATM +AF_ATM = PF_ATM +pseudo_AF_HDRCMPLT = PF_HDRCMPLT +AF_NETGRAPH = PF_NETGRAPH +AF_MAX = PF_MAX +SOMAXCONN = 128 + +# Included from bits/sockaddr.h +_BITS_SOCKADDR_H = 1 +def __SOCKADDR_COMMON(sa_prefix): return \ + +_HAVE_SA_LEN = 1 +_SS_SIZE = 128 +def CMSG_FIRSTHDR(mhdr): return \ + +CMGROUP_MAX = 16 +SOL_SOCKET = 0xffff +LOCAL_PEERCRED = 0x001 +LOCAL_CREDS = 0x002 +LOCAL_CONNWAIT = 0x004 + +# Included from bits/socket2.h +def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) + +IN_CLASSA_NET = (-16777216) +IN_CLASSA_NSHIFT = 24 +IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) +IN_CLASSA_MAX = 128 +def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) + +IN_CLASSB_NET = (-65536) +IN_CLASSB_NSHIFT = 16 +IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) +IN_CLASSB_MAX = 65536 +def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) + +IN_CLASSC_NET = (-256) +IN_CLASSC_NSHIFT = 8 +IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) +def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) + +def IN_MULTICAST(a): return IN_CLASSD(a) + +def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) + +def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) + +IN_LOOPBACKNET = 127 +INET_ADDRSTRLEN = 16 +INET6_ADDRSTRLEN = 46 + +# Included from bits/in.h +IMPLINK_IP = 155 +IMPLINK_LOWEXPER = 156 +IMPLINK_HIGHEXPER = 158 +IPPROTO_DIVERT = 258 +SOL_IP = 0 +IP_OPTIONS = 1 +IP_HDRINCL = 2 +IP_TOS = 3 +IP_TTL = 4 +IP_RECVOPTS = 5 +IP_RECVRETOPTS = 6 +IP_RECVDSTADDR = 7 +IP_SENDSRCADDR = IP_RECVDSTADDR +IP_RETOPTS = 8 +IP_MULTICAST_IF = 9 +IP_MULTICAST_TTL = 10 +IP_MULTICAST_LOOP = 11 +IP_ADD_MEMBERSHIP = 12 +IP_DROP_MEMBERSHIP = 13 +IP_MULTICAST_VIF = 14 +IP_RSVP_ON = 15 +IP_RSVP_OFF = 16 +IP_RSVP_VIF_ON = 17 +IP_RSVP_VIF_OFF = 18 +IP_PORTRANGE = 19 +IP_RECVIF = 20 +IP_IPSEC_POLICY = 21 +IP_FAITH = 22 +IP_ONESBCAST = 23 +IP_NONLOCALOK = 24 +IP_FW_TABLE_ADD = 40 +IP_FW_TABLE_DEL = 41 +IP_FW_TABLE_FLUSH = 42 +IP_FW_TABLE_GETSIZE = 43 +IP_FW_TABLE_LIST = 44 +IP_FW_ADD = 50 +IP_FW_DEL = 51 +IP_FW_FLUSH = 52 +IP_FW_ZERO = 53 +IP_FW_GET = 54 +IP_FW_RESETLOG = 55 +IP_FW_NAT_CFG = 56 +IP_FW_NAT_DEL = 57 +IP_FW_NAT_GET_CONFIG = 58 +IP_FW_NAT_GET_LOG = 59 +IP_DUMMYNET_CONFIGURE = 60 +IP_DUMMYNET_DEL = 61 +IP_DUMMYNET_FLUSH = 62 +IP_DUMMYNET_GET = 64 +IP_RECVTTL = 65 +IP_MINTTL = 66 +IP_DONTFRAG = 67 +IP_ADD_SOURCE_MEMBERSHIP = 70 +IP_DROP_SOURCE_MEMBERSHIP = 71 +IP_BLOCK_SOURCE = 72 +IP_UNBLOCK_SOURCE = 73 +IP_MSFILTER = 74 +MCAST_JOIN_GROUP = 80 +MCAST_LEAVE_GROUP = 81 +MCAST_JOIN_SOURCE_GROUP = 82 +MCAST_LEAVE_SOURCE_GROUP = 83 +MCAST_BLOCK_SOURCE = 84 +MCAST_UNBLOCK_SOURCE = 85 +IP_DEFAULT_MULTICAST_TTL = 1 +IP_DEFAULT_MULTICAST_LOOP = 1 +IP_MIN_MEMBERSHIPS = 31 +IP_MAX_MEMBERSHIPS = 4095 +IP_MAX_SOURCE_FILTER = 1024 +MCAST_UNDEFINED = 0 +MCAST_INCLUDE = 1 +MCAST_EXCLUDE = 2 +IP_PORTRANGE_DEFAULT = 0 +IP_PORTRANGE_HIGH = 1 +IP_PORTRANGE_LOW = 2 +IPCTL_FORWARDING = 1 +IPCTL_SENDREDIRECTS = 2 +IPCTL_DEFTTL = 3 +IPCTL_DEFMTU = 4 +IPCTL_RTEXPIRE = 5 +IPCTL_RTMINEXPIRE = 6 +IPCTL_RTMAXCACHE = 7 +IPCTL_SOURCEROUTE = 8 +IPCTL_DIRECTEDBROADCAST = 9 +IPCTL_INTRQMAXLEN = 10 +IPCTL_INTRQDROPS = 11 +IPCTL_STATS = 12 +IPCTL_ACCEPTSOURCEROUTE = 13 +IPCTL_FASTFORWARDING = 14 +IPCTL_KEEPFAITH = 15 +IPCTL_GIF_TTL = 16 +IPCTL_MAXID = 17 +IPV6_SOCKOPT_RESERVED1 = 3 +IPV6_UNICAST_HOPS = 4 +IPV6_MULTICAST_IF = 9 +IPV6_MULTICAST_HOPS = 10 +IPV6_MULTICAST_LOOP = 11 +IPV6_JOIN_GROUP = 12 +IPV6_LEAVE_GROUP = 13 +IPV6_PORTRANGE = 14 +ICMP6_FILTER = 18 +IPV6_CHECKSUM = 26 +IPV6_V6ONLY = 27 +IPV6_IPSEC_POLICY = 28 +IPV6_FAITH = 29 +IPV6_FW_ADD = 30 +IPV6_FW_DEL = 31 +IPV6_FW_FLUSH = 32 +IPV6_FW_ZERO = 33 +IPV6_FW_GET = 34 +IPV6_RTHDRDSTOPTS = 35 +IPV6_RECVPKTINFO = 36 +IPV6_RECVHOPLIMIT = 37 +IPV6_RECVRTHDR = 38 +IPV6_RECVHOPOPTS = 39 +IPV6_RECVDSTOPTS = 40 +IPV6_USE_MIN_MTU = 42 +IPV6_RECVPATHMTU = 43 +IPV6_PATHMTU = 44 +IPV6_PKTINFO = 46 +IPV6_HOPLIMIT = 47 +IPV6_NEXTHOP = 48 +IPV6_HOPOPTS = 49 +IPV6_DSTOPTS = 50 +IPV6_RTHDR = 51 +IPV6_RECVTCLASS = 57 +IPV6_AUTOFLOWLABEL = 59 +IPV6_TCLASS = 61 +IPV6_DONTFRAG = 62 +IPV6_PREFER_TEMPADDR = 63 +IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP +IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP +IPV6_RXHOPOPTS = IPV6_HOPOPTS +IPV6_RXDSTOPTS = IPV6_DSTOPTS +SOL_IPV6 = 41 +SOL_ICMPV6 = 58 +IPV6_DEFAULT_MULTICAST_HOPS = 1 +IPV6_DEFAULT_MULTICAST_LOOP = 1 +IPV6_PORTRANGE_DEFAULT = 0 +IPV6_PORTRANGE_HIGH = 1 +IPV6_PORTRANGE_LOW = 2 +IPV6_RTHDR_LOOSE = 0 +IPV6_RTHDR_STRICT = 1 +IPV6_RTHDR_TYPE_0 = 0 +IPV6CTL_FORWARDING = 1 +IPV6CTL_SENDREDIRECTS = 2 +IPV6CTL_DEFHLIM = 3 +IPV6CTL_FORWSRCRT = 5 +IPV6CTL_STATS = 6 +IPV6CTL_MRTSTATS = 7 +IPV6CTL_MRTPROTO = 8 +IPV6CTL_MAXFRAGPACKETS = 9 +IPV6CTL_SOURCECHECK = 10 +IPV6CTL_SOURCECHECK_LOGINT = 11 +IPV6CTL_ACCEPT_RTADV = 12 +IPV6CTL_KEEPFAITH = 13 +IPV6CTL_LOG_INTERVAL = 14 +IPV6CTL_HDRNESTLIMIT = 15 +IPV6CTL_DAD_COUNT = 16 +IPV6CTL_AUTO_FLOWLABEL = 17 +IPV6CTL_DEFMCASTHLIM = 18 +IPV6CTL_GIF_HLIM = 19 +IPV6CTL_KAME_VERSION = 20 +IPV6CTL_USE_DEPRECATED = 21 +IPV6CTL_RR_PRUNE = 22 +IPV6CTL_V6ONLY = 24 +IPV6CTL_RTEXPIRE = 25 +IPV6CTL_RTMINEXPIRE = 26 +IPV6CTL_RTMAXCACHE = 27 +IPV6CTL_USETEMPADDR = 32 +IPV6CTL_TEMPPLTIME = 33 +IPV6CTL_TEMPVLTIME = 34 +IPV6CTL_AUTO_LINKLOCAL = 35 +IPV6CTL_RIP6STATS = 36 +IPV6CTL_PREFER_TEMPADDR = 37 +IPV6CTL_ADDRCTLPOLICY = 38 +IPV6CTL_USE_DEFAULTZONE = 39 +IPV6CTL_MAXFRAGS = 41 +IPV6CTL_MCAST_PMTU = 44 +IPV6CTL_STEALTH = 45 +ICMPV6CTL_ND6_ONLINKNSRFC4861 = 47 +IPV6CTL_MAXID = 48 + +# Included from endian.h +_ENDIAN_H = 1 +__LITTLE_ENDIAN = 1234 +__BIG_ENDIAN = 4321 +__PDP_ENDIAN = 3412 + +# Included from bits/endian.h +__BYTE_ORDER = __LITTLE_ENDIAN +__FLOAT_WORD_ORDER = __BYTE_ORDER +LITTLE_ENDIAN = __LITTLE_ENDIAN +BIG_ENDIAN = __BIG_ENDIAN +PDP_ENDIAN = __PDP_ENDIAN +BYTE_ORDER = __BYTE_ORDER + +# Included from bits/byteswap.h +_BITS_BYTESWAP_H = 1 +def __bswap_constant_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_constant_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_constant_64(x): return \ + +def __bswap_64(x): return \ + +def htobe16(x): return __bswap_16 (x) + +def htole16(x): return (x) + +def be16toh(x): return __bswap_16 (x) + +def le16toh(x): return (x) + +def htobe32(x): return __bswap_32 (x) + +def htole32(x): return (x) + +def be32toh(x): return __bswap_32 (x) + +def le32toh(x): return (x) + +def htobe64(x): return __bswap_64 (x) + +def htole64(x): return (x) + +def be64toh(x): return __bswap_64 (x) + +def le64toh(x): return (x) + +def htobe16(x): return (x) + +def htole16(x): return __bswap_16 (x) + +def be16toh(x): return (x) + +def le16toh(x): return __bswap_16 (x) + +def htobe32(x): return (x) + +def htole32(x): return __bswap_32 (x) + +def be32toh(x): return (x) + +def le32toh(x): return __bswap_32 (x) + +def htobe64(x): return (x) + +def htole64(x): return __bswap_64 (x) + +def be64toh(x): return (x) + +def le64toh(x): return __bswap_64 (x) + +def ntohl(x): return (x) + +def ntohs(x): return (x) + +def htonl(x): return (x) + +def htons(x): return (x) + +def ntohl(x): return __bswap_32 (x) + +def ntohs(x): return __bswap_16 (x) + +def htonl(x): return __bswap_32 (x) + +def htons(x): return __bswap_16 (x) + +def IN6_IS_ADDR_UNSPECIFIED(a): return \ + +def IN6_IS_ADDR_LOOPBACK(a): return \ + +def IN6_IS_ADDR_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_SITELOCAL(a): return \ + +def IN6_IS_ADDR_V4MAPPED(a): return \ + +def IN6_IS_ADDR_V4COMPAT(a): return \ + +def IN6_IS_ADDR_MC_NODELOCAL(a): return \ + +def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_MC_SITELOCAL(a): return \ + +def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ + +def IN6_IS_ADDR_MC_GLOBAL(a): return \ + --- /dev/null +++ b/lib-python/2.7/plat-gnukfreebsd7/TYPES.py @@ -0,0 +1,303 @@ +# Generated by h2py from /usr/include/sys/types.h +_SYS_TYPES_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 200809L +_XOPEN_SOURCE = 700 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_ATFILE_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +__USE_ISOC95 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 200112L +_POSIX_C_SOURCE = 200809L +__USE_POSIX_IMPLICITLY = 1 +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN2K8 = 1 +_ATFILE_SOURCE = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K8 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_ATFILE = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__USE_FORTIFY_LEVEL = 2 +__USE_FORTIFY_LEVEL = 1 +__USE_FORTIFY_LEVEL = 0 + +# Included from bits/predefs.h +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 11 +__GLIBC_HAVE_LONG_LONG = 1 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __NTH(fct): return fct + +def __NTH(fct): return fct + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) + +def __bos0(ptr): return __builtin_object_size (ptr, 0) + +def __warnattr(msg): return __attribute__((__warning__ (msg))) + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + + +# Included from bits/wordsize.h +__WORDSIZE = 32 +__LDBL_COMPAT = 1 +def __LDBL_REDIR_DECL(name): return \ + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 +__USE_EXTERN_INLINES_IN_LIBC = 1 + +# Included from gnu/stubs.h + +# Included from bits/types.h +_BITS_TYPES_H = 1 +__S32_TYPE = int +__SWORD_TYPE = int +__SLONG32_TYPE = int + +# Included from bits/typesizes.h +_BITS_TYPESIZES_H = 1 +__PID_T_TYPE = __S32_TYPE +__CLOCK_T_TYPE = __S32_TYPE +__SWBLK_T_TYPE = __S32_TYPE +__CLOCKID_T_TYPE = __S32_TYPE +__TIMER_T_TYPE = __S32_TYPE +__SSIZE_T_TYPE = __SWORD_TYPE +__FD_SETSIZE = 1024 + +# Included from time.h +_TIME_H = 1 + +# Included from bits/time.h +_BITS_TIME_H = 1 +CLOCKS_PER_SEC = 1000000l +CLK_TCK = 128 +CLOCK_REALTIME = 0 +CLOCK_PROCESS_CPUTIME_ID = 2 +CLOCK_THREAD_CPUTIME_ID = 3 +CLOCK_MONOTONIC = 4 +CLOCK_VIRTUAL = 1 +CLOCK_PROF = 2 +CLOCK_UPTIME = 5 +CLOCK_UPTIME_PRECISE = 7 +CLOCK_UPTIME_FAST = 8 +CLOCK_REALTIME_PRECISE = 9 +CLOCK_REALTIME_FAST = 10 +CLOCK_MONOTONIC_PRECISE = 11 +CLOCK_MONOTONIC_FAST = 12 +CLOCK_SECOND = 13 +TIMER_RELTIME = 0 +TIMER_ABSTIME = 1 +_STRUCT_TIMEVAL = 1 +CLK_TCK = CLOCKS_PER_SEC +__clock_t_defined = 1 +__time_t_defined = 1 +__clockid_t_defined = 1 +__timer_t_defined = 1 +__timespec_defined = 1 + +# Included from xlocale.h +_XLOCALE_H = 1 +def __isleap(year): return \ + +__BIT_TYPES_DEFINED__ = 1 + +# Included from endian.h +_ENDIAN_H = 1 +__LITTLE_ENDIAN = 1234 +__BIG_ENDIAN = 4321 +__PDP_ENDIAN = 3412 + +# Included from bits/endian.h +__BYTE_ORDER = __LITTLE_ENDIAN +__FLOAT_WORD_ORDER = __BYTE_ORDER +LITTLE_ENDIAN = __LITTLE_ENDIAN +BIG_ENDIAN = __BIG_ENDIAN +PDP_ENDIAN = __PDP_ENDIAN +BYTE_ORDER = __BYTE_ORDER + +# Included from bits/byteswap.h +_BITS_BYTESWAP_H = 1 +def __bswap_constant_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_constant_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_constant_64(x): return \ + +def __bswap_64(x): return \ + +def htobe16(x): return __bswap_16 (x) + +def htole16(x): return (x) + +def be16toh(x): return __bswap_16 (x) + +def le16toh(x): return (x) + +def htobe32(x): return __bswap_32 (x) + +def htole32(x): return (x) + +def be32toh(x): return __bswap_32 (x) + +def le32toh(x): return (x) + +def htobe64(x): return __bswap_64 (x) + +def htole64(x): return (x) + +def be64toh(x): return __bswap_64 (x) + +def le64toh(x): return (x) + +def htobe16(x): return (x) + +def htole16(x): return __bswap_16 (x) + +def be16toh(x): return (x) + +def le16toh(x): return __bswap_16 (x) + +def htobe32(x): return (x) + +def htole32(x): return __bswap_32 (x) + +def be32toh(x): return (x) + +def le32toh(x): return __bswap_32 (x) + +def htobe64(x): return (x) + +def htole64(x): return __bswap_64 (x) + +def be64toh(x): return (x) + +def le64toh(x): return __bswap_64 (x) + + +# Included from sys/select.h +_SYS_SELECT_H = 1 + +# Included from bits/select.h +def __FD_ZERO(fdsp): return \ + +def __FD_ZERO(set): return \ + + +# Included from bits/sigset.h +_SIGSET_H_types = 1 +_SIGSET_H_fns = 1 +def __sigword(sig): return (((sig) - 1) >> 5) + +def __sigemptyset(set): return \ + +def __sigfillset(set): return \ + +def __sigisemptyset(set): return \ + +def __FDELT(d): return ((d) / __NFDBITS) + +FD_SETSIZE = __FD_SETSIZE +def FD_ZERO(fdsetp): return __FD_ZERO (fdsetp) + + +# Included from sys/sysmacros.h +_SYS_SYSMACROS_H = 1 +def minor(dev): return ((int)((dev) & (-65281))) + +def gnu_dev_major(dev): return major (dev) + +def gnu_dev_minor(dev): return minor (dev) + + +# Included from bits/pthreadtypes.h +_BITS_PTHREADTYPES_H = 1 + +# Included from bits/sched.h +SCHED_OTHER = 2 +SCHED_FIFO = 1 +SCHED_RR = 3 +CSIGNAL = 0x000000ff +CLONE_VM = 0x00000100 +CLONE_FS = 0x00000200 +CLONE_FILES = 0x00000400 +CLONE_SIGHAND = 0x00000800 +CLONE_PTRACE = 0x00002000 +CLONE_VFORK = 0x00004000 +CLONE_SYSVSEM = 0x00040000 +__defined_schedparam = 1 +__CPU_SETSIZE = 128 +def __CPUELT(cpu): return ((cpu) / __NCPUBITS) + +def __CPU_ALLOC_SIZE(count): return \ + +def __CPU_ALLOC(count): return __sched_cpualloc (count) + +def __CPU_FREE(cpuset): return __sched_cpufree (cpuset) + --- /dev/null +++ b/lib-python/2.7/plat-gnukfreebsd7/DLFCN.py @@ -0,0 +1,118 @@ +# Generated by h2py from /usr/include/dlfcn.h +_DLFCN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 200809L +_XOPEN_SOURCE = 700 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_ATFILE_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +__USE_ISOC95 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 200112L +_POSIX_C_SOURCE = 200809L +__USE_POSIX_IMPLICITLY = 1 +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN2K8 = 1 +_ATFILE_SOURCE = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K8 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_ATFILE = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__USE_FORTIFY_LEVEL = 2 +__USE_FORTIFY_LEVEL = 1 +__USE_FORTIFY_LEVEL = 0 + +# Included from bits/predefs.h +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 11 +__GLIBC_HAVE_LONG_LONG = 1 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __NTH(fct): return fct + +def __NTH(fct): return fct + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) + +def __bos0(ptr): return __builtin_object_size (ptr, 0) + +def __warnattr(msg): return __attribute__((__warning__ (msg))) + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + + +# Included from bits/wordsize.h +__WORDSIZE = 32 +__LDBL_COMPAT = 1 +def __LDBL_REDIR_DECL(name): return \ + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 +__USE_EXTERN_INLINES_IN_LIBC = 1 + +# Included from gnu/stubs.h + +# Included from bits/dlfcn.h +RTLD_LAZY = 0x00001 +RTLD_NOW = 0x00002 +RTLD_BINDING_MASK = 0x3 +RTLD_NOLOAD = 0x00004 +RTLD_DEEPBIND = 0x00008 +RTLD_GLOBAL = 0x00100 +RTLD_LOCAL = 0 +RTLD_NODELETE = 0x01000 +LM_ID_BASE = 0 +LM_ID_NEWLM = -1 --- /dev/null +++ b/lib-python/2.7/plat-gnukfreebsd8/IN.py @@ -0,0 +1,809 @@ +# Generated by h2py from /usr/include/netinet/in.h +_NETINET_IN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 200809L +_XOPEN_SOURCE = 700 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_ATFILE_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +__USE_ISOC95 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 200112L +_POSIX_C_SOURCE = 200809L +__USE_POSIX_IMPLICITLY = 1 +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN2K8 = 1 +_ATFILE_SOURCE = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K8 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_ATFILE = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__USE_FORTIFY_LEVEL = 2 +__USE_FORTIFY_LEVEL = 1 +__USE_FORTIFY_LEVEL = 0 + +# Included from bits/predefs.h +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 11 +__GLIBC_HAVE_LONG_LONG = 1 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __NTH(fct): return fct + +def __NTH(fct): return fct + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) + +def __bos0(ptr): return __builtin_object_size (ptr, 0) + +def __warnattr(msg): return __attribute__((__warning__ (msg))) + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + + +# Included from bits/wordsize.h +__WORDSIZE = 32 +__LDBL_COMPAT = 1 +def __LDBL_REDIR_DECL(name): return \ + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 +__USE_EXTERN_INLINES_IN_LIBC = 1 + +# Included from gnu/stubs.h + +# Included from stdint.h +_STDINT_H = 1 + +# Included from bits/wchar.h +_BITS_WCHAR_H = 1 +__WCHAR_MAX = (2147483647) +__WCHAR_MIN = (-__WCHAR_MAX - 1) +def __INT64_C(c): return c ## L + +def __UINT64_C(c): return c ## UL + +def __INT64_C(c): return c ## LL + +def __UINT64_C(c): return c ## ULL + +INT8_MIN = (-128) +INT16_MIN = (-32767-1) +INT32_MIN = (-2147483647-1) +INT64_MIN = (-__INT64_C(9223372036854775807)-1) +INT8_MAX = (127) +INT16_MAX = (32767) +INT32_MAX = (2147483647) +INT64_MAX = (__INT64_C(9223372036854775807)) +UINT8_MAX = (255) +UINT16_MAX = (65535) +UINT64_MAX = (__UINT64_C(18446744073709551615)) +INT_LEAST8_MIN = (-128) +INT_LEAST16_MIN = (-32767-1) +INT_LEAST32_MIN = (-2147483647-1) +INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_LEAST8_MAX = (127) +INT_LEAST16_MAX = (32767) +INT_LEAST32_MAX = (2147483647) +INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_LEAST8_MAX = (255) +UINT_LEAST16_MAX = (65535) +UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) +INT_FAST8_MIN = (-128) +INT_FAST16_MIN = (-9223372036854775807L-1) +INT_FAST32_MIN = (-9223372036854775807L-1) +INT_FAST16_MIN = (-2147483647-1) +INT_FAST32_MIN = (-2147483647-1) +INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_FAST8_MAX = (127) +INT_FAST16_MAX = (9223372036854775807L) +INT_FAST32_MAX = (9223372036854775807L) +INT_FAST16_MAX = (2147483647) +INT_FAST32_MAX = (2147483647) +INT_FAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_FAST8_MAX = (255) +UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) +INTPTR_MIN = (-9223372036854775807L-1) +INTPTR_MAX = (9223372036854775807L) +INTPTR_MIN = (-2147483647-1) +INTPTR_MAX = (2147483647) +INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) +INTMAX_MAX = (__INT64_C(9223372036854775807)) +UINTMAX_MAX = (__UINT64_C(18446744073709551615)) +PTRDIFF_MIN = (-9223372036854775807L-1) +PTRDIFF_MAX = (9223372036854775807L) +PTRDIFF_MIN = (-2147483647-1) +PTRDIFF_MAX = (2147483647) +SIG_ATOMIC_MIN = (-2147483647-1) +SIG_ATOMIC_MAX = (2147483647) +WCHAR_MIN = __WCHAR_MIN +WCHAR_MAX = __WCHAR_MAX +def INT8_C(c): return c + +def INT16_C(c): return c + +def INT32_C(c): return c + +def INT64_C(c): return c ## L + +def INT64_C(c): return c ## LL + +def UINT8_C(c): return c + +def UINT16_C(c): return c + +def UINT32_C(c): return c ## U + +def UINT64_C(c): return c ## UL + +def UINT64_C(c): return c ## ULL + +def INTMAX_C(c): return c ## L + +def UINTMAX_C(c): return c ## UL + +def INTMAX_C(c): return c ## LL + +def UINTMAX_C(c): return c ## ULL + + +# Included from sys/socket.h +_SYS_SOCKET_H = 1 + +# Included from sys/uio.h +_SYS_UIO_H = 1 +from TYPES import * + +# Included from bits/uio.h +_BITS_UIO_H = 1 +from TYPES import * +UIO_MAXIOV = 1024 + +# Included from bits/sigset.h +_SIGSET_H_types = 1 +_SIGSET_H_fns = 1 +def __sigword(sig): return (((sig) - 1) >> 5) + +def __sigemptyset(set): return \ + +def __sigfillset(set): return \ + +def __sigisemptyset(set): return \ + + +# Included from bits/socket.h +__BITS_SOCKET_H = 1 + +# Included from limits.h +_LIBC_LIMITS_H_ = 1 +MB_LEN_MAX = 16 +_LIMITS_H = 1 +CHAR_BIT = 8 +SCHAR_MIN = (-128) +SCHAR_MAX = 127 +UCHAR_MAX = 255 +CHAR_MIN = 0 +CHAR_MAX = UCHAR_MAX +CHAR_MIN = SCHAR_MIN +CHAR_MAX = SCHAR_MAX +SHRT_MIN = (-32768) +SHRT_MAX = 32767 +USHRT_MAX = 65535 +INT_MAX = 2147483647 +LONG_MAX = 9223372036854775807L +LONG_MAX = 2147483647L +LONG_MIN = (-LONG_MAX - 1L) + +# Included from bits/posix1_lim.h +_BITS_POSIX1_LIM_H = 1 +_POSIX_AIO_LISTIO_MAX = 2 +_POSIX_AIO_MAX = 1 +_POSIX_ARG_MAX = 4096 +_POSIX_CHILD_MAX = 25 +_POSIX_CHILD_MAX = 6 +_POSIX_DELAYTIMER_MAX = 32 +_POSIX_HOST_NAME_MAX = 255 +_POSIX_LINK_MAX = 8 +_POSIX_LOGIN_NAME_MAX = 9 +_POSIX_MAX_CANON = 255 +_POSIX_MAX_INPUT = 255 +_POSIX_MQ_OPEN_MAX = 8 +_POSIX_MQ_PRIO_MAX = 32 +_POSIX_NAME_MAX = 14 +_POSIX_NGROUPS_MAX = 8 +_POSIX_NGROUPS_MAX = 0 +_POSIX_OPEN_MAX = 20 +_POSIX_OPEN_MAX = 16 +_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX +_POSIX_PATH_MAX = 256 +_POSIX_PIPE_BUF = 512 +_POSIX_RE_DUP_MAX = 255 +_POSIX_RTSIG_MAX = 8 +_POSIX_SEM_NSEMS_MAX = 256 +_POSIX_SEM_VALUE_MAX = 32767 +_POSIX_SIGQUEUE_MAX = 32 +_POSIX_SSIZE_MAX = 32767 +_POSIX_STREAM_MAX = 8 +_POSIX_SYMLINK_MAX = 255 +_POSIX_SYMLOOP_MAX = 8 +_POSIX_TIMER_MAX = 32 +_POSIX_TTY_NAME_MAX = 9 +_POSIX_TZNAME_MAX = 6 +_POSIX_QLIMIT = 1 +_POSIX_HIWAT = _POSIX_PIPE_BUF +_POSIX_UIO_MAXIOV = 16 +_POSIX_CLOCKRES_MIN = 20000000 + +# Included from bits/local_lim.h + +# Included from sys/syslimits.h +ARG_MAX = 262144 +CHILD_MAX = 40 +LINK_MAX = 32767 +MAX_CANON = 255 +MAX_INPUT = 255 +NAME_MAX = 255 +NGROUPS_MAX = 1023 +OPEN_MAX = 64 +PATH_MAX = 1024 +PIPE_BUF = 512 +IOV_MAX = 1024 +_POSIX_THREAD_KEYS_MAX = 128 +PTHREAD_KEYS_MAX = 1024 +_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 +PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS +_POSIX_THREAD_THREADS_MAX = 64 +PTHREAD_THREADS_MAX = 1024 +AIO_PRIO_DELTA_MAX = 20 +PTHREAD_STACK_MIN = 16384 +TIMER_MAX = 256 +DELAYTIMER_MAX = 2147483647 +SSIZE_MAX = LONG_MAX +NGROUPS_MAX = 8 + +# Included from bits/posix2_lim.h +_BITS_POSIX2_LIM_H = 1 +_POSIX2_BC_BASE_MAX = 99 +_POSIX2_BC_DIM_MAX = 2048 +_POSIX2_BC_SCALE_MAX = 99 +_POSIX2_BC_STRING_MAX = 1000 +_POSIX2_COLL_WEIGHTS_MAX = 2 +_POSIX2_EXPR_NEST_MAX = 32 +_POSIX2_LINE_MAX = 2048 +_POSIX2_RE_DUP_MAX = 255 +_POSIX2_CHARCLASS_NAME_MAX = 14 +BC_BASE_MAX = _POSIX2_BC_BASE_MAX +BC_DIM_MAX = _POSIX2_BC_DIM_MAX +BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX +BC_STRING_MAX = _POSIX2_BC_STRING_MAX +COLL_WEIGHTS_MAX = 255 +EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX +LINE_MAX = _POSIX2_LINE_MAX +CHARCLASS_NAME_MAX = 2048 +RE_DUP_MAX = (0x7fff) + +# Included from bits/xopen_lim.h +_XOPEN_LIM_H = 1 + +# Included from bits/stdio_lim.h +L_tmpnam = 20 +TMP_MAX = 238328 +FILENAME_MAX = 1024 +L_ctermid = 9 +L_cuserid = 9 +FOPEN_MAX = 64 +IOV_MAX = 1024 +_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV +NL_ARGMAX = _POSIX_ARG_MAX +NL_LANGMAX = _POSIX2_LINE_MAX +NL_MSGMAX = INT_MAX +NL_NMAX = INT_MAX +NL_SETMAX = INT_MAX +NL_TEXTMAX = INT_MAX +NZERO = 20 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 32 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 64 +LONG_BIT = 32 + +# Included from bits/types.h +_BITS_TYPES_H = 1 +__S32_TYPE = int +__SWORD_TYPE = int +__SLONG32_TYPE = int + +# Included from bits/typesizes.h +_BITS_TYPESIZES_H = 1 +__PID_T_TYPE = __S32_TYPE +__CLOCK_T_TYPE = __S32_TYPE +__SWBLK_T_TYPE = __S32_TYPE +__CLOCKID_T_TYPE = __S32_TYPE +__TIMER_T_TYPE = __S32_TYPE +__SSIZE_T_TYPE = __SWORD_TYPE +__FD_SETSIZE = 1024 +PF_UNSPEC = 0 +PF_LOCAL = 1 +PF_UNIX = PF_LOCAL +PF_FILE = PF_LOCAL +PF_INET = 2 +PF_IMPLINK = 3 +PF_PUP = 4 +PF_CHAOS = 5 +PF_NS = 6 +PF_ISO = 7 +PF_OSI = PF_ISO +PF_ECMA = 8 +PF_DATAKIT = 9 +PF_CCITT = 10 +PF_SNA = 11 +PF_DECnet = 12 +PF_DLI = 13 +PF_LAT = 14 +PF_HYLINK = 15 +PF_APPLETALK = 16 +PF_ROUTE = 17 +PF_LINK = 18 +PF_XTP = 19 +PF_COIP = 20 +PF_CNT = 21 +PF_RTIP = 22 +PF_IPX = 23 +PF_SIP = 24 +PF_PIP = 25 +PF_ISDN = 26 +PF_KEY = 27 +PF_INET6 = 28 +PF_NATM = 29 +PF_ATM = 30 +PF_HDRCMPLT = 31 +PF_NETGRAPH = 32 +PF_MAX = 33 +AF_UNSPEC = PF_UNSPEC +AF_LOCAL = PF_LOCAL +AF_UNIX = PF_UNIX +AF_FILE = PF_FILE +AF_INET = PF_INET +AF_IMPLINK = PF_IMPLINK +AF_PUP = PF_PUP +AF_CHAOS = PF_CHAOS +AF_NS = PF_NS +AF_ISO = PF_ISO +AF_OSI = PF_OSI +AF_ECMA = PF_ECMA +AF_DATAKIT = PF_DATAKIT +AF_CCITT = PF_CCITT +AF_SNA = PF_SNA +AF_DECnet = PF_DECnet +AF_DLI = PF_DLI +AF_LAT = PF_LAT +AF_HYLINK = PF_HYLINK +AF_APPLETALK = PF_APPLETALK +AF_ROUTE = PF_ROUTE +AF_LINK = PF_LINK +pseudo_AF_XTP = PF_XTP +AF_COIP = PF_COIP +AF_CNT = PF_CNT +pseudo_AF_RTIP = PF_RTIP +AF_IPX = PF_IPX +AF_SIP = PF_SIP +pseudo_AF_PIP = PF_PIP +AF_ISDN = PF_ISDN +AF_E164 = AF_ISDN +pseudo_AF_KEY = PF_KEY +AF_INET6 = PF_INET6 +AF_NATM = PF_NATM +AF_ATM = PF_ATM +pseudo_AF_HDRCMPLT = PF_HDRCMPLT +AF_NETGRAPH = PF_NETGRAPH +AF_MAX = PF_MAX +SOMAXCONN = 128 + +# Included from bits/sockaddr.h +_BITS_SOCKADDR_H = 1 +def __SOCKADDR_COMMON(sa_prefix): return \ + +_HAVE_SA_LEN = 1 +_SS_SIZE = 128 +def CMSG_FIRSTHDR(mhdr): return \ + +CMGROUP_MAX = 16 +SOL_SOCKET = 0xffff +LOCAL_PEERCRED = 0x001 +LOCAL_CREDS = 0x002 +LOCAL_CONNWAIT = 0x004 + +# Included from bits/socket2.h +def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) + +IN_CLASSA_NET = (-16777216) +IN_CLASSA_NSHIFT = 24 +IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) +IN_CLASSA_MAX = 128 +def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) + +IN_CLASSB_NET = (-65536) +IN_CLASSB_NSHIFT = 16 +IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) +IN_CLASSB_MAX = 65536 +def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) + +IN_CLASSC_NET = (-256) +IN_CLASSC_NSHIFT = 8 +IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) +def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) + +def IN_MULTICAST(a): return IN_CLASSD(a) + +def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) + +def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) + +IN_LOOPBACKNET = 127 +INET_ADDRSTRLEN = 16 +INET6_ADDRSTRLEN = 46 + +# Included from bits/in.h +IMPLINK_IP = 155 +IMPLINK_LOWEXPER = 156 +IMPLINK_HIGHEXPER = 158 +IPPROTO_DIVERT = 258 +SOL_IP = 0 +IP_OPTIONS = 1 +IP_HDRINCL = 2 +IP_TOS = 3 +IP_TTL = 4 +IP_RECVOPTS = 5 +IP_RECVRETOPTS = 6 +IP_RECVDSTADDR = 7 +IP_SENDSRCADDR = IP_RECVDSTADDR +IP_RETOPTS = 8 +IP_MULTICAST_IF = 9 +IP_MULTICAST_TTL = 10 +IP_MULTICAST_LOOP = 11 +IP_ADD_MEMBERSHIP = 12 +IP_DROP_MEMBERSHIP = 13 +IP_MULTICAST_VIF = 14 +IP_RSVP_ON = 15 +IP_RSVP_OFF = 16 +IP_RSVP_VIF_ON = 17 +IP_RSVP_VIF_OFF = 18 +IP_PORTRANGE = 19 +IP_RECVIF = 20 +IP_IPSEC_POLICY = 21 +IP_FAITH = 22 +IP_ONESBCAST = 23 +IP_NONLOCALOK = 24 +IP_FW_TABLE_ADD = 40 +IP_FW_TABLE_DEL = 41 +IP_FW_TABLE_FLUSH = 42 +IP_FW_TABLE_GETSIZE = 43 +IP_FW_TABLE_LIST = 44 +IP_FW_ADD = 50 +IP_FW_DEL = 51 +IP_FW_FLUSH = 52 +IP_FW_ZERO = 53 +IP_FW_GET = 54 +IP_FW_RESETLOG = 55 +IP_FW_NAT_CFG = 56 +IP_FW_NAT_DEL = 57 +IP_FW_NAT_GET_CONFIG = 58 +IP_FW_NAT_GET_LOG = 59 +IP_DUMMYNET_CONFIGURE = 60 +IP_DUMMYNET_DEL = 61 +IP_DUMMYNET_FLUSH = 62 +IP_DUMMYNET_GET = 64 +IP_RECVTTL = 65 +IP_MINTTL = 66 +IP_DONTFRAG = 67 +IP_ADD_SOURCE_MEMBERSHIP = 70 +IP_DROP_SOURCE_MEMBERSHIP = 71 +IP_BLOCK_SOURCE = 72 +IP_UNBLOCK_SOURCE = 73 +IP_MSFILTER = 74 +MCAST_JOIN_GROUP = 80 +MCAST_LEAVE_GROUP = 81 +MCAST_JOIN_SOURCE_GROUP = 82 +MCAST_LEAVE_SOURCE_GROUP = 83 +MCAST_BLOCK_SOURCE = 84 +MCAST_UNBLOCK_SOURCE = 85 +IP_DEFAULT_MULTICAST_TTL = 1 +IP_DEFAULT_MULTICAST_LOOP = 1 +IP_MIN_MEMBERSHIPS = 31 +IP_MAX_MEMBERSHIPS = 4095 +IP_MAX_SOURCE_FILTER = 1024 +MCAST_UNDEFINED = 0 +MCAST_INCLUDE = 1 +MCAST_EXCLUDE = 2 +IP_PORTRANGE_DEFAULT = 0 +IP_PORTRANGE_HIGH = 1 +IP_PORTRANGE_LOW = 2 +IPCTL_FORWARDING = 1 +IPCTL_SENDREDIRECTS = 2 +IPCTL_DEFTTL = 3 +IPCTL_DEFMTU = 4 +IPCTL_RTEXPIRE = 5 +IPCTL_RTMINEXPIRE = 6 +IPCTL_RTMAXCACHE = 7 +IPCTL_SOURCEROUTE = 8 +IPCTL_DIRECTEDBROADCAST = 9 +IPCTL_INTRQMAXLEN = 10 +IPCTL_INTRQDROPS = 11 +IPCTL_STATS = 12 +IPCTL_ACCEPTSOURCEROUTE = 13 +IPCTL_FASTFORWARDING = 14 +IPCTL_KEEPFAITH = 15 +IPCTL_GIF_TTL = 16 +IPCTL_MAXID = 17 +IPV6_SOCKOPT_RESERVED1 = 3 +IPV6_UNICAST_HOPS = 4 +IPV6_MULTICAST_IF = 9 +IPV6_MULTICAST_HOPS = 10 +IPV6_MULTICAST_LOOP = 11 +IPV6_JOIN_GROUP = 12 +IPV6_LEAVE_GROUP = 13 +IPV6_PORTRANGE = 14 +ICMP6_FILTER = 18 +IPV6_CHECKSUM = 26 +IPV6_V6ONLY = 27 +IPV6_IPSEC_POLICY = 28 +IPV6_FAITH = 29 +IPV6_FW_ADD = 30 +IPV6_FW_DEL = 31 +IPV6_FW_FLUSH = 32 +IPV6_FW_ZERO = 33 +IPV6_FW_GET = 34 +IPV6_RTHDRDSTOPTS = 35 +IPV6_RECVPKTINFO = 36 +IPV6_RECVHOPLIMIT = 37 +IPV6_RECVRTHDR = 38 +IPV6_RECVHOPOPTS = 39 +IPV6_RECVDSTOPTS = 40 +IPV6_USE_MIN_MTU = 42 +IPV6_RECVPATHMTU = 43 +IPV6_PATHMTU = 44 +IPV6_PKTINFO = 46 +IPV6_HOPLIMIT = 47 +IPV6_NEXTHOP = 48 +IPV6_HOPOPTS = 49 +IPV6_DSTOPTS = 50 +IPV6_RTHDR = 51 +IPV6_RECVTCLASS = 57 +IPV6_AUTOFLOWLABEL = 59 +IPV6_TCLASS = 61 +IPV6_DONTFRAG = 62 +IPV6_PREFER_TEMPADDR = 63 +IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP +IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP +IPV6_RXHOPOPTS = IPV6_HOPOPTS +IPV6_RXDSTOPTS = IPV6_DSTOPTS +SOL_IPV6 = 41 +SOL_ICMPV6 = 58 +IPV6_DEFAULT_MULTICAST_HOPS = 1 +IPV6_DEFAULT_MULTICAST_LOOP = 1 +IPV6_PORTRANGE_DEFAULT = 0 +IPV6_PORTRANGE_HIGH = 1 +IPV6_PORTRANGE_LOW = 2 +IPV6_RTHDR_LOOSE = 0 +IPV6_RTHDR_STRICT = 1 +IPV6_RTHDR_TYPE_0 = 0 +IPV6CTL_FORWARDING = 1 +IPV6CTL_SENDREDIRECTS = 2 +IPV6CTL_DEFHLIM = 3 +IPV6CTL_FORWSRCRT = 5 +IPV6CTL_STATS = 6 +IPV6CTL_MRTSTATS = 7 +IPV6CTL_MRTPROTO = 8 +IPV6CTL_MAXFRAGPACKETS = 9 +IPV6CTL_SOURCECHECK = 10 +IPV6CTL_SOURCECHECK_LOGINT = 11 +IPV6CTL_ACCEPT_RTADV = 12 +IPV6CTL_KEEPFAITH = 13 +IPV6CTL_LOG_INTERVAL = 14 +IPV6CTL_HDRNESTLIMIT = 15 +IPV6CTL_DAD_COUNT = 16 +IPV6CTL_AUTO_FLOWLABEL = 17 +IPV6CTL_DEFMCASTHLIM = 18 +IPV6CTL_GIF_HLIM = 19 +IPV6CTL_KAME_VERSION = 20 +IPV6CTL_USE_DEPRECATED = 21 +IPV6CTL_RR_PRUNE = 22 +IPV6CTL_V6ONLY = 24 +IPV6CTL_RTEXPIRE = 25 +IPV6CTL_RTMINEXPIRE = 26 +IPV6CTL_RTMAXCACHE = 27 +IPV6CTL_USETEMPADDR = 32 +IPV6CTL_TEMPPLTIME = 33 +IPV6CTL_TEMPVLTIME = 34 +IPV6CTL_AUTO_LINKLOCAL = 35 +IPV6CTL_RIP6STATS = 36 +IPV6CTL_PREFER_TEMPADDR = 37 +IPV6CTL_ADDRCTLPOLICY = 38 +IPV6CTL_USE_DEFAULTZONE = 39 +IPV6CTL_MAXFRAGS = 41 +IPV6CTL_MCAST_PMTU = 44 +IPV6CTL_STEALTH = 45 +ICMPV6CTL_ND6_ONLINKNSRFC4861 = 47 +IPV6CTL_MAXID = 48 + +# Included from endian.h +_ENDIAN_H = 1 +__LITTLE_ENDIAN = 1234 +__BIG_ENDIAN = 4321 +__PDP_ENDIAN = 3412 + +# Included from bits/endian.h +__BYTE_ORDER = __LITTLE_ENDIAN +__FLOAT_WORD_ORDER = __BYTE_ORDER +LITTLE_ENDIAN = __LITTLE_ENDIAN +BIG_ENDIAN = __BIG_ENDIAN +PDP_ENDIAN = __PDP_ENDIAN +BYTE_ORDER = __BYTE_ORDER + +# Included from bits/byteswap.h +_BITS_BYTESWAP_H = 1 +def __bswap_constant_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_constant_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_constant_64(x): return \ + +def __bswap_64(x): return \ + +def htobe16(x): return __bswap_16 (x) + +def htole16(x): return (x) + +def be16toh(x): return __bswap_16 (x) + +def le16toh(x): return (x) + +def htobe32(x): return __bswap_32 (x) + +def htole32(x): return (x) + +def be32toh(x): return __bswap_32 (x) + +def le32toh(x): return (x) + +def htobe64(x): return __bswap_64 (x) + +def htole64(x): return (x) + +def be64toh(x): return __bswap_64 (x) + +def le64toh(x): return (x) + +def htobe16(x): return (x) + +def htole16(x): return __bswap_16 (x) + +def be16toh(x): return (x) + +def le16toh(x): return __bswap_16 (x) + +def htobe32(x): return (x) + +def htole32(x): return __bswap_32 (x) + +def be32toh(x): return (x) + +def le32toh(x): return __bswap_32 (x) + +def htobe64(x): return (x) + +def htole64(x): return __bswap_64 (x) + +def be64toh(x): return (x) + +def le64toh(x): return __bswap_64 (x) + +def ntohl(x): return (x) + +def ntohs(x): return (x) + +def htonl(x): return (x) + +def htons(x): return (x) + +def ntohl(x): return __bswap_32 (x) + +def ntohs(x): return __bswap_16 (x) + +def htonl(x): return __bswap_32 (x) + +def htons(x): return __bswap_16 (x) + +def IN6_IS_ADDR_UNSPECIFIED(a): return \ + +def IN6_IS_ADDR_LOOPBACK(a): return \ + +def IN6_IS_ADDR_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_SITELOCAL(a): return \ + +def IN6_IS_ADDR_V4MAPPED(a): return \ + +def IN6_IS_ADDR_V4COMPAT(a): return \ + +def IN6_IS_ADDR_MC_NODELOCAL(a): return \ + +def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_MC_SITELOCAL(a): return \ + +def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ + +def IN6_IS_ADDR_MC_GLOBAL(a): return \ + --- /dev/null +++ b/lib-python/2.7/plat-gnukfreebsd8/TYPES.py @@ -0,0 +1,303 @@ +# Generated by h2py from /usr/include/sys/types.h +_SYS_TYPES_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 200809L +_XOPEN_SOURCE = 700 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_ATFILE_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +__USE_ISOC95 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 200112L +_POSIX_C_SOURCE = 200809L +__USE_POSIX_IMPLICITLY = 1 +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN2K8 = 1 +_ATFILE_SOURCE = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K8 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_ATFILE = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__USE_FORTIFY_LEVEL = 2 +__USE_FORTIFY_LEVEL = 1 +__USE_FORTIFY_LEVEL = 0 + +# Included from bits/predefs.h +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 11 +__GLIBC_HAVE_LONG_LONG = 1 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __NTH(fct): return fct + +def __NTH(fct): return fct + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) + +def __bos0(ptr): return __builtin_object_size (ptr, 0) + +def __warnattr(msg): return __attribute__((__warning__ (msg))) + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + + +# Included from bits/wordsize.h +__WORDSIZE = 32 +__LDBL_COMPAT = 1 +def __LDBL_REDIR_DECL(name): return \ + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 +__USE_EXTERN_INLINES_IN_LIBC = 1 + +# Included from gnu/stubs.h + +# Included from bits/types.h +_BITS_TYPES_H = 1 +__S32_TYPE = int +__SWORD_TYPE = int +__SLONG32_TYPE = int + +# Included from bits/typesizes.h +_BITS_TYPESIZES_H = 1 +__PID_T_TYPE = __S32_TYPE +__CLOCK_T_TYPE = __S32_TYPE +__SWBLK_T_TYPE = __S32_TYPE +__CLOCKID_T_TYPE = __S32_TYPE +__TIMER_T_TYPE = __S32_TYPE +__SSIZE_T_TYPE = __SWORD_TYPE +__FD_SETSIZE = 1024 + +# Included from time.h +_TIME_H = 1 + +# Included from bits/time.h +_BITS_TIME_H = 1 +CLOCKS_PER_SEC = 1000000l +CLK_TCK = 128 +CLOCK_REALTIME = 0 +CLOCK_PROCESS_CPUTIME_ID = 2 +CLOCK_THREAD_CPUTIME_ID = 3 +CLOCK_MONOTONIC = 4 +CLOCK_VIRTUAL = 1 +CLOCK_PROF = 2 +CLOCK_UPTIME = 5 +CLOCK_UPTIME_PRECISE = 7 +CLOCK_UPTIME_FAST = 8 +CLOCK_REALTIME_PRECISE = 9 +CLOCK_REALTIME_FAST = 10 +CLOCK_MONOTONIC_PRECISE = 11 +CLOCK_MONOTONIC_FAST = 12 +CLOCK_SECOND = 13 +TIMER_RELTIME = 0 +TIMER_ABSTIME = 1 +_STRUCT_TIMEVAL = 1 +CLK_TCK = CLOCKS_PER_SEC +__clock_t_defined = 1 +__time_t_defined = 1 +__clockid_t_defined = 1 +__timer_t_defined = 1 +__timespec_defined = 1 + +# Included from xlocale.h +_XLOCALE_H = 1 +def __isleap(year): return \ + +__BIT_TYPES_DEFINED__ = 1 + +# Included from endian.h +_ENDIAN_H = 1 +__LITTLE_ENDIAN = 1234 +__BIG_ENDIAN = 4321 +__PDP_ENDIAN = 3412 + +# Included from bits/endian.h +__BYTE_ORDER = __LITTLE_ENDIAN +__FLOAT_WORD_ORDER = __BYTE_ORDER +LITTLE_ENDIAN = __LITTLE_ENDIAN +BIG_ENDIAN = __BIG_ENDIAN +PDP_ENDIAN = __PDP_ENDIAN +BYTE_ORDER = __BYTE_ORDER + +# Included from bits/byteswap.h +_BITS_BYTESWAP_H = 1 +def __bswap_constant_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_constant_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_constant_64(x): return \ + +def __bswap_64(x): return \ + +def htobe16(x): return __bswap_16 (x) + +def htole16(x): return (x) + +def be16toh(x): return __bswap_16 (x) + +def le16toh(x): return (x) + +def htobe32(x): return __bswap_32 (x) + +def htole32(x): return (x) + +def be32toh(x): return __bswap_32 (x) + +def le32toh(x): return (x) + +def htobe64(x): return __bswap_64 (x) + +def htole64(x): return (x) + +def be64toh(x): return __bswap_64 (x) + +def le64toh(x): return (x) + +def htobe16(x): return (x) + +def htole16(x): return __bswap_16 (x) + +def be16toh(x): return (x) + +def le16toh(x): return __bswap_16 (x) + +def htobe32(x): return (x) + +def htole32(x): return __bswap_32 (x) + +def be32toh(x): return (x) + +def le32toh(x): return __bswap_32 (x) + +def htobe64(x): return (x) + +def htole64(x): return __bswap_64 (x) + +def be64toh(x): return (x) + +def le64toh(x): return __bswap_64 (x) + + +# Included from sys/select.h +_SYS_SELECT_H = 1 + +# Included from bits/select.h +def __FD_ZERO(fdsp): return \ + +def __FD_ZERO(set): return \ + + +# Included from bits/sigset.h +_SIGSET_H_types = 1 +_SIGSET_H_fns = 1 +def __sigword(sig): return (((sig) - 1) >> 5) + +def __sigemptyset(set): return \ + +def __sigfillset(set): return \ + +def __sigisemptyset(set): return \ + +def __FDELT(d): return ((d) / __NFDBITS) + +FD_SETSIZE = __FD_SETSIZE +def FD_ZERO(fdsetp): return __FD_ZERO (fdsetp) + + +# Included from sys/sysmacros.h +_SYS_SYSMACROS_H = 1 +def minor(dev): return ((int)((dev) & (-65281))) + +def gnu_dev_major(dev): return major (dev) + +def gnu_dev_minor(dev): return minor (dev) + + +# Included from bits/pthreadtypes.h +_BITS_PTHREADTYPES_H = 1 + +# Included from bits/sched.h +SCHED_OTHER = 2 +SCHED_FIFO = 1 +SCHED_RR = 3 +CSIGNAL = 0x000000ff +CLONE_VM = 0x00000100 +CLONE_FS = 0x00000200 +CLONE_FILES = 0x00000400 +CLONE_SIGHAND = 0x00000800 +CLONE_PTRACE = 0x00002000 +CLONE_VFORK = 0x00004000 +CLONE_SYSVSEM = 0x00040000 +__defined_schedparam = 1 +__CPU_SETSIZE = 128 +def __CPUELT(cpu): return ((cpu) / __NCPUBITS) + +def __CPU_ALLOC_SIZE(count): return \ + +def __CPU_ALLOC(count): return __sched_cpualloc (count) + +def __CPU_FREE(cpuset): return __sched_cpufree (cpuset) + --- /dev/null +++ b/lib-python/2.7/plat-gnukfreebsd8/DLFCN.py @@ -0,0 +1,118 @@ +# Generated by h2py from /usr/include/dlfcn.h +_DLFCN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 200809L +_XOPEN_SOURCE = 700 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_ATFILE_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +__USE_ISOC95 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 200112L +_POSIX_C_SOURCE = 200809L +__USE_POSIX_IMPLICITLY = 1 +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN2K8 = 1 +_ATFILE_SOURCE = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K8 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_ATFILE = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__USE_FORTIFY_LEVEL = 2 +__USE_FORTIFY_LEVEL = 1 +__USE_FORTIFY_LEVEL = 0 + +# Included from bits/predefs.h +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 11 +__GLIBC_HAVE_LONG_LONG = 1 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __NTH(fct): return fct + +def __NTH(fct): return fct + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) + +def __bos0(ptr): return __builtin_object_size (ptr, 0) + +def __warnattr(msg): return __attribute__((__warning__ (msg))) + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + + +# Included from bits/wordsize.h +__WORDSIZE = 32 +__LDBL_COMPAT = 1 +def __LDBL_REDIR_DECL(name): return \ + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 +__USE_EXTERN_INLINES_IN_LIBC = 1 + +# Included from gnu/stubs.h + +# Included from bits/dlfcn.h +RTLD_LAZY = 0x00001 +RTLD_NOW = 0x00002 +RTLD_BINDING_MASK = 0x3 +RTLD_NOLOAD = 0x00004 +RTLD_DEEPBIND = 0x00008 +RTLD_GLOBAL = 0x00100 +RTLD_LOCAL = 0 +RTLD_NODELETE = 0x01000 +LM_ID_BASE = 0 +LM_ID_NEWLM = -1 --- /dev/null +++ b/lib-python/2.7/plat-gnukfreebsd9/DLFCN.py @@ -0,0 +1,118 @@ +# Generated by h2py from /usr/include/dlfcn.h +_DLFCN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 200809L +_XOPEN_SOURCE = 700 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_ATFILE_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +__USE_ISOC95 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 200112L +_POSIX_C_SOURCE = 200809L +__USE_POSIX_IMPLICITLY = 1 +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN2K8 = 1 +_ATFILE_SOURCE = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K8 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_ATFILE = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__USE_FORTIFY_LEVEL = 2 +__USE_FORTIFY_LEVEL = 1 +__USE_FORTIFY_LEVEL = 0 + +# Included from bits/predefs.h +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 11 +__GLIBC_HAVE_LONG_LONG = 1 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __NTH(fct): return fct + +def __NTH(fct): return fct + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) + +def __bos0(ptr): return __builtin_object_size (ptr, 0) + +def __warnattr(msg): return __attribute__((__warning__ (msg))) + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + + +# Included from bits/wordsize.h +__WORDSIZE = 32 +__LDBL_COMPAT = 1 +def __LDBL_REDIR_DECL(name): return \ + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 +__USE_EXTERN_INLINES_IN_LIBC = 1 + +# Included from gnu/stubs.h + +# Included from bits/dlfcn.h +RTLD_LAZY = 0x00001 +RTLD_NOW = 0x00002 +RTLD_BINDING_MASK = 0x3 +RTLD_NOLOAD = 0x00004 +RTLD_DEEPBIND = 0x00008 +RTLD_GLOBAL = 0x00100 +RTLD_LOCAL = 0 +RTLD_NODELETE = 0x01000 +LM_ID_BASE = 0 +LM_ID_NEWLM = -1 --- /dev/null +++ b/lib-python/2.7/plat-gnukfreebsd9/IN.py @@ -0,0 +1,809 @@ +# Generated by h2py from /usr/include/netinet/in.h +_NETINET_IN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 200809L +_XOPEN_SOURCE = 700 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_ATFILE_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +__USE_ISOC95 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 200112L +_POSIX_C_SOURCE = 200809L +__USE_POSIX_IMPLICITLY = 1 +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN2K8 = 1 +_ATFILE_SOURCE = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K8 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_ATFILE = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__USE_FORTIFY_LEVEL = 2 +__USE_FORTIFY_LEVEL = 1 +__USE_FORTIFY_LEVEL = 0 + +# Included from bits/predefs.h +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 11 +__GLIBC_HAVE_LONG_LONG = 1 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __NTH(fct): return fct + +def __NTH(fct): return fct + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) + +def __bos0(ptr): return __builtin_object_size (ptr, 0) + +def __warnattr(msg): return __attribute__((__warning__ (msg))) + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + + +# Included from bits/wordsize.h +__WORDSIZE = 32 +__LDBL_COMPAT = 1 +def __LDBL_REDIR_DECL(name): return \ + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 +__USE_EXTERN_INLINES_IN_LIBC = 1 + +# Included from gnu/stubs.h + +# Included from stdint.h +_STDINT_H = 1 + +# Included from bits/wchar.h +_BITS_WCHAR_H = 1 +__WCHAR_MAX = (2147483647) +__WCHAR_MIN = (-__WCHAR_MAX - 1) +def __INT64_C(c): return c ## L + +def __UINT64_C(c): return c ## UL + +def __INT64_C(c): return c ## LL + +def __UINT64_C(c): return c ## ULL + +INT8_MIN = (-128) +INT16_MIN = (-32767-1) +INT32_MIN = (-2147483647-1) +INT64_MIN = (-__INT64_C(9223372036854775807)-1) +INT8_MAX = (127) +INT16_MAX = (32767) +INT32_MAX = (2147483647) +INT64_MAX = (__INT64_C(9223372036854775807)) +UINT8_MAX = (255) +UINT16_MAX = (65535) +UINT64_MAX = (__UINT64_C(18446744073709551615)) +INT_LEAST8_MIN = (-128) +INT_LEAST16_MIN = (-32767-1) +INT_LEAST32_MIN = (-2147483647-1) +INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_LEAST8_MAX = (127) +INT_LEAST16_MAX = (32767) +INT_LEAST32_MAX = (2147483647) +INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_LEAST8_MAX = (255) +UINT_LEAST16_MAX = (65535) +UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) +INT_FAST8_MIN = (-128) +INT_FAST16_MIN = (-9223372036854775807L-1) +INT_FAST32_MIN = (-9223372036854775807L-1) +INT_FAST16_MIN = (-2147483647-1) +INT_FAST32_MIN = (-2147483647-1) +INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_FAST8_MAX = (127) +INT_FAST16_MAX = (9223372036854775807L) +INT_FAST32_MAX = (9223372036854775807L) +INT_FAST16_MAX = (2147483647) +INT_FAST32_MAX = (2147483647) +INT_FAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_FAST8_MAX = (255) +UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) +INTPTR_MIN = (-9223372036854775807L-1) +INTPTR_MAX = (9223372036854775807L) +INTPTR_MIN = (-2147483647-1) +INTPTR_MAX = (2147483647) +INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) +INTMAX_MAX = (__INT64_C(9223372036854775807)) +UINTMAX_MAX = (__UINT64_C(18446744073709551615)) +PTRDIFF_MIN = (-9223372036854775807L-1) +PTRDIFF_MAX = (9223372036854775807L) +PTRDIFF_MIN = (-2147483647-1) +PTRDIFF_MAX = (2147483647) +SIG_ATOMIC_MIN = (-2147483647-1) +SIG_ATOMIC_MAX = (2147483647) +WCHAR_MIN = __WCHAR_MIN +WCHAR_MAX = __WCHAR_MAX +def INT8_C(c): return c + +def INT16_C(c): return c + +def INT32_C(c): return c + +def INT64_C(c): return c ## L + +def INT64_C(c): return c ## LL + +def UINT8_C(c): return c + +def UINT16_C(c): return c + +def UINT32_C(c): return c ## U + +def UINT64_C(c): return c ## UL + +def UINT64_C(c): return c ## ULL + +def INTMAX_C(c): return c ## L + +def UINTMAX_C(c): return c ## UL + +def INTMAX_C(c): return c ## LL + +def UINTMAX_C(c): return c ## ULL + + +# Included from sys/socket.h +_SYS_SOCKET_H = 1 + +# Included from sys/uio.h +_SYS_UIO_H = 1 +from TYPES import * + +# Included from bits/uio.h +_BITS_UIO_H = 1 +from TYPES import * +UIO_MAXIOV = 1024 + +# Included from bits/sigset.h +_SIGSET_H_types = 1 +_SIGSET_H_fns = 1 +def __sigword(sig): return (((sig) - 1) >> 5) + +def __sigemptyset(set): return \ + +def __sigfillset(set): return \ + +def __sigisemptyset(set): return \ + + +# Included from bits/socket.h +__BITS_SOCKET_H = 1 + +# Included from limits.h +_LIBC_LIMITS_H_ = 1 +MB_LEN_MAX = 16 +_LIMITS_H = 1 +CHAR_BIT = 8 +SCHAR_MIN = (-128) +SCHAR_MAX = 127 +UCHAR_MAX = 255 +CHAR_MIN = 0 +CHAR_MAX = UCHAR_MAX +CHAR_MIN = SCHAR_MIN +CHAR_MAX = SCHAR_MAX +SHRT_MIN = (-32768) +SHRT_MAX = 32767 +USHRT_MAX = 65535 +INT_MAX = 2147483647 +LONG_MAX = 9223372036854775807L +LONG_MAX = 2147483647L +LONG_MIN = (-LONG_MAX - 1L) + +# Included from bits/posix1_lim.h +_BITS_POSIX1_LIM_H = 1 +_POSIX_AIO_LISTIO_MAX = 2 +_POSIX_AIO_MAX = 1 +_POSIX_ARG_MAX = 4096 +_POSIX_CHILD_MAX = 25 +_POSIX_CHILD_MAX = 6 +_POSIX_DELAYTIMER_MAX = 32 +_POSIX_HOST_NAME_MAX = 255 +_POSIX_LINK_MAX = 8 +_POSIX_LOGIN_NAME_MAX = 9 +_POSIX_MAX_CANON = 255 +_POSIX_MAX_INPUT = 255 +_POSIX_MQ_OPEN_MAX = 8 +_POSIX_MQ_PRIO_MAX = 32 +_POSIX_NAME_MAX = 14 +_POSIX_NGROUPS_MAX = 8 +_POSIX_NGROUPS_MAX = 0 +_POSIX_OPEN_MAX = 20 +_POSIX_OPEN_MAX = 16 +_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX +_POSIX_PATH_MAX = 256 +_POSIX_PIPE_BUF = 512 +_POSIX_RE_DUP_MAX = 255 +_POSIX_RTSIG_MAX = 8 +_POSIX_SEM_NSEMS_MAX = 256 +_POSIX_SEM_VALUE_MAX = 32767 +_POSIX_SIGQUEUE_MAX = 32 +_POSIX_SSIZE_MAX = 32767 +_POSIX_STREAM_MAX = 8 +_POSIX_SYMLINK_MAX = 255 +_POSIX_SYMLOOP_MAX = 8 +_POSIX_TIMER_MAX = 32 +_POSIX_TTY_NAME_MAX = 9 +_POSIX_TZNAME_MAX = 6 +_POSIX_QLIMIT = 1 +_POSIX_HIWAT = _POSIX_PIPE_BUF +_POSIX_UIO_MAXIOV = 16 +_POSIX_CLOCKRES_MIN = 20000000 + +# Included from bits/local_lim.h + +# Included from sys/syslimits.h +ARG_MAX = 262144 +CHILD_MAX = 40 +LINK_MAX = 32767 +MAX_CANON = 255 +MAX_INPUT = 255 +NAME_MAX = 255 +NGROUPS_MAX = 1023 +OPEN_MAX = 64 +PATH_MAX = 1024 +PIPE_BUF = 512 +IOV_MAX = 1024 +_POSIX_THREAD_KEYS_MAX = 128 +PTHREAD_KEYS_MAX = 1024 +_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 +PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS +_POSIX_THREAD_THREADS_MAX = 64 +PTHREAD_THREADS_MAX = 1024 +AIO_PRIO_DELTA_MAX = 20 +PTHREAD_STACK_MIN = 16384 +TIMER_MAX = 256 +DELAYTIMER_MAX = 2147483647 +SSIZE_MAX = LONG_MAX +NGROUPS_MAX = 8 + +# Included from bits/posix2_lim.h +_BITS_POSIX2_LIM_H = 1 +_POSIX2_BC_BASE_MAX = 99 +_POSIX2_BC_DIM_MAX = 2048 +_POSIX2_BC_SCALE_MAX = 99 +_POSIX2_BC_STRING_MAX = 1000 +_POSIX2_COLL_WEIGHTS_MAX = 2 +_POSIX2_EXPR_NEST_MAX = 32 +_POSIX2_LINE_MAX = 2048 +_POSIX2_RE_DUP_MAX = 255 +_POSIX2_CHARCLASS_NAME_MAX = 14 +BC_BASE_MAX = _POSIX2_BC_BASE_MAX +BC_DIM_MAX = _POSIX2_BC_DIM_MAX +BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX +BC_STRING_MAX = _POSIX2_BC_STRING_MAX +COLL_WEIGHTS_MAX = 255 +EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX +LINE_MAX = _POSIX2_LINE_MAX +CHARCLASS_NAME_MAX = 2048 +RE_DUP_MAX = (0x7fff) + +# Included from bits/xopen_lim.h +_XOPEN_LIM_H = 1 + +# Included from bits/stdio_lim.h +L_tmpnam = 20 +TMP_MAX = 238328 +FILENAME_MAX = 1024 +L_ctermid = 9 +L_cuserid = 9 +FOPEN_MAX = 64 +IOV_MAX = 1024 +_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV +NL_ARGMAX = _POSIX_ARG_MAX +NL_LANGMAX = _POSIX2_LINE_MAX +NL_MSGMAX = INT_MAX +NL_NMAX = INT_MAX +NL_SETMAX = INT_MAX +NL_TEXTMAX = INT_MAX +NZERO = 20 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 32 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 64 +LONG_BIT = 32 + +# Included from bits/types.h +_BITS_TYPES_H = 1 +__S32_TYPE = int +__SWORD_TYPE = int +__SLONG32_TYPE = int + +# Included from bits/typesizes.h +_BITS_TYPESIZES_H = 1 +__PID_T_TYPE = __S32_TYPE +__CLOCK_T_TYPE = __S32_TYPE +__SWBLK_T_TYPE = __S32_TYPE +__CLOCKID_T_TYPE = __S32_TYPE +__TIMER_T_TYPE = __S32_TYPE +__SSIZE_T_TYPE = __SWORD_TYPE +__FD_SETSIZE = 1024 +PF_UNSPEC = 0 +PF_LOCAL = 1 +PF_UNIX = PF_LOCAL +PF_FILE = PF_LOCAL +PF_INET = 2 +PF_IMPLINK = 3 +PF_PUP = 4 +PF_CHAOS = 5 +PF_NS = 6 +PF_ISO = 7 +PF_OSI = PF_ISO +PF_ECMA = 8 +PF_DATAKIT = 9 +PF_CCITT = 10 +PF_SNA = 11 +PF_DECnet = 12 +PF_DLI = 13 +PF_LAT = 14 +PF_HYLINK = 15 +PF_APPLETALK = 16 +PF_ROUTE = 17 +PF_LINK = 18 +PF_XTP = 19 +PF_COIP = 20 +PF_CNT = 21 +PF_RTIP = 22 +PF_IPX = 23 +PF_SIP = 24 +PF_PIP = 25 +PF_ISDN = 26 +PF_KEY = 27 +PF_INET6 = 28 +PF_NATM = 29 +PF_ATM = 30 +PF_HDRCMPLT = 31 +PF_NETGRAPH = 32 +PF_MAX = 33 +AF_UNSPEC = PF_UNSPEC +AF_LOCAL = PF_LOCAL +AF_UNIX = PF_UNIX +AF_FILE = PF_FILE +AF_INET = PF_INET +AF_IMPLINK = PF_IMPLINK +AF_PUP = PF_PUP +AF_CHAOS = PF_CHAOS +AF_NS = PF_NS +AF_ISO = PF_ISO +AF_OSI = PF_OSI +AF_ECMA = PF_ECMA +AF_DATAKIT = PF_DATAKIT +AF_CCITT = PF_CCITT +AF_SNA = PF_SNA +AF_DECnet = PF_DECnet +AF_DLI = PF_DLI +AF_LAT = PF_LAT +AF_HYLINK = PF_HYLINK +AF_APPLETALK = PF_APPLETALK +AF_ROUTE = PF_ROUTE +AF_LINK = PF_LINK +pseudo_AF_XTP = PF_XTP +AF_COIP = PF_COIP +AF_CNT = PF_CNT +pseudo_AF_RTIP = PF_RTIP +AF_IPX = PF_IPX +AF_SIP = PF_SIP +pseudo_AF_PIP = PF_PIP +AF_ISDN = PF_ISDN +AF_E164 = AF_ISDN +pseudo_AF_KEY = PF_KEY +AF_INET6 = PF_INET6 +AF_NATM = PF_NATM +AF_ATM = PF_ATM +pseudo_AF_HDRCMPLT = PF_HDRCMPLT +AF_NETGRAPH = PF_NETGRAPH +AF_MAX = PF_MAX +SOMAXCONN = 128 + +# Included from bits/sockaddr.h +_BITS_SOCKADDR_H = 1 +def __SOCKADDR_COMMON(sa_prefix): return \ + +_HAVE_SA_LEN = 1 +_SS_SIZE = 128 +def CMSG_FIRSTHDR(mhdr): return \ + +CMGROUP_MAX = 16 +SOL_SOCKET = 0xffff +LOCAL_PEERCRED = 0x001 +LOCAL_CREDS = 0x002 +LOCAL_CONNWAIT = 0x004 + +# Included from bits/socket2.h +def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) + +IN_CLASSA_NET = (-16777216) +IN_CLASSA_NSHIFT = 24 +IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) +IN_CLASSA_MAX = 128 +def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) + +IN_CLASSB_NET = (-65536) +IN_CLASSB_NSHIFT = 16 +IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) +IN_CLASSB_MAX = 65536 +def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) + +IN_CLASSC_NET = (-256) +IN_CLASSC_NSHIFT = 8 +IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) +def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) + +def IN_MULTICAST(a): return IN_CLASSD(a) + +def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) + +def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) + +IN_LOOPBACKNET = 127 +INET_ADDRSTRLEN = 16 +INET6_ADDRSTRLEN = 46 + +# Included from bits/in.h +IMPLINK_IP = 155 +IMPLINK_LOWEXPER = 156 +IMPLINK_HIGHEXPER = 158 +IPPROTO_DIVERT = 258 +SOL_IP = 0 +IP_OPTIONS = 1 +IP_HDRINCL = 2 +IP_TOS = 3 +IP_TTL = 4 +IP_RECVOPTS = 5 +IP_RECVRETOPTS = 6 +IP_RECVDSTADDR = 7 +IP_SENDSRCADDR = IP_RECVDSTADDR +IP_RETOPTS = 8 +IP_MULTICAST_IF = 9 +IP_MULTICAST_TTL = 10 +IP_MULTICAST_LOOP = 11 +IP_ADD_MEMBERSHIP = 12 +IP_DROP_MEMBERSHIP = 13 +IP_MULTICAST_VIF = 14 +IP_RSVP_ON = 15 +IP_RSVP_OFF = 16 +IP_RSVP_VIF_ON = 17 +IP_RSVP_VIF_OFF = 18 +IP_PORTRANGE = 19 +IP_RECVIF = 20 +IP_IPSEC_POLICY = 21 +IP_FAITH = 22 +IP_ONESBCAST = 23 +IP_NONLOCALOK = 24 +IP_FW_TABLE_ADD = 40 +IP_FW_TABLE_DEL = 41 +IP_FW_TABLE_FLUSH = 42 +IP_FW_TABLE_GETSIZE = 43 +IP_FW_TABLE_LIST = 44 +IP_FW_ADD = 50 +IP_FW_DEL = 51 +IP_FW_FLUSH = 52 +IP_FW_ZERO = 53 +IP_FW_GET = 54 +IP_FW_RESETLOG = 55 +IP_FW_NAT_CFG = 56 +IP_FW_NAT_DEL = 57 +IP_FW_NAT_GET_CONFIG = 58 +IP_FW_NAT_GET_LOG = 59 +IP_DUMMYNET_CONFIGURE = 60 +IP_DUMMYNET_DEL = 61 +IP_DUMMYNET_FLUSH = 62 +IP_DUMMYNET_GET = 64 +IP_RECVTTL = 65 +IP_MINTTL = 66 +IP_DONTFRAG = 67 +IP_ADD_SOURCE_MEMBERSHIP = 70 +IP_DROP_SOURCE_MEMBERSHIP = 71 +IP_BLOCK_SOURCE = 72 +IP_UNBLOCK_SOURCE = 73 +IP_MSFILTER = 74 +MCAST_JOIN_GROUP = 80 +MCAST_LEAVE_GROUP = 81 +MCAST_JOIN_SOURCE_GROUP = 82 +MCAST_LEAVE_SOURCE_GROUP = 83 +MCAST_BLOCK_SOURCE = 84 +MCAST_UNBLOCK_SOURCE = 85 +IP_DEFAULT_MULTICAST_TTL = 1 +IP_DEFAULT_MULTICAST_LOOP = 1 +IP_MIN_MEMBERSHIPS = 31 +IP_MAX_MEMBERSHIPS = 4095 +IP_MAX_SOURCE_FILTER = 1024 +MCAST_UNDEFINED = 0 +MCAST_INCLUDE = 1 +MCAST_EXCLUDE = 2 +IP_PORTRANGE_DEFAULT = 0 +IP_PORTRANGE_HIGH = 1 +IP_PORTRANGE_LOW = 2 +IPCTL_FORWARDING = 1 +IPCTL_SENDREDIRECTS = 2 +IPCTL_DEFTTL = 3 +IPCTL_DEFMTU = 4 +IPCTL_RTEXPIRE = 5 +IPCTL_RTMINEXPIRE = 6 +IPCTL_RTMAXCACHE = 7 +IPCTL_SOURCEROUTE = 8 +IPCTL_DIRECTEDBROADCAST = 9 +IPCTL_INTRQMAXLEN = 10 +IPCTL_INTRQDROPS = 11 +IPCTL_STATS = 12 +IPCTL_ACCEPTSOURCEROUTE = 13 +IPCTL_FASTFORWARDING = 14 +IPCTL_KEEPFAITH = 15 +IPCTL_GIF_TTL = 16 +IPCTL_MAXID = 17 +IPV6_SOCKOPT_RESERVED1 = 3 +IPV6_UNICAST_HOPS = 4 +IPV6_MULTICAST_IF = 9 +IPV6_MULTICAST_HOPS = 10 +IPV6_MULTICAST_LOOP = 11 +IPV6_JOIN_GROUP = 12 +IPV6_LEAVE_GROUP = 13 +IPV6_PORTRANGE = 14 +ICMP6_FILTER = 18 +IPV6_CHECKSUM = 26 +IPV6_V6ONLY = 27 +IPV6_IPSEC_POLICY = 28 +IPV6_FAITH = 29 +IPV6_FW_ADD = 30 +IPV6_FW_DEL = 31 +IPV6_FW_FLUSH = 32 +IPV6_FW_ZERO = 33 +IPV6_FW_GET = 34 +IPV6_RTHDRDSTOPTS = 35 +IPV6_RECVPKTINFO = 36 +IPV6_RECVHOPLIMIT = 37 +IPV6_RECVRTHDR = 38 +IPV6_RECVHOPOPTS = 39 +IPV6_RECVDSTOPTS = 40 +IPV6_USE_MIN_MTU = 42 +IPV6_RECVPATHMTU = 43 +IPV6_PATHMTU = 44 +IPV6_PKTINFO = 46 +IPV6_HOPLIMIT = 47 +IPV6_NEXTHOP = 48 +IPV6_HOPOPTS = 49 +IPV6_DSTOPTS = 50 +IPV6_RTHDR = 51 +IPV6_RECVTCLASS = 57 +IPV6_AUTOFLOWLABEL = 59 +IPV6_TCLASS = 61 +IPV6_DONTFRAG = 62 +IPV6_PREFER_TEMPADDR = 63 +IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP +IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP +IPV6_RXHOPOPTS = IPV6_HOPOPTS +IPV6_RXDSTOPTS = IPV6_DSTOPTS +SOL_IPV6 = 41 +SOL_ICMPV6 = 58 +IPV6_DEFAULT_MULTICAST_HOPS = 1 +IPV6_DEFAULT_MULTICAST_LOOP = 1 +IPV6_PORTRANGE_DEFAULT = 0 +IPV6_PORTRANGE_HIGH = 1 +IPV6_PORTRANGE_LOW = 2 +IPV6_RTHDR_LOOSE = 0 +IPV6_RTHDR_STRICT = 1 +IPV6_RTHDR_TYPE_0 = 0 +IPV6CTL_FORWARDING = 1 +IPV6CTL_SENDREDIRECTS = 2 +IPV6CTL_DEFHLIM = 3 +IPV6CTL_FORWSRCRT = 5 +IPV6CTL_STATS = 6 +IPV6CTL_MRTSTATS = 7 +IPV6CTL_MRTPROTO = 8 +IPV6CTL_MAXFRAGPACKETS = 9 +IPV6CTL_SOURCECHECK = 10 +IPV6CTL_SOURCECHECK_LOGINT = 11 +IPV6CTL_ACCEPT_RTADV = 12 +IPV6CTL_KEEPFAITH = 13 +IPV6CTL_LOG_INTERVAL = 14 +IPV6CTL_HDRNESTLIMIT = 15 +IPV6CTL_DAD_COUNT = 16 +IPV6CTL_AUTO_FLOWLABEL = 17 +IPV6CTL_DEFMCASTHLIM = 18 +IPV6CTL_GIF_HLIM = 19 +IPV6CTL_KAME_VERSION = 20 +IPV6CTL_USE_DEPRECATED = 21 +IPV6CTL_RR_PRUNE = 22 +IPV6CTL_V6ONLY = 24 +IPV6CTL_RTEXPIRE = 25 +IPV6CTL_RTMINEXPIRE = 26 +IPV6CTL_RTMAXCACHE = 27 +IPV6CTL_USETEMPADDR = 32 +IPV6CTL_TEMPPLTIME = 33 +IPV6CTL_TEMPVLTIME = 34 +IPV6CTL_AUTO_LINKLOCAL = 35 +IPV6CTL_RIP6STATS = 36 +IPV6CTL_PREFER_TEMPADDR = 37 +IPV6CTL_ADDRCTLPOLICY = 38 +IPV6CTL_USE_DEFAULTZONE = 39 +IPV6CTL_MAXFRAGS = 41 +IPV6CTL_MCAST_PMTU = 44 +IPV6CTL_STEALTH = 45 +ICMPV6CTL_ND6_ONLINKNSRFC4861 = 47 +IPV6CTL_MAXID = 48 + +# Included from endian.h +_ENDIAN_H = 1 +__LITTLE_ENDIAN = 1234 +__BIG_ENDIAN = 4321 +__PDP_ENDIAN = 3412 + +# Included from bits/endian.h +__BYTE_ORDER = __LITTLE_ENDIAN +__FLOAT_WORD_ORDER = __BYTE_ORDER +LITTLE_ENDIAN = __LITTLE_ENDIAN +BIG_ENDIAN = __BIG_ENDIAN +PDP_ENDIAN = __PDP_ENDIAN +BYTE_ORDER = __BYTE_ORDER + +# Included from bits/byteswap.h +_BITS_BYTESWAP_H = 1 +def __bswap_constant_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_constant_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_constant_64(x): return \ + +def __bswap_64(x): return \ + +def htobe16(x): return __bswap_16 (x) + +def htole16(x): return (x) + +def be16toh(x): return __bswap_16 (x) + +def le16toh(x): return (x) + +def htobe32(x): return __bswap_32 (x) + +def htole32(x): return (x) + +def be32toh(x): return __bswap_32 (x) + +def le32toh(x): return (x) + +def htobe64(x): return __bswap_64 (x) + +def htole64(x): return (x) + +def be64toh(x): return __bswap_64 (x) + +def le64toh(x): return (x) + +def htobe16(x): return (x) + +def htole16(x): return __bswap_16 (x) + +def be16toh(x): return (x) + +def le16toh(x): return __bswap_16 (x) + +def htobe32(x): return (x) + +def htole32(x): return __bswap_32 (x) + +def be32toh(x): return (x) + +def le32toh(x): return __bswap_32 (x) + +def htobe64(x): return (x) + +def htole64(x): return __bswap_64 (x) + +def be64toh(x): return (x) + +def le64toh(x): return __bswap_64 (x) + +def ntohl(x): return (x) + +def ntohs(x): return (x) + +def htonl(x): return (x) + +def htons(x): return (x) + +def ntohl(x): return __bswap_32 (x) + +def ntohs(x): return __bswap_16 (x) + +def htonl(x): return __bswap_32 (x) + +def htons(x): return __bswap_16 (x) + +def IN6_IS_ADDR_UNSPECIFIED(a): return \ + +def IN6_IS_ADDR_LOOPBACK(a): return \ + +def IN6_IS_ADDR_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_SITELOCAL(a): return \ + +def IN6_IS_ADDR_V4MAPPED(a): return \ + +def IN6_IS_ADDR_V4COMPAT(a): return \ + +def IN6_IS_ADDR_MC_NODELOCAL(a): return \ + +def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_MC_SITELOCAL(a): return \ + +def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ + +def IN6_IS_ADDR_MC_GLOBAL(a): return \ + --- /dev/null +++ b/lib-python/2.7/plat-gnukfreebsd9/TYPES.py @@ -0,0 +1,303 @@ +# Generated by h2py from /usr/include/sys/types.h +_SYS_TYPES_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 200809L +_XOPEN_SOURCE = 700 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_ATFILE_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +__USE_ISOC95 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 200112L +_POSIX_C_SOURCE = 200809L +__USE_POSIX_IMPLICITLY = 1 +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN2K8 = 1 +_ATFILE_SOURCE = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K8 = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_ATFILE = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__USE_FORTIFY_LEVEL = 2 +__USE_FORTIFY_LEVEL = 1 +__USE_FORTIFY_LEVEL = 0 + +# Included from bits/predefs.h +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 11 +__GLIBC_HAVE_LONG_LONG = 1 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __NTH(fct): return fct + +def __NTH(fct): return fct + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) + +def __bos0(ptr): return __builtin_object_size (ptr, 0) + +def __warnattr(msg): return __attribute__((__warning__ (msg))) + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + + +# Included from bits/wordsize.h +__WORDSIZE = 32 +__LDBL_COMPAT = 1 +def __LDBL_REDIR_DECL(name): return \ + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 +__USE_EXTERN_INLINES_IN_LIBC = 1 + +# Included from gnu/stubs.h + +# Included from bits/types.h +_BITS_TYPES_H = 1 +__S32_TYPE = int +__SWORD_TYPE = int +__SLONG32_TYPE = int + +# Included from bits/typesizes.h +_BITS_TYPESIZES_H = 1 +__PID_T_TYPE = __S32_TYPE +__CLOCK_T_TYPE = __S32_TYPE +__SWBLK_T_TYPE = __S32_TYPE +__CLOCKID_T_TYPE = __S32_TYPE +__TIMER_T_TYPE = __S32_TYPE +__SSIZE_T_TYPE = __SWORD_TYPE +__FD_SETSIZE = 1024 + +# Included from time.h +_TIME_H = 1 + +# Included from bits/time.h +_BITS_TIME_H = 1 +CLOCKS_PER_SEC = 1000000l +CLK_TCK = 128 +CLOCK_REALTIME = 0 +CLOCK_PROCESS_CPUTIME_ID = 2 +CLOCK_THREAD_CPUTIME_ID = 3 +CLOCK_MONOTONIC = 4 +CLOCK_VIRTUAL = 1 +CLOCK_PROF = 2 +CLOCK_UPTIME = 5 +CLOCK_UPTIME_PRECISE = 7 +CLOCK_UPTIME_FAST = 8 +CLOCK_REALTIME_PRECISE = 9 +CLOCK_REALTIME_FAST = 10 +CLOCK_MONOTONIC_PRECISE = 11 +CLOCK_MONOTONIC_FAST = 12 +CLOCK_SECOND = 13 +TIMER_RELTIME = 0 +TIMER_ABSTIME = 1 +_STRUCT_TIMEVAL = 1 +CLK_TCK = CLOCKS_PER_SEC +__clock_t_defined = 1 +__time_t_defined = 1 +__clockid_t_defined = 1 +__timer_t_defined = 1 +__timespec_defined = 1 + +# Included from xlocale.h +_XLOCALE_H = 1 +def __isleap(year): return \ + +__BIT_TYPES_DEFINED__ = 1 + +# Included from endian.h +_ENDIAN_H = 1 +__LITTLE_ENDIAN = 1234 +__BIG_ENDIAN = 4321 +__PDP_ENDIAN = 3412 + +# Included from bits/endian.h +__BYTE_ORDER = __LITTLE_ENDIAN +__FLOAT_WORD_ORDER = __BYTE_ORDER +LITTLE_ENDIAN = __LITTLE_ENDIAN +BIG_ENDIAN = __BIG_ENDIAN +PDP_ENDIAN = __PDP_ENDIAN +BYTE_ORDER = __BYTE_ORDER + +# Included from bits/byteswap.h +_BITS_BYTESWAP_H = 1 +def __bswap_constant_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_constant_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_constant_64(x): return \ + +def __bswap_64(x): return \ + +def htobe16(x): return __bswap_16 (x) + +def htole16(x): return (x) + +def be16toh(x): return __bswap_16 (x) + +def le16toh(x): return (x) + +def htobe32(x): return __bswap_32 (x) + +def htole32(x): return (x) + +def be32toh(x): return __bswap_32 (x) + +def le32toh(x): return (x) + +def htobe64(x): return __bswap_64 (x) + +def htole64(x): return (x) + +def be64toh(x): return __bswap_64 (x) + +def le64toh(x): return (x) + +def htobe16(x): return (x) + +def htole16(x): return __bswap_16 (x) + +def be16toh(x): return (x) + +def le16toh(x): return __bswap_16 (x) + +def htobe32(x): return (x) + +def htole32(x): return __bswap_32 (x) + +def be32toh(x): return (x) + +def le32toh(x): return __bswap_32 (x) + +def htobe64(x): return (x) + +def htole64(x): return __bswap_64 (x) + +def be64toh(x): return (x) + +def le64toh(x): return __bswap_64 (x) + + +# Included from sys/select.h +_SYS_SELECT_H = 1 + +# Included from bits/select.h +def __FD_ZERO(fdsp): return \ + +def __FD_ZERO(set): return \ + + +# Included from bits/sigset.h +_SIGSET_H_types = 1 +_SIGSET_H_fns = 1 +def __sigword(sig): return (((sig) - 1) >> 5) + +def __sigemptyset(set): return \ + +def __sigfillset(set): return \ + +def __sigisemptyset(set): return \ + +def __FDELT(d): return ((d) / __NFDBITS) + +FD_SETSIZE = __FD_SETSIZE +def FD_ZERO(fdsetp): return __FD_ZERO (fdsetp) + + +# Included from sys/sysmacros.h +_SYS_SYSMACROS_H = 1 +def minor(dev): return ((int)((dev) & (-65281))) + +def gnu_dev_major(dev): return major (dev) + +def gnu_dev_minor(dev): return minor (dev) + + +# Included from bits/pthreadtypes.h +_BITS_PTHREADTYPES_H = 1 + +# Included from bits/sched.h +SCHED_OTHER = 2 +SCHED_FIFO = 1 +SCHED_RR = 3 +CSIGNAL = 0x000000ff +CLONE_VM = 0x00000100 +CLONE_FS = 0x00000200 +CLONE_FILES = 0x00000400 +CLONE_SIGHAND = 0x00000800 +CLONE_PTRACE = 0x00002000 +CLONE_VFORK = 0x00004000 +CLONE_SYSVSEM = 0x00040000 +__defined_schedparam = 1 +__CPU_SETSIZE = 128 +def __CPUELT(cpu): return ((cpu) / __NCPUBITS) + +def __CPU_ALLOC_SIZE(count): return \ + +def __CPU_ALLOC(count): return __sched_cpualloc (count) + +def __CPU_FREE(cpuset): return __sched_cpufree (cpuset) + debian/patches/pypirc-secure0000644000000000000000000000173312215550224013334 0ustar Description: create the .pypirc securely Author: User Philip Jenvey Bug-Debian: http://bugs.debian.org/650555 Bug-CVE: CVE-2011-4944 Bug-cpython: http://bugs.python.org/issue13512 Origin: http://bugs.python.org/file23824/pypirc-secure.diff --- a/lib-python/2.7/distutils/config.py +++ b/lib-python/2.7/distutils/config.py @@ -42,16 +42,8 @@ def _store_pypirc(self, username, password): """Creates a default .pypirc file.""" rc = self._get_rc_file() - f = open(rc, 'w') - try: - f.write(DEFAULT_PYPIRC % (username, password)) - finally: - f.close() - try: - os.chmod(rc, 0600) - except OSError: - # should do something better here - pass + with os.fdopen(os.open(rc, os.O_CREAT | os.O_WRONLY, 0600), 'w') as fp: + fp.write(DEFAULT_PYPIRC % (username, password)) def _read_pypirc(self): """Reads the .pypirc file.""" debian/patches/platform-lsbrelease0000644000000000000000000000316612215550224014507 0ustar Description: Use /etc/lsb-release to identify the platform. Author: Matthias Klose Bug-Ubuntu: https://bugs.launchpad.net/bugs/196526 Bug-cpython: http://bugs.python.org/issue1322 Bug-cpython: http://bugs.python.org/issue9514 Origin: cpython Debian packaging Last-Update: 2011-12-19 --- a/lib-python/2.7/platform.py +++ b/lib-python/2.7/platform.py @@ -288,6 +288,10 @@ id = l[1] return '', version, id +_distributor_id_file_re = re.compile("(?:DISTRIB_ID\s*=)\s*(.*)", re.I) +_release_file_re = re.compile("(?:DISTRIB_RELEASE\s*=)\s*(.*)", re.I) +_codename_file_re = re.compile("(?:DISTRIB_CODENAME\s*=)\s*(.*)", re.I) + def linux_distribution(distname='', version='', id='', supported_dists=_supported_dists, @@ -312,6 +316,25 @@ args given as parameters. """ + # check for the Debian/Ubuntu /etc/lsb-release file first, needed so + # that the distribution doesn't get identified as Debian. + try: + etclsbrel = open("/etc/lsb-release", "rU") + for line in etclsbrel: + m = _distributor_id_file_re.search(line) + if m: + _u_distname = m.group(1).strip() + m = _release_file_re.search(line) + if m: + _u_version = m.group(1).strip() + m = _codename_file_re.search(line) + if m: + _u_id = m.group(1).strip() + if _u_distname and _u_version: + return (_u_distname, _u_version, _u_id) + except (EnvironmentError, UnboundLocalError): + pass + try: etc = os.listdir('/etc') except os.error: debian/patches/distutils-link0000644000000000000000000000212012215550224013510 0ustar Description: Don't add standard library dirs to library_dirs and runtime_library_dirs. Origin: Debian cpython packaging Author: Matthias Klose Last-Update: 2011-12-19 --- a/lib-python/2.7/distutils/unixccompiler.py +++ b/lib-python/2.7/distutils/unixccompiler.py @@ -228,7 +228,12 @@ objects, output_dir = self._fix_object_args(objects, output_dir) libraries, library_dirs, runtime_library_dirs = \ self._fix_lib_args(libraries, library_dirs, runtime_library_dirs) - + # filter out standard library paths, which are not explicitely needed + # for linking + library_dirs = [dir for dir in library_dirs + if not dir in ('/lib', '/lib64', '/usr/lib', '/usr/lib64')] + runtime_library_dirs = [dir for dir in runtime_library_dirs + if not dir in ('/lib', '/lib64', '/usr/lib', '/usr/lib64')] lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs, libraries) if type(output_dir) not in (StringType, NoneType): debian/patches/langpack-gettext0000644000000000000000000000215012215550224013776 0ustar Description: Support Ubuntu langpacks Support alternative gettext tree in /usr/share/locale-langpack; if a file is present in both trees, prefer the newer one Forwarded: not-needed Origin: Debian cpython packaging Author: Michael Vogt Last-Update: 2011-12-19 --- a/lib-python/2.7/gettext.py +++ b/lib-python/2.7/gettext.py @@ -446,11 +446,26 @@ if lang == 'C': break mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain) + mofile_lp = os.path.join("/usr/share/locale-langpack", lang, + 'LC_MESSAGES', '%s.mo' % domain) + + # first look into the standard locale dir, then into the + # langpack locale dir + + # standard mo file if os.path.exists(mofile): if all: result.append(mofile) else: return mofile + + # langpack mofile -> use it + if os.path.exists(mofile_lp): + if all: + result.append(mofile_lp) + else: + return mofile_lp + return result debian/patches/version-info0000644000000000000000000000247312215550224013162 0ustar Description: Get version details from the Debian source package, rather than VCS Return the Debian package version in sys.version. Return null strings in sys._mercurial. Author: Stefano Rivera Forwarded: not-needed Last-Update: 2013-02-23 --- a/rpython/tool/version.py +++ b/rpython/tool/version.py @@ -18,6 +18,16 @@ def get_repo_version_info(hgexe=None, root=rpythonroot): '''Obtain version information by invoking the 'hg' or 'git' commands.''' + # Debian: built from a source tarball + p = Popen(('dpkg-parsechangelog',), stdout=PIPE, cwd=rpythonroot) + if p.wait() != 0: + maywarn(p.stderr.read(), 'dpkg-parsechangelog') + return default_retval + for line in p.stdout.read().split('\n'): + if line.split(':', 1)[0].strip() == 'Version': + version = line.split(':', 1)[1].strip() + return '', version + # Try to see if we can get info from Git if hgexe is not specified. if not hgexe: if os.path.isdir(os.path.join(root, '.git')): --- a/pypy/module/sys/version.py +++ b/pypy/module/sys/version.py @@ -88,6 +88,7 @@ return space.wrap(('PyPy', '', '')) def get_repo_info(space): + return space.wrap(('PyPy', '', '')) info = get_repo_version_info(root=pypyroot) if info: repo_tag, repo_version = info debian/patches/sandbox-dependencies0000644000000000000000000000337312215550224014626 0ustar Description: Remove dependencies on the rest of PyPy's source Remove py.path dependancy from sandlib. Print warning if py.log isn't available and is needed (--verbose). Author: Stefano Rivera Forwarded: no Last-Update: 2013-02-23 --- a/rpython/translator/sandbox/sandlib.py +++ b/rpython/translator/sandbox/sandlib.py @@ -8,11 +8,16 @@ import subprocess from rpython.tool.killsubprocess import killsubprocess from rpython.translator.sandbox.vfs import UID, GID -import py def create_log(): """Make and return a log for the sandbox to use, if needed.""" # These imports are local to avoid importing pypy if we don't need to. + try: + import py + except ImportError: + sys.stderr.write("The --verbose option requires python-py to be installed.\n") + return None + from rpython.tool.ansi_print import AnsiLog class MyAnsiLog(AnsiLog): @@ -34,7 +39,8 @@ # load(). Also, marshal.load(f) blocks with the GIL held when # f is a pipe with no data immediately avaialble, preventing the # _waiting_thread to run. -from rpython.translator.sandbox import _marshal as marshal +# In Debian we have a marshal symlinked into lib_pypy +import marshal # Non-marshal result types RESULTTYPE_STATRESULT = object() --- a/pypy/sandbox/pypy_interact.py +++ b/pypy/sandbox/pypy_interact.py @@ -25,8 +25,7 @@ from rpython.translator.sandbox.sandlib import SimpleIOSandboxedProc from rpython.translator.sandbox.sandlib import VirtualizedSandboxedProc from rpython.translator.sandbox.vfs import Dir, RealDir, RealFile -import pypy -LIB_ROOT = os.path.dirname(os.path.dirname(pypy.__file__)) +LIB_ROOT = '/usr/lib/pypy' class PyPySandboxedProc(VirtualizedSandboxedProc, SimpleIOSandboxedProc): argv0 = '/bin/pypy-c' debian/patches/test_fsync-eatmydata0000644000000000000000000000105312215550224014665 0ustar Description: Skip fsync tests when building with eatmydata Author: Stefano Rivera Forwarded: not-needed Last-Update: 2012-02-06 --- a/lib-python/2.7/test/test_os.py +++ b/lib-python/2.7/test/test_os.py @@ -609,6 +609,8 @@ except OSError as e: self.assertEqual(e.errno, errno.EBADF) else: + if f.__name__.endswith('sync'): + return # eatmydata won't raise an OSError self.fail("%r didn't raise a OSError with a bad file descriptor" % f) debian/patches/sandbox-bin0000644000000000000000000000246512215550224012751 0ustar Description: Make pypy_interact suitable for end-user use Hardcode our pypy-c-sandbox location in pypy_interact, and change it to think that it's called pypy-sandbox Author: Stefano Rivera Forwarded: no Last-Update: 2013-02-23 --- a/pypy/sandbox/pypy_interact.py +++ b/pypy/sandbox/pypy_interact.py @@ -3,7 +3,7 @@ """Interacts with a PyPy subprocess translated with --sandbox. Usage: - pypy_interact.py [options] + pypy-sandbox [options] Options: --tmp=DIR the real directory that corresponds to the virtual /tmp, @@ -17,7 +17,7 @@ Note that you can get readline-like behavior with a tool like 'ledit', provided you use enough -u options: - ledit python -u pypy_interact.py pypy-c-sandbox -u + ledit python -u /usr/bin/pypy-sandbox -u """ import sys, os @@ -110,10 +110,8 @@ else: raise ValueError(option) - if len(arguments) < 1: - help() - - sandproc = PyPySandboxedProc(arguments[0], extraoptions + arguments[1:], + sandproc = PyPySandboxedProc('/usr/lib/pypy-sandbox/pypy-c-sandbox', + extraoptions + arguments, tmpdir=tmpdir, debug=debug) if timeout is not None: sandproc.settimeout(timeout, interrupt_main=True) debian/patches/pep3147-stdlib0000644000000000000000000015275112215550224013133 0ustar Description: PEP3147 changes to lib-python Backported from cpython's PEP3147 commit Origin: cpython: http://hg.python.org/cpython/rev/7b69e630d237 Author: Barry Warsaw Author: Stefano Rivera Last-Update: 2013-02-23 --- a/lib-python/2.7/compileall.py +++ b/lib-python/2.7/compileall.py @@ -11,6 +11,7 @@ See module py_compile for details of the actual byte-compilation. """ import os +import errno import sys import py_compile import struct @@ -19,7 +20,7 @@ __all__ = ["compile_dir","compile_file","compile_path"] def compile_dir(dir, maxlevels=10, ddir=None, - force=0, rx=None, quiet=0): + force=False, rx=None, quiet=False, legacy=False): """Byte-compile all modules in the given directory tree. Arguments (only dir is required): @@ -28,8 +29,9 @@ maxlevels: maximum recursion level (default 10) ddir: the directory that will be prepended to the path to the file as it is compiled into each byte-code file. - force: if 1, force compilation, even if timestamps are up-to-date - quiet: if 1, be quiet during compilation + force: if True, force compilation, even if timestamps are up-to-date + quiet: if True, be quiet during compilation + legacy: if True, produce legacy pyc paths instead of PEP 3147 paths """ if not quiet: print 'Listing', dir, '...' @@ -47,18 +49,20 @@ else: dfile = None if not os.path.isdir(fullname): - if not compile_file(fullname, ddir, force, rx, quiet): + if not compile_file(fullname, ddir, force, rx, quiet, legacy): success = 0 elif maxlevels > 0 and \ name != os.curdir and name != os.pardir and \ os.path.isdir(fullname) and \ - not os.path.islink(fullname): + not os.path.islink(fullname) and \ + name != '__pycache__': if not compile_dir(fullname, maxlevels - 1, dfile, force, rx, - quiet): + quiet, legacy): success = 0 return success -def compile_file(fullname, ddir=None, force=0, rx=None, quiet=0): +def compile_file(fullname, ddir=None, force=0, rx=None, quiet=False, + legacy=False): """Byte-compile one file. Arguments (only fullname is required): @@ -66,8 +70,9 @@ fullname: the file to byte-compile ddir: if given, the directory name compiled in to the byte-code file. - force: if 1, force compilation, even if timestamps are up-to-date - quiet: if 1, be quiet during compilation + force: if True, force compilation, even if timestamps are up-to-date + quiet: if True, be quiet during compilation + legacy: if True, produce legacy pyc paths instead of PEP 3147 paths """ success = 1 name = os.path.basename(fullname) @@ -80,13 +85,22 @@ if mo: return success if os.path.isfile(fullname): + if legacy: + cfile = fullname + ('c' if __debug__ else 'o') + else: + cfile = imp.cache_from_source(fullname) + cache_dir = os.path.dirname(cfile) + try: + os.mkdir(cache_dir) + except OSError, error: + if error.errno != errno.EEXIST: + raise head, tail = name[:-3], name[-3:] if tail == '.py': if not force: try: mtime = int(os.stat(fullname).st_mtime) expect = struct.pack('<4sl', imp.get_magic(), mtime) - cfile = fullname + (__debug__ and 'c' or 'o') with open(cfile, 'rb') as chandle: actual = chandle.read(8) if expect == actual: @@ -96,7 +110,7 @@ if not quiet: print 'Compiling', fullname, '...' try: - ok = py_compile.compile(fullname, None, dfile, True) + ok = py_compile.compile(fullname, cfile, dfile, True) except py_compile.PyCompileError,err: if quiet: print 'Compiling', fullname, '...' @@ -110,15 +124,17 @@ success = 0 return success -def compile_path(skip_curdir=1, maxlevels=0, force=0, quiet=0): +def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=False, + legacy=False): """Byte-compile all module on sys.path. Arguments (all optional): skip_curdir: if true, skip current directory (default true) maxlevels: max recursion level (default 0) - force: as for compile_dir() (default 0) - quiet: as for compile_dir() (default 0) + force: as for compile_dir() (default False) + quiet: as for compile_dir() (default False) + legacy: as for compile_dir() (default False) """ success = 1 for dir in sys.path: @@ -126,7 +142,8 @@ print 'Skipping current directory' else: success = success and compile_dir(dir, maxlevels, None, - force, quiet=quiet) + force, quiet=quiet, + legacy=legacy) return success def expand_args(args, flist): @@ -152,7 +169,7 @@ """Script main program.""" import getopt try: - opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:i:') + opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:i:b') except getopt.error, msg: print msg print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \ @@ -177,23 +194,26 @@ print "-i file: add all the files and directories listed in file to " \ "the list considered for" print ' compilation; if "-", names are read from stdin' + print "-b: Produce legacy byte-compile file paths" sys.exit(2) maxlevels = 10 ddir = None - force = 0 - quiet = 0 + force = False + quiet = False rx = None flist = None + legacy = False for o, a in opts: if o == '-l': maxlevels = 0 if o == '-d': ddir = a - if o == '-f': force = 1 - if o == '-q': quiet = 1 + if o == '-f': force = True + if o == '-q': quiet = True if o == '-x': import re rx = re.compile(a) if o == '-i': flist = a + if o == '-b': legacy = True if ddir: if len(args) != 1 and not os.path.isdir(args[0]): print "-d destdir require exactly one directory argument" @@ -210,13 +230,14 @@ for arg in args: if os.path.isdir(arg): if not compile_dir(arg, maxlevels, ddir, - force, rx, quiet): + force, rx, quiet, legacy): success = 0 else: - if not compile_file(arg, ddir, force, rx, quiet): + if not compile_file(arg, ddir, force, rx, + quiet, legacy): success = 0 else: - success = compile_path() + success = compile_path(legacy=legacy) except KeyboardInterrupt: print "\n[interrupted]" success = 0 --- a/lib-python/2.7/py_compile.py +++ b/lib-python/2.7/py_compile.py @@ -4,6 +4,7 @@ """ import __builtin__ +import errno import imp import marshal import os @@ -71,20 +72,18 @@ def compile(file, cfile=None, dfile=None, doraise=False): """Byte-compile one Python source file to Python bytecode. - Arguments: - - file: source filename - cfile: target filename; defaults to source with 'c' or 'o' appended - ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) - dfile: purported filename; defaults to source (this is the filename - that will show up in error messages) - doraise: flag indicating whether or not an exception should be - raised when a compile error is found. If an exception - occurs and this flag is set to False, a string - indicating the nature of the exception will be printed, - and the function will return to the caller. If an - exception occurs and this flag is set to True, a - PyCompileError exception will be raised. + :param file: The source file name. + :param cfile: The target byte compiled file name. When not given, this + defaults to the PEP 3147 location. + :param dfile: Purported file name, i.e. the file name that shows up in + error messages. Defaults to the source file name. + :param doraise: Flag indicating whether or not an exception should be + raised when a compile error is found. If an exception occurs and this + flag is set to False, a string indicating the nature of the exception + will be printed, and the function will return to the caller. If an + exception occurs and this flag is set to True, a PyCompileError + exception will be raised. + :return: Path to the resulting byte compiled file. Note that it isn't necessary to byte-compile Python modules for execution efficiency -- Python itself byte-compiles a module when @@ -119,7 +118,12 @@ sys.stderr.write(py_exc.msg + '\n') return if cfile is None: - cfile = file + (__debug__ and 'c' or 'o') + cfile = imp.cache_from_source(file) + try: + os.mkdir(os.path.dirname(cfile)) + except OSError, error: + if error.errno != errno.EEXIST: + raise with open(cfile, 'wb') as fc: fc.write('\0\0\0\0') wr_long(fc, timestamp) @@ -127,6 +131,7 @@ fc.flush() fc.seek(0, 0) fc.write(MAGIC) + return cfile def main(args=None): """Compile several source files. --- a/lib-python/2.7/runpy.py +++ b/lib-python/2.7/runpy.py @@ -67,6 +67,7 @@ run_globals.update(init_globals) run_globals.update(__name__ = mod_name, __file__ = mod_fname, + __cached__ = None, __loader__ = mod_loader, __package__ = pkg_name) exec code in run_globals @@ -143,6 +144,7 @@ At the very least, these variables in __main__ will be overwritten: __name__ __file__ + __cached__ __loader__ __package__ """ --- a/lib-python/2.7/test/script_helper.py +++ b/lib-python/2.7/test/script_helper.py @@ -14,6 +14,9 @@ from test.test_support import strip_python_stderr +from imp import source_from_cache +from test.test_support import make_legacy_pyc + # Executing the interpreter in a subprocess def _assert_python(expected_success, *args, **env_vars): cmd_line = [sys.executable] @@ -105,20 +108,18 @@ script_file.close() return script_name -def compile_script(script_name): - py_compile.compile(script_name, doraise=True) - if __debug__: - compiled_name = script_name + 'c' - else: - compiled_name = script_name + 'o' - return compiled_name - def make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None): zip_filename = zip_basename+os.extsep+'zip' zip_name = os.path.join(zip_dir, zip_filename) zip_file = zipfile.ZipFile(zip_name, 'w') if name_in_zip is None: - name_in_zip = os.path.basename(script_name) + parts = script_name.split(os.sep) + if len(parts) >= 2 and parts[-2] == '__pycache__': + legacy_pyc = make_legacy_pyc(source_from_cache(script_name)) + name_in_zip = os.path.basename(legacy_pyc) + script_name = legacy_pyc + else: + name_in_zip = os.path.basename(script_name) zip_file.write(script_name, name_in_zip) zip_file.close() #if test.test_support.verbose: @@ -141,8 +142,8 @@ script_name = make_script(zip_dir, script_basename, source) unlink.append(script_name) if compiled: - init_name = compile_script(init_name) - script_name = compile_script(script_name) + init_name = py_compile(init_name, doraise=True) + script_name = py_compile(script_name, doraise=True) unlink.extend((init_name, script_name)) pkg_names = [os.sep.join([pkg_name]*i) for i in range(1, depth+1)] script_name_in_zip = os.path.join(pkg_names[-1], os.path.basename(script_name)) --- a/lib-python/2.7/test/test_compileall.py +++ b/lib-python/2.7/test/test_compileall.py @@ -4,6 +4,8 @@ import py_compile import shutil import struct +import sys +import subprocess import tempfile from test import test_support import unittest @@ -14,11 +16,11 @@ def setUp(self): self.directory = tempfile.mkdtemp() self.source_path = os.path.join(self.directory, '_test.py') - self.bc_path = self.source_path + ('c' if __debug__ else 'o') + self.bc_path = imp.cache_from_source(self.source_path) with open(self.source_path, 'w') as file: file.write('x = 123\n') self.source_path2 = os.path.join(self.directory, '_test2.py') - self.bc_path2 = self.source_path2 + ('c' if __debug__ else 'o') + self.bc_path2 = imp.cache_from_source(self.source_path2) shutil.copyfile(self.source_path, self.source_path2) def tearDown(self): @@ -72,8 +74,61 @@ os.unlink(self.bc_path) os.unlink(self.bc_path2) +class CommandLineTests(unittest.TestCase): + """Test some aspects of compileall's CLI.""" + + def setUp(self): + self.addCleanup(self._cleanup) + self.directory = tempfile.mkdtemp() + self.pkgdir = os.path.join(self.directory, 'foo') + os.mkdir(self.pkgdir) + # Touch the __init__.py and a package module. + with open(os.path.join(self.pkgdir, '__init__.py'), 'w'): + pass + with open(os.path.join(self.pkgdir, 'bar.py'), 'w'): + pass + sys.path.insert(0, self.directory) + + def _cleanup(self): + test_support.rmtree(self.directory) + assert sys.path[0] == self.directory, 'Missing path' + del sys.path[0] + + def test_pep3147_paths(self): + # Ensure that the default behavior of compileall's CLI is to create + # PEP 3147 pyc/pyo files. + retcode = subprocess.call( + (sys.executable, '-m', 'compileall', '-q', self.pkgdir)) + self.assertEqual(retcode, 0) + # Verify the __pycache__ directory contents. + cachedir = os.path.join(self.pkgdir, '__pycache__') + self.assertTrue(os.path.exists(cachedir)) + ext = ('pyc' if __debug__ else 'pyo') + expected = sorted(base.format(imp.get_tag(), ext) for base in + ('__init__.{}.{}', 'bar.{}.{}')) + self.assertEqual(sorted(os.listdir(cachedir)), expected) + # Make sure there are no .pyc files in the source directory. + self.assertFalse([pyc_file for pyc_file in os.listdir(self.pkgdir) + if pyc_file.endswith(ext)]) + + def test_legacy_paths(self): + # Ensure that with the proper switch, compileall leaves legacy + # pyc/pyo files, and no __pycache__ directory. + retcode = subprocess.call( + (sys.executable, '-m', 'compileall', '-b', '-q', self.pkgdir)) + self.assertEqual(retcode, 0) + # Verify the __pycache__ directory contents. + cachedir = os.path.join(self.pkgdir, '__pycache__') + self.assertFalse(os.path.exists(cachedir)) + ext = ('pyc' if __debug__ else 'pyo') + expected = [base.format(ext) for base in ('__init__.{}', 'bar.{}')] + expected.extend(['__init__.py', 'bar.py']) + expected.sort() + self.assertEqual(sorted(os.listdir(self.pkgdir)), expected) + + def test_main(): - test_support.run_unittest(CompileallTests) + test_support.run_unittest(CommandLineTests, CompileallTests) if __name__ == "__main__": --- a/lib-python/2.7/test/test_imp.py +++ b/lib-python/2.7/test/test_imp.py @@ -1,4 +1,7 @@ import imp +import os +import shutil +import sys import unittest from test import test_support @@ -65,8 +68,147 @@ imp.reload(marshal) +class PEP3147Tests(unittest.TestCase): + """Tests of PEP 3147.""" + + tag = imp.get_tag() + + def test_cache_from_source(self): + # Given the path to a .py file, return the path to its PEP 3147 + # defined .pyc file (i.e. under __pycache__). + self.assertEqual( + imp.cache_from_source('/foo/bar/baz/qux.py', True), + '/foo/bar/baz/__pycache__/qux.{}.pyc'.format(self.tag)) + + def test_cache_from_source_optimized(self): + # Given the path to a .py file, return the path to its PEP 3147 + # defined .pyo file (i.e. under __pycache__). + if test_support.check_impl_detail(pypy=True): + # PyPy doesn't support .pyo, so we expect .pyc + extension = 'pyc' + else: + extension = 'pyo' + self.assertEqual( + imp.cache_from_source('/foo/bar/baz/qux.py', False), + '/foo/bar/baz/__pycache__/qux.{}.{}'.format(self.tag, extension)) + + def test_cache_from_source_cwd(self): + self.assertEqual(imp.cache_from_source('foo.py', True), + os.sep.join(('__pycache__', + 'foo.{}.pyc'.format(self.tag)))) + + def test_cache_from_source_override(self): + # When debug_override is not None, it can be any true-ish or false-ish + # value. + if test_support.check_impl_detail(pypy=True): + # PyPy doesn't support .pyo, so we expect .pyc + extension = 'pyc' + else: + extension = 'pyo' + self.assertEqual( + imp.cache_from_source('/foo/bar/baz.py', []), + '/foo/bar/__pycache__/baz.{}.pyc'.format(self.tag)) + self.assertEqual( + imp.cache_from_source('/foo/bar/baz.py', [17]), + '/foo/bar/__pycache__/baz.{}.{}'.format(self.tag, extension)) + # However if the bool-ishness can't be determined, the exception + # propagates. + class Bearish: + def __bool__(self): raise RuntimeError + + if test_support.check_impl_detail(pypy=True): + # Pypy doesn't even determine bool-ishness + try: + imp.cache_from_source('/foo/bar/baz.py', Bearish()) + except RuntimeError: + pass + else: + self.assertRaises( + RuntimeError, + imp.cache_from_source, '/foo/bar/baz.py', Bearish()) + + @unittest.skipIf(os.altsep is None, + 'test meaningful only where os.altsep is defined') + def test_altsep_cache_from_source(self): + # Windows path and PEP 3147. + self.assertEqual( + imp.cache_from_source('\\foo\\bar\\baz\\qux.py', True), + '\\foo\\bar\\baz\\__pycache__\\qux.{}.pyc'.format(self.tag)) + + @unittest.skipIf(os.altsep is None, + 'test meaningful only where os.altsep is defined') + def test_altsep_and_sep_cache_from_source(self): + # Windows path and PEP 3147 where altsep is right of sep. + self.assertEqual( + imp.cache_from_source('\\foo\\bar/baz\\qux.py', True), + '\\foo\\bar/baz\\__pycache__\\qux.{}.pyc'.format(self.tag)) + + @unittest.skipIf(os.altsep is None, + 'test meaningful only where os.altsep is defined') + def test_sep_altsep_and_sep_cache_from_source(self): + # Windows path and PEP 3147 where sep is right of altsep. + self.assertEqual( + imp.cache_from_source('\\foo\\bar\\baz/qux.py', True), + '\\foo\\bar\\baz/__pycache__/qux.{}.pyc'.format(self.tag)) + + def test_source_from_cache(self): + # Given the path to a PEP 3147 defined .pyc file, return the path to + # its source. This tests the good path. + self.assertEqual(imp.source_from_cache( + '/foo/bar/baz/__pycache__/qux.{}.pyc'.format(self.tag)), + '/foo/bar/baz/qux.py') + + def test_source_from_cache_bad_path(self): + # When the path to a pyc file is not in PEP 3147 format, a ValueError + # is raised. + self.assertRaises( + ValueError, imp.source_from_cache, '/foo/bar/bazqux.pyc') + + def test_source_from_cache_no_slash(self): + # No slashes at all in path -> ValueError + self.assertRaises( + ValueError, imp.source_from_cache, 'foo.cpython-32.pyc') + + def test_source_from_cache_too_few_dots(self): + # Too few dots in final path component -> ValueError + self.assertRaises( + ValueError, imp.source_from_cache, '__pycache__/foo.pyc') + + def test_source_from_cache_too_many_dots(self): + # Too many dots in final path component -> ValueError + self.assertRaises( + ValueError, imp.source_from_cache, + '__pycache__/foo.cpython-32.foo.pyc') + + def test_source_from_cache_no__pycache__(self): + # Another problem with the path -> ValueError + self.assertRaises( + ValueError, imp.source_from_cache, + '/foo/bar/foo.cpython-32.foo.pyc') + + def test_package___file__(self): + # Test that a package's __file__ points to the right source directory. + os.mkdir('pep3147') + sys.path.insert(0, os.curdir) + def cleanup(): + if sys.path[0] == os.curdir: + del sys.path[0] + shutil.rmtree('pep3147') + self.addCleanup(cleanup) + # Touch the __init__.py file. + with open('pep3147/__init__.py', 'w'): + pass + m = __import__('pep3147') + # Ensure we load the pyc file. + test_support.forget('pep3147') + m = __import__('pep3147') + self.assertEqual(m.__file__, + os.sep.join(('.', 'pep3147', '__init__.py'))) + + def test_main(): tests = [ + PEP3147Tests, ReloadTests, ] try: --- a/lib-python/2.7/test/test_pkg.py +++ b/lib-python/2.7/test/test_pkg.py @@ -194,14 +194,14 @@ import t5 self.assertEqual(fixdir(dir(t5)), - ['__doc__', '__file__', '__name__', + ['__cached__', '__doc__', '__file__', '__name__', '__package__', '__path__', 'foo', 'string', 't5']) self.assertEqual(fixdir(dir(t5.foo)), - ['__doc__', '__file__', '__name__', '__package__', - 'string']) + ['__cached__', '__doc__', '__file__', '__name__', + '__package__', 'string']) self.assertEqual(fixdir(dir(t5.string)), - ['__doc__', '__file__', '__name__','__package__', - 'spam']) + ['__cached__', '__doc__', '__file__', '__name__', + '__package__', 'spam']) def test_6(self): hier = [ @@ -216,13 +216,13 @@ import t6 self.assertEqual(fixdir(dir(t6)), - ['__all__', '__doc__', '__file__', + ['__all__', '__cached__', '__doc__', '__file__', '__name__', '__package__', '__path__']) s = """ import t6 from t6 import * self.assertEqual(fixdir(dir(t6)), - ['__all__', '__doc__', '__file__', + ['__all__', '__cached__', '__doc__', '__file__', '__name__', '__package__', '__path__', 'eggs', 'ham', 'spam']) self.assertEqual(dir(), ['eggs', 'ham', 'self', 'spam', 't6']) @@ -250,18 +250,18 @@ t7, sub, subsub = None, None, None import t7 as tas self.assertEqual(fixdir(dir(tas)), - ['__doc__', '__file__', '__name__', + ['__cached__', '__doc__', '__file__', '__name__', '__package__', '__path__']) self.assertFalse(t7) from t7 import sub as subpar self.assertEqual(fixdir(dir(subpar)), - ['__doc__', '__file__', '__name__', + ['__cached__', '__doc__', '__file__', '__name__', '__package__', '__path__']) self.assertFalse(t7) self.assertFalse(sub) from t7.sub import subsub as subsubsub self.assertEqual(fixdir(dir(subsubsub)), - ['__doc__', '__file__', '__name__', + ['__cached__', '__doc__', '__file__', '__name__', '__package__', '__path__', 'spam']) self.assertFalse(t7) self.assertFalse(sub) --- a/lib-python/2.7/test/test_pkgimport.py +++ b/lib-python/2.7/test/test_pkgimport.py @@ -1,5 +1,6 @@ -import os, sys, string, random, tempfile, unittest +import os, sys, shutil, string, random, tempfile, unittest +from imp import cache_from_source from test.test_support import run_unittest class TestImport(unittest.TestCase): @@ -27,22 +28,17 @@ self.module_path = os.path.join(self.package_dir, 'foo'+os.extsep+'py') def tearDown(self): - for file in os.listdir(self.package_dir): - os.remove(os.path.join(self.package_dir, file)) - os.rmdir(self.package_dir) - os.rmdir(self.test_dir) + shutil.rmtree(self.test_dir) self.assertNotEqual(sys.path.count(self.test_dir), 0) sys.path.remove(self.test_dir) self.remove_modules() def rewrite_file(self, contents): - for extension in "co": - compiled_path = self.module_path + extension - if os.path.exists(compiled_path): - os.remove(compiled_path) - f = open(self.module_path, 'w') - f.write(contents) - f.close() + compiled_path = cache_from_source(self.module_path) + if os.path.exists(compiled_path): + os.remove(compiled_path) + with open(self.module_path, 'w') as f: + f.write(contents) def test_package_import__semantics(self): --- a/lib-python/2.7/test/test_zipfile.py +++ b/lib-python/2.7/test/test_zipfile.py @@ -6,6 +6,7 @@ import os import io +import imp import sys import time import shutil @@ -609,7 +610,13 @@ with zipfile.PyZipFile(TemporaryFile(), "w") as zipfp: fn = __file__ if fn.endswith('.pyc') or fn.endswith('.pyo'): - fn = fn[:-1] + path_split = fn.split(os.sep) + if os.altsep is not None: + path_split.extend(fn.split(os.altsep)) + if '__pycache__' in path_split: + fn = imp.source_from_cache(fn) + else: + fn = fn[:-1] zipfp.writepy(fn) --- a/lib-python/2.7/test/test_zipimport.py +++ b/lib-python/2.7/test/test_zipimport.py @@ -43,17 +43,14 @@ test_pyc = make_pyc(test_co, NOW) -if __debug__: - pyc_ext = ".pyc" -else: - pyc_ext = ".pyo" - - TESTMOD = "ziptestmodule" TESTPACK = "ziptestpackage" TESTPACK2 = "ziptestpackage2" TEMP_ZIP = os.path.abspath("junk95142" + os.extsep + "zip") +pyc_file = imp.cache_from_source(TESTMOD + '.py') +pyc_ext = ('.pyc' if __debug__ else '.pyo') + class UncompressedZipImportTestCase(ImportHooksBaseTestCase): --- a/lib-python/2.7/zipfile.py +++ b/lib-python/2.7/zipfile.py @@ -5,6 +5,7 @@ import binascii, cStringIO, stat import io import re +import imp try: import zlib # We may need its compression method @@ -1360,22 +1361,42 @@ file_py = pathname + ".py" file_pyc = pathname + ".pyc" file_pyo = pathname + ".pyo" - if os.path.isfile(file_pyo) and \ - os.stat(file_pyo).st_mtime >= os.stat(file_py).st_mtime: - fname = file_pyo # Use .pyo file - elif not os.path.isfile(file_pyc) or \ - os.stat(file_pyc).st_mtime < os.stat(file_py).st_mtime: + pycache_pyc = imp.cache_from_source(file_py, True) + pycache_pyo = imp.cache_from_source(file_py, False) + if (os.path.isfile(file_pyo) and + os.stat(file_pyo).st_mtime >= os.stat(file_py).st_mtime): + # Use .pyo file. + arcname = fname = file_pyo + elif (os.path.isfile(file_pyc) and + os.stat(file_pyc).st_mtime >= os.stat(file_py).st_mtime): + # Use .pyc file. + arcname = fname = file_pyc + elif (os.path.isfile(pycache_pyc) and + os.stat(pycache_pyc).st_mtime >= os.stat(file_py).st_mtime): + # Use the __pycache__/*.pyc file, but write it to the legacy pyc + # file name in the archive. + fname = pycache_pyc + arcname = file_pyc + elif (os.path.isfile(pycache_pyo) and + os.stat(pycache_pyo).st_mtime >= os.stat(file_py).st_mtime): + # Use the __pycache__/*.pyo file, but write it to the legacy pyo + # file name in the archive. + fname = pycache_pyo + arcname = file_pyo + else: + # Compile py into PEP 3147 pyc file. import py_compile if self.debug: print "Compiling", file_py try: - py_compile.compile(file_py, file_pyc, None, True) - except py_compile.PyCompileError,err: + py_compile.compile(file_py, doraise=True) + except py_compile.PyCompileError, error: print err.msg - fname = file_pyc - else: - fname = file_pyc - archivename = os.path.split(fname)[1] + fname = file_py + else: + fname = (pycache_pyc if __debug__ else pycache_pyo) + arcname = (file_pyc if __debug__ else file_pyo) + archivename = os.path.split(arcname)[1] if basename: archivename = "%s/%s" % (basename, archivename) return (fname, archivename) --- a/lib-python/2.7/inspect.py +++ b/lib-python/2.7/inspect.py @@ -52,6 +52,7 @@ """Return true if the object is a module. Module objects provide these attributes: + __cached__ pathname to byte compiled file __doc__ documentation string __file__ filename (missing for built-in modules)""" return isinstance(object, types.ModuleType) --- a/lib-python/2.7/pydoc.py +++ b/lib-python/2.7/pydoc.py @@ -160,7 +160,8 @@ """Decide whether to show documentation on a variable.""" # Certain special names are redundant. _hidden_names = ('__builtins__', '__doc__', '__file__', '__path__', - '__module__', '__name__', '__slots__', '__package__') + '__module__', '__name__', '__slots__', '__package__', + '__cached__') if name in _hidden_names: return 0 # Private names are hidden, but special names are displayed. if name.startswith('__') and name.endswith('__'): return 1 --- a/lib-python/2.7/site.py +++ b/lib-python/2.7/site.py @@ -85,8 +85,8 @@ return dir, os.path.normcase(dir) -def abs__file__(): - """Set all module' __file__ attribute to an absolute path""" +def abs_paths(): + """Set all module __file__ and __cached__ attributes to an absolute path""" for m in sys.modules.values(): if hasattr(m, '__loader__'): continue # don't mess with a PEP 302-supplied __file__ @@ -97,6 +97,13 @@ m.__file__ = new except (AttributeError, OSError): pass + try: + prev = m.__cached__ + new = os.path.abspath(m.__cached__) + if prev != new: + m.__cached__ = new + except (AttributeError, OSError): + pass def removeduppaths(): @@ -565,7 +572,7 @@ global ENABLE_USER_SITE import_builtin_stuff() - abs__file__() + abs_paths() known_paths = removeduppaths() if (os.name == "posix" and sys.path and os.path.basename(sys.path[-1]) == "Modules"): --- a/lib-python/2.7/test/test_cmd_line_script.py +++ b/lib-python/2.7/test/test_cmd_line_script.py @@ -3,9 +3,11 @@ import unittest import os import os.path +import py_compile + import test.test_support from test.script_helper import (run_python, - temp_dir, make_script, compile_script, + temp_dir, make_script, make_pkg, make_zip_script, make_zip_pkg) verbose = test.test_support.verbose @@ -29,6 +31,7 @@ # Check population of magic variables assertEqual(__name__, '__main__') print '__file__==%r' % __file__ +assertEqual(__cached__, None) print '__package__==%r' % __package__ # Check the sys module import sys @@ -102,7 +105,7 @@ def test_script_compiled(self): with temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'script') - compiled_name = compile_script(script_name) + compiled_name = py_compile.compile(script_name, doraise=True) os.remove(script_name) self._check_script(compiled_name, compiled_name, compiled_name, None) @@ -116,9 +119,10 @@ raise unittest.SkipTest("pypy won't load lone .pyc files") with temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') - compiled_name = compile_script(script_name) + compiled_name = py_compile.compile(script_name, doraise=True) os.remove(script_name) - self._check_script(script_dir, compiled_name, script_dir, '') + pyc_file = test.test_support.make_legacy_pyc(script_name) + self._check_script(script_dir, pyc_file, script_dir, '') def test_directory_error(self): with temp_dir() as script_dir: @@ -134,7 +138,7 @@ def test_zipfile_compiled(self): with temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') - compiled_name = compile_script(script_name) + compiled_name = py_compile.compile(script_name, doraise=True) zip_name, run_name = make_zip_script(script_dir, 'test_zip', compiled_name) self._check_script(zip_name, run_name, zip_name, '') @@ -181,11 +185,12 @@ pkg_dir = os.path.join(script_dir, 'test_pkg') make_pkg(pkg_dir) script_name = _make_test_script(pkg_dir, '__main__') - compiled_name = compile_script(script_name) + compiled_name = py_compile.compile(script_name, doraise=True) os.remove(script_name) + pyc_file = test.test_support.make_legacy_pyc(script_name) launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') - self._check_script(launch_name, compiled_name, - compiled_name, 'test_pkg') + self._check_script(launch_name, pyc_file, + pyc_file, 'test_pkg') def test_package_error(self): with temp_dir() as script_dir: --- a/lib-python/2.7/test/test_import.py +++ b/lib-python/2.7/test/test_import.py @@ -4,12 +4,14 @@ import os import py_compile import random +import shutil import stat import sys import unittest from test.test_support import (unlink, TESTFN, unload, run_unittest, rmtree, is_jython, check_warnings, EnvironmentVarGuard, - impl_detail, check_impl_detail) + impl_detail, check_impl_detail, forget, + make_legacy_pyc, temp_umask) import textwrap from test import script_helper @@ -20,6 +22,11 @@ name + os.extsep + "pyw", name + "$py.class"): unlink(f) + try: + shutil.rmtree('__pycache__') + except OSError, error: + if error.errno != errno.ENOENT: + raise class ImportTests(unittest.TestCase): @@ -79,9 +86,9 @@ except ImportError, err: self.fail("import from .pyc/.pyo failed: %s" % err) finally: + forget(TESTFN) unlink(pyc) unlink(pyo) - unload(TESTFN) sys.path.insert(0, os.curdir) try: @@ -96,28 +103,26 @@ def test_execute_bit_not_copied(self): # Issue 6070: under posix .pyc files got their execute bit set if # the .py file had the execute bit set, but they aren't executable. - oldmask = os.umask(022) - sys.path.insert(0, os.curdir) - try: - fname = TESTFN + os.extsep + "py" - f = open(fname, 'w').close() - os.chmod(fname, (stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH | - stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)) - __import__(TESTFN) - fn = fname + 'c' - if not os.path.exists(fn): - fn = fname + 'o' + with temp_umask(022): + sys.path.insert(0, os.curdir) + try: + fname = TESTFN + os.extsep + "py" + f = open(fname, 'w').close() + os.chmod(fname, (stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH | + stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)) + __import__(TESTFN) + fn = imp.cache_from_source(fname) if not os.path.exists(fn): self.fail("__import__ did not result in creation of " "either a .pyc or .pyo file") - s = os.stat(fn) - self.assertEqual(stat.S_IMODE(s.st_mode), - stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH) - finally: - os.umask(oldmask) - remove_files(TESTFN) - unload(TESTFN) - del sys.path[0] + s = os.stat(fn) + self.assertEqual( + stat.S_IMODE(s.st_mode), + stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH) + finally: + del sys.path[0] + remove_files(TESTFN) + unload(TESTFN) def test_imp_module(self): # Verify that the imp module can correctly load and find .py files @@ -149,12 +154,14 @@ f.write('"",\n') f.write(']') - # Compile & remove .py file, we only need .pyc (or .pyo). + # Compile & remove .py file, we only need .pyc (or .pyo), but that + # must be relocated to the PEP 3147 bytecode-only location. with open(filename, 'r') as f: py_compile.compile(filename) if check_impl_detail(pypy=False): # pypy refuses to import a .pyc if the .py does not exist unlink(filename) + make_legacy_pyc(filename) # Need to be able to load from current dir. sys.path.append('') @@ -289,7 +296,7 @@ sys.path.insert(0, os.curdir) try: source = TESTFN + ".py" - compiled = source + ('c' if __debug__ else 'o') + compiled = imp.cache_from_source(source) with open(source, 'w') as f: pass try: @@ -318,6 +325,7 @@ import sys code_filename = sys._getframe().f_code.co_filename module_filename = __file__ +module_pyc_filename = __cached__ constant = 1 def func(): pass @@ -325,7 +333,7 @@ """ dir_name = os.path.abspath(TESTFN) file_name = os.path.join(dir_name, module_name) + os.extsep + "py" - compiled_name = file_name + ("c" if __debug__ else "o") + compiled_name = imp.cache_from_source(file_name) def setUp(self): self.sys_path = sys.path[:] @@ -353,18 +361,21 @@ def test_basics(self): mod = self.import_module() self.assertEqual(mod.module_filename, self.file_name) + self.assertEqual(mod.module_pyc_filename, self.compiled_name) self.assertEqual(mod.code_filename, self.file_name) self.assertEqual(mod.func_filename, self.file_name) del sys.modules[self.module_name] mod = self.import_module() - self.assertEqual(mod.module_filename, self.compiled_name) + self.assertEqual(mod.module_filename, self.file_name) + self.assertEqual(mod.module_pyc_filename, self.compiled_name) self.assertEqual(mod.code_filename, self.file_name) self.assertEqual(mod.func_filename, self.file_name) def test_incorrect_code_name(self): py_compile.compile(self.file_name, dfile="another_module.py") mod = self.import_module() - self.assertEqual(mod.module_filename, self.compiled_name) + self.assertEqual(mod.module_filename, self.file_name) + self.assertEqual(mod.module_pyc_filename, self.compiled_name) self.assertEqual(mod.code_filename, self.file_name) self.assertEqual(mod.func_filename, self.file_name) @@ -373,8 +384,9 @@ target = "another_module.py" py_compile.compile(self.file_name, dfile=target) os.remove(self.file_name) + pyc_file = make_legacy_pyc(self.file_name) mod = self.import_module() - self.assertEqual(mod.module_filename, self.compiled_name) + self.assertEqual(mod.module_filename, pyc_file) self.assertEqual(mod.code_filename, target) self.assertEqual(mod.func_filename, target) --- a/lib-python/2.7/test/test_runpy.py +++ b/lib-python/2.7/test/test_runpy.py @@ -5,8 +5,9 @@ import sys import re import tempfile -from test.test_support import verbose, run_unittest, forget, check_impl_detail -from test.script_helper import (temp_dir, make_script, compile_script, +import py_compile +from test.test_support import verbose, run_unittest, forget, check_impl_detail, make_legacy_pyc +from test.script_helper import (temp_dir, make_script, make_pkg, make_zip_script, make_zip_pkg) if check_impl_detail(pypy=True): @@ -50,6 +51,7 @@ self.assertEqual(d["result"], self.expected_result) self.assertIs(d["__name__"], None) self.assertIs(d["__file__"], None) + self.assertIs(d["__cached__"], None) self.assertIs(d["__loader__"], None) self.assertIs(d["__package__"], None) self.assertIs(d["run_argv0"], saved_argv0) @@ -78,6 +80,7 @@ self.assertTrue(d2["run_name_in_sys_modules"]) self.assertTrue(d2["module_in_sys_modules"]) self.assertIs(d2["__file__"], file) + self.assertIs(d2["__cached__"], None) self.assertIs(d2["run_argv0"], file) self.assertIs(d2["__loader__"], loader) self.assertIs(d2["__package__"], package) @@ -176,6 +179,7 @@ if not no_lone_pyc_file: __import__(mod_name) os.remove(mod_fname) + make_legacy_pyc(mod_fname) if verbose: print "Running from compiled:", mod_name d2 = run_module(mod_name) # Read from bytecode self.assertIn("x", d2) @@ -199,6 +203,7 @@ if not no_lone_pyc_file: __import__(mod_name) os.remove(mod_fname) + make_legacy_pyc(mod_fname) if verbose: print "Running from compiled:", pkg_name d2 = run_module(pkg_name) # Read from bytecode self.assertIn("x", d2) @@ -254,6 +259,7 @@ if not no_lone_pyc_file: __import__(mod_name) os.remove(mod_fname) + make_legacy_pyc(mod_fname) if verbose: print "Running from compiled:", mod_name # Read from bytecode d2 = run_module(mod_name, run_name=run_name) @@ -322,6 +328,7 @@ result = run_path(script_name) self.assertEqual(result["__name__"], expected_name) self.assertEqual(result["__file__"], expected_file) + self.assertEqual(result["__cached__"], None) self.assertIn("argv0", result) self.assertEqual(result["argv0"], expected_argv0) self.assertEqual(result["__package__"], expected_package) @@ -341,7 +348,7 @@ with temp_dir() as script_dir: mod_name = 'script' script_name = self._make_test_script(script_dir, mod_name) - compiled_name = compile_script(script_name) + compiled_name = py_compile.compile(script_name, doraise=True) os.remove(script_name) self._check_script(compiled_name, "", compiled_name, compiled_name, None) @@ -359,9 +366,10 @@ with temp_dir() as script_dir: mod_name = '__main__' script_name = self._make_test_script(script_dir, mod_name) - compiled_name = compile_script(script_name) + compiled_name = py_compile.compile(script_name, doraise=True) os.remove(script_name) - self._check_script(script_dir, "", compiled_name, + legacy_pyc = make_legacy_pyc(script_name) + self._check_script(script_dir, "", legacy_pyc, script_dir, '') def test_directory_error(self): @@ -382,8 +390,9 @@ with temp_dir() as script_dir: mod_name = '__main__' script_name = self._make_test_script(script_dir, mod_name) - compiled_name = compile_script(script_name) - zip_name, fname = make_zip_script(script_dir, 'test_zip', compiled_name) + compiled_name = py_compile.compile(script_name, doraise=True) + zip_name, fname = make_zip_script(script_dir, 'test_zip', + compiled_name) self._check_script(zip_name, "", fname, zip_name, '') def test_zipfile_error(self): --- a/lib-python/2.7/test/test_site.py +++ b/lib-python/2.7/test/test_site.py @@ -324,19 +324,40 @@ """Restore sys.path""" sys.path[:] = self.sys_path - def test_abs__file__(self): - # Make sure all imported modules have their __file__ attribute - # as an absolute path. - # Handled by abs__file__() - site.abs__file__() - for module in (sys, os, __builtin__): - try: - self.assertTrue(os.path.isabs(module.__file__), repr(module)) - except AttributeError: - continue - # We could try everything in sys.modules; however, when regrtest.py - # runs something like test_frozen before test_site, then we will - # be testing things loaded *after* test_site did path normalization + def test_abs_paths(self): + # Make sure all imported modules have their __file__ and __cached__ + # attributes as absolute paths. Arranging to put the Lib directory on + # PYTHONPATH would cause the os module to have a relative path for + # __file__ if abs_paths() does not get run. sys and builtins (the + # only other modules imported before site.py runs) do not have + # __file__ or __cached__ because they are built-in. + parent = os.path.relpath(os.path.dirname(os.__file__)) + env = os.environ.copy() + env['PYTHONPATH'] = parent + # We use uuid rather than os, as os isn't modified in pypy + # and so not in the same path as test_site + command = 'import uuid; print uuid.__file__, uuid.__cached__' + # First, prove that with -S (no 'import site'), the paths are + # relative. + proc = subprocess.Popen([sys.executable, '-S', '-c', command], + env=env, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + stdout, stderr = proc.communicate() + self.assertEqual(proc.returncode, 0) + os__file__, os__cached__ = stdout.split() + self.assertFalse(os.path.isabs(os__file__)) + self.assertFalse(os.path.isabs(os__cached__)) + # Now, with 'import site', it works. + proc = subprocess.Popen([sys.executable, '-c', command], + env=env, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + stdout, stderr = proc.communicate() + self.assertEqual(proc.returncode, 0) + os__file__, os__cached__ = stdout.split() + self.assertTrue(os.path.isabs(os__file__)) + self.assertTrue(os.path.isabs(os__cached__)) def test_no_duplicate_paths(self): # No duplicate paths should exist in sys.path --- a/lib-python/2.7/test/test_support.py +++ b/lib-python/2.7/test/test_support.py @@ -17,6 +17,7 @@ import importlib import UserDict import re +import imp import time try: import thread @@ -32,7 +33,7 @@ "open_urlresource", "check_warnings", "check_py3k_warnings", "CleanImport", "EnvironmentVarGuard", "captured_output", "captured_stdout", "TransientResource", "transient_internet", - "run_with_locale", "set_memlimit", "bigmemtest", "bigaddrspacetest", + "run_with_locale", "set_memlimit", "temp_umask", "bigmemtest", "bigaddrspacetest", "BasicTestRunner", "run_unittest", "run_doctest", "threading_setup", "threading_cleanup", "reap_children", "cpython_only", "check_impl_detail", "get_attribute", "py3k_bytes", @@ -182,27 +183,50 @@ def unlink(filename): try: os.unlink(filename) - except OSError: - pass + except OSError, error: + # The filename need not exist. + if error.errno != errno.ENOENT: + raise def rmtree(path): try: shutil.rmtree(path) - except OSError, e: + except OSError, error: # Unix returns ENOENT, Windows returns ESRCH. - if e.errno not in (errno.ENOENT, errno.ESRCH): + if error.errno not in (errno.ENOENT, errno.ESRCH): raise +def make_legacy_pyc(source): + """Move a PEP 3147 pyc/pyo file to its legacy pyc/pyo location. + + The choice of .pyc or .pyo extension is done based on the __debug__ flag + value. + + :param source: The file system path to the source file. The source file + does not need to exist, however the PEP 3147 pyc file must exist. + :return: The file system path to the legacy pyc file. + """ + pyc_file = imp.cache_from_source(source) + up_one = os.path.dirname(os.path.abspath(source)) + legacy_pyc = os.path.join(up_one, source + ('c' if __debug__ else 'o')) + os.rename(pyc_file, legacy_pyc) + return legacy_pyc + def forget(modname): - '''"Forget" a module was ever imported by removing it from sys.modules and - deleting any .pyc and .pyo files.''' + """'Forget' a module was ever imported. + + This removes the module from sys.modules and deletes any PEP 3147 or + legacy .pyc and .pyo files. + """ unload(modname) for dirname in sys.path: - unlink(os.path.join(dirname, modname + os.extsep + 'pyc')) - # Deleting the .pyo file cannot be within the 'try' for the .pyc since - # the chance exists that there is no .pyc (and thus the 'try' statement - # is exited) but there is a .pyo file. - unlink(os.path.join(dirname, modname + os.extsep + 'pyo')) + source = os.path.join(dirname, modname + os.extsep + 'py') + # It doesn't matter if they exist or not, unlink all possible + # combinations of PEP 3147 and legacy pyc and pyo files. + unlink(source + 'c') + unlink(source + 'o') + unlink(imp.cache_from_source(source, debug_override=True)) + unlink(imp.cache_from_source(source, debug_override=False)) def is_resource_enabled(resource): """Test whether a resource is enabled. Known resources are set by @@ -431,6 +455,16 @@ rmtree(name) +@contextlib.contextmanager +def temp_umask(umask): + """Context manager that temporarily sets the process umask.""" + oldmask = os.umask(umask) + try: + yield + finally: + os.umask(oldmask) + + def findfile(file, here=None, subdir=None): """Try to find a file on sys.path and the working directory. If it is not found the argument passed to the function is returned (this does not --- a/lib-python/2.7/test/test_traceback.py +++ b/lib-python/2.7/test/test_traceback.py @@ -5,6 +5,7 @@ except ImportError: traceback_print = None from StringIO import StringIO +import shutil import sys import unittest from imp import reload @@ -114,9 +115,7 @@ self.assertEqual(src, 'raise NotImplementedError') finally: sys.path[:] = savedpath - for f in os.listdir(testdir): - os.unlink(os.path.join(testdir, f)) - os.rmdir(testdir) + shutil.rmtree(testdir) def test_base_exception(self): # Test that exceptions derived from BaseException are formatted right --- a/lib-python/2.7/test/test_py_compile.py +++ b/lib-python/2.7/test/test_py_compile.py @@ -12,7 +12,7 @@ def setUp(self): self.directory = tempfile.mkdtemp() self.source_path = os.path.join(self.directory, '_test.py') - self.pyc_path = self.source_path + 'c' + self.pyc_path = imp.cache_from_source(self.source_path) self.cwd_drive = os.path.splitdrive(os.getcwd())[0] # In these tests we compute relative paths. When using Windows, the # current working directory path and the 'self.source_path' might be @@ -37,8 +37,9 @@ def test_cwd(self): cwd = os.getcwd() os.chdir(self.directory) + pyc_file = imp.cache_from_source(os.path.basename(self.source_path)) py_compile.compile(os.path.basename(self.source_path), - os.path.basename(self.pyc_path)) + pyc_file) os.chdir(cwd) self.assertTrue(os.path.exists(self.pyc_path)) debian/patches/locale-module0000644000000000000000000000163612215550224013266 0ustar Description: Don't map 'utf8', 'utf-8' to 'utf', which is not a known encoding for glibc. Author: Matthias Klose Origin: Debian cpython packaging Bug-cpython: http://bugs.python.org/issue1166957 Last-Update: 2011-12-19 --- a/lib-python/2.7/locale.py +++ b/lib-python/2.7/locale.py @@ -1520,8 +1520,8 @@ 'uk_ua.iso88595': 'uk_UA.ISO8859-5', 'uk_ua.koi8u': 'uk_UA.KOI8-U', 'uk_ua.microsoftcp1251': 'uk_UA.CP1251', - 'univ': 'en_US.utf', - 'universal': 'en_US.utf', + 'univ': 'en_US.UTF-8', + 'universal': 'en_US.UTF-8', 'universal.utf8@ucs4': 'en_US.UTF-8', 'ur': 'ur_PK.CP1256', 'ur_pk': 'ur_PK.CP1256', debian/patches/tkinter-import0000644000000000000000000000135212241450506013530 0ustar Description: suggest installation of pypy-tk package on failing _tkinter import Author: Matthias Klose Author: Stefano Rivera Last-Update: 2013-11-15 --- a/lib-python/2.7/lib-tk/Tkinter.py +++ b/lib-python/2.7/lib-tk/Tkinter.py @@ -36,7 +36,10 @@ if sys.platform == "win32": # Attempt to configure Tcl/Tk without requiring PATH import FixTk -import _tkinter # If this fails your Python may not be configured for Tk +try: + import _tkinter # If this fails your Python may not be configured for Tk +except ImportError, msg: + raise ImportError, str(msg) + ', please install the pypy-tk package' tkinter = _tkinter # b/w compat for export TclError = _tkinter.TclError from types import * debian/patches/so_reuseport0000644000000000000000000000270312215550224013271 0ustar Description: Avoid test failures when the kernel doesn't support SO_REUSEPORT If Python was compiled on a machine with SO_REUSEPORT support, it'll be in the socket module, but that doesn't mean it's available in the running kernel. So avoid tripping over ENOPROTOOPT in this situation. Author: Stefano Rivera Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=913732 Forwarded: no Last-Updated: 2013-05-17 --- a/lib-python/2.7/test/test_support.py +++ b/lib-python/2.7/test/test_support.py @@ -329,9 +329,13 @@ raise TestFailed("tests should never set the SO_REUSEADDR " \ "socket option on TCP/IP sockets!") if hasattr(socket, 'SO_REUSEPORT'): - if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: - raise TestFailed("tests should never set the SO_REUSEPORT " \ - "socket option on TCP/IP sockets!") + try: + if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: + raise TestFailed("tests should never set the SO_REUSEPORT " \ + "socket option on TCP/IP sockets!") + except socket.error as e: + if e.errno != errno.ENOPROTOOPT: + raise if hasattr(socket, 'SO_EXCLUSIVEADDRUSE'): sock.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1) debian/patches/plat-linux2-differences0000644000000000000000000025574112215550224015206 0ustar Description: plat-linux2's constants vary Break the affected files up, and import based on platform.machine() Bug-cpython: http://bugs.python.org/issue3990 Origin: Debian cpython packaging Author: Thiemo Seufer Author: Matthias Klose Author: Stefano Rivera Last-Update: 2011-12-21 --- /dev/null +++ b/lib-python/2.7/plat-linux2/DLFCN_default.py @@ -0,0 +1,83 @@ +# Generated by h2py from /usr/include/dlfcn.h +_DLFCN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 199506L +_XOPEN_SOURCE = 600 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 2 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __PMT(args): return args + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 + +# Included from gnu/stubs.h + +# Included from bits/dlfcn.h +RTLD_LAZY = 0x00001 +RTLD_NOW = 0x00002 +RTLD_BINDING_MASK = 0x3 +RTLD_NOLOAD = 0x00004 +RTLD_GLOBAL = 0x00100 +RTLD_LOCAL = 0 +RTLD_NODELETE = 0x01000 --- /dev/null +++ b/lib-python/2.7/plat-linux2/IN_default.py @@ -0,0 +1,615 @@ +# Generated by h2py from /usr/include/netinet/in.h +_NETINET_IN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 199506L +_XOPEN_SOURCE = 600 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 2 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __PMT(args): return args + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 + +# Included from gnu/stubs.h + +# Included from stdint.h +_STDINT_H = 1 + +# Included from bits/wchar.h +_BITS_WCHAR_H = 1 +__WCHAR_MIN = (-2147483647l - 1l) +__WCHAR_MAX = (2147483647l) + +# Included from bits/wordsize.h +__WORDSIZE = 32 +def __INT64_C(c): return c ## L + +def __UINT64_C(c): return c ## UL + +def __INT64_C(c): return c ## LL + +def __UINT64_C(c): return c ## ULL + +INT8_MIN = (-128) +INT16_MIN = (-32767-1) +INT32_MIN = (-2147483647-1) +INT64_MIN = (-__INT64_C(9223372036854775807)-1) +INT8_MAX = (127) +INT16_MAX = (32767) +INT32_MAX = (2147483647) +INT64_MAX = (__INT64_C(9223372036854775807)) +UINT8_MAX = (255) +UINT16_MAX = (65535) +UINT64_MAX = (__UINT64_C(18446744073709551615)) +INT_LEAST8_MIN = (-128) +INT_LEAST16_MIN = (-32767-1) +INT_LEAST32_MIN = (-2147483647-1) +INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_LEAST8_MAX = (127) +INT_LEAST16_MAX = (32767) +INT_LEAST32_MAX = (2147483647) +INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_LEAST8_MAX = (255) +UINT_LEAST16_MAX = (65535) +UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) +INT_FAST8_MIN = (-128) +INT_FAST16_MIN = (-9223372036854775807L-1) +INT_FAST32_MIN = (-9223372036854775807L-1) +INT_FAST16_MIN = (-2147483647-1) +INT_FAST32_MIN = (-2147483647-1) +INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_FAST8_MAX = (127) +INT_FAST16_MAX = (9223372036854775807L) +INT_FAST32_MAX = (9223372036854775807L) +INT_FAST16_MAX = (2147483647) +INT_FAST32_MAX = (2147483647) +INT_FAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_FAST8_MAX = (255) +UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) +INTPTR_MIN = (-9223372036854775807L-1) +INTPTR_MAX = (9223372036854775807L) +INTPTR_MIN = (-2147483647-1) +INTPTR_MAX = (2147483647) +INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) +INTMAX_MAX = (__INT64_C(9223372036854775807)) +UINTMAX_MAX = (__UINT64_C(18446744073709551615)) +PTRDIFF_MIN = (-9223372036854775807L-1) +PTRDIFF_MAX = (9223372036854775807L) +PTRDIFF_MIN = (-2147483647-1) +PTRDIFF_MAX = (2147483647) +SIG_ATOMIC_MIN = (-2147483647-1) +SIG_ATOMIC_MAX = (2147483647) +WCHAR_MIN = __WCHAR_MIN +WCHAR_MAX = __WCHAR_MAX +def INT8_C(c): return c + +def INT16_C(c): return c + +def INT32_C(c): return c + +def INT64_C(c): return c ## L + +def INT64_C(c): return c ## LL + +def UINT8_C(c): return c ## U + +def UINT16_C(c): return c ## U + +def UINT32_C(c): return c ## U + +def UINT64_C(c): return c ## UL + +def UINT64_C(c): return c ## ULL + +def INTMAX_C(c): return c ## L + +def UINTMAX_C(c): return c ## UL + +def INTMAX_C(c): return c ## LL + +def UINTMAX_C(c): return c ## ULL + + +# Included from bits/types.h +_BITS_TYPES_H = 1 +__FD_SETSIZE = 1024 + +# Included from bits/pthreadtypes.h +_BITS_PTHREADTYPES_H = 1 + +# Included from bits/sched.h +SCHED_OTHER = 0 +SCHED_FIFO = 1 +SCHED_RR = 2 +CSIGNAL = 0x000000ff +CLONE_VM = 0x00000100 +CLONE_FS = 0x00000200 +CLONE_FILES = 0x00000400 +CLONE_SIGHAND = 0x00000800 +CLONE_PID = 0x00001000 +CLONE_PTRACE = 0x00002000 +CLONE_VFORK = 0x00004000 +__defined_schedparam = 1 +def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) + +IN_CLASSA_NET = (-16777216) +IN_CLASSA_NSHIFT = 24 +IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) +IN_CLASSA_MAX = 128 +def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) + +IN_CLASSB_NET = (-65536) +IN_CLASSB_NSHIFT = 16 +IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) +IN_CLASSB_MAX = 65536 +def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) + +IN_CLASSC_NET = (-256) +IN_CLASSC_NSHIFT = 8 +IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) +def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) + +def IN_MULTICAST(a): return IN_CLASSD(a) + +def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) + +def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) + +IN_LOOPBACKNET = 127 +INET_ADDRSTRLEN = 16 +INET6_ADDRSTRLEN = 46 + +# Included from bits/socket.h + +# Included from limits.h +_LIBC_LIMITS_H_ = 1 +MB_LEN_MAX = 16 +_LIMITS_H = 1 +CHAR_BIT = 8 +SCHAR_MIN = (-128) +SCHAR_MAX = 127 +UCHAR_MAX = 255 +CHAR_MIN = 0 +CHAR_MAX = UCHAR_MAX +CHAR_MIN = SCHAR_MIN +CHAR_MAX = SCHAR_MAX +SHRT_MIN = (-32768) +SHRT_MAX = 32767 +USHRT_MAX = 65535 +INT_MAX = 2147483647 +LONG_MAX = 9223372036854775807L +LONG_MAX = 2147483647L +LONG_MIN = (-LONG_MAX - 1L) + +# Included from bits/posix1_lim.h +_BITS_POSIX1_LIM_H = 1 +_POSIX_AIO_LISTIO_MAX = 2 +_POSIX_AIO_MAX = 1 +_POSIX_ARG_MAX = 4096 +_POSIX_CHILD_MAX = 6 +_POSIX_DELAYTIMER_MAX = 32 +_POSIX_LINK_MAX = 8 +_POSIX_MAX_CANON = 255 +_POSIX_MAX_INPUT = 255 +_POSIX_MQ_OPEN_MAX = 8 +_POSIX_MQ_PRIO_MAX = 32 +_POSIX_NGROUPS_MAX = 0 +_POSIX_OPEN_MAX = 16 +_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX +_POSIX_NAME_MAX = 14 +_POSIX_PATH_MAX = 256 +_POSIX_PIPE_BUF = 512 +_POSIX_RTSIG_MAX = 8 +_POSIX_SEM_NSEMS_MAX = 256 +_POSIX_SEM_VALUE_MAX = 32767 +_POSIX_SIGQUEUE_MAX = 32 +_POSIX_SSIZE_MAX = 32767 +_POSIX_STREAM_MAX = 8 +_POSIX_TZNAME_MAX = 6 +_POSIX_QLIMIT = 1 +_POSIX_HIWAT = _POSIX_PIPE_BUF +_POSIX_UIO_MAXIOV = 16 +_POSIX_TTY_NAME_MAX = 9 +_POSIX_TIMER_MAX = 32 +_POSIX_LOGIN_NAME_MAX = 9 +_POSIX_CLOCKRES_MIN = 20000000 + +# Included from bits/local_lim.h + +# Included from linux/limits.h +NR_OPEN = 1024 +NGROUPS_MAX = 32 +ARG_MAX = 131072 +CHILD_MAX = 999 +OPEN_MAX = 256 +LINK_MAX = 127 +MAX_CANON = 255 +MAX_INPUT = 255 +NAME_MAX = 255 +PATH_MAX = 4096 +PIPE_BUF = 4096 +RTSIG_MAX = 32 +_POSIX_THREAD_KEYS_MAX = 128 +PTHREAD_KEYS_MAX = 1024 +_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 +PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS +_POSIX_THREAD_THREADS_MAX = 64 +PTHREAD_THREADS_MAX = 1024 +AIO_PRIO_DELTA_MAX = 20 +PTHREAD_STACK_MIN = 16384 +TIMER_MAX = 256 +SSIZE_MAX = LONG_MAX +NGROUPS_MAX = _POSIX_NGROUPS_MAX + +# Included from bits/posix2_lim.h +_BITS_POSIX2_LIM_H = 1 +_POSIX2_BC_BASE_MAX = 99 +_POSIX2_BC_DIM_MAX = 2048 +_POSIX2_BC_SCALE_MAX = 99 +_POSIX2_BC_STRING_MAX = 1000 +_POSIX2_COLL_WEIGHTS_MAX = 2 +_POSIX2_EXPR_NEST_MAX = 32 +_POSIX2_LINE_MAX = 2048 +_POSIX2_RE_DUP_MAX = 255 +_POSIX2_CHARCLASS_NAME_MAX = 14 +BC_BASE_MAX = _POSIX2_BC_BASE_MAX +BC_DIM_MAX = _POSIX2_BC_DIM_MAX +BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX +BC_STRING_MAX = _POSIX2_BC_STRING_MAX +COLL_WEIGHTS_MAX = 255 +EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX +LINE_MAX = _POSIX2_LINE_MAX +CHARCLASS_NAME_MAX = 2048 +RE_DUP_MAX = (0x7fff) + +# Included from bits/xopen_lim.h +_XOPEN_LIM_H = 1 + +# Included from bits/stdio_lim.h +L_tmpnam = 20 +TMP_MAX = 238328 +FILENAME_MAX = 4096 +L_ctermid = 9 +L_cuserid = 9 +FOPEN_MAX = 16 +IOV_MAX = 1024 +_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV +NL_ARGMAX = _POSIX_ARG_MAX +NL_LANGMAX = _POSIX2_LINE_MAX +NL_MSGMAX = INT_MAX +NL_NMAX = INT_MAX +NL_SETMAX = INT_MAX +NL_TEXTMAX = INT_MAX +NZERO = 20 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 32 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 64 +LONG_BIT = 32 +from TYPES import * +PF_UNSPEC = 0 +PF_LOCAL = 1 +PF_UNIX = PF_LOCAL +PF_FILE = PF_LOCAL +PF_INET = 2 +PF_AX25 = 3 +PF_IPX = 4 +PF_APPLETALK = 5 +PF_NETROM = 6 +PF_BRIDGE = 7 +PF_ATMPVC = 8 +PF_X25 = 9 +PF_INET6 = 10 +PF_ROSE = 11 +PF_DECnet = 12 +PF_NETBEUI = 13 +PF_SECURITY = 14 +PF_KEY = 15 +PF_NETLINK = 16 +PF_ROUTE = PF_NETLINK +PF_PACKET = 17 +PF_ASH = 18 +PF_ECONET = 19 +PF_ATMSVC = 20 +PF_SNA = 22 +PF_IRDA = 23 +PF_PPPOX = 24 +PF_WANPIPE = 25 +PF_BLUETOOTH = 31 +PF_MAX = 32 +AF_UNSPEC = PF_UNSPEC +AF_LOCAL = PF_LOCAL +AF_UNIX = PF_UNIX +AF_FILE = PF_FILE +AF_INET = PF_INET +AF_AX25 = PF_AX25 +AF_IPX = PF_IPX +AF_APPLETALK = PF_APPLETALK +AF_NETROM = PF_NETROM +AF_BRIDGE = PF_BRIDGE +AF_ATMPVC = PF_ATMPVC +AF_X25 = PF_X25 +AF_INET6 = PF_INET6 +AF_ROSE = PF_ROSE +AF_DECnet = PF_DECnet +AF_NETBEUI = PF_NETBEUI +AF_SECURITY = PF_SECURITY +AF_KEY = PF_KEY +AF_NETLINK = PF_NETLINK +AF_ROUTE = PF_ROUTE +AF_PACKET = PF_PACKET +AF_ASH = PF_ASH +AF_ECONET = PF_ECONET +AF_ATMSVC = PF_ATMSVC +AF_SNA = PF_SNA +AF_IRDA = PF_IRDA +AF_PPPOX = PF_PPPOX +AF_WANPIPE = PF_WANPIPE +AF_BLUETOOTH = PF_BLUETOOTH +AF_MAX = PF_MAX +SOL_RAW = 255 +SOL_DECNET = 261 +SOL_X25 = 262 +SOL_PACKET = 263 +SOL_ATM = 264 +SOL_AAL = 265 +SOL_IRDA = 266 +SOMAXCONN = 128 + +# Included from bits/sockaddr.h +_BITS_SOCKADDR_H = 1 +def __SOCKADDR_COMMON(sa_prefix): return \ + +_SS_SIZE = 128 +def CMSG_FIRSTHDR(mhdr): return \ + + +# Included from asm/socket.h + +# Included from asm/sockios.h +FIOSETOWN = 0x8901 +SIOCSPGRP = 0x8902 +FIOGETOWN = 0x8903 +SIOCGPGRP = 0x8904 +SIOCATMARK = 0x8905 +SIOCGSTAMP = 0x8906 +SOL_SOCKET = 1 +SO_DEBUG = 1 +SO_REUSEADDR = 2 +SO_TYPE = 3 +SO_ERROR = 4 +SO_DONTROUTE = 5 +SO_BROADCAST = 6 +SO_SNDBUF = 7 +SO_RCVBUF = 8 +SO_KEEPALIVE = 9 +SO_OOBINLINE = 10 +SO_NO_CHECK = 11 +SO_PRIORITY = 12 +SO_LINGER = 13 +SO_BSDCOMPAT = 14 +SO_PASSCRED = 16 +SO_PEERCRED = 17 +SO_RCVLOWAT = 18 +SO_SNDLOWAT = 19 +SO_RCVTIMEO = 20 +SO_SNDTIMEO = 21 +SO_SECURITY_AUTHENTICATION = 22 +SO_SECURITY_ENCRYPTION_TRANSPORT = 23 +SO_SECURITY_ENCRYPTION_NETWORK = 24 +SO_BINDTODEVICE = 25 +SO_ATTACH_FILTER = 26 +SO_DETACH_FILTER = 27 +SO_PEERNAME = 28 +SO_TIMESTAMP = 29 +SCM_TIMESTAMP = SO_TIMESTAMP +SO_ACCEPTCONN = 30 +SOCK_STREAM = 1 +SOCK_DGRAM = 2 +SOCK_RAW = 3 +SOCK_RDM = 4 +SOCK_SEQPACKET = 5 +SOCK_PACKET = 10 +SOCK_MAX = (SOCK_PACKET+1) + +# Included from bits/in.h +IP_TOS = 1 +IP_TTL = 2 +IP_HDRINCL = 3 +IP_OPTIONS = 4 +IP_ROUTER_ALERT = 5 +IP_RECVOPTS = 6 +IP_RETOPTS = 7 +IP_PKTINFO = 8 +IP_PKTOPTIONS = 9 +IP_PMTUDISC = 10 +IP_MTU_DISCOVER = 10 +IP_RECVERR = 11 +IP_RECVTTL = 12 +IP_RECVTOS = 13 +IP_MULTICAST_IF = 32 +IP_MULTICAST_TTL = 33 +IP_MULTICAST_LOOP = 34 +IP_ADD_MEMBERSHIP = 35 +IP_DROP_MEMBERSHIP = 36 +IP_RECVRETOPTS = IP_RETOPTS +IP_PMTUDISC_DONT = 0 +IP_PMTUDISC_WANT = 1 +IP_PMTUDISC_DO = 2 +SOL_IP = 0 +IP_DEFAULT_MULTICAST_TTL = 1 +IP_DEFAULT_MULTICAST_LOOP = 1 +IP_MAX_MEMBERSHIPS = 20 +IPV6_ADDRFORM = 1 +IPV6_PKTINFO = 2 +IPV6_HOPOPTS = 3 +IPV6_DSTOPTS = 4 +IPV6_RTHDR = 5 +IPV6_PKTOPTIONS = 6 +IPV6_CHECKSUM = 7 +IPV6_HOPLIMIT = 8 +IPV6_NEXTHOP = 9 +IPV6_AUTHHDR = 10 +IPV6_UNICAST_HOPS = 16 +IPV6_MULTICAST_IF = 17 +IPV6_MULTICAST_HOPS = 18 +IPV6_MULTICAST_LOOP = 19 +IPV6_JOIN_GROUP = 20 +IPV6_LEAVE_GROUP = 21 +IPV6_ROUTER_ALERT = 22 +IPV6_MTU_DISCOVER = 23 +IPV6_MTU = 24 +IPV6_RECVERR = 25 +IPV6_RXHOPOPTS = IPV6_HOPOPTS +IPV6_RXDSTOPTS = IPV6_DSTOPTS +IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP +IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP +IPV6_PMTUDISC_DONT = 0 +IPV6_PMTUDISC_WANT = 1 +IPV6_PMTUDISC_DO = 2 +SOL_IPV6 = 41 +SOL_ICMPV6 = 58 +IPV6_RTHDR_LOOSE = 0 +IPV6_RTHDR_STRICT = 1 +IPV6_RTHDR_TYPE_0 = 0 + +# Included from endian.h +_ENDIAN_H = 1 +__LITTLE_ENDIAN = 1234 +__BIG_ENDIAN = 4321 +__PDP_ENDIAN = 3412 + +# Included from bits/endian.h +__BYTE_ORDER = __LITTLE_ENDIAN +__FLOAT_WORD_ORDER = __BYTE_ORDER +LITTLE_ENDIAN = __LITTLE_ENDIAN +BIG_ENDIAN = __BIG_ENDIAN +PDP_ENDIAN = __PDP_ENDIAN +BYTE_ORDER = __BYTE_ORDER + +# Included from bits/byteswap.h +_BITS_BYTESWAP_H = 1 +def __bswap_constant_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_16(x): return __bswap_constant_16 (x) + +def __bswap_constant_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return __bswap_constant_32 (x) + +def __bswap_constant_64(x): return \ + +def __bswap_64(x): return \ + +def ntohl(x): return (x) + +def ntohs(x): return (x) + +def htonl(x): return (x) + +def htons(x): return (x) + +def ntohl(x): return __bswap_32 (x) + +def ntohs(x): return __bswap_16 (x) + +def htonl(x): return __bswap_32 (x) + +def htons(x): return __bswap_16 (x) + +def IN6_IS_ADDR_UNSPECIFIED(a): return \ + +def IN6_IS_ADDR_LOOPBACK(a): return \ + +def IN6_IS_ADDR_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_SITELOCAL(a): return \ + +def IN6_IS_ADDR_V4MAPPED(a): return \ + +def IN6_IS_ADDR_V4COMPAT(a): return \ + +def IN6_IS_ADDR_MC_NODELOCAL(a): return \ + +def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_MC_SITELOCAL(a): return \ + +def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ + +def IN6_IS_ADDR_MC_GLOBAL(a): return --- /dev/null +++ b/lib-python/2.7/plat-linux2/DLFCN_mips.py @@ -0,0 +1,83 @@ +# Generated by h2py from /usr/include/dlfcn.h +_DLFCN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 199506L +_XOPEN_SOURCE = 600 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 2 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __PMT(args): return args + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 + +# Included from gnu/stubs.h + +# Included from bits/dlfcn.h +RTLD_LAZY = 0x00001 +RTLD_NOW = 0x00002 +RTLD_BINDING_MASK = 0x3 +RTLD_NOLOAD = 0x00008 +RTLD_GLOBAL = 0x00004 +RTLD_LOCAL = 0 +RTLD_NODELETE = 0x01000 --- /dev/null +++ b/lib-python/2.7/plat-linux2/IN_alpha.py @@ -0,0 +1,615 @@ +# Generated by h2py from /usr/include/netinet/in.h +_NETINET_IN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 199506L +_XOPEN_SOURCE = 600 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 2 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __PMT(args): return args + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 + +# Included from gnu/stubs.h + +# Included from stdint.h +_STDINT_H = 1 + +# Included from bits/wchar.h +_BITS_WCHAR_H = 1 +__WCHAR_MIN = (-2147483647l - 1l) +__WCHAR_MAX = (2147483647l) + +# Included from bits/wordsize.h +__WORDSIZE = 32 +def __INT64_C(c): return c ## L + +def __UINT64_C(c): return c ## UL + +def __INT64_C(c): return c ## LL + +def __UINT64_C(c): return c ## ULL + +INT8_MIN = (-128) +INT16_MIN = (-32767-1) +INT32_MIN = (-2147483647-1) +INT64_MIN = (-__INT64_C(9223372036854775807)-1) +INT8_MAX = (127) +INT16_MAX = (32767) +INT32_MAX = (2147483647) +INT64_MAX = (__INT64_C(9223372036854775807)) +UINT8_MAX = (255) +UINT16_MAX = (65535) +UINT64_MAX = (__UINT64_C(18446744073709551615)) +INT_LEAST8_MIN = (-128) +INT_LEAST16_MIN = (-32767-1) +INT_LEAST32_MIN = (-2147483647-1) +INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_LEAST8_MAX = (127) +INT_LEAST16_MAX = (32767) +INT_LEAST32_MAX = (2147483647) +INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_LEAST8_MAX = (255) +UINT_LEAST16_MAX = (65535) +UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) +INT_FAST8_MIN = (-128) +INT_FAST16_MIN = (-9223372036854775807L-1) +INT_FAST32_MIN = (-9223372036854775807L-1) +INT_FAST16_MIN = (-2147483647-1) +INT_FAST32_MIN = (-2147483647-1) +INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_FAST8_MAX = (127) +INT_FAST16_MAX = (9223372036854775807L) +INT_FAST32_MAX = (9223372036854775807L) +INT_FAST16_MAX = (2147483647) +INT_FAST32_MAX = (2147483647) +INT_FAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_FAST8_MAX = (255) +UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) +INTPTR_MIN = (-9223372036854775807L-1) +INTPTR_MAX = (9223372036854775807L) +INTPTR_MIN = (-2147483647-1) +INTPTR_MAX = (2147483647) +INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) +INTMAX_MAX = (__INT64_C(9223372036854775807)) +UINTMAX_MAX = (__UINT64_C(18446744073709551615)) +PTRDIFF_MIN = (-9223372036854775807L-1) +PTRDIFF_MAX = (9223372036854775807L) +PTRDIFF_MIN = (-2147483647-1) +PTRDIFF_MAX = (2147483647) +SIG_ATOMIC_MIN = (-2147483647-1) +SIG_ATOMIC_MAX = (2147483647) +WCHAR_MIN = __WCHAR_MIN +WCHAR_MAX = __WCHAR_MAX +def INT8_C(c): return c + +def INT16_C(c): return c + +def INT32_C(c): return c + +def INT64_C(c): return c ## L + +def INT64_C(c): return c ## LL + +def UINT8_C(c): return c ## U + +def UINT16_C(c): return c ## U + +def UINT32_C(c): return c ## U + +def UINT64_C(c): return c ## UL + +def UINT64_C(c): return c ## ULL + +def INTMAX_C(c): return c ## L + +def UINTMAX_C(c): return c ## UL + +def INTMAX_C(c): return c ## LL + +def UINTMAX_C(c): return c ## ULL + + +# Included from bits/types.h +_BITS_TYPES_H = 1 +__FD_SETSIZE = 1024 + +# Included from bits/pthreadtypes.h +_BITS_PTHREADTYPES_H = 1 + +# Included from bits/sched.h +SCHED_OTHER = 0 +SCHED_FIFO = 1 +SCHED_RR = 2 +CSIGNAL = 0x000000ff +CLONE_VM = 0x00000100 +CLONE_FS = 0x00000200 +CLONE_FILES = 0x00000400 +CLONE_SIGHAND = 0x00000800 +CLONE_PID = 0x00001000 +CLONE_PTRACE = 0x00002000 +CLONE_VFORK = 0x00004000 +__defined_schedparam = 1 +def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) + +IN_CLASSA_NET = (-16777216) +IN_CLASSA_NSHIFT = 24 +IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) +IN_CLASSA_MAX = 128 +def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) + +IN_CLASSB_NET = (-65536) +IN_CLASSB_NSHIFT = 16 +IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) +IN_CLASSB_MAX = 65536 +def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) + +IN_CLASSC_NET = (-256) +IN_CLASSC_NSHIFT = 8 +IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) +def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) + +def IN_MULTICAST(a): return IN_CLASSD(a) + +def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) + +def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) + +IN_LOOPBACKNET = 127 +INET_ADDRSTRLEN = 16 +INET6_ADDRSTRLEN = 46 + +# Included from bits/socket.h + +# Included from limits.h +_LIBC_LIMITS_H_ = 1 +MB_LEN_MAX = 16 +_LIMITS_H = 1 +CHAR_BIT = 8 +SCHAR_MIN = (-128) +SCHAR_MAX = 127 +UCHAR_MAX = 255 +CHAR_MIN = 0 +CHAR_MAX = UCHAR_MAX +CHAR_MIN = SCHAR_MIN +CHAR_MAX = SCHAR_MAX +SHRT_MIN = (-32768) +SHRT_MAX = 32767 +USHRT_MAX = 65535 +INT_MAX = 2147483647 +LONG_MAX = 9223372036854775807L +LONG_MAX = 2147483647L +LONG_MIN = (-LONG_MAX - 1L) + +# Included from bits/posix1_lim.h +_BITS_POSIX1_LIM_H = 1 +_POSIX_AIO_LISTIO_MAX = 2 +_POSIX_AIO_MAX = 1 +_POSIX_ARG_MAX = 4096 +_POSIX_CHILD_MAX = 6 +_POSIX_DELAYTIMER_MAX = 32 +_POSIX_LINK_MAX = 8 +_POSIX_MAX_CANON = 255 +_POSIX_MAX_INPUT = 255 +_POSIX_MQ_OPEN_MAX = 8 +_POSIX_MQ_PRIO_MAX = 32 +_POSIX_NGROUPS_MAX = 0 +_POSIX_OPEN_MAX = 16 +_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX +_POSIX_NAME_MAX = 14 +_POSIX_PATH_MAX = 256 +_POSIX_PIPE_BUF = 512 +_POSIX_RTSIG_MAX = 8 +_POSIX_SEM_NSEMS_MAX = 256 +_POSIX_SEM_VALUE_MAX = 32767 +_POSIX_SIGQUEUE_MAX = 32 +_POSIX_SSIZE_MAX = 32767 +_POSIX_STREAM_MAX = 8 +_POSIX_TZNAME_MAX = 6 +_POSIX_QLIMIT = 1 +_POSIX_HIWAT = _POSIX_PIPE_BUF +_POSIX_UIO_MAXIOV = 16 +_POSIX_TTY_NAME_MAX = 9 +_POSIX_TIMER_MAX = 32 +_POSIX_LOGIN_NAME_MAX = 9 +_POSIX_CLOCKRES_MIN = 20000000 + +# Included from bits/local_lim.h + +# Included from linux/limits.h +NR_OPEN = 1024 +NGROUPS_MAX = 32 +ARG_MAX = 131072 +CHILD_MAX = 999 +OPEN_MAX = 256 +LINK_MAX = 127 +MAX_CANON = 255 +MAX_INPUT = 255 +NAME_MAX = 255 +PATH_MAX = 4096 +PIPE_BUF = 4096 +RTSIG_MAX = 32 +_POSIX_THREAD_KEYS_MAX = 128 +PTHREAD_KEYS_MAX = 1024 +_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 +PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS +_POSIX_THREAD_THREADS_MAX = 64 +PTHREAD_THREADS_MAX = 1024 +AIO_PRIO_DELTA_MAX = 20 +PTHREAD_STACK_MIN = 16384 +TIMER_MAX = 256 +SSIZE_MAX = LONG_MAX +NGROUPS_MAX = _POSIX_NGROUPS_MAX + +# Included from bits/posix2_lim.h +_BITS_POSIX2_LIM_H = 1 +_POSIX2_BC_BASE_MAX = 99 +_POSIX2_BC_DIM_MAX = 2048 +_POSIX2_BC_SCALE_MAX = 99 +_POSIX2_BC_STRING_MAX = 1000 +_POSIX2_COLL_WEIGHTS_MAX = 2 +_POSIX2_EXPR_NEST_MAX = 32 +_POSIX2_LINE_MAX = 2048 +_POSIX2_RE_DUP_MAX = 255 +_POSIX2_CHARCLASS_NAME_MAX = 14 +BC_BASE_MAX = _POSIX2_BC_BASE_MAX +BC_DIM_MAX = _POSIX2_BC_DIM_MAX +BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX +BC_STRING_MAX = _POSIX2_BC_STRING_MAX +COLL_WEIGHTS_MAX = 255 +EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX +LINE_MAX = _POSIX2_LINE_MAX +CHARCLASS_NAME_MAX = 2048 +RE_DUP_MAX = (0x7fff) + +# Included from bits/xopen_lim.h +_XOPEN_LIM_H = 1 + +# Included from bits/stdio_lim.h +L_tmpnam = 20 +TMP_MAX = 238328 +FILENAME_MAX = 4096 +L_ctermid = 9 +L_cuserid = 9 +FOPEN_MAX = 16 +IOV_MAX = 1024 +_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV +NL_ARGMAX = _POSIX_ARG_MAX +NL_LANGMAX = _POSIX2_LINE_MAX +NL_MSGMAX = INT_MAX +NL_NMAX = INT_MAX +NL_SETMAX = INT_MAX +NL_TEXTMAX = INT_MAX +NZERO = 20 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 32 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 64 +LONG_BIT = 32 +from TYPES import * +PF_UNSPEC = 0 +PF_LOCAL = 1 +PF_UNIX = PF_LOCAL +PF_FILE = PF_LOCAL +PF_INET = 2 +PF_AX25 = 3 +PF_IPX = 4 +PF_APPLETALK = 5 +PF_NETROM = 6 +PF_BRIDGE = 7 +PF_ATMPVC = 8 +PF_X25 = 9 +PF_INET6 = 10 +PF_ROSE = 11 +PF_DECnet = 12 +PF_NETBEUI = 13 +PF_SECURITY = 14 +PF_KEY = 15 +PF_NETLINK = 16 +PF_ROUTE = PF_NETLINK +PF_PACKET = 17 +PF_ASH = 18 +PF_ECONET = 19 +PF_ATMSVC = 20 +PF_SNA = 22 +PF_IRDA = 23 +PF_PPPOX = 24 +PF_WANPIPE = 25 +PF_BLUETOOTH = 31 +PF_MAX = 32 +AF_UNSPEC = PF_UNSPEC +AF_LOCAL = PF_LOCAL +AF_UNIX = PF_UNIX +AF_FILE = PF_FILE +AF_INET = PF_INET +AF_AX25 = PF_AX25 +AF_IPX = PF_IPX +AF_APPLETALK = PF_APPLETALK +AF_NETROM = PF_NETROM +AF_BRIDGE = PF_BRIDGE +AF_ATMPVC = PF_ATMPVC +AF_X25 = PF_X25 +AF_INET6 = PF_INET6 +AF_ROSE = PF_ROSE +AF_DECnet = PF_DECnet +AF_NETBEUI = PF_NETBEUI +AF_SECURITY = PF_SECURITY +AF_KEY = PF_KEY +AF_NETLINK = PF_NETLINK +AF_ROUTE = PF_ROUTE +AF_PACKET = PF_PACKET +AF_ASH = PF_ASH +AF_ECONET = PF_ECONET +AF_ATMSVC = PF_ATMSVC +AF_SNA = PF_SNA +AF_IRDA = PF_IRDA +AF_PPPOX = PF_PPPOX +AF_WANPIPE = PF_WANPIPE +AF_BLUETOOTH = PF_BLUETOOTH +AF_MAX = PF_MAX +SOL_RAW = 255 +SOL_DECNET = 261 +SOL_X25 = 262 +SOL_PACKET = 263 +SOL_ATM = 264 +SOL_AAL = 265 +SOL_IRDA = 266 +SOMAXCONN = 128 + +# Included from bits/sockaddr.h +_BITS_SOCKADDR_H = 1 +def __SOCKADDR_COMMON(sa_prefix): return \ + +_SS_SIZE = 128 +def CMSG_FIRSTHDR(mhdr): return \ + + +# Included from asm/socket.h + +# Included from asm/sockios.h +FIOSETOWN = 0x8004667c +SIOCSPGRP = 0x80047308 +FIOGETOWN = 0x4004667b +SIOCGPGRP = 0x40047309 +SIOCATMARK = 0x40047307 +SIOCGSTAMP = 0x8906 +SOL_SOCKET = 0xffff +SO_DEBUG = 0x0001 +SO_REUSEADDR = 0x0004 +SO_TYPE = 0x1008 +SO_ERROR = 0x1007 +SO_DONTROUTE = 0x0010 +SO_BROADCAST = 0x0020 +SO_SNDBUF = 0x1001 +SO_RCVBUF = 0x1002 +SO_KEEPALIVE = 0x0008 +SO_OOBINLINE = 0x0100 +SO_NO_CHECK = 11 +SO_PRIORITY = 12 +SO_LINGER = 0x0080 +SO_BSDCOMPAT = 14 +SO_PASSCRED = 16 +SO_PEERCRED = 17 +SO_RCVLOWAT = 0x1010 +SO_SNDLOWAT = 0x1011 +SO_RCVTIMEO = 0x1012 +SO_SNDTIMEO = 0x1013 +SO_SECURITY_AUTHENTICATION = 19 +SO_SECURITY_ENCRYPTION_TRANSPORT = 20 +SO_SECURITY_ENCRYPTION_NETWORK = 21 +SO_BINDTODEVICE = 25 +SO_ATTACH_FILTER = 26 +SO_DETACH_FILTER = 27 +SO_PEERNAME = 28 +SO_TIMESTAMP = 29 +SCM_TIMESTAMP = SO_TIMESTAMP +SO_ACCEPTCONN = 0x1014 +SOCK_STREAM = 1 +SOCK_DGRAM = 2 +SOCK_RAW = 3 +SOCK_RDM = 4 +SOCK_SEQPACKET = 5 +SOCK_PACKET = 10 +SOCK_MAX = (SOCK_PACKET+1) + +# Included from bits/in.h +IP_TOS = 1 +IP_TTL = 2 +IP_HDRINCL = 3 +IP_OPTIONS = 4 +IP_ROUTER_ALERT = 5 +IP_RECVOPTS = 6 +IP_RETOPTS = 7 +IP_PKTINFO = 8 +IP_PKTOPTIONS = 9 +IP_PMTUDISC = 10 +IP_MTU_DISCOVER = 10 +IP_RECVERR = 11 +IP_RECVTTL = 12 +IP_RECVTOS = 13 +IP_MULTICAST_IF = 32 +IP_MULTICAST_TTL = 33 +IP_MULTICAST_LOOP = 34 +IP_ADD_MEMBERSHIP = 35 +IP_DROP_MEMBERSHIP = 36 +IP_RECVRETOPTS = IP_RETOPTS +IP_PMTUDISC_DONT = 0 +IP_PMTUDISC_WANT = 1 +IP_PMTUDISC_DO = 2 +SOL_IP = 0 +IP_DEFAULT_MULTICAST_TTL = 1 +IP_DEFAULT_MULTICAST_LOOP = 1 +IP_MAX_MEMBERSHIPS = 20 +IPV6_ADDRFORM = 1 +IPV6_PKTINFO = 2 +IPV6_HOPOPTS = 3 +IPV6_DSTOPTS = 4 +IPV6_RTHDR = 5 +IPV6_PKTOPTIONS = 6 +IPV6_CHECKSUM = 7 +IPV6_HOPLIMIT = 8 +IPV6_NEXTHOP = 9 +IPV6_AUTHHDR = 10 +IPV6_UNICAST_HOPS = 16 +IPV6_MULTICAST_IF = 17 +IPV6_MULTICAST_HOPS = 18 +IPV6_MULTICAST_LOOP = 19 +IPV6_JOIN_GROUP = 20 +IPV6_LEAVE_GROUP = 21 +IPV6_ROUTER_ALERT = 22 +IPV6_MTU_DISCOVER = 23 +IPV6_MTU = 24 +IPV6_RECVERR = 25 +IPV6_RXHOPOPTS = IPV6_HOPOPTS +IPV6_RXDSTOPTS = IPV6_DSTOPTS +IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP +IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP +IPV6_PMTUDISC_DONT = 0 +IPV6_PMTUDISC_WANT = 1 +IPV6_PMTUDISC_DO = 2 +SOL_IPV6 = 41 +SOL_ICMPV6 = 58 +IPV6_RTHDR_LOOSE = 0 +IPV6_RTHDR_STRICT = 1 +IPV6_RTHDR_TYPE_0 = 0 + +# Included from endian.h +_ENDIAN_H = 1 +__LITTLE_ENDIAN = 1234 +__BIG_ENDIAN = 4321 +__PDP_ENDIAN = 3412 + +# Included from bits/endian.h +__BYTE_ORDER = __LITTLE_ENDIAN +__FLOAT_WORD_ORDER = __BYTE_ORDER +LITTLE_ENDIAN = __LITTLE_ENDIAN +BIG_ENDIAN = __BIG_ENDIAN +PDP_ENDIAN = __PDP_ENDIAN +BYTE_ORDER = __BYTE_ORDER + +# Included from bits/byteswap.h +_BITS_BYTESWAP_H = 1 +def __bswap_constant_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_16(x): return __bswap_constant_16 (x) + +def __bswap_constant_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return __bswap_constant_32 (x) + +def __bswap_constant_64(x): return \ + +def __bswap_64(x): return \ + +def ntohl(x): return (x) + +def ntohs(x): return (x) + +def htonl(x): return (x) + +def htons(x): return (x) + +def ntohl(x): return __bswap_32 (x) + +def ntohs(x): return __bswap_16 (x) + +def htonl(x): return __bswap_32 (x) + +def htons(x): return __bswap_16 (x) + +def IN6_IS_ADDR_UNSPECIFIED(a): return \ + +def IN6_IS_ADDR_LOOPBACK(a): return \ + +def IN6_IS_ADDR_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_SITELOCAL(a): return \ + +def IN6_IS_ADDR_V4MAPPED(a): return \ + +def IN6_IS_ADDR_V4COMPAT(a): return \ + +def IN6_IS_ADDR_MC_NODELOCAL(a): return \ + +def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_MC_SITELOCAL(a): return \ + +def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ + +def IN6_IS_ADDR_MC_GLOBAL(a): return --- /dev/null +++ b/lib-python/2.7/plat-linux2/IN_hppa.py @@ -0,0 +1,615 @@ +# Generated by h2py from /usr/include/netinet/in.h +_NETINET_IN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 199506L +_XOPEN_SOURCE = 600 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 2 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __PMT(args): return args + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 + +# Included from gnu/stubs.h + +# Included from stdint.h +_STDINT_H = 1 + +# Included from bits/wchar.h +_BITS_WCHAR_H = 1 +__WCHAR_MIN = (-2147483647l - 1l) +__WCHAR_MAX = (2147483647l) + +# Included from bits/wordsize.h +__WORDSIZE = 32 +def __INT64_C(c): return c ## L + +def __UINT64_C(c): return c ## UL + +def __INT64_C(c): return c ## LL + +def __UINT64_C(c): return c ## ULL + +INT8_MIN = (-128) +INT16_MIN = (-32767-1) +INT32_MIN = (-2147483647-1) +INT64_MIN = (-__INT64_C(9223372036854775807)-1) +INT8_MAX = (127) +INT16_MAX = (32767) +INT32_MAX = (2147483647) +INT64_MAX = (__INT64_C(9223372036854775807)) +UINT8_MAX = (255) +UINT16_MAX = (65535) +UINT64_MAX = (__UINT64_C(18446744073709551615)) +INT_LEAST8_MIN = (-128) +INT_LEAST16_MIN = (-32767-1) +INT_LEAST32_MIN = (-2147483647-1) +INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_LEAST8_MAX = (127) +INT_LEAST16_MAX = (32767) +INT_LEAST32_MAX = (2147483647) +INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_LEAST8_MAX = (255) +UINT_LEAST16_MAX = (65535) +UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) +INT_FAST8_MIN = (-128) +INT_FAST16_MIN = (-9223372036854775807L-1) +INT_FAST32_MIN = (-9223372036854775807L-1) +INT_FAST16_MIN = (-2147483647-1) +INT_FAST32_MIN = (-2147483647-1) +INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_FAST8_MAX = (127) +INT_FAST16_MAX = (9223372036854775807L) +INT_FAST32_MAX = (9223372036854775807L) +INT_FAST16_MAX = (2147483647) +INT_FAST32_MAX = (2147483647) +INT_FAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_FAST8_MAX = (255) +UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) +INTPTR_MIN = (-9223372036854775807L-1) +INTPTR_MAX = (9223372036854775807L) +INTPTR_MIN = (-2147483647-1) +INTPTR_MAX = (2147483647) +INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) +INTMAX_MAX = (__INT64_C(9223372036854775807)) +UINTMAX_MAX = (__UINT64_C(18446744073709551615)) +PTRDIFF_MIN = (-9223372036854775807L-1) +PTRDIFF_MAX = (9223372036854775807L) +PTRDIFF_MIN = (-2147483647-1) +PTRDIFF_MAX = (2147483647) +SIG_ATOMIC_MIN = (-2147483647-1) +SIG_ATOMIC_MAX = (2147483647) +WCHAR_MIN = __WCHAR_MIN +WCHAR_MAX = __WCHAR_MAX +def INT8_C(c): return c + +def INT16_C(c): return c + +def INT32_C(c): return c + +def INT64_C(c): return c ## L + +def INT64_C(c): return c ## LL + +def UINT8_C(c): return c ## U + +def UINT16_C(c): return c ## U + +def UINT32_C(c): return c ## U + +def UINT64_C(c): return c ## UL + +def UINT64_C(c): return c ## ULL + +def INTMAX_C(c): return c ## L + +def UINTMAX_C(c): return c ## UL + +def INTMAX_C(c): return c ## LL + +def UINTMAX_C(c): return c ## ULL + + +# Included from bits/types.h +_BITS_TYPES_H = 1 +__FD_SETSIZE = 1024 + +# Included from bits/pthreadtypes.h +_BITS_PTHREADTYPES_H = 1 + +# Included from bits/sched.h +SCHED_OTHER = 0 +SCHED_FIFO = 1 +SCHED_RR = 2 +CSIGNAL = 0x000000ff +CLONE_VM = 0x00000100 +CLONE_FS = 0x00000200 +CLONE_FILES = 0x00000400 +CLONE_SIGHAND = 0x00000800 +CLONE_PID = 0x00001000 +CLONE_PTRACE = 0x00002000 +CLONE_VFORK = 0x00004000 +__defined_schedparam = 1 +def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) + +IN_CLASSA_NET = (-16777216) +IN_CLASSA_NSHIFT = 24 +IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) +IN_CLASSA_MAX = 128 +def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) + +IN_CLASSB_NET = (-65536) +IN_CLASSB_NSHIFT = 16 +IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) +IN_CLASSB_MAX = 65536 +def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) + +IN_CLASSC_NET = (-256) +IN_CLASSC_NSHIFT = 8 +IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) +def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) + +def IN_MULTICAST(a): return IN_CLASSD(a) + +def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) + +def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) + +IN_LOOPBACKNET = 127 +INET_ADDRSTRLEN = 16 +INET6_ADDRSTRLEN = 46 + +# Included from bits/socket.h + +# Included from limits.h +_LIBC_LIMITS_H_ = 1 +MB_LEN_MAX = 16 +_LIMITS_H = 1 +CHAR_BIT = 8 +SCHAR_MIN = (-128) +SCHAR_MAX = 127 +UCHAR_MAX = 255 +CHAR_MIN = 0 +CHAR_MAX = UCHAR_MAX +CHAR_MIN = SCHAR_MIN +CHAR_MAX = SCHAR_MAX +SHRT_MIN = (-32768) +SHRT_MAX = 32767 +USHRT_MAX = 65535 +INT_MAX = 2147483647 +LONG_MAX = 9223372036854775807L +LONG_MAX = 2147483647L +LONG_MIN = (-LONG_MAX - 1L) + +# Included from bits/posix1_lim.h +_BITS_POSIX1_LIM_H = 1 +_POSIX_AIO_LISTIO_MAX = 2 +_POSIX_AIO_MAX = 1 +_POSIX_ARG_MAX = 4096 +_POSIX_CHILD_MAX = 6 +_POSIX_DELAYTIMER_MAX = 32 +_POSIX_LINK_MAX = 8 +_POSIX_MAX_CANON = 255 +_POSIX_MAX_INPUT = 255 +_POSIX_MQ_OPEN_MAX = 8 +_POSIX_MQ_PRIO_MAX = 32 +_POSIX_NGROUPS_MAX = 0 +_POSIX_OPEN_MAX = 16 +_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX +_POSIX_NAME_MAX = 14 +_POSIX_PATH_MAX = 256 +_POSIX_PIPE_BUF = 512 +_POSIX_RTSIG_MAX = 8 +_POSIX_SEM_NSEMS_MAX = 256 +_POSIX_SEM_VALUE_MAX = 32767 +_POSIX_SIGQUEUE_MAX = 32 +_POSIX_SSIZE_MAX = 32767 +_POSIX_STREAM_MAX = 8 +_POSIX_TZNAME_MAX = 6 +_POSIX_QLIMIT = 1 +_POSIX_HIWAT = _POSIX_PIPE_BUF +_POSIX_UIO_MAXIOV = 16 +_POSIX_TTY_NAME_MAX = 9 +_POSIX_TIMER_MAX = 32 +_POSIX_LOGIN_NAME_MAX = 9 +_POSIX_CLOCKRES_MIN = 20000000 + +# Included from bits/local_lim.h + +# Included from linux/limits.h +NR_OPEN = 1024 +NGROUPS_MAX = 32 +ARG_MAX = 131072 +CHILD_MAX = 999 +OPEN_MAX = 256 +LINK_MAX = 127 +MAX_CANON = 255 +MAX_INPUT = 255 +NAME_MAX = 255 +PATH_MAX = 4096 +PIPE_BUF = 4096 +RTSIG_MAX = 32 +_POSIX_THREAD_KEYS_MAX = 128 +PTHREAD_KEYS_MAX = 1024 +_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 +PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS +_POSIX_THREAD_THREADS_MAX = 64 +PTHREAD_THREADS_MAX = 1024 +AIO_PRIO_DELTA_MAX = 20 +PTHREAD_STACK_MIN = 16384 +TIMER_MAX = 256 +SSIZE_MAX = LONG_MAX +NGROUPS_MAX = _POSIX_NGROUPS_MAX + +# Included from bits/posix2_lim.h +_BITS_POSIX2_LIM_H = 1 +_POSIX2_BC_BASE_MAX = 99 +_POSIX2_BC_DIM_MAX = 2048 +_POSIX2_BC_SCALE_MAX = 99 +_POSIX2_BC_STRING_MAX = 1000 +_POSIX2_COLL_WEIGHTS_MAX = 2 +_POSIX2_EXPR_NEST_MAX = 32 +_POSIX2_LINE_MAX = 2048 +_POSIX2_RE_DUP_MAX = 255 +_POSIX2_CHARCLASS_NAME_MAX = 14 +BC_BASE_MAX = _POSIX2_BC_BASE_MAX +BC_DIM_MAX = _POSIX2_BC_DIM_MAX +BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX +BC_STRING_MAX = _POSIX2_BC_STRING_MAX +COLL_WEIGHTS_MAX = 255 +EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX +LINE_MAX = _POSIX2_LINE_MAX +CHARCLASS_NAME_MAX = 2048 +RE_DUP_MAX = (0x7fff) + +# Included from bits/xopen_lim.h +_XOPEN_LIM_H = 1 + +# Included from bits/stdio_lim.h +L_tmpnam = 20 +TMP_MAX = 238328 +FILENAME_MAX = 4096 +L_ctermid = 9 +L_cuserid = 9 +FOPEN_MAX = 16 +IOV_MAX = 1024 +_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV +NL_ARGMAX = _POSIX_ARG_MAX +NL_LANGMAX = _POSIX2_LINE_MAX +NL_MSGMAX = INT_MAX +NL_NMAX = INT_MAX +NL_SETMAX = INT_MAX +NL_TEXTMAX = INT_MAX +NZERO = 20 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 32 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 64 +LONG_BIT = 32 +from TYPES import * +PF_UNSPEC = 0 +PF_LOCAL = 1 +PF_UNIX = PF_LOCAL +PF_FILE = PF_LOCAL +PF_INET = 2 +PF_AX25 = 3 +PF_IPX = 4 +PF_APPLETALK = 5 +PF_NETROM = 6 +PF_BRIDGE = 7 +PF_ATMPVC = 8 +PF_X25 = 9 +PF_INET6 = 10 +PF_ROSE = 11 +PF_DECnet = 12 +PF_NETBEUI = 13 +PF_SECURITY = 14 +PF_KEY = 15 +PF_NETLINK = 16 +PF_ROUTE = PF_NETLINK +PF_PACKET = 17 +PF_ASH = 18 +PF_ECONET = 19 +PF_ATMSVC = 20 +PF_SNA = 22 +PF_IRDA = 23 +PF_PPPOX = 24 +PF_WANPIPE = 25 +PF_BLUETOOTH = 31 +PF_MAX = 32 +AF_UNSPEC = PF_UNSPEC +AF_LOCAL = PF_LOCAL +AF_UNIX = PF_UNIX +AF_FILE = PF_FILE +AF_INET = PF_INET +AF_AX25 = PF_AX25 +AF_IPX = PF_IPX +AF_APPLETALK = PF_APPLETALK +AF_NETROM = PF_NETROM +AF_BRIDGE = PF_BRIDGE +AF_ATMPVC = PF_ATMPVC +AF_X25 = PF_X25 +AF_INET6 = PF_INET6 +AF_ROSE = PF_ROSE +AF_DECnet = PF_DECnet +AF_NETBEUI = PF_NETBEUI +AF_SECURITY = PF_SECURITY +AF_KEY = PF_KEY +AF_NETLINK = PF_NETLINK +AF_ROUTE = PF_ROUTE +AF_PACKET = PF_PACKET +AF_ASH = PF_ASH +AF_ECONET = PF_ECONET +AF_ATMSVC = PF_ATMSVC +AF_SNA = PF_SNA +AF_IRDA = PF_IRDA +AF_PPPOX = PF_PPPOX +AF_WANPIPE = PF_WANPIPE +AF_BLUETOOTH = PF_BLUETOOTH +AF_MAX = PF_MAX +SOL_RAW = 255 +SOL_DECNET = 261 +SOL_X25 = 262 +SOL_PACKET = 263 +SOL_ATM = 264 +SOL_AAL = 265 +SOL_IRDA = 266 +SOMAXCONN = 128 + +# Included from bits/sockaddr.h +_BITS_SOCKADDR_H = 1 +def __SOCKADDR_COMMON(sa_prefix): return \ + +_SS_SIZE = 128 +def CMSG_FIRSTHDR(mhdr): return \ + + +# Included from asm/socket.h + +# Included from asm/sockios.h +FIOSETOWN = 0x8901 +SIOCSPGRP = 0x8902 +FIOGETOWN = 0x8903 +SIOCGPGRP = 0x8904 +SIOCATMARK = 0x8905 +SIOCGSTAMP = 0x8906 +SOL_SOCKET = 0xffff +SO_DEBUG = 0x0001 +SO_REUSEADDR = 0x0004 +SO_TYPE = 0x1008 +SO_ERROR = 0x1007 +SO_DONTROUTE = 0x0010 +SO_BROADCAST = 0x0020 +SO_SNDBUF = 0x1001 +SO_RCVBUF = 0x1002 +SO_KEEPALIVE = 0x0008 +SO_OOBINLINE = 0x0100 +SO_NO_CHECK = 0x400b +SO_PRIORITY = 0x400c +SO_LINGER = 0x0080 +SO_BSDCOMPAT = 0x400e +SO_PASSCRED = 0x4010 +SO_PEERCRED = 0x4011 +SO_RCVLOWAT = 0x1004 +SO_SNDLOWAT = 0x1003 +SO_RCVTIMEO = 0x1006 +SO_SNDTIMEO = 0x1005 +SO_SECURITY_AUTHENTICATION = 0x4016 +SO_SECURITY_ENCRYPTION_TRANSPORT = 0x4017 +SO_SECURITY_ENCRYPTION_NETWORK = 0x4018 +SO_BINDTODEVICE = 0x4019 +SO_ATTACH_FILTER = 0x401a +SO_DETACH_FILTER = 0x401b +SO_PEERNAME = 0x2000 +SO_TIMESTAMP = 0x4012 +SCM_TIMESTAMP = SO_TIMESTAMP +SO_ACCEPTCONN = 0x401c +SOCK_STREAM = 1 +SOCK_DGRAM = 2 +SOCK_RAW = 3 +SOCK_RDM = 4 +SOCK_SEQPACKET = 5 +SOCK_PACKET = 10 +SOCK_MAX = (SOCK_PACKET+1) + +# Included from bits/in.h +IP_TOS = 1 +IP_TTL = 2 +IP_HDRINCL = 3 +IP_OPTIONS = 4 +IP_ROUTER_ALERT = 5 +IP_RECVOPTS = 6 +IP_RETOPTS = 7 +IP_PKTINFO = 8 +IP_PKTOPTIONS = 9 +IP_PMTUDISC = 10 +IP_MTU_DISCOVER = 10 +IP_RECVERR = 11 +IP_RECVTTL = 12 +IP_RECVTOS = 13 +IP_MULTICAST_IF = 32 +IP_MULTICAST_TTL = 33 +IP_MULTICAST_LOOP = 34 +IP_ADD_MEMBERSHIP = 35 +IP_DROP_MEMBERSHIP = 36 +IP_RECVRETOPTS = IP_RETOPTS +IP_PMTUDISC_DONT = 0 +IP_PMTUDISC_WANT = 1 +IP_PMTUDISC_DO = 2 +SOL_IP = 0 +IP_DEFAULT_MULTICAST_TTL = 1 +IP_DEFAULT_MULTICAST_LOOP = 1 +IP_MAX_MEMBERSHIPS = 20 +IPV6_ADDRFORM = 1 +IPV6_PKTINFO = 2 +IPV6_HOPOPTS = 3 +IPV6_DSTOPTS = 4 +IPV6_RTHDR = 5 +IPV6_PKTOPTIONS = 6 +IPV6_CHECKSUM = 7 +IPV6_HOPLIMIT = 8 +IPV6_NEXTHOP = 9 +IPV6_AUTHHDR = 10 +IPV6_UNICAST_HOPS = 16 +IPV6_MULTICAST_IF = 17 +IPV6_MULTICAST_HOPS = 18 +IPV6_MULTICAST_LOOP = 19 +IPV6_JOIN_GROUP = 20 +IPV6_LEAVE_GROUP = 21 +IPV6_ROUTER_ALERT = 22 +IPV6_MTU_DISCOVER = 23 +IPV6_MTU = 24 +IPV6_RECVERR = 25 +IPV6_RXHOPOPTS = IPV6_HOPOPTS +IPV6_RXDSTOPTS = IPV6_DSTOPTS +IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP +IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP +IPV6_PMTUDISC_DONT = 0 +IPV6_PMTUDISC_WANT = 1 +IPV6_PMTUDISC_DO = 2 +SOL_IPV6 = 41 +SOL_ICMPV6 = 58 +IPV6_RTHDR_LOOSE = 0 +IPV6_RTHDR_STRICT = 1 +IPV6_RTHDR_TYPE_0 = 0 + +# Included from endian.h +_ENDIAN_H = 1 +__LITTLE_ENDIAN = 1234 +__BIG_ENDIAN = 4321 +__PDP_ENDIAN = 3412 + +# Included from bits/endian.h +__BYTE_ORDER = __LITTLE_ENDIAN +__FLOAT_WORD_ORDER = __BYTE_ORDER +LITTLE_ENDIAN = __LITTLE_ENDIAN +BIG_ENDIAN = __BIG_ENDIAN +PDP_ENDIAN = __PDP_ENDIAN +BYTE_ORDER = __BYTE_ORDER + +# Included from bits/byteswap.h +_BITS_BYTESWAP_H = 1 +def __bswap_constant_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_16(x): return __bswap_constant_16 (x) + +def __bswap_constant_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return __bswap_constant_32 (x) + +def __bswap_constant_64(x): return \ + +def __bswap_64(x): return \ + +def ntohl(x): return (x) + +def ntohs(x): return (x) + +def htonl(x): return (x) + +def htons(x): return (x) + +def ntohl(x): return __bswap_32 (x) + +def ntohs(x): return __bswap_16 (x) + +def htonl(x): return __bswap_32 (x) + +def htons(x): return __bswap_16 (x) + +def IN6_IS_ADDR_UNSPECIFIED(a): return \ + +def IN6_IS_ADDR_LOOPBACK(a): return \ + +def IN6_IS_ADDR_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_SITELOCAL(a): return \ + +def IN6_IS_ADDR_V4MAPPED(a): return \ + +def IN6_IS_ADDR_V4COMPAT(a): return \ + +def IN6_IS_ADDR_MC_NODELOCAL(a): return \ + +def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_MC_SITELOCAL(a): return \ + +def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ + +def IN6_IS_ADDR_MC_GLOBAL(a): return --- /dev/null +++ b/lib-python/2.7/plat-linux2/IN_mips.py @@ -0,0 +1,615 @@ +# Generated by h2py from /usr/include/netinet/in.h +_NETINET_IN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 199506L +_XOPEN_SOURCE = 600 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 2 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __PMT(args): return args + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 + +# Included from gnu/stubs.h + +# Included from stdint.h +_STDINT_H = 1 + +# Included from bits/wchar.h +_BITS_WCHAR_H = 1 +__WCHAR_MIN = (-2147483647l - 1l) +__WCHAR_MAX = (2147483647l) + +# Included from bits/wordsize.h +__WORDSIZE = 32 +def __INT64_C(c): return c ## L + +def __UINT64_C(c): return c ## UL + +def __INT64_C(c): return c ## LL + +def __UINT64_C(c): return c ## ULL + +INT8_MIN = (-128) +INT16_MIN = (-32767-1) +INT32_MIN = (-2147483647-1) +INT64_MIN = (-__INT64_C(9223372036854775807)-1) +INT8_MAX = (127) +INT16_MAX = (32767) +INT32_MAX = (2147483647) +INT64_MAX = (__INT64_C(9223372036854775807)) +UINT8_MAX = (255) +UINT16_MAX = (65535) +UINT64_MAX = (__UINT64_C(18446744073709551615)) +INT_LEAST8_MIN = (-128) +INT_LEAST16_MIN = (-32767-1) +INT_LEAST32_MIN = (-2147483647-1) +INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_LEAST8_MAX = (127) +INT_LEAST16_MAX = (32767) +INT_LEAST32_MAX = (2147483647) +INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_LEAST8_MAX = (255) +UINT_LEAST16_MAX = (65535) +UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) +INT_FAST8_MIN = (-128) +INT_FAST16_MIN = (-9223372036854775807L-1) +INT_FAST32_MIN = (-9223372036854775807L-1) +INT_FAST16_MIN = (-2147483647-1) +INT_FAST32_MIN = (-2147483647-1) +INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_FAST8_MAX = (127) +INT_FAST16_MAX = (9223372036854775807L) +INT_FAST32_MAX = (9223372036854775807L) +INT_FAST16_MAX = (2147483647) +INT_FAST32_MAX = (2147483647) +INT_FAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_FAST8_MAX = (255) +UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) +INTPTR_MIN = (-9223372036854775807L-1) +INTPTR_MAX = (9223372036854775807L) +INTPTR_MIN = (-2147483647-1) +INTPTR_MAX = (2147483647) +INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) +INTMAX_MAX = (__INT64_C(9223372036854775807)) +UINTMAX_MAX = (__UINT64_C(18446744073709551615)) +PTRDIFF_MIN = (-9223372036854775807L-1) +PTRDIFF_MAX = (9223372036854775807L) +PTRDIFF_MIN = (-2147483647-1) +PTRDIFF_MAX = (2147483647) +SIG_ATOMIC_MIN = (-2147483647-1) +SIG_ATOMIC_MAX = (2147483647) +WCHAR_MIN = __WCHAR_MIN +WCHAR_MAX = __WCHAR_MAX +def INT8_C(c): return c + +def INT16_C(c): return c + +def INT32_C(c): return c + +def INT64_C(c): return c ## L + +def INT64_C(c): return c ## LL + +def UINT8_C(c): return c ## U + +def UINT16_C(c): return c ## U + +def UINT32_C(c): return c ## U + +def UINT64_C(c): return c ## UL + +def UINT64_C(c): return c ## ULL + +def INTMAX_C(c): return c ## L + +def UINTMAX_C(c): return c ## UL + +def INTMAX_C(c): return c ## LL + +def UINTMAX_C(c): return c ## ULL + + +# Included from bits/types.h +_BITS_TYPES_H = 1 +__FD_SETSIZE = 1024 + +# Included from bits/pthreadtypes.h +_BITS_PTHREADTYPES_H = 1 + +# Included from bits/sched.h +SCHED_OTHER = 0 +SCHED_FIFO = 1 +SCHED_RR = 2 +CSIGNAL = 0x000000ff +CLONE_VM = 0x00000100 +CLONE_FS = 0x00000200 +CLONE_FILES = 0x00000400 +CLONE_SIGHAND = 0x00000800 +CLONE_PID = 0x00001000 +CLONE_PTRACE = 0x00002000 +CLONE_VFORK = 0x00004000 +__defined_schedparam = 1 +def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) + +IN_CLASSA_NET = (-16777216) +IN_CLASSA_NSHIFT = 24 +IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) +IN_CLASSA_MAX = 128 +def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) + +IN_CLASSB_NET = (-65536) +IN_CLASSB_NSHIFT = 16 +IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) +IN_CLASSB_MAX = 65536 +def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) + +IN_CLASSC_NET = (-256) +IN_CLASSC_NSHIFT = 8 +IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) +def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) + +def IN_MULTICAST(a): return IN_CLASSD(a) + +def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) + +def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) + +IN_LOOPBACKNET = 127 +INET_ADDRSTRLEN = 16 +INET6_ADDRSTRLEN = 46 + +# Included from bits/socket.h + +# Included from limits.h +_LIBC_LIMITS_H_ = 1 +MB_LEN_MAX = 16 +_LIMITS_H = 1 +CHAR_BIT = 8 +SCHAR_MIN = (-128) +SCHAR_MAX = 127 +UCHAR_MAX = 255 +CHAR_MIN = 0 +CHAR_MAX = UCHAR_MAX +CHAR_MIN = SCHAR_MIN +CHAR_MAX = SCHAR_MAX +SHRT_MIN = (-32768) +SHRT_MAX = 32767 +USHRT_MAX = 65535 +INT_MAX = 2147483647 +LONG_MAX = 9223372036854775807L +LONG_MAX = 2147483647L +LONG_MIN = (-LONG_MAX - 1L) + +# Included from bits/posix1_lim.h +_BITS_POSIX1_LIM_H = 1 +_POSIX_AIO_LISTIO_MAX = 2 +_POSIX_AIO_MAX = 1 +_POSIX_ARG_MAX = 4096 +_POSIX_CHILD_MAX = 6 +_POSIX_DELAYTIMER_MAX = 32 +_POSIX_LINK_MAX = 8 +_POSIX_MAX_CANON = 255 +_POSIX_MAX_INPUT = 255 +_POSIX_MQ_OPEN_MAX = 8 +_POSIX_MQ_PRIO_MAX = 32 +_POSIX_NGROUPS_MAX = 0 +_POSIX_OPEN_MAX = 16 +_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX +_POSIX_NAME_MAX = 14 +_POSIX_PATH_MAX = 256 +_POSIX_PIPE_BUF = 512 +_POSIX_RTSIG_MAX = 8 +_POSIX_SEM_NSEMS_MAX = 256 +_POSIX_SEM_VALUE_MAX = 32767 +_POSIX_SIGQUEUE_MAX = 32 +_POSIX_SSIZE_MAX = 32767 +_POSIX_STREAM_MAX = 8 +_POSIX_TZNAME_MAX = 6 +_POSIX_QLIMIT = 1 +_POSIX_HIWAT = _POSIX_PIPE_BUF +_POSIX_UIO_MAXIOV = 16 +_POSIX_TTY_NAME_MAX = 9 +_POSIX_TIMER_MAX = 32 +_POSIX_LOGIN_NAME_MAX = 9 +_POSIX_CLOCKRES_MIN = 20000000 + +# Included from bits/local_lim.h + +# Included from linux/limits.h +NR_OPEN = 1024 +NGROUPS_MAX = 32 +ARG_MAX = 131072 +CHILD_MAX = 999 +OPEN_MAX = 256 +LINK_MAX = 127 +MAX_CANON = 255 +MAX_INPUT = 255 +NAME_MAX = 255 +PATH_MAX = 4096 +PIPE_BUF = 4096 +RTSIG_MAX = 32 +_POSIX_THREAD_KEYS_MAX = 128 +PTHREAD_KEYS_MAX = 1024 +_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 +PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS +_POSIX_THREAD_THREADS_MAX = 64 +PTHREAD_THREADS_MAX = 1024 +AIO_PRIO_DELTA_MAX = 20 +PTHREAD_STACK_MIN = 16384 +TIMER_MAX = 256 +SSIZE_MAX = LONG_MAX +NGROUPS_MAX = _POSIX_NGROUPS_MAX + +# Included from bits/posix2_lim.h +_BITS_POSIX2_LIM_H = 1 +_POSIX2_BC_BASE_MAX = 99 +_POSIX2_BC_DIM_MAX = 2048 +_POSIX2_BC_SCALE_MAX = 99 +_POSIX2_BC_STRING_MAX = 1000 +_POSIX2_COLL_WEIGHTS_MAX = 2 +_POSIX2_EXPR_NEST_MAX = 32 +_POSIX2_LINE_MAX = 2048 +_POSIX2_RE_DUP_MAX = 255 +_POSIX2_CHARCLASS_NAME_MAX = 14 +BC_BASE_MAX = _POSIX2_BC_BASE_MAX +BC_DIM_MAX = _POSIX2_BC_DIM_MAX +BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX +BC_STRING_MAX = _POSIX2_BC_STRING_MAX +COLL_WEIGHTS_MAX = 255 +EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX +LINE_MAX = _POSIX2_LINE_MAX +CHARCLASS_NAME_MAX = 2048 +RE_DUP_MAX = (0x7fff) + +# Included from bits/xopen_lim.h +_XOPEN_LIM_H = 1 + +# Included from bits/stdio_lim.h +L_tmpnam = 20 +TMP_MAX = 238328 +FILENAME_MAX = 4096 +L_ctermid = 9 +L_cuserid = 9 +FOPEN_MAX = 16 +IOV_MAX = 1024 +_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV +NL_ARGMAX = _POSIX_ARG_MAX +NL_LANGMAX = _POSIX2_LINE_MAX +NL_MSGMAX = INT_MAX +NL_NMAX = INT_MAX +NL_SETMAX = INT_MAX +NL_TEXTMAX = INT_MAX +NZERO = 20 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 32 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 64 +LONG_BIT = 32 +from TYPES import * +PF_UNSPEC = 0 +PF_LOCAL = 1 +PF_UNIX = PF_LOCAL +PF_FILE = PF_LOCAL +PF_INET = 2 +PF_AX25 = 3 +PF_IPX = 4 +PF_APPLETALK = 5 +PF_NETROM = 6 +PF_BRIDGE = 7 +PF_ATMPVC = 8 +PF_X25 = 9 +PF_INET6 = 10 +PF_ROSE = 11 +PF_DECnet = 12 +PF_NETBEUI = 13 +PF_SECURITY = 14 +PF_KEY = 15 +PF_NETLINK = 16 +PF_ROUTE = PF_NETLINK +PF_PACKET = 17 +PF_ASH = 18 +PF_ECONET = 19 +PF_ATMSVC = 20 +PF_SNA = 22 +PF_IRDA = 23 +PF_PPPOX = 24 +PF_WANPIPE = 25 +PF_BLUETOOTH = 31 +PF_MAX = 32 +AF_UNSPEC = PF_UNSPEC +AF_LOCAL = PF_LOCAL +AF_UNIX = PF_UNIX +AF_FILE = PF_FILE +AF_INET = PF_INET +AF_AX25 = PF_AX25 +AF_IPX = PF_IPX +AF_APPLETALK = PF_APPLETALK +AF_NETROM = PF_NETROM +AF_BRIDGE = PF_BRIDGE +AF_ATMPVC = PF_ATMPVC +AF_X25 = PF_X25 +AF_INET6 = PF_INET6 +AF_ROSE = PF_ROSE +AF_DECnet = PF_DECnet +AF_NETBEUI = PF_NETBEUI +AF_SECURITY = PF_SECURITY +AF_KEY = PF_KEY +AF_NETLINK = PF_NETLINK +AF_ROUTE = PF_ROUTE +AF_PACKET = PF_PACKET +AF_ASH = PF_ASH +AF_ECONET = PF_ECONET +AF_ATMSVC = PF_ATMSVC +AF_SNA = PF_SNA +AF_IRDA = PF_IRDA +AF_PPPOX = PF_PPPOX +AF_WANPIPE = PF_WANPIPE +AF_BLUETOOTH = PF_BLUETOOTH +AF_MAX = PF_MAX +SOL_RAW = 255 +SOL_DECNET = 261 +SOL_X25 = 262 +SOL_PACKET = 263 +SOL_ATM = 264 +SOL_AAL = 265 +SOL_IRDA = 266 +SOMAXCONN = 128 + +# Included from bits/sockaddr.h +_BITS_SOCKADDR_H = 1 +def __SOCKADDR_COMMON(sa_prefix): return \ + +_SS_SIZE = 128 +def CMSG_FIRSTHDR(mhdr): return \ + + +# Included from asm/socket.h + +# Included from asm/sockios.h +FIOSETOWN = 0x8004667c +SIOCSPGRP = 0x80047308 +FIOGETOWN = 0x4004667b +SIOCGPGRP = 0x40047309 +SIOCATMARK = 0x40047307 +SIOCGSTAMP = 0x8906 +SOL_SOCKET = 0xffff +SO_DEBUG = 0x0001 +SO_REUSEADDR = 0x0004 +SO_TYPE = 0x1008 +SO_ERROR = 0x1007 +SO_DONTROUTE = 0x0010 +SO_BROADCAST = 0x0020 +SO_SNDBUF = 0x1001 +SO_RCVBUF = 0x1002 +SO_KEEPALIVE = 0x0008 +SO_OOBINLINE = 0x0100 +SO_NO_CHECK = 11 +SO_PRIORITY = 12 +SO_LINGER = 0x0080 +SO_BSDCOMPAT = 14 +SO_PASSCRED = 17 +SO_PEERCRED = 18 +SO_RCVLOWAT = 0x1004 +SO_SNDLOWAT = 0x1003 +SO_RCVTIMEO = 0x1006 +SO_SNDTIMEO = 0x1005 +SO_SECURITY_AUTHENTICATION = 22 +SO_SECURITY_ENCRYPTION_TRANSPORT = 23 +SO_SECURITY_ENCRYPTION_NETWORK = 24 +SO_BINDTODEVICE = 25 +SO_ATTACH_FILTER = 26 +SO_DETACH_FILTER = 27 +SO_PEERNAME = 28 +SO_TIMESTAMP = 29 +SCM_TIMESTAMP = SO_TIMESTAMP +SO_ACCEPTCONN = 0x1009 +SOCK_STREAM = 2 +SOCK_DGRAM = 1 +SOCK_RAW = 3 +SOCK_RDM = 4 +SOCK_SEQPACKET = 5 +SOCK_PACKET = 10 +SOCK_MAX = (SOCK_PACKET+1) + +# Included from bits/in.h +IP_TOS = 1 +IP_TTL = 2 +IP_HDRINCL = 3 +IP_OPTIONS = 4 +IP_ROUTER_ALERT = 5 +IP_RECVOPTS = 6 +IP_RETOPTS = 7 +IP_PKTINFO = 8 +IP_PKTOPTIONS = 9 +IP_PMTUDISC = 10 +IP_MTU_DISCOVER = 10 +IP_RECVERR = 11 +IP_RECVTTL = 12 +IP_RECVTOS = 13 +IP_MULTICAST_IF = 32 +IP_MULTICAST_TTL = 33 +IP_MULTICAST_LOOP = 34 +IP_ADD_MEMBERSHIP = 35 +IP_DROP_MEMBERSHIP = 36 +IP_RECVRETOPTS = IP_RETOPTS +IP_PMTUDISC_DONT = 0 +IP_PMTUDISC_WANT = 1 +IP_PMTUDISC_DO = 2 +SOL_IP = 0 +IP_DEFAULT_MULTICAST_TTL = 1 +IP_DEFAULT_MULTICAST_LOOP = 1 +IP_MAX_MEMBERSHIPS = 20 +IPV6_ADDRFORM = 1 +IPV6_PKTINFO = 2 +IPV6_HOPOPTS = 3 +IPV6_DSTOPTS = 4 +IPV6_RTHDR = 5 +IPV6_PKTOPTIONS = 6 +IPV6_CHECKSUM = 7 +IPV6_HOPLIMIT = 8 +IPV6_NEXTHOP = 9 +IPV6_AUTHHDR = 10 +IPV6_UNICAST_HOPS = 16 +IPV6_MULTICAST_IF = 17 +IPV6_MULTICAST_HOPS = 18 +IPV6_MULTICAST_LOOP = 19 +IPV6_JOIN_GROUP = 20 +IPV6_LEAVE_GROUP = 21 +IPV6_ROUTER_ALERT = 22 +IPV6_MTU_DISCOVER = 23 +IPV6_MTU = 24 +IPV6_RECVERR = 25 +IPV6_RXHOPOPTS = IPV6_HOPOPTS +IPV6_RXDSTOPTS = IPV6_DSTOPTS +IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP +IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP +IPV6_PMTUDISC_DONT = 0 +IPV6_PMTUDISC_WANT = 1 +IPV6_PMTUDISC_DO = 2 +SOL_IPV6 = 41 +SOL_ICMPV6 = 58 +IPV6_RTHDR_LOOSE = 0 +IPV6_RTHDR_STRICT = 1 +IPV6_RTHDR_TYPE_0 = 0 + +# Included from endian.h +_ENDIAN_H = 1 +__LITTLE_ENDIAN = 1234 +__BIG_ENDIAN = 4321 +__PDP_ENDIAN = 3412 + +# Included from bits/endian.h +__BYTE_ORDER = __LITTLE_ENDIAN +__FLOAT_WORD_ORDER = __BYTE_ORDER +LITTLE_ENDIAN = __LITTLE_ENDIAN +BIG_ENDIAN = __BIG_ENDIAN +PDP_ENDIAN = __PDP_ENDIAN +BYTE_ORDER = __BYTE_ORDER + +# Included from bits/byteswap.h +_BITS_BYTESWAP_H = 1 +def __bswap_constant_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_16(x): return __bswap_constant_16 (x) + +def __bswap_constant_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return __bswap_constant_32 (x) + +def __bswap_constant_64(x): return \ + +def __bswap_64(x): return \ + +def ntohl(x): return (x) + +def ntohs(x): return (x) + +def htonl(x): return (x) + +def htons(x): return (x) + +def ntohl(x): return __bswap_32 (x) + +def ntohs(x): return __bswap_16 (x) + +def htonl(x): return __bswap_32 (x) + +def htons(x): return __bswap_16 (x) + +def IN6_IS_ADDR_UNSPECIFIED(a): return \ + +def IN6_IS_ADDR_LOOPBACK(a): return \ + +def IN6_IS_ADDR_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_SITELOCAL(a): return \ + +def IN6_IS_ADDR_V4MAPPED(a): return \ + +def IN6_IS_ADDR_V4COMPAT(a): return \ + +def IN6_IS_ADDR_MC_NODELOCAL(a): return \ + +def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_MC_SITELOCAL(a): return \ + +def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ + +def IN6_IS_ADDR_MC_GLOBAL(a): return --- /dev/null +++ b/lib-python/2.7/plat-linux2/IN_sparc.py @@ -0,0 +1,615 @@ +# Generated by h2py from /usr/include/netinet/in.h +_NETINET_IN_H = 1 + +# Included from features.h +_FEATURES_H = 1 +__USE_ANSI = 1 +__FAVOR_BSD = 1 +_ISOC99_SOURCE = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 199506L +_XOPEN_SOURCE = 600 +_XOPEN_SOURCE_EXTENDED = 1 +_LARGEFILE64_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +_BSD_SOURCE = 1 +_SVID_SOURCE = 1 +__USE_ISOC99 = 1 +_POSIX_SOURCE = 1 +_POSIX_C_SOURCE = 2 +_POSIX_C_SOURCE = 199506L +__USE_POSIX = 1 +__USE_POSIX2 = 1 +__USE_POSIX199309 = 1 +__USE_POSIX199506 = 1 +__USE_XOPEN = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_UNIX98 = 1 +_LARGEFILE_SOURCE = 1 +__USE_XOPEN2K = 1 +__USE_ISOC99 = 1 +__USE_XOPEN_EXTENDED = 1 +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_FILE_OFFSET64 = 1 +__USE_MISC = 1 +__USE_BSD = 1 +__USE_SVID = 1 +__USE_GNU = 1 +__USE_REENTRANT = 1 +__STDC_IEC_559__ = 1 +__STDC_IEC_559_COMPLEX__ = 1 +__STDC_ISO_10646__ = 200009L +__GNU_LIBRARY__ = 6 +__GLIBC__ = 2 +__GLIBC_MINOR__ = 2 + +# Included from sys/cdefs.h +_SYS_CDEFS_H = 1 +def __PMT(args): return args + +def __P(args): return args + +def __PMT(args): return args + +def __STRING(x): return #x + +__flexarr = [] +__flexarr = [0] +__flexarr = [] +__flexarr = [1] +def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) + +def __attribute__(xyz): return + +def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) + +def __attribute_format_arg__(x): return + +__USE_LARGEFILE = 1 +__USE_LARGEFILE64 = 1 +__USE_EXTERN_INLINES = 1 + +# Included from gnu/stubs.h + +# Included from stdint.h +_STDINT_H = 1 + +# Included from bits/wchar.h +_BITS_WCHAR_H = 1 +__WCHAR_MIN = (-2147483647l - 1l) +__WCHAR_MAX = (2147483647l) + +# Included from bits/wordsize.h +__WORDSIZE = 32 +def __INT64_C(c): return c ## L + +def __UINT64_C(c): return c ## UL + +def __INT64_C(c): return c ## LL + +def __UINT64_C(c): return c ## ULL + +INT8_MIN = (-128) +INT16_MIN = (-32767-1) +INT32_MIN = (-2147483647-1) +INT64_MIN = (-__INT64_C(9223372036854775807)-1) +INT8_MAX = (127) +INT16_MAX = (32767) +INT32_MAX = (2147483647) +INT64_MAX = (__INT64_C(9223372036854775807)) +UINT8_MAX = (255) +UINT16_MAX = (65535) +UINT64_MAX = (__UINT64_C(18446744073709551615)) +INT_LEAST8_MIN = (-128) +INT_LEAST16_MIN = (-32767-1) +INT_LEAST32_MIN = (-2147483647-1) +INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_LEAST8_MAX = (127) +INT_LEAST16_MAX = (32767) +INT_LEAST32_MAX = (2147483647) +INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_LEAST8_MAX = (255) +UINT_LEAST16_MAX = (65535) +UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) +INT_FAST8_MIN = (-128) +INT_FAST16_MIN = (-9223372036854775807L-1) +INT_FAST32_MIN = (-9223372036854775807L-1) +INT_FAST16_MIN = (-2147483647-1) +INT_FAST32_MIN = (-2147483647-1) +INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) +INT_FAST8_MAX = (127) +INT_FAST16_MAX = (9223372036854775807L) +INT_FAST32_MAX = (9223372036854775807L) +INT_FAST16_MAX = (2147483647) +INT_FAST32_MAX = (2147483647) +INT_FAST64_MAX = (__INT64_C(9223372036854775807)) +UINT_FAST8_MAX = (255) +UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) +INTPTR_MIN = (-9223372036854775807L-1) +INTPTR_MAX = (9223372036854775807L) +INTPTR_MIN = (-2147483647-1) +INTPTR_MAX = (2147483647) +INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) +INTMAX_MAX = (__INT64_C(9223372036854775807)) +UINTMAX_MAX = (__UINT64_C(18446744073709551615)) +PTRDIFF_MIN = (-9223372036854775807L-1) +PTRDIFF_MAX = (9223372036854775807L) +PTRDIFF_MIN = (-2147483647-1) +PTRDIFF_MAX = (2147483647) +SIG_ATOMIC_MIN = (-2147483647-1) +SIG_ATOMIC_MAX = (2147483647) +WCHAR_MIN = __WCHAR_MIN +WCHAR_MAX = __WCHAR_MAX +def INT8_C(c): return c + +def INT16_C(c): return c + +def INT32_C(c): return c + +def INT64_C(c): return c ## L + +def INT64_C(c): return c ## LL + +def UINT8_C(c): return c ## U + +def UINT16_C(c): return c ## U + +def UINT32_C(c): return c ## U + +def UINT64_C(c): return c ## UL + +def UINT64_C(c): return c ## ULL + +def INTMAX_C(c): return c ## L + +def UINTMAX_C(c): return c ## UL + +def INTMAX_C(c): return c ## LL + +def UINTMAX_C(c): return c ## ULL + + +# Included from bits/types.h +_BITS_TYPES_H = 1 +__FD_SETSIZE = 1024 + +# Included from bits/pthreadtypes.h +_BITS_PTHREADTYPES_H = 1 + +# Included from bits/sched.h +SCHED_OTHER = 0 +SCHED_FIFO = 1 +SCHED_RR = 2 +CSIGNAL = 0x000000ff +CLONE_VM = 0x00000100 +CLONE_FS = 0x00000200 +CLONE_FILES = 0x00000400 +CLONE_SIGHAND = 0x00000800 +CLONE_PID = 0x00001000 +CLONE_PTRACE = 0x00002000 +CLONE_VFORK = 0x00004000 +__defined_schedparam = 1 +def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) + +IN_CLASSA_NET = (-16777216) +IN_CLASSA_NSHIFT = 24 +IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) +IN_CLASSA_MAX = 128 +def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) + +IN_CLASSB_NET = (-65536) +IN_CLASSB_NSHIFT = 16 +IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) +IN_CLASSB_MAX = 65536 +def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) + +IN_CLASSC_NET = (-256) +IN_CLASSC_NSHIFT = 8 +IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) +def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) + +def IN_MULTICAST(a): return IN_CLASSD(a) + +def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) + +def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) + +IN_LOOPBACKNET = 127 +INET_ADDRSTRLEN = 16 +INET6_ADDRSTRLEN = 46 + +# Included from bits/socket.h + +# Included from limits.h +_LIBC_LIMITS_H_ = 1 +MB_LEN_MAX = 16 +_LIMITS_H = 1 +CHAR_BIT = 8 +SCHAR_MIN = (-128) +SCHAR_MAX = 127 +UCHAR_MAX = 255 +CHAR_MIN = 0 +CHAR_MAX = UCHAR_MAX +CHAR_MIN = SCHAR_MIN +CHAR_MAX = SCHAR_MAX +SHRT_MIN = (-32768) +SHRT_MAX = 32767 +USHRT_MAX = 65535 +INT_MAX = 2147483647 +LONG_MAX = 9223372036854775807L +LONG_MAX = 2147483647L +LONG_MIN = (-LONG_MAX - 1L) + +# Included from bits/posix1_lim.h +_BITS_POSIX1_LIM_H = 1 +_POSIX_AIO_LISTIO_MAX = 2 +_POSIX_AIO_MAX = 1 +_POSIX_ARG_MAX = 4096 +_POSIX_CHILD_MAX = 6 +_POSIX_DELAYTIMER_MAX = 32 +_POSIX_LINK_MAX = 8 +_POSIX_MAX_CANON = 255 +_POSIX_MAX_INPUT = 255 +_POSIX_MQ_OPEN_MAX = 8 +_POSIX_MQ_PRIO_MAX = 32 +_POSIX_NGROUPS_MAX = 0 +_POSIX_OPEN_MAX = 16 +_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX +_POSIX_NAME_MAX = 14 +_POSIX_PATH_MAX = 256 +_POSIX_PIPE_BUF = 512 +_POSIX_RTSIG_MAX = 8 +_POSIX_SEM_NSEMS_MAX = 256 +_POSIX_SEM_VALUE_MAX = 32767 +_POSIX_SIGQUEUE_MAX = 32 +_POSIX_SSIZE_MAX = 32767 +_POSIX_STREAM_MAX = 8 +_POSIX_TZNAME_MAX = 6 +_POSIX_QLIMIT = 1 +_POSIX_HIWAT = _POSIX_PIPE_BUF +_POSIX_UIO_MAXIOV = 16 +_POSIX_TTY_NAME_MAX = 9 +_POSIX_TIMER_MAX = 32 +_POSIX_LOGIN_NAME_MAX = 9 +_POSIX_CLOCKRES_MIN = 20000000 + +# Included from bits/local_lim.h + +# Included from linux/limits.h +NR_OPEN = 1024 +NGROUPS_MAX = 32 +ARG_MAX = 131072 +CHILD_MAX = 999 +OPEN_MAX = 256 +LINK_MAX = 127 +MAX_CANON = 255 +MAX_INPUT = 255 +NAME_MAX = 255 +PATH_MAX = 4096 +PIPE_BUF = 4096 +RTSIG_MAX = 32 +_POSIX_THREAD_KEYS_MAX = 128 +PTHREAD_KEYS_MAX = 1024 +_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 +PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS +_POSIX_THREAD_THREADS_MAX = 64 +PTHREAD_THREADS_MAX = 1024 +AIO_PRIO_DELTA_MAX = 20 +PTHREAD_STACK_MIN = 16384 +TIMER_MAX = 256 +SSIZE_MAX = LONG_MAX +NGROUPS_MAX = _POSIX_NGROUPS_MAX + +# Included from bits/posix2_lim.h +_BITS_POSIX2_LIM_H = 1 +_POSIX2_BC_BASE_MAX = 99 +_POSIX2_BC_DIM_MAX = 2048 +_POSIX2_BC_SCALE_MAX = 99 +_POSIX2_BC_STRING_MAX = 1000 +_POSIX2_COLL_WEIGHTS_MAX = 2 +_POSIX2_EXPR_NEST_MAX = 32 +_POSIX2_LINE_MAX = 2048 +_POSIX2_RE_DUP_MAX = 255 +_POSIX2_CHARCLASS_NAME_MAX = 14 +BC_BASE_MAX = _POSIX2_BC_BASE_MAX +BC_DIM_MAX = _POSIX2_BC_DIM_MAX +BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX +BC_STRING_MAX = _POSIX2_BC_STRING_MAX +COLL_WEIGHTS_MAX = 255 +EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX +LINE_MAX = _POSIX2_LINE_MAX +CHARCLASS_NAME_MAX = 2048 +RE_DUP_MAX = (0x7fff) + +# Included from bits/xopen_lim.h +_XOPEN_LIM_H = 1 + +# Included from bits/stdio_lim.h +L_tmpnam = 20 +TMP_MAX = 238328 +FILENAME_MAX = 4096 +L_ctermid = 9 +L_cuserid = 9 +FOPEN_MAX = 16 +IOV_MAX = 1024 +_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV +NL_ARGMAX = _POSIX_ARG_MAX +NL_LANGMAX = _POSIX2_LINE_MAX +NL_MSGMAX = INT_MAX +NL_NMAX = INT_MAX +NL_SETMAX = INT_MAX +NL_TEXTMAX = INT_MAX +NZERO = 20 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 16 +WORD_BIT = 32 +WORD_BIT = 64 +WORD_BIT = 32 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 32 +LONG_BIT = 64 +LONG_BIT = 64 +LONG_BIT = 32 +from TYPES import * +PF_UNSPEC = 0 +PF_LOCAL = 1 +PF_UNIX = PF_LOCAL +PF_FILE = PF_LOCAL +PF_INET = 2 +PF_AX25 = 3 +PF_IPX = 4 +PF_APPLETALK = 5 +PF_NETROM = 6 +PF_BRIDGE = 7 +PF_ATMPVC = 8 +PF_X25 = 9 +PF_INET6 = 10 +PF_ROSE = 11 +PF_DECnet = 12 +PF_NETBEUI = 13 +PF_SECURITY = 14 +PF_KEY = 15 +PF_NETLINK = 16 +PF_ROUTE = PF_NETLINK +PF_PACKET = 17 +PF_ASH = 18 +PF_ECONET = 19 +PF_ATMSVC = 20 +PF_SNA = 22 +PF_IRDA = 23 +PF_PPPOX = 24 +PF_WANPIPE = 25 +PF_BLUETOOTH = 31 +PF_MAX = 32 +AF_UNSPEC = PF_UNSPEC +AF_LOCAL = PF_LOCAL +AF_UNIX = PF_UNIX +AF_FILE = PF_FILE +AF_INET = PF_INET +AF_AX25 = PF_AX25 +AF_IPX = PF_IPX +AF_APPLETALK = PF_APPLETALK +AF_NETROM = PF_NETROM +AF_BRIDGE = PF_BRIDGE +AF_ATMPVC = PF_ATMPVC +AF_X25 = PF_X25 +AF_INET6 = PF_INET6 +AF_ROSE = PF_ROSE +AF_DECnet = PF_DECnet +AF_NETBEUI = PF_NETBEUI +AF_SECURITY = PF_SECURITY +AF_KEY = PF_KEY +AF_NETLINK = PF_NETLINK +AF_ROUTE = PF_ROUTE +AF_PACKET = PF_PACKET +AF_ASH = PF_ASH +AF_ECONET = PF_ECONET +AF_ATMSVC = PF_ATMSVC +AF_SNA = PF_SNA +AF_IRDA = PF_IRDA +AF_PPPOX = PF_PPPOX +AF_WANPIPE = PF_WANPIPE +AF_BLUETOOTH = PF_BLUETOOTH +AF_MAX = PF_MAX +SOL_RAW = 255 +SOL_DECNET = 261 +SOL_X25 = 262 +SOL_PACKET = 263 +SOL_ATM = 264 +SOL_AAL = 265 +SOL_IRDA = 266 +SOMAXCONN = 128 + +# Included from bits/sockaddr.h +_BITS_SOCKADDR_H = 1 +def __SOCKADDR_COMMON(sa_prefix): return \ + +_SS_SIZE = 128 +def CMSG_FIRSTHDR(mhdr): return \ + + +# Included from asm/socket.h + +# Included from asm/sockios.h +FIOSETOWN = 0x8901 +SIOCSPGRP = 0x8902 +FIOGETOWN = 0x8903 +SIOCGPGRP = 0x8904 +SIOCATMARK = 0x8905 +SIOCGSTAMP = 0x8906 +SOL_SOCKET = 0xffff +SO_DEBUG = 0x0001 +SO_REUSEADDR = 0x0004 +SO_TYPE = 0x1008 +SO_ERROR = 0x1007 +SO_DONTROUTE = 0x0010 +SO_BROADCAST = 0x0020 +SO_SNDBUF = 0x1001 +SO_RCVBUF = 0x1002 +SO_KEEPALIVE = 0x0008 +SO_OOBINLINE = 0x0100 +SO_NO_CHECK = 0x000b +SO_PRIORITY = 0x000c +SO_LINGER = 0x0080 +SO_BSDCOMPAT = 0x0400 +SO_PASSCRED = 0x0002 +SO_PEERCRED = 0x0040 +SO_RCVLOWAT = 0x0800 +SO_SNDLOWAT = 0x1000 +SO_RCVTIMEO = 0x2000 +SO_SNDTIMEO = 0x4000 +SO_SECURITY_AUTHENTICATION = 0x5001 +SO_SECURITY_ENCRYPTION_TRANSPORT = 0x5002 +SO_SECURITY_ENCRYPTION_NETWORK = 0x5004 +SO_BINDTODEVICE = 0x000d +SO_ATTACH_FILTER = 0x001a +SO_DETACH_FILTER = 0x001b +SO_PEERNAME = 0x001c +SO_TIMESTAMP = 0x001d +SCM_TIMESTAMP = SO_TIMESTAMP +SO_ACCEPTCONN = 0x8000 +SOCK_STREAM = 1 +SOCK_DGRAM = 2 +SOCK_RAW = 3 +SOCK_RDM = 4 +SOCK_SEQPACKET = 5 +SOCK_PACKET = 10 +SOCK_MAX = (SOCK_PACKET+1) + +# Included from bits/in.h +IP_TOS = 1 +IP_TTL = 2 +IP_HDRINCL = 3 +IP_OPTIONS = 4 +IP_ROUTER_ALERT = 5 +IP_RECVOPTS = 6 +IP_RETOPTS = 7 +IP_PKTINFO = 8 +IP_PKTOPTIONS = 9 +IP_PMTUDISC = 10 +IP_MTU_DISCOVER = 10 +IP_RECVERR = 11 +IP_RECVTTL = 12 +IP_RECVTOS = 13 +IP_MULTICAST_IF = 32 +IP_MULTICAST_TTL = 33 +IP_MULTICAST_LOOP = 34 +IP_ADD_MEMBERSHIP = 35 +IP_DROP_MEMBERSHIP = 36 +IP_RECVRETOPTS = IP_RETOPTS +IP_PMTUDISC_DONT = 0 +IP_PMTUDISC_WANT = 1 +IP_PMTUDISC_DO = 2 +SOL_IP = 0 +IP_DEFAULT_MULTICAST_TTL = 1 +IP_DEFAULT_MULTICAST_LOOP = 1 +IP_MAX_MEMBERSHIPS = 20 +IPV6_ADDRFORM = 1 +IPV6_PKTINFO = 2 +IPV6_HOPOPTS = 3 +IPV6_DSTOPTS = 4 +IPV6_RTHDR = 5 +IPV6_PKTOPTIONS = 6 +IPV6_CHECKSUM = 7 +IPV6_HOPLIMIT = 8 +IPV6_NEXTHOP = 9 +IPV6_AUTHHDR = 10 +IPV6_UNICAST_HOPS = 16 +IPV6_MULTICAST_IF = 17 +IPV6_MULTICAST_HOPS = 18 +IPV6_MULTICAST_LOOP = 19 +IPV6_JOIN_GROUP = 20 +IPV6_LEAVE_GROUP = 21 +IPV6_ROUTER_ALERT = 22 +IPV6_MTU_DISCOVER = 23 +IPV6_MTU = 24 +IPV6_RECVERR = 25 +IPV6_RXHOPOPTS = IPV6_HOPOPTS +IPV6_RXDSTOPTS = IPV6_DSTOPTS +IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP +IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP +IPV6_PMTUDISC_DONT = 0 +IPV6_PMTUDISC_WANT = 1 +IPV6_PMTUDISC_DO = 2 +SOL_IPV6 = 41 +SOL_ICMPV6 = 58 +IPV6_RTHDR_LOOSE = 0 +IPV6_RTHDR_STRICT = 1 +IPV6_RTHDR_TYPE_0 = 0 + +# Included from endian.h +_ENDIAN_H = 1 +__LITTLE_ENDIAN = 1234 +__BIG_ENDIAN = 4321 +__PDP_ENDIAN = 3412 + +# Included from bits/endian.h +__BYTE_ORDER = __LITTLE_ENDIAN +__FLOAT_WORD_ORDER = __BYTE_ORDER +LITTLE_ENDIAN = __LITTLE_ENDIAN +BIG_ENDIAN = __BIG_ENDIAN +PDP_ENDIAN = __PDP_ENDIAN +BYTE_ORDER = __BYTE_ORDER + +# Included from bits/byteswap.h +_BITS_BYTESWAP_H = 1 +def __bswap_constant_16(x): return \ + +def __bswap_16(x): return \ + +def __bswap_16(x): return __bswap_constant_16 (x) + +def __bswap_constant_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return \ + +def __bswap_32(x): return __bswap_constant_32 (x) + +def __bswap_constant_64(x): return \ + +def __bswap_64(x): return \ + +def ntohl(x): return (x) + +def ntohs(x): return (x) + +def htonl(x): return (x) + +def htons(x): return (x) + +def ntohl(x): return __bswap_32 (x) + +def ntohs(x): return __bswap_16 (x) + +def htonl(x): return __bswap_32 (x) + +def htons(x): return __bswap_16 (x) + +def IN6_IS_ADDR_UNSPECIFIED(a): return \ + +def IN6_IS_ADDR_LOOPBACK(a): return \ + +def IN6_IS_ADDR_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_SITELOCAL(a): return \ + +def IN6_IS_ADDR_V4MAPPED(a): return \ + +def IN6_IS_ADDR_V4COMPAT(a): return \ + +def IN6_IS_ADDR_MC_NODELOCAL(a): return \ + +def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ + +def IN6_IS_ADDR_MC_SITELOCAL(a): return \ + +def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ + +def IN6_IS_ADDR_MC_GLOBAL(a): return --- a/lib-python/2.7/plat-linux2/DLFCN.py +++ b/lib-python/2.7/plat-linux2/DLFCN.py @@ -1,83 +1,7 @@ -# Generated by h2py from /usr/include/dlfcn.h -_DLFCN_H = 1 +import platform -# Included from features.h -_FEATURES_H = 1 -__USE_ANSI = 1 -__FAVOR_BSD = 1 -_ISOC99_SOURCE = 1 -_POSIX_SOURCE = 1 -_POSIX_C_SOURCE = 199506L -_XOPEN_SOURCE = 600 -_XOPEN_SOURCE_EXTENDED = 1 -_LARGEFILE64_SOURCE = 1 -_BSD_SOURCE = 1 -_SVID_SOURCE = 1 -_BSD_SOURCE = 1 -_SVID_SOURCE = 1 -__USE_ISOC99 = 1 -_POSIX_SOURCE = 1 -_POSIX_C_SOURCE = 2 -_POSIX_C_SOURCE = 199506L -__USE_POSIX = 1 -__USE_POSIX2 = 1 -__USE_POSIX199309 = 1 -__USE_POSIX199506 = 1 -__USE_XOPEN = 1 -__USE_XOPEN_EXTENDED = 1 -__USE_UNIX98 = 1 -_LARGEFILE_SOURCE = 1 -__USE_XOPEN2K = 1 -__USE_ISOC99 = 1 -__USE_XOPEN_EXTENDED = 1 -__USE_LARGEFILE = 1 -__USE_LARGEFILE64 = 1 -__USE_FILE_OFFSET64 = 1 -__USE_MISC = 1 -__USE_BSD = 1 -__USE_SVID = 1 -__USE_GNU = 1 -__USE_REENTRANT = 1 -__STDC_IEC_559__ = 1 -__STDC_IEC_559_COMPLEX__ = 1 -__STDC_ISO_10646__ = 200009L -__GNU_LIBRARY__ = 6 -__GLIBC__ = 2 -__GLIBC_MINOR__ = 2 - -# Included from sys/cdefs.h -_SYS_CDEFS_H = 1 -def __PMT(args): return args - -def __P(args): return args - -def __PMT(args): return args - -def __STRING(x): return #x - -__flexarr = [] -__flexarr = [0] -__flexarr = [] -__flexarr = [1] -def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) - -def __attribute__(xyz): return - -def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) - -def __attribute_format_arg__(x): return - -__USE_LARGEFILE = 1 -__USE_LARGEFILE64 = 1 -__USE_EXTERN_INLINES = 1 - -# Included from gnu/stubs.h - -# Included from bits/dlfcn.h -RTLD_LAZY = 0x00001 -RTLD_NOW = 0x00002 -RTLD_BINDING_MASK = 0x3 -RTLD_NOLOAD = 0x00004 -RTLD_GLOBAL = 0x00100 -RTLD_LOCAL = 0 -RTLD_NODELETE = 0x01000 +_architecture = platform.machine() +if _architecture.startswith('mips'): + from DLFCN_mips import * +else: + from DLFCN_default import * --- a/lib-python/2.7/plat-linux2/IN.py +++ b/lib-python/2.7/plat-linux2/IN.py @@ -1,615 +1,13 @@ -# Generated by h2py from /usr/include/netinet/in.h -_NETINET_IN_H = 1 +import platform -# Included from features.h -_FEATURES_H = 1 -__USE_ANSI = 1 -__FAVOR_BSD = 1 -_ISOC99_SOURCE = 1 -_POSIX_SOURCE = 1 -_POSIX_C_SOURCE = 199506L -_XOPEN_SOURCE = 600 -_XOPEN_SOURCE_EXTENDED = 1 -_LARGEFILE64_SOURCE = 1 -_BSD_SOURCE = 1 -_SVID_SOURCE = 1 -_BSD_SOURCE = 1 -_SVID_SOURCE = 1 -__USE_ISOC99 = 1 -_POSIX_SOURCE = 1 -_POSIX_C_SOURCE = 2 -_POSIX_C_SOURCE = 199506L -__USE_POSIX = 1 -__USE_POSIX2 = 1 -__USE_POSIX199309 = 1 -__USE_POSIX199506 = 1 -__USE_XOPEN = 1 -__USE_XOPEN_EXTENDED = 1 -__USE_UNIX98 = 1 -_LARGEFILE_SOURCE = 1 -__USE_XOPEN2K = 1 -__USE_ISOC99 = 1 -__USE_XOPEN_EXTENDED = 1 -__USE_LARGEFILE = 1 -__USE_LARGEFILE64 = 1 -__USE_FILE_OFFSET64 = 1 -__USE_MISC = 1 -__USE_BSD = 1 -__USE_SVID = 1 -__USE_GNU = 1 -__USE_REENTRANT = 1 -__STDC_IEC_559__ = 1 -__STDC_IEC_559_COMPLEX__ = 1 -__STDC_ISO_10646__ = 200009L -__GNU_LIBRARY__ = 6 -__GLIBC__ = 2 -__GLIBC_MINOR__ = 2 - -# Included from sys/cdefs.h -_SYS_CDEFS_H = 1 -def __PMT(args): return args - -def __P(args): return args - -def __PMT(args): return args - -def __STRING(x): return #x - -__flexarr = [] -__flexarr = [0] -__flexarr = [] -__flexarr = [1] -def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) - -def __attribute__(xyz): return - -def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) - -def __attribute_format_arg__(x): return - -__USE_LARGEFILE = 1 -__USE_LARGEFILE64 = 1 -__USE_EXTERN_INLINES = 1 - -# Included from gnu/stubs.h - -# Included from stdint.h -_STDINT_H = 1 - -# Included from bits/wchar.h -_BITS_WCHAR_H = 1 -__WCHAR_MIN = (-2147483647l - 1l) -__WCHAR_MAX = (2147483647l) - -# Included from bits/wordsize.h -__WORDSIZE = 32 -def __INT64_C(c): return c ## L - -def __UINT64_C(c): return c ## UL - -def __INT64_C(c): return c ## LL - -def __UINT64_C(c): return c ## ULL - -INT8_MIN = (-128) -INT16_MIN = (-32767-1) -INT32_MIN = (-2147483647-1) -INT64_MIN = (-__INT64_C(9223372036854775807)-1) -INT8_MAX = (127) -INT16_MAX = (32767) -INT32_MAX = (2147483647) -INT64_MAX = (__INT64_C(9223372036854775807)) -UINT8_MAX = (255) -UINT16_MAX = (65535) -UINT64_MAX = (__UINT64_C(18446744073709551615)) -INT_LEAST8_MIN = (-128) -INT_LEAST16_MIN = (-32767-1) -INT_LEAST32_MIN = (-2147483647-1) -INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) -INT_LEAST8_MAX = (127) -INT_LEAST16_MAX = (32767) -INT_LEAST32_MAX = (2147483647) -INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) -UINT_LEAST8_MAX = (255) -UINT_LEAST16_MAX = (65535) -UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) -INT_FAST8_MIN = (-128) -INT_FAST16_MIN = (-9223372036854775807L-1) -INT_FAST32_MIN = (-9223372036854775807L-1) -INT_FAST16_MIN = (-2147483647-1) -INT_FAST32_MIN = (-2147483647-1) -INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) -INT_FAST8_MAX = (127) -INT_FAST16_MAX = (9223372036854775807L) -INT_FAST32_MAX = (9223372036854775807L) -INT_FAST16_MAX = (2147483647) -INT_FAST32_MAX = (2147483647) -INT_FAST64_MAX = (__INT64_C(9223372036854775807)) -UINT_FAST8_MAX = (255) -UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) -INTPTR_MIN = (-9223372036854775807L-1) -INTPTR_MAX = (9223372036854775807L) -INTPTR_MIN = (-2147483647-1) -INTPTR_MAX = (2147483647) -INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) -INTMAX_MAX = (__INT64_C(9223372036854775807)) -UINTMAX_MAX = (__UINT64_C(18446744073709551615)) -PTRDIFF_MIN = (-9223372036854775807L-1) -PTRDIFF_MAX = (9223372036854775807L) -PTRDIFF_MIN = (-2147483647-1) -PTRDIFF_MAX = (2147483647) -SIG_ATOMIC_MIN = (-2147483647-1) -SIG_ATOMIC_MAX = (2147483647) -WCHAR_MIN = __WCHAR_MIN -WCHAR_MAX = __WCHAR_MAX -def INT8_C(c): return c - -def INT16_C(c): return c - -def INT32_C(c): return c - -def INT64_C(c): return c ## L - -def INT64_C(c): return c ## LL - -def UINT8_C(c): return c ## U - -def UINT16_C(c): return c ## U - -def UINT32_C(c): return c ## U - -def UINT64_C(c): return c ## UL - -def UINT64_C(c): return c ## ULL - -def INTMAX_C(c): return c ## L - -def UINTMAX_C(c): return c ## UL - -def INTMAX_C(c): return c ## LL - -def UINTMAX_C(c): return c ## ULL - - -# Included from bits/types.h -_BITS_TYPES_H = 1 -__FD_SETSIZE = 1024 - -# Included from bits/pthreadtypes.h -_BITS_PTHREADTYPES_H = 1 - -# Included from bits/sched.h -SCHED_OTHER = 0 -SCHED_FIFO = 1 -SCHED_RR = 2 -CSIGNAL = 0x000000ff -CLONE_VM = 0x00000100 -CLONE_FS = 0x00000200 -CLONE_FILES = 0x00000400 -CLONE_SIGHAND = 0x00000800 -CLONE_PID = 0x00001000 -CLONE_PTRACE = 0x00002000 -CLONE_VFORK = 0x00004000 -__defined_schedparam = 1 -def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) - -IN_CLASSA_NET = (-16777216) -IN_CLASSA_NSHIFT = 24 -IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) -IN_CLASSA_MAX = 128 -def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) - -IN_CLASSB_NET = (-65536) -IN_CLASSB_NSHIFT = 16 -IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) -IN_CLASSB_MAX = 65536 -def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) - -IN_CLASSC_NET = (-256) -IN_CLASSC_NSHIFT = 8 -IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) -def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) - -def IN_MULTICAST(a): return IN_CLASSD(a) - -def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) - -def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) - -IN_LOOPBACKNET = 127 -INET_ADDRSTRLEN = 16 -INET6_ADDRSTRLEN = 46 - -# Included from bits/socket.h - -# Included from limits.h -_LIBC_LIMITS_H_ = 1 -MB_LEN_MAX = 16 -_LIMITS_H = 1 -CHAR_BIT = 8 -SCHAR_MIN = (-128) -SCHAR_MAX = 127 -UCHAR_MAX = 255 -CHAR_MIN = 0 -CHAR_MAX = UCHAR_MAX -CHAR_MIN = SCHAR_MIN -CHAR_MAX = SCHAR_MAX -SHRT_MIN = (-32768) -SHRT_MAX = 32767 -USHRT_MAX = 65535 -INT_MAX = 2147483647 -LONG_MAX = 9223372036854775807L -LONG_MAX = 2147483647L -LONG_MIN = (-LONG_MAX - 1L) - -# Included from bits/posix1_lim.h -_BITS_POSIX1_LIM_H = 1 -_POSIX_AIO_LISTIO_MAX = 2 -_POSIX_AIO_MAX = 1 -_POSIX_ARG_MAX = 4096 -_POSIX_CHILD_MAX = 6 -_POSIX_DELAYTIMER_MAX = 32 -_POSIX_LINK_MAX = 8 -_POSIX_MAX_CANON = 255 -_POSIX_MAX_INPUT = 255 -_POSIX_MQ_OPEN_MAX = 8 -_POSIX_MQ_PRIO_MAX = 32 -_POSIX_NGROUPS_MAX = 0 -_POSIX_OPEN_MAX = 16 -_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX -_POSIX_NAME_MAX = 14 -_POSIX_PATH_MAX = 256 -_POSIX_PIPE_BUF = 512 -_POSIX_RTSIG_MAX = 8 -_POSIX_SEM_NSEMS_MAX = 256 -_POSIX_SEM_VALUE_MAX = 32767 -_POSIX_SIGQUEUE_MAX = 32 -_POSIX_SSIZE_MAX = 32767 -_POSIX_STREAM_MAX = 8 -_POSIX_TZNAME_MAX = 6 -_POSIX_QLIMIT = 1 -_POSIX_HIWAT = _POSIX_PIPE_BUF -_POSIX_UIO_MAXIOV = 16 -_POSIX_TTY_NAME_MAX = 9 -_POSIX_TIMER_MAX = 32 -_POSIX_LOGIN_NAME_MAX = 9 -_POSIX_CLOCKRES_MIN = 20000000 - -# Included from bits/local_lim.h - -# Included from linux/limits.h -NR_OPEN = 1024 -NGROUPS_MAX = 32 -ARG_MAX = 131072 -CHILD_MAX = 999 -OPEN_MAX = 256 -LINK_MAX = 127 -MAX_CANON = 255 -MAX_INPUT = 255 -NAME_MAX = 255 -PATH_MAX = 4096 -PIPE_BUF = 4096 -RTSIG_MAX = 32 -_POSIX_THREAD_KEYS_MAX = 128 -PTHREAD_KEYS_MAX = 1024 -_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 -PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS -_POSIX_THREAD_THREADS_MAX = 64 -PTHREAD_THREADS_MAX = 1024 -AIO_PRIO_DELTA_MAX = 20 -PTHREAD_STACK_MIN = 16384 -TIMER_MAX = 256 -SSIZE_MAX = LONG_MAX -NGROUPS_MAX = _POSIX_NGROUPS_MAX - -# Included from bits/posix2_lim.h -_BITS_POSIX2_LIM_H = 1 -_POSIX2_BC_BASE_MAX = 99 -_POSIX2_BC_DIM_MAX = 2048 -_POSIX2_BC_SCALE_MAX = 99 -_POSIX2_BC_STRING_MAX = 1000 -_POSIX2_COLL_WEIGHTS_MAX = 2 -_POSIX2_EXPR_NEST_MAX = 32 -_POSIX2_LINE_MAX = 2048 -_POSIX2_RE_DUP_MAX = 255 -_POSIX2_CHARCLASS_NAME_MAX = 14 -BC_BASE_MAX = _POSIX2_BC_BASE_MAX -BC_DIM_MAX = _POSIX2_BC_DIM_MAX -BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX -BC_STRING_MAX = _POSIX2_BC_STRING_MAX -COLL_WEIGHTS_MAX = 255 -EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX -LINE_MAX = _POSIX2_LINE_MAX -CHARCLASS_NAME_MAX = 2048 -RE_DUP_MAX = (0x7fff) - -# Included from bits/xopen_lim.h -_XOPEN_LIM_H = 1 - -# Included from bits/stdio_lim.h -L_tmpnam = 20 -TMP_MAX = 238328 -FILENAME_MAX = 4096 -L_ctermid = 9 -L_cuserid = 9 -FOPEN_MAX = 16 -IOV_MAX = 1024 -_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV -NL_ARGMAX = _POSIX_ARG_MAX -NL_LANGMAX = _POSIX2_LINE_MAX -NL_MSGMAX = INT_MAX -NL_NMAX = INT_MAX -NL_SETMAX = INT_MAX -NL_TEXTMAX = INT_MAX -NZERO = 20 -WORD_BIT = 16 -WORD_BIT = 32 -WORD_BIT = 64 -WORD_BIT = 16 -WORD_BIT = 32 -WORD_BIT = 64 -WORD_BIT = 32 -LONG_BIT = 32 -LONG_BIT = 64 -LONG_BIT = 32 -LONG_BIT = 64 -LONG_BIT = 64 -LONG_BIT = 32 -from TYPES import * -PF_UNSPEC = 0 -PF_LOCAL = 1 -PF_UNIX = PF_LOCAL -PF_FILE = PF_LOCAL -PF_INET = 2 -PF_AX25 = 3 -PF_IPX = 4 -PF_APPLETALK = 5 -PF_NETROM = 6 -PF_BRIDGE = 7 -PF_ATMPVC = 8 -PF_X25 = 9 -PF_INET6 = 10 -PF_ROSE = 11 -PF_DECnet = 12 -PF_NETBEUI = 13 -PF_SECURITY = 14 -PF_KEY = 15 -PF_NETLINK = 16 -PF_ROUTE = PF_NETLINK -PF_PACKET = 17 -PF_ASH = 18 -PF_ECONET = 19 -PF_ATMSVC = 20 -PF_SNA = 22 -PF_IRDA = 23 -PF_PPPOX = 24 -PF_WANPIPE = 25 -PF_BLUETOOTH = 31 -PF_MAX = 32 -AF_UNSPEC = PF_UNSPEC -AF_LOCAL = PF_LOCAL -AF_UNIX = PF_UNIX -AF_FILE = PF_FILE -AF_INET = PF_INET -AF_AX25 = PF_AX25 -AF_IPX = PF_IPX -AF_APPLETALK = PF_APPLETALK -AF_NETROM = PF_NETROM -AF_BRIDGE = PF_BRIDGE -AF_ATMPVC = PF_ATMPVC -AF_X25 = PF_X25 -AF_INET6 = PF_INET6 -AF_ROSE = PF_ROSE -AF_DECnet = PF_DECnet -AF_NETBEUI = PF_NETBEUI -AF_SECURITY = PF_SECURITY -AF_KEY = PF_KEY -AF_NETLINK = PF_NETLINK -AF_ROUTE = PF_ROUTE -AF_PACKET = PF_PACKET -AF_ASH = PF_ASH -AF_ECONET = PF_ECONET -AF_ATMSVC = PF_ATMSVC -AF_SNA = PF_SNA -AF_IRDA = PF_IRDA -AF_PPPOX = PF_PPPOX -AF_WANPIPE = PF_WANPIPE -AF_BLUETOOTH = PF_BLUETOOTH -AF_MAX = PF_MAX -SOL_RAW = 255 -SOL_DECNET = 261 -SOL_X25 = 262 -SOL_PACKET = 263 -SOL_ATM = 264 -SOL_AAL = 265 -SOL_IRDA = 266 -SOMAXCONN = 128 - -# Included from bits/sockaddr.h -_BITS_SOCKADDR_H = 1 -def __SOCKADDR_COMMON(sa_prefix): return \ - -_SS_SIZE = 128 -def CMSG_FIRSTHDR(mhdr): return \ - - -# Included from asm/socket.h - -# Included from asm/sockios.h -FIOSETOWN = 0x8901 -SIOCSPGRP = 0x8902 -FIOGETOWN = 0x8903 -SIOCGPGRP = 0x8904 -SIOCATMARK = 0x8905 -SIOCGSTAMP = 0x8906 -SOL_SOCKET = 1 -SO_DEBUG = 1 -SO_REUSEADDR = 2 -SO_TYPE = 3 -SO_ERROR = 4 -SO_DONTROUTE = 5 -SO_BROADCAST = 6 -SO_SNDBUF = 7 -SO_RCVBUF = 8 -SO_KEEPALIVE = 9 -SO_OOBINLINE = 10 -SO_NO_CHECK = 11 -SO_PRIORITY = 12 -SO_LINGER = 13 -SO_BSDCOMPAT = 14 -SO_PASSCRED = 16 -SO_PEERCRED = 17 -SO_RCVLOWAT = 18 -SO_SNDLOWAT = 19 -SO_RCVTIMEO = 20 -SO_SNDTIMEO = 21 -SO_SECURITY_AUTHENTICATION = 22 -SO_SECURITY_ENCRYPTION_TRANSPORT = 23 -SO_SECURITY_ENCRYPTION_NETWORK = 24 -SO_BINDTODEVICE = 25 -SO_ATTACH_FILTER = 26 -SO_DETACH_FILTER = 27 -SO_PEERNAME = 28 -SO_TIMESTAMP = 29 -SCM_TIMESTAMP = SO_TIMESTAMP -SO_ACCEPTCONN = 30 -SOCK_STREAM = 1 -SOCK_DGRAM = 2 -SOCK_RAW = 3 -SOCK_RDM = 4 -SOCK_SEQPACKET = 5 -SOCK_PACKET = 10 -SOCK_MAX = (SOCK_PACKET+1) - -# Included from bits/in.h -IP_TOS = 1 -IP_TTL = 2 -IP_HDRINCL = 3 -IP_OPTIONS = 4 -IP_ROUTER_ALERT = 5 -IP_RECVOPTS = 6 -IP_RETOPTS = 7 -IP_PKTINFO = 8 -IP_PKTOPTIONS = 9 -IP_PMTUDISC = 10 -IP_MTU_DISCOVER = 10 -IP_RECVERR = 11 -IP_RECVTTL = 12 -IP_RECVTOS = 13 -IP_MULTICAST_IF = 32 -IP_MULTICAST_TTL = 33 -IP_MULTICAST_LOOP = 34 -IP_ADD_MEMBERSHIP = 35 -IP_DROP_MEMBERSHIP = 36 -IP_RECVRETOPTS = IP_RETOPTS -IP_PMTUDISC_DONT = 0 -IP_PMTUDISC_WANT = 1 -IP_PMTUDISC_DO = 2 -SOL_IP = 0 -IP_DEFAULT_MULTICAST_TTL = 1 -IP_DEFAULT_MULTICAST_LOOP = 1 -IP_MAX_MEMBERSHIPS = 20 -IPV6_ADDRFORM = 1 -IPV6_PKTINFO = 2 -IPV6_HOPOPTS = 3 -IPV6_DSTOPTS = 4 -IPV6_RTHDR = 5 -IPV6_PKTOPTIONS = 6 -IPV6_CHECKSUM = 7 -IPV6_HOPLIMIT = 8 -IPV6_NEXTHOP = 9 -IPV6_AUTHHDR = 10 -IPV6_UNICAST_HOPS = 16 -IPV6_MULTICAST_IF = 17 -IPV6_MULTICAST_HOPS = 18 -IPV6_MULTICAST_LOOP = 19 -IPV6_JOIN_GROUP = 20 -IPV6_LEAVE_GROUP = 21 -IPV6_ROUTER_ALERT = 22 -IPV6_MTU_DISCOVER = 23 -IPV6_MTU = 24 -IPV6_RECVERR = 25 -IPV6_RXHOPOPTS = IPV6_HOPOPTS -IPV6_RXDSTOPTS = IPV6_DSTOPTS -IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP -IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP -IPV6_PMTUDISC_DONT = 0 -IPV6_PMTUDISC_WANT = 1 -IPV6_PMTUDISC_DO = 2 -SOL_IPV6 = 41 -SOL_ICMPV6 = 58 -IPV6_RTHDR_LOOSE = 0 -IPV6_RTHDR_STRICT = 1 -IPV6_RTHDR_TYPE_0 = 0 - -# Included from endian.h -_ENDIAN_H = 1 -__LITTLE_ENDIAN = 1234 -__BIG_ENDIAN = 4321 -__PDP_ENDIAN = 3412 - -# Included from bits/endian.h -__BYTE_ORDER = __LITTLE_ENDIAN -__FLOAT_WORD_ORDER = __BYTE_ORDER -LITTLE_ENDIAN = __LITTLE_ENDIAN -BIG_ENDIAN = __BIG_ENDIAN -PDP_ENDIAN = __PDP_ENDIAN -BYTE_ORDER = __BYTE_ORDER - -# Included from bits/byteswap.h -_BITS_BYTESWAP_H = 1 -def __bswap_constant_16(x): return \ - -def __bswap_16(x): return \ - -def __bswap_16(x): return __bswap_constant_16 (x) - -def __bswap_constant_32(x): return \ - -def __bswap_32(x): return \ - -def __bswap_32(x): return \ - -def __bswap_32(x): return __bswap_constant_32 (x) - -def __bswap_constant_64(x): return \ - -def __bswap_64(x): return \ - -def ntohl(x): return (x) - -def ntohs(x): return (x) - -def htonl(x): return (x) - -def htons(x): return (x) - -def ntohl(x): return __bswap_32 (x) - -def ntohs(x): return __bswap_16 (x) - -def htonl(x): return __bswap_32 (x) - -def htons(x): return __bswap_16 (x) - -def IN6_IS_ADDR_UNSPECIFIED(a): return \ - -def IN6_IS_ADDR_LOOPBACK(a): return \ - -def IN6_IS_ADDR_LINKLOCAL(a): return \ - -def IN6_IS_ADDR_SITELOCAL(a): return \ - -def IN6_IS_ADDR_V4MAPPED(a): return \ - -def IN6_IS_ADDR_V4COMPAT(a): return \ - -def IN6_IS_ADDR_MC_NODELOCAL(a): return \ - -def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ - -def IN6_IS_ADDR_MC_SITELOCAL(a): return \ - -def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ - -def IN6_IS_ADDR_MC_GLOBAL(a): return +_architecture = platform.machine() +if _architecture == 'alpha': + from IN_alpha import * +elif _architecture.startswith('parisc'): + from IN_hppa import * +elif _architecture.startswith('mips'): + from IN_mips import * +elif _architecture.startswith('sparc'): + from IN_sparc import * +else: + from IN_default import * debian/patches/xdg-gvfs-open0000644000000000000000000000155712215550224013232 0ustar Description: Use xdg-open/gvfs-open in webbrowser Bug-cpython: http://bugs.python.org/issue14493 Bug-Ubuntu: https://bugs.launchpad.net/bugs/971311 Origin: cpython, http://hg.python.org/cpython/rev/70c58903b52e Author: Michael Vogt --- a/lib-python/2.7/webbrowser.py +++ b/lib-python/2.7/webbrowser.py @@ -441,6 +441,14 @@ def register_X_browsers(): + # use xdg-open if around + if _iscommand("xdg-open"): + register("xdg-open", None, BackgroundBrowser("xdg-open")) + + # The default GNOME3 browser + if "GNOME_DESKTOP_SESSION_ID" in os.environ and _iscommand("gvfs-open"): + register("gvfs-open", None, BackgroundBrowser("gvfs-open")) + # The default GNOME browser if "GNOME_DESKTOP_SESSION_ID" in os.environ and _iscommand("gnome-open"): register("gnome-open", None, BackgroundBrowser("gnome-open")) debian/compat0000644000000000000000000000000212241444370010365 0ustar 9 debian/pypy.lintian-overrides0000644000000000000000000000024612215550224013547 0ustar # We link to expat and include none of its symbols, but PyPy thinks that its # constants are embeddable. pypy binary: embedded-library usr/lib/pypy/bin/pypy-c: expat debian/gbp.conf0000644000000000000000000000011012244444376010607 0ustar [DEFAULT] debian-branch = debian [git-import-orig] pristine-tar = True debian/clean0000755000000000000000000000172412241444370010203 0ustar #!/bin/sh set -eu # Temporary build directories rm -rf build-* # Caches rm -rf rpython/_cache echo lib_pypy/ctypes_config_cache/_*_cache.py find lib_pypy/ctypes_config_cache -name '_*_cache.py' \ -o '(' -name '_*_.py' -a ! -name __init__.py ')' # Created by our PEP3147 patch: echo pypy/doc/config/objspace.magic_tag.txt # Build artifacts find . -name '*.pyc' find . -name __pycache__ | xargs rm -rf echo pypy/goal/pypy-c* find rpython/translator/c -name '*.o' find include -name '*.h' -o -name '*.inl' # Tests echo pypy/test.db find pypy/module/test_lib_pypy/ctypes_tests/ -name '*.o' find lib-python/2.7/lib2to3/ -name '*Grammar*.pickle' find pypy/module/test_lib_pypy/cffi_tests/snippets -type d \ '(' -name build -o -name dist -o -name '*.egg-info' ')' \ | xargs rm -rf # Docs find pypy/doc/config -name 'commandline*.rst' \ -o -name 'objspace*.rst' \ -o -name 'translation*.rst' # Generated in override_dh_installdeb echo debian/pypy.preinst debian/pypy.postinst