/home/fresvfqn/waterdamagerestorationandrepairsmithtown.com/Compressed/ctypes.tar
util.py000064400000033067150532450630006107 0ustar00import os
import shutil
import subprocess
import sys

# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":

    def _get_build_version():
        """Return the version of MSVC that was used to build Python.

        For Python 2.3 and up, the version number is included in
        sys.version.  For earlier versions, assume the compiler is MSVC 6.
        """
        # This function was copied from Lib/distutils/msvccompiler.py
        prefix = "MSC v."
        i = sys.version.find(prefix)
        if i == -1:
            return 6
        i = i + len(prefix)
        s, rest = sys.version[i:].split(" ", 1)
        majorVersion = int(s[:-2]) - 6
        if majorVersion >= 13:
            majorVersion += 1
        minorVersion = int(s[2:3]) / 10.0
        # I don't think paths are affected by minor version in version 6
        if majorVersion == 6:
            minorVersion = 0
        if majorVersion >= 6:
            return majorVersion + minorVersion
        # else we don't know what version of the compiler this is
        return None

    def find_msvcrt():
        """Return the name of the VC runtime dll"""
        version = _get_build_version()
        if version is None:
            # better be safe than sorry
            return None
        if version <= 6:
            clibname = 'msvcrt'
        elif version <= 13:
            clibname = 'msvcr%d' % (version * 10)
        else:
            # CRT is no longer directly loadable. See issue23606 for the
            # discussion about alternative approaches.
            return None

        # If python was built with in debug mode
        import importlib.machinery
        if '_d.pyd' in importlib.machinery.EXTENSION_SUFFIXES:
            clibname += 'd'
        return clibname+'.dll'

    def find_library(name):
        if name in ('c', 'm'):
            return find_msvcrt()
        # See MSDN for the REAL search order.
        for directory in os.environ['PATH'].split(os.pathsep):
            fname = os.path.join(directory, name)
            if os.path.isfile(fname):
                return fname
            if fname.lower().endswith(".dll"):
                continue
            fname = fname + ".dll"
            if os.path.isfile(fname):
                return fname
        return None

elif os.name == "posix" and sys.platform == "darwin":
    from ctypes.macholib.dyld import dyld_find as _dyld_find
    def find_library(name):
        possible = ['lib%s.dylib' % name,
                    '%s.dylib' % name,
                    '%s.framework/%s' % (name, name)]
        for name in possible:
            try:
                return _dyld_find(name)
            except ValueError:
                continue
        return None

elif sys.platform.startswith("aix"):
    # AIX has two styles of storing shared libraries
    # GNU auto_tools refer to these as svr4 and aix
    # svr4 (System V Release 4) is a regular file, often with .so as suffix
    # AIX style uses an archive (suffix .a) with members (e.g., shr.o, libssl.so)
    # see issue#26439 and _aix.py for more details

    from ctypes._aix import find_library

elif os.name == "posix":
    # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
    import re, tempfile

    def _is_elf(filename):
        "Return True if the given file is an ELF file"
        elf_header = b'\x7fELF'
        with open(filename, 'br') as thefile:
            return thefile.read(4) == elf_header

    def _findLib_gcc(name):
        # Run GCC's linker with the -t (aka --trace) option and examine the
        # library name it prints out. The GCC command will fail because we
        # haven't supplied a proper program with main(), but that does not
        # matter.
        expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name))

        c_compiler = shutil.which('gcc')
        if not c_compiler:
            c_compiler = shutil.which('cc')
        if not c_compiler:
            # No C compiler available, give up
            return None

        temp = tempfile.NamedTemporaryFile()
        try:
            args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name]

            env = dict(os.environ)
            env['LC_ALL'] = 'C'
            env['LANG'] = 'C'
            try:
                proc = subprocess.Popen(args,
                                        stdout=subprocess.PIPE,
                                        stderr=subprocess.STDOUT,
                                        env=env)
            except OSError:  # E.g. bad executable
                return None
            with proc:
                trace = proc.stdout.read()
        finally:
            try:
                temp.close()
            except FileNotFoundError:
                # Raised if the file was already removed, which is the normal
                # behaviour of GCC if linking fails
                pass
        res = re.findall(expr, trace)
        if not res:
            return None

        for file in res:
            # Check if the given file is an elf file: gcc can report
            # some files that are linker scripts and not actual
            # shared objects. See bpo-41976 for more details
            if not _is_elf(file):
                continue
            return os.fsdecode(file)


    if sys.platform == "sunos5":
        # use /usr/ccs/bin/dump on solaris
        def _get_soname(f):
            if not f:
                return None

            try:
                proc = subprocess.Popen(("/usr/ccs/bin/dump", "-Lpv", f),
                                        stdout=subprocess.PIPE,
                                        stderr=subprocess.DEVNULL)
            except OSError:  # E.g. command not found
                return None
            with proc:
                data = proc.stdout.read()
            res = re.search(br'\[.*\]\sSONAME\s+([^\s]+)', data)
            if not res:
                return None
            return os.fsdecode(res.group(1))
    else:
        def _get_soname(f):
            # assuming GNU binutils / ELF
            if not f:
                return None
            objdump = shutil.which('objdump')
            if not objdump:
                # objdump is not available, give up
                return None

            try:
                proc = subprocess.Popen((objdump, '-p', '-j', '.dynamic', f),
                                        stdout=subprocess.PIPE,
                                        stderr=subprocess.DEVNULL)
            except OSError:  # E.g. bad executable
                return None
            with proc:
                dump = proc.stdout.read()
            res = re.search(br'\sSONAME\s+([^\s]+)', dump)
            if not res:
                return None
            return os.fsdecode(res.group(1))

    if sys.platform.startswith(("freebsd", "openbsd", "dragonfly")):

        def _num_version(libname):
            # "libxyz.so.MAJOR.MINOR" => [ MAJOR, MINOR ]
            parts = libname.split(b".")
            nums = []
            try:
                while parts:
                    nums.insert(0, int(parts.pop()))
            except ValueError:
                pass
            return nums or [sys.maxsize]

        def find_library(name):
            ename = re.escape(name)
            expr = r':-l%s\.\S+ => \S*/(lib%s\.\S+)' % (ename, ename)
            expr = os.fsencode(expr)

            try:
                proc = subprocess.Popen(('/sbin/ldconfig', '-r'),
                                        stdout=subprocess.PIPE,
                                        stderr=subprocess.DEVNULL)
            except OSError:  # E.g. command not found
                data = b''
            else:
                with proc:
                    data = proc.stdout.read()

            res = re.findall(expr, data)
            if not res:
                return _get_soname(_findLib_gcc(name))
            res.sort(key=_num_version)
            return os.fsdecode(res[-1])

    elif sys.platform == "sunos5":

        def _findLib_crle(name, is64):
            if not os.path.exists('/usr/bin/crle'):
                return None

            env = dict(os.environ)
            env['LC_ALL'] = 'C'

            if is64:
                args = ('/usr/bin/crle', '-64')
            else:
                args = ('/usr/bin/crle',)

            paths = None
            try:
                proc = subprocess.Popen(args,
                                        stdout=subprocess.PIPE,
                                        stderr=subprocess.DEVNULL,
                                        env=env)
            except OSError:  # E.g. bad executable
                return None
            with proc:
                for line in proc.stdout:
                    line = line.strip()
                    if line.startswith(b'Default Library Path (ELF):'):
                        paths = os.fsdecode(line).split()[4]

            if not paths:
                return None

            for dir in paths.split(":"):
                libfile = os.path.join(dir, "lib%s.so" % name)
                if os.path.exists(libfile):
                    return libfile

            return None

        def find_library(name, is64 = False):
            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))

    else:

        def _findSoname_ldconfig(name):
            import struct
            if struct.calcsize('l') == 4:
                machine = os.uname().machine + '-32'
            else:
                machine = os.uname().machine + '-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',
                }
            abi_type = mach_map.get(machine, 'libc6')

            # XXX assuming GLIBC's ldconfig (with option -p)
            regex = r'\s+(lib%s\.[^\s]+)\s+\(%s'
            regex = os.fsencode(regex % (re.escape(name), abi_type))
            try:
                with subprocess.Popen(['/sbin/ldconfig', '-p'],
                                      stdin=subprocess.DEVNULL,
                                      stderr=subprocess.DEVNULL,
                                      stdout=subprocess.PIPE,
                                      env={'LC_ALL': 'C', 'LANG': 'C'}) as p:
                    res = re.search(regex, p.stdout.read())
                    if res:
                        return os.fsdecode(res.group(1))
            except OSError:
                pass

        def _findLib_ld(name):
            # See issue #9998 for why this is needed
            expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
            cmd = ['ld', '-t']
            libpath = os.environ.get('LD_LIBRARY_PATH')
            if libpath:
                for d in libpath.split(':'):
                    cmd.extend(['-L', d])
            cmd.extend(['-o', os.devnull, '-l%s' % name])
            result = None
            try:
                p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                                     stderr=subprocess.PIPE,
                                     universal_newlines=True)
                out, _ = p.communicate()
                res = re.findall(expr, os.fsdecode(out))
                for file in res:
                    # Check if the given file is an elf file: gcc can report
                    # some files that are linker scripts and not actual
                    # shared objects. See bpo-41976 for more details
                    if not _is_elf(file):
                        continue
                    return os.fsdecode(file)
            except Exception:
                pass  # result will be None
            return result

        def find_library(name):
            # See issue #9998
            return _findSoname_ldconfig(name) or \
                   _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))

################################################################
# test code

def test():
    from ctypes import cdll
    if os.name == "nt":
        print(cdll.msvcrt)
        print(cdll.load("msvcrt"))
        print(find_library("msvcrt"))

    if os.name == "posix":
        # find and load_version
        print(find_library("m"))
        print(find_library("c"))
        print(find_library("bz2"))

        # load
        if sys.platform == "darwin":
            print(cdll.LoadLibrary("libm.dylib"))
            print(cdll.LoadLibrary("libcrypto.dylib"))
            print(cdll.LoadLibrary("libSystem.dylib"))
            print(cdll.LoadLibrary("System.framework/System"))
        # issue-26439 - fix broken test call for AIX
        elif sys.platform.startswith("aix"):
            from ctypes import CDLL
            if sys.maxsize < 2**32:
                print(f"Using CDLL(name, os.RTLD_MEMBER): {CDLL('libc.a(shr.o)', os.RTLD_MEMBER)}")
                print(f"Using cdll.LoadLibrary(): {cdll.LoadLibrary('libc.a(shr.o)')}")
                # librpm.so is only available as 32-bit shared library
                print(find_library("rpm"))
                print(cdll.LoadLibrary("librpm.so"))
            else:
                print(f"Using CDLL(name, os.RTLD_MEMBER): {CDLL('libc.a(shr_64.o)', os.RTLD_MEMBER)}")
                print(f"Using cdll.LoadLibrary(): {cdll.LoadLibrary('libc.a(shr_64.o)')}")
            print(f"crypt\t:: {find_library('crypt')}")
            print(f"crypt\t:: {cdll.LoadLibrary(find_library('crypt'))}")
            print(f"crypto\t:: {find_library('crypto')}")
            print(f"crypto\t:: {cdll.LoadLibrary(find_library('crypto'))}")
        else:
            print(cdll.LoadLibrary("libm.so"))
            print(cdll.LoadLibrary("libcrypt.so"))
            print(find_library("crypt"))

if __name__ == "__main__":
    test()
wintypes.py000064400000012774150532450630007016 0ustar00# The most useful windows datatypes
import ctypes

BYTE = ctypes.c_byte
WORD = ctypes.c_ushort
DWORD = ctypes.c_ulong

#UCHAR = ctypes.c_uchar
CHAR = ctypes.c_char
WCHAR = ctypes.c_wchar
UINT = ctypes.c_uint
INT = ctypes.c_int

DOUBLE = ctypes.c_double
FLOAT = ctypes.c_float

BOOLEAN = BYTE
BOOL = ctypes.c_long

class VARIANT_BOOL(ctypes._SimpleCData):
    _type_ = "v"
    def __repr__(self):
        return "%s(%r)" % (self.__class__.__name__, self.value)

ULONG = ctypes.c_ulong
LONG = ctypes.c_long

USHORT = ctypes.c_ushort
SHORT = ctypes.c_short

# in the windows header files, these are structures.
_LARGE_INTEGER = LARGE_INTEGER = ctypes.c_longlong
_ULARGE_INTEGER = ULARGE_INTEGER = ctypes.c_ulonglong

LPCOLESTR = LPOLESTR = OLESTR = ctypes.c_wchar_p
LPCWSTR = LPWSTR = ctypes.c_wchar_p
LPCSTR = LPSTR = ctypes.c_char_p
LPCVOID = LPVOID = ctypes.c_void_p

# WPARAM is defined as UINT_PTR (unsigned type)
# LPARAM is defined as LONG_PTR (signed type)
if ctypes.sizeof(ctypes.c_long) == ctypes.sizeof(ctypes.c_void_p):
    WPARAM = ctypes.c_ulong
    LPARAM = ctypes.c_long
elif ctypes.sizeof(ctypes.c_longlong) == ctypes.sizeof(ctypes.c_void_p):
    WPARAM = ctypes.c_ulonglong
    LPARAM = ctypes.c_longlong

ATOM = WORD
LANGID = WORD

COLORREF = DWORD
LGRPID = DWORD
LCTYPE = DWORD

LCID = DWORD

################################################################
# HANDLE types
HANDLE = ctypes.c_void_p # in the header files: void *

HACCEL = HANDLE
HBITMAP = HANDLE
HBRUSH = HANDLE
HCOLORSPACE = HANDLE
HDC = HANDLE
HDESK = HANDLE
HDWP = HANDLE
HENHMETAFILE = HANDLE
HFONT = HANDLE
HGDIOBJ = HANDLE
HGLOBAL = HANDLE
HHOOK = HANDLE
HICON = HANDLE
HINSTANCE = HANDLE
HKEY = HANDLE
HKL = HANDLE
HLOCAL = HANDLE
HMENU = HANDLE
HMETAFILE = HANDLE
HMODULE = HANDLE
HMONITOR = HANDLE
HPALETTE = HANDLE
HPEN = HANDLE
HRGN = HANDLE
HRSRC = HANDLE
HSTR = HANDLE
HTASK = HANDLE
HWINSTA = HANDLE
HWND = HANDLE
SC_HANDLE = HANDLE
SERVICE_STATUS_HANDLE = HANDLE

################################################################
# Some important structure definitions

class RECT(ctypes.Structure):
    _fields_ = [("left", LONG),
                ("top", LONG),
                ("right", LONG),
                ("bottom", LONG)]
tagRECT = _RECTL = RECTL = RECT

class _SMALL_RECT(ctypes.Structure):
    _fields_ = [('Left', SHORT),
                ('Top', SHORT),
                ('Right', SHORT),
                ('Bottom', SHORT)]
SMALL_RECT = _SMALL_RECT

class _COORD(ctypes.Structure):
    _fields_ = [('X', SHORT),
                ('Y', SHORT)]

class POINT(ctypes.Structure):
    _fields_ = [("x", LONG),
                ("y", LONG)]
tagPOINT = _POINTL = POINTL = POINT

class SIZE(ctypes.Structure):
    _fields_ = [("cx", LONG),
                ("cy", LONG)]
tagSIZE = SIZEL = SIZE

def RGB(red, green, blue):
    return red + (green << 8) + (blue << 16)

class FILETIME(ctypes.Structure):
    _fields_ = [("dwLowDateTime", DWORD),
                ("dwHighDateTime", DWORD)]
_FILETIME = FILETIME

class MSG(ctypes.Structure):
    _fields_ = [("hWnd", HWND),
                ("message", UINT),
                ("wParam", WPARAM),
                ("lParam", LPARAM),
                ("time", DWORD),
                ("pt", POINT)]
tagMSG = MSG
MAX_PATH = 260

class WIN32_FIND_DATAA(ctypes.Structure):
    _fields_ = [("dwFileAttributes", DWORD),
                ("ftCreationTime", FILETIME),
                ("ftLastAccessTime", FILETIME),
                ("ftLastWriteTime", FILETIME),
                ("nFileSizeHigh", DWORD),
                ("nFileSizeLow", DWORD),
                ("dwReserved0", DWORD),
                ("dwReserved1", DWORD),
                ("cFileName", CHAR * MAX_PATH),
                ("cAlternateFileName", CHAR * 14)]

class WIN32_FIND_DATAW(ctypes.Structure):
    _fields_ = [("dwFileAttributes", DWORD),
                ("ftCreationTime", FILETIME),
                ("ftLastAccessTime", FILETIME),
                ("ftLastWriteTime", FILETIME),
                ("nFileSizeHigh", DWORD),
                ("nFileSizeLow", DWORD),
                ("dwReserved0", DWORD),
                ("dwReserved1", DWORD),
                ("cFileName", WCHAR * MAX_PATH),
                ("cAlternateFileName", WCHAR * 14)]

################################################################
# Pointer types

LPBOOL = PBOOL = ctypes.POINTER(BOOL)
PBOOLEAN = ctypes.POINTER(BOOLEAN)
LPBYTE = PBYTE = ctypes.POINTER(BYTE)
PCHAR = ctypes.POINTER(CHAR)
LPCOLORREF = ctypes.POINTER(COLORREF)
LPDWORD = PDWORD = ctypes.POINTER(DWORD)
LPFILETIME = PFILETIME = ctypes.POINTER(FILETIME)
PFLOAT = ctypes.POINTER(FLOAT)
LPHANDLE = PHANDLE = ctypes.POINTER(HANDLE)
PHKEY = ctypes.POINTER(HKEY)
LPHKL = ctypes.POINTER(HKL)
LPINT = PINT = ctypes.POINTER(INT)
PLARGE_INTEGER = ctypes.POINTER(LARGE_INTEGER)
PLCID = ctypes.POINTER(LCID)
LPLONG = PLONG = ctypes.POINTER(LONG)
LPMSG = PMSG = ctypes.POINTER(MSG)
LPPOINT = PPOINT = ctypes.POINTER(POINT)
PPOINTL = ctypes.POINTER(POINTL)
LPRECT = PRECT = ctypes.POINTER(RECT)
LPRECTL = PRECTL = ctypes.POINTER(RECTL)
LPSC_HANDLE = ctypes.POINTER(SC_HANDLE)
PSHORT = ctypes.POINTER(SHORT)
LPSIZE = PSIZE = ctypes.POINTER(SIZE)
LPSIZEL = PSIZEL = ctypes.POINTER(SIZEL)
PSMALL_RECT = ctypes.POINTER(SMALL_RECT)
LPUINT = PUINT = ctypes.POINTER(UINT)
PULARGE_INTEGER = ctypes.POINTER(ULARGE_INTEGER)
PULONG = ctypes.POINTER(ULONG)
PUSHORT = ctypes.POINTER(USHORT)
PWCHAR = ctypes.POINTER(WCHAR)
LPWIN32_FIND_DATAA = PWIN32_FIND_DATAA = ctypes.POINTER(WIN32_FIND_DATAA)
LPWIN32_FIND_DATAW = PWIN32_FIND_DATAW = ctypes.POINTER(WIN32_FIND_DATAW)
LPWORD = PWORD = ctypes.POINTER(WORD)
macholib/dylib.py000064400000003444150532450630010007 0ustar00"""
Generic dylib path manipulation
"""

import re

__all__ = ['dylib_info']

DYLIB_RE = re.compile(r"""(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
""")

def dylib_info(filename):
    """
    A dylib name can take one of the following four forms:
        Location/Name.SomeVersion_Suffix.dylib
        Location/Name.SomeVersion.dylib
        Location/Name_Suffix.dylib
        Location/Name.dylib

    returns None if not found or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.SomeVersion_Suffix.dylib',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present.
    """
    is_dylib = DYLIB_RE.match(filename)
    if not is_dylib:
        return None
    return is_dylib.groupdict()


def test_dylib_info():
    def d(location=None, name=None, shortname=None, version=None, suffix=None):
        return dict(
            location=location,
            name=name,
            shortname=shortname,
            version=version,
            suffix=suffix
        )
    assert dylib_info('completely/invalid') is None
    assert dylib_info('completely/invalide_debug') is None
    assert dylib_info('P/Foo.dylib') == d('P', 'Foo.dylib', 'Foo')
    assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')
    assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A')
    assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')
    assert dylib_info('P/Foo.A_debug.dylib') == d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug')

if __name__ == '__main__':
    test_dylib_info()
macholib/fetch_macholib000075500000000124150532450630011177 0ustar00#!/bin/sh
svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ .
macholib/framework.py000064400000004231150532450630010674 0ustar00"""
Generic framework path manipulation
"""

import re

__all__ = ['framework_info']

STRICT_FRAMEWORK_RE = re.compile(r"""(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
""")

def framework_info(filename):
    """
    A framework name can take one of the following four forms:
        Location/Name.framework/Versions/SomeVersion/Name_Suffix
        Location/Name.framework/Versions/SomeVersion/Name
        Location/Name.framework/Name_Suffix
        Location/Name.framework/Name

    returns None if not found, or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.framework/Versions/SomeVersion/Name_Suffix',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present
    """
    is_framework = STRICT_FRAMEWORK_RE.match(filename)
    if not is_framework:
        return None
    return is_framework.groupdict()

def test_framework_info():
    def d(location=None, name=None, shortname=None, version=None, suffix=None):
        return dict(
            location=location,
            name=name,
            shortname=shortname,
            version=version,
            suffix=suffix
        )
    assert framework_info('completely/invalid') is None
    assert framework_info('completely/invalid/_debug') is None
    assert framework_info('P/F.framework') is None
    assert framework_info('P/F.framework/_debug') is None
    assert framework_info('P/F.framework/F') == d('P', 'F.framework/F', 'F')
    assert framework_info('P/F.framework/F_debug') == d('P', 'F.framework/F_debug', 'F', suffix='debug')
    assert framework_info('P/F.framework/Versions') is None
    assert framework_info('P/F.framework/Versions/A') is None
    assert framework_info('P/F.framework/Versions/A/F') == d('P', 'F.framework/Versions/A/F', 'F', 'A')
    assert framework_info('P/F.framework/Versions/A/F_debug') == d('P', 'F.framework/Versions/A/F_debug', 'F', 'A', 'debug')

if __name__ == '__main__':
    test_framework_info()
macholib/dyld.py000064400000012243150532450630007635 0ustar00"""
dyld emulation
"""

import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

__all__ = [
    'dyld_find', 'framework_find',
    'framework_info', 'dylib_info',
]

# These are the defaults as per man dyld(1)
#
DEFAULT_FRAMEWORK_FALLBACK = [
    os.path.expanduser("~/Library/Frameworks"),
    "/Library/Frameworks",
    "/Network/Library/Frameworks",
    "/System/Library/Frameworks",
]

DEFAULT_LIBRARY_FALLBACK = [
    os.path.expanduser("~/lib"),
    "/usr/local/lib",
    "/lib",
    "/usr/lib",
]

def dyld_env(env, var):
    if env is None:
        env = os.environ
    rval = env.get(var)
    if rval is None:
        return []
    return rval.split(':')

def dyld_image_suffix(env=None):
    if env is None:
        env = os.environ
    return env.get('DYLD_IMAGE_SUFFIX')

def dyld_framework_path(env=None):
    return dyld_env(env, 'DYLD_FRAMEWORK_PATH')

def dyld_library_path(env=None):
    return dyld_env(env, 'DYLD_LIBRARY_PATH')

def dyld_fallback_framework_path(env=None):
    return dyld_env(env, 'DYLD_FALLBACK_FRAMEWORK_PATH')

def dyld_fallback_library_path(env=None):
    return dyld_env(env, 'DYLD_FALLBACK_LIBRARY_PATH')

def dyld_image_suffix_search(iterator, env=None):
    """For a potential path iterator, add DYLD_IMAGE_SUFFIX semantics"""
    suffix = dyld_image_suffix(env)
    if suffix is None:
        return iterator
    def _inject(iterator=iterator, suffix=suffix):
        for path in iterator:
            if path.endswith('.dylib'):
                yield path[:-len('.dylib')] + suffix + '.dylib'
            else:
                yield path + suffix
            yield path
    return _inject()

def dyld_override_search(name, env=None):
    # If DYLD_FRAMEWORK_PATH is set and this dylib_name is a
    # framework name, use the first file that exists in the framework
    # path if any.  If there is none go on to search the DYLD_LIBRARY_PATH
    # if any.

    framework = framework_info(name)

    if framework is not None:
        for path in dyld_framework_path(env):
            yield os.path.join(path, framework['name'])

    # If DYLD_LIBRARY_PATH is set then use the first file that exists
    # in the path.  If none use the original name.
    for path in dyld_library_path(env):
        yield os.path.join(path, os.path.basename(name))

def dyld_executable_path_search(name, executable_path=None):
    # If we haven't done any searching and found a library and the
    # dylib_name starts with "@executable_path/" then construct the
    # library name.
    if name.startswith('@executable_path/') and executable_path is not None:
        yield os.path.join(executable_path, name[len('@executable_path/'):])

def dyld_default_search(name, env=None):
    yield name

    framework = framework_info(name)

    if framework is not None:
        fallback_framework_path = dyld_fallback_framework_path(env)
        for path in fallback_framework_path:
            yield os.path.join(path, framework['name'])

    fallback_library_path = dyld_fallback_library_path(env)
    for path in fallback_library_path:
        yield os.path.join(path, os.path.basename(name))

    if framework is not None and not fallback_framework_path:
        for path in DEFAULT_FRAMEWORK_FALLBACK:
            yield os.path.join(path, framework['name'])

    if not fallback_library_path:
        for path in DEFAULT_LIBRARY_FALLBACK:
            yield os.path.join(path, os.path.basename(name))

def dyld_find(name, executable_path=None, env=None):
    """
    Find a library or framework using dyld semantics
    """
    for path in dyld_image_suffix_search(chain(
                dyld_override_search(name, env),
                dyld_executable_path_search(name, executable_path),
                dyld_default_search(name, env),
            ), env):

        if os.path.isfile(path):
            return path
        try:
            if _dyld_shared_cache_contains_path(path):
                return path
        except NotImplementedError:
            pass

    raise ValueError("dylib %s could not be found" % (name,))

def framework_find(fn, executable_path=None, env=None):
    """
    Find a framework using dyld semantics in a very loose manner.

    Will take input such as:
        Python
        Python.framework
        Python.framework/Versions/Current
    """
    error = None
    try:
        return dyld_find(fn, executable_path=executable_path, env=env)
    except ValueError as e:
        error = e
    fmwk_index = fn.rfind('.framework')
    if fmwk_index == -1:
        fmwk_index = len(fn)
        fn += '.framework'
    fn = os.path.join(fn, os.path.basename(fn[:fmwk_index]))
    try:
        return dyld_find(fn, executable_path=executable_path, env=env)
    except ValueError:
        raise error
    finally:
        error = None

def test_dyld_find():
    env = {}
    assert dyld_find('libSystem.dylib') == '/usr/lib/libSystem.dylib'
    assert dyld_find('System.framework/System') == '/System/Library/Frameworks/System.framework/System'

if __name__ == '__main__':
    test_dyld_find()
macholib/__pycache__/__init__.cpython-36.opt-1.pyc000064400000000445150532450630015664 0ustar003


 \��@sdZdZdS)z~
Enough Mach-O to make your head spin.

See the relevant header files in /usr/include/mach-o

And also Apple's documentation.
z1.0N)�__doc__�__version__�rr�0/usr/lib64/python3.6/ctypes/macholib/__init__.py�<module>smacholib/__pycache__/framework.cpython-36.pyc000064400000004230150532450630015157 0ustar003


 \��@s>dZddlZdgZejd�Zdd�Zdd�Zedkr:e�dS)	z%
Generic framework path manipulation
�N�framework_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
cCstj|�}|sdS|j�S)a}
    A framework name can take one of the following four forms:
        Location/Name.framework/Versions/SomeVersion/Name_Suffix
        Location/Name.framework/Versions/SomeVersion/Name
        Location/Name.framework/Name_Suffix
        Location/Name.framework/Name

    returns None if not found, or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.framework/Versions/SomeVersion/Name_Suffix',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present
    N)�STRICT_FRAMEWORK_RE�match�	groupdict)�filenameZis_framework�r�1/usr/lib64/python3.6/ctypes/macholib/framework.pyrs
cCs�ddd�}td�dkst�td�dks*t�td�dks:t�td�dksJt�td�|dd	d
�ksbt�td�|ddd
d
d�ks~t�td�dks�t�td�dks�t�td�|ddd
d�ks�t�td�|ddd
dd
�ks�t�dS)NcSst|||||d�S)N)�location�name�	shortname�version�suffix)�dict)r	r
rrr
rrr�d-sztest_framework_info.<locals>.dzcompletely/invalidzcompletely/invalid/_debugz
P/F.frameworkzP/F.framework/_debugzP/F.framework/F�Pz
F.framework/F�FzP/F.framework/F_debugzF.framework/F_debug�debug)r
zP/F.framework/VersionszP/F.framework/Versions/AzP/F.framework/Versions/A/FzF.framework/Versions/A/F�Az P/F.framework/Versions/A/F_debugzF.framework/Versions/A/F_debug)NNNNN)r�AssertionError)rrrr�test_framework_info,s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>smacholib/__pycache__/__init__.cpython-36.opt-2.pyc000064400000000226150532450630015662 0ustar003


 \��@sdZdS)z1.0N)�__version__�rr�0/usr/lib64/python3.6/ctypes/macholib/__init__.py�<module>	smacholib/__pycache__/dyld.cpython-36.opt-1.pyc000064400000010101150532450630015047 0ustar003


 \E�@s�dZddlZddlmZddlmZddlTdddd	gZejj	d
�ddd
gZ
ejj	d�dddgZdd�Zd+dd�Z
d,dd�Zd-dd�Zd.dd�Zd/dd�Zd0dd�Zd1d d!�Zd2d"d#�Zd3d$d%�Zd4d&d�Zd5d'd�Zd(d)�Zed*k�r�e�dS)6z
dyld emulation
�N)�framework_info)�
dylib_info)�*�	dyld_find�framework_findrrz~/Library/Frameworksz/Library/Frameworksz/Network/Library/Frameworksz/System/Library/Frameworksz~/libz/usr/local/libz/libz/usr/libcCs.|dkrtj}|j|�}|dkr$gS|jd�S)N�:)�os�environ�get�split)�env�varZrval�r�,/usr/lib64/python3.6/ctypes/macholib/dyld.py�dyld_envs
rcCs|dkrtj}|jd�S)NZDYLD_IMAGE_SUFFIX)rr	r
)rrrr�dyld_image_suffix'srcCs
t|d�S)NZDYLD_FRAMEWORK_PATH)r)rrrr�dyld_framework_path,srcCs
t|d�S)NZDYLD_LIBRARY_PATH)r)rrrr�dyld_library_path/srcCs
t|d�S)NZDYLD_FALLBACK_FRAMEWORK_PATH)r)rrrr�dyld_fallback_framework_path2srcCs
t|d�S)NZDYLD_FALLBACK_LIBRARY_PATH)r)rrrr�dyld_fallback_library_path5srcCs(t|�}|dkr|S||fdd�}|�S)z>For a potential path iterator, add DYLD_IMAGE_SUFFIX semanticsNcssJxD|D]<}|jd�r2|dtd��|dVn
||V|VqWdS)Nz.dylib)�endswith�len)�iterator�suffix�pathrrr�_inject=s



z)dyld_image_suffix_search.<locals>._inject)r)rrrrrrr�dyld_image_suffix_search8s
rccsdt|�}|dk	r6x$t|�D]}tjj||d�VqWx(t|�D]}tjj|tjj|��Vq@WdS)N�name)rrrr�joinr�basename)rr�	frameworkrrrr�dyld_override_searchFsr!ccs2|jd�r.|dk	r.tjj||td�d��VdS)Nz@executable_path/)�
startswithrrrr)r�executable_pathrrr�dyld_executable_path_searchWsr$ccs�|Vt|�}|dk	r@t|�}x |D]}tjj||d�Vq$Wt|�}x$|D]}tjj|tjj|��VqNW|dk	r�|r�x tD]}tjj||d�Vq�W|s�x$tD]}tjj|tjj|��Vq�WdS)Nr)	rrrrrrr�DEFAULT_FRAMEWORK_FALLBACK�DEFAULT_LIBRARY_FALLBACK)rrr Zfallback_framework_pathrZfallback_library_pathrrr�dyld_default_search^s



r'cCsPx<ttt||�t||�t||��|�D]}tjj|�r&|Sq&Wtd|f��dS)z:
    Find a library or framework using dyld semantics
    zdylib %s could not be foundN)	r�chainr!r$r'rr�isfile�
ValueError)rr#rrrrrrts

cCs�d}yt|||d�Stk
r8}z
|}WYdd}~XnX|jd�}|dkr\t|�}|d7}tjj|tjj|d|���}yt|||d�Stk
r�|�YnXdS)z�
    Find a framework using dyld semantics in a very loose manner.

    Will take input such as:
        Python
        Python.framework
        Python.framework/Versions/Current
    N)r#rz
.framework����)rr*�rfindrrrrr)�fnr#r�error�eZ
fmwk_indexrrrr�s	
cCsi}dS)Nr)rrrr�test_dyld_find�sr1�__main__)N)N)N)N)N)N)N)N)N)NN)NN)�__doc__rZctypes.macholib.frameworkrZctypes.macholib.dylibr�	itertools�__all__r�
expanduserr%r&rrrrrrrr!r$r'rrr1�__name__rrrr�<module>s:













macholib/__pycache__/__init__.cpython-36.pyc000064400000000445150532450630014725 0ustar003


 \��@sdZdZdS)z~
Enough Mach-O to make your head spin.

See the relevant header files in /usr/include/mach-o

And also Apple's documentation.
z1.0N)�__doc__�__version__�rr�0/usr/lib64/python3.6/ctypes/macholib/__init__.py�<module>smacholib/__pycache__/dyld.cpython-36.pyc000064400000010355150532450630014123 0ustar003


 \E�@s�dZddlZddlmZddlmZddlTdddd	gZejj	d
�ddd
gZ
ejj	d�dddgZdd�Zd+dd�Z
d,dd�Zd-dd�Zd.dd�Zd/dd�Zd0dd�Zd1d d!�Zd2d"d#�Zd3d$d%�Zd4d&d�Zd5d'd�Zd(d)�Zed*k�r�e�dS)6z
dyld emulation
�N)�framework_info)�
dylib_info)�*�	dyld_find�framework_findrrz~/Library/Frameworksz/Library/Frameworksz/Network/Library/Frameworksz/System/Library/Frameworksz~/libz/usr/local/libz/libz/usr/libcCs.|dkrtj}|j|�}|dkr$gS|jd�S)N�:)�os�environ�get�split)�env�varZrval�r�,/usr/lib64/python3.6/ctypes/macholib/dyld.py�dyld_envs
rcCs|dkrtj}|jd�S)NZDYLD_IMAGE_SUFFIX)rr	r
)rrrr�dyld_image_suffix'srcCs
t|d�S)NZDYLD_FRAMEWORK_PATH)r)rrrr�dyld_framework_path,srcCs
t|d�S)NZDYLD_LIBRARY_PATH)r)rrrr�dyld_library_path/srcCs
t|d�S)NZDYLD_FALLBACK_FRAMEWORK_PATH)r)rrrr�dyld_fallback_framework_path2srcCs
t|d�S)NZDYLD_FALLBACK_LIBRARY_PATH)r)rrrr�dyld_fallback_library_path5srcCs(t|�}|dkr|S||fdd�}|�S)z>For a potential path iterator, add DYLD_IMAGE_SUFFIX semanticsNcssJxD|D]<}|jd�r2|dtd��|dVn
||V|VqWdS)Nz.dylib)�endswith�len)�iterator�suffix�pathrrr�_inject=s



z)dyld_image_suffix_search.<locals>._inject)r)rrrrrrr�dyld_image_suffix_search8s
rccsdt|�}|dk	r6x$t|�D]}tjj||d�VqWx(t|�D]}tjj|tjj|��Vq@WdS)N�name)rrrr�joinr�basename)rr�	frameworkrrrr�dyld_override_searchFsr!ccs2|jd�r.|dk	r.tjj||td�d��VdS)Nz@executable_path/)�
startswithrrrr)r�executable_pathrrr�dyld_executable_path_searchWsr$ccs�|Vt|�}|dk	r@t|�}x |D]}tjj||d�Vq$Wt|�}x$|D]}tjj|tjj|��VqNW|dk	r�|r�x tD]}tjj||d�Vq�W|s�x$tD]}tjj|tjj|��Vq�WdS)Nr)	rrrrrrr�DEFAULT_FRAMEWORK_FALLBACK�DEFAULT_LIBRARY_FALLBACK)rrr Zfallback_framework_pathrZfallback_library_pathrrr�dyld_default_search^s



r'cCsPx<ttt||�t||�t||��|�D]}tjj|�r&|Sq&Wtd|f��dS)z:
    Find a library or framework using dyld semantics
    zdylib %s could not be foundN)	r�chainr!r$r'rr�isfile�
ValueError)rr#rrrrrrts

cCs�d}yt|||d�Stk
r8}z
|}WYdd}~XnX|jd�}|dkr\t|�}|d7}tjj|tjj|d|���}yt|||d�Stk
r�|�YnXdS)z�
    Find a framework using dyld semantics in a very loose manner.

    Will take input such as:
        Python
        Python.framework
        Python.framework/Versions/Current
    N)r#rz
.framework����)rr*�rfindrrrrr)�fnr#r�error�eZ
fmwk_indexrrrr�s	
cCs(i}td�dkst�td�dks$t�dS)NzlibSystem.dylibz/usr/lib/libSystem.dylibzSystem.framework/Systemz2/System/Library/Frameworks/System.framework/System)r�AssertionError)rrrr�test_dyld_find�sr2�__main__)N)N)N)N)N)N)N)N)N)NN)NN)�__doc__rZctypes.macholib.frameworkrZctypes.macholib.dylibr�	itertools�__all__r�
expanduserr%r&rrrrrrrr!r$r'rrr2�__name__rrrr�<module>s:













macholib/__pycache__/dylib.cpython-36.opt-1.pyc000064400000002703150532450630015227 0ustar003


 \$�@s>dZddlZdgZejd�Zdd�Zdd�Zedkr:e�dS)	z!
Generic dylib path manipulation
�N�
dylib_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
cCstj|�}|sdS|j�S)a1
    A dylib name can take one of the following four forms:
        Location/Name.SomeVersion_Suffix.dylib
        Location/Name.SomeVersion.dylib
        Location/Name_Suffix.dylib
        Location/Name.dylib

    returns None if not found or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.SomeVersion_Suffix.dylib',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present.
    N)�DYLIB_RE�match�	groupdict)�filenameZis_dylib�r�-/usr/lib64/python3.6/ctypes/macholib/dylib.pyrs
cCsddd�}dS)NcSst|||||d�S)N)�location�name�	shortname�version�suffix)�dict)r	r
rrr
rrr�d.sztest_dylib_info.<locals>.d)NNNNNr)rrrr�test_dylib_info-s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>smacholib/__pycache__/dyld.cpython-36.opt-2.pyc000064400000007353150532450630015067 0ustar003


 \E�@s�ddlZddlmZddlmZddlTddddgZejjd	�d
ddgZ	ejjd
�dddgZ
dd�Zd*dd�Zd+dd�Z
d,dd�Zd-dd�Zd.dd�Zd/dd�Zd0dd �Zd1d!d"�Zd2d#d$�Zd3d%d�Zd4d&d�Zd'd(�Zed)k�r�e�dS)5�N)�framework_info)�
dylib_info)�*�	dyld_find�framework_findrrz~/Library/Frameworksz/Library/Frameworksz/Network/Library/Frameworksz/System/Library/Frameworksz~/libz/usr/local/libz/libz/usr/libcCs.|dkrtj}|j|�}|dkr$gS|jd�S)N�:)�os�environ�get�split)�env�varZrval�r�,/usr/lib64/python3.6/ctypes/macholib/dyld.py�dyld_envs
rcCs|dkrtj}|jd�S)NZDYLD_IMAGE_SUFFIX)rr	r
)rrrr�dyld_image_suffix'srcCs
t|d�S)NZDYLD_FRAMEWORK_PATH)r)rrrr�dyld_framework_path,srcCs
t|d�S)NZDYLD_LIBRARY_PATH)r)rrrr�dyld_library_path/srcCs
t|d�S)NZDYLD_FALLBACK_FRAMEWORK_PATH)r)rrrr�dyld_fallback_framework_path2srcCs
t|d�S)NZDYLD_FALLBACK_LIBRARY_PATH)r)rrrr�dyld_fallback_library_path5srcCs(t|�}|dkr|S||fdd�}|�S)NcssJxD|D]<}|jd�r2|dtd��|dVn
||V|VqWdS)Nz.dylib)�endswith�len)�iterator�suffix�pathrrr�_inject=s



z)dyld_image_suffix_search.<locals>._inject)r)rrrrrrr�dyld_image_suffix_search8s
rccsdt|�}|dk	r6x$t|�D]}tjj||d�VqWx(t|�D]}tjj|tjj|��Vq@WdS)N�name)rrrr�joinr�basename)rr�	frameworkrrrr�dyld_override_searchFsr!ccs2|jd�r.|dk	r.tjj||td�d��VdS)Nz@executable_path/)�
startswithrrrr)r�executable_pathrrr�dyld_executable_path_searchWsr$ccs�|Vt|�}|dk	r@t|�}x |D]}tjj||d�Vq$Wt|�}x$|D]}tjj|tjj|��VqNW|dk	r�|r�x tD]}tjj||d�Vq�W|s�x$tD]}tjj|tjj|��Vq�WdS)Nr)	rrrrrrr�DEFAULT_FRAMEWORK_FALLBACK�DEFAULT_LIBRARY_FALLBACK)rrr Zfallback_framework_pathrZfallback_library_pathrrr�dyld_default_search^s



r'cCsPx<ttt||�t||�t||��|�D]}tjj|�r&|Sq&Wtd|f��dS)Nzdylib %s could not be found)	r�chainr!r$r'rr�isfile�
ValueError)rr#rrrrrrts

cCs�d}yt|||d�Stk
r8}z
|}WYdd}~XnX|jd�}|dkr\t|�}|d7}tjj|tjj|d|���}yt|||d�Stk
r�|�YnXdS)N)r#rz
.framework����)rr*�rfindrrrrr)�fnr#r�error�eZ
fmwk_indexrrrr�s	
cCsi}dS)Nr)rrrr�test_dyld_find�sr1�__main__)N)N)N)N)N)N)N)N)N)NN)NN)rZctypes.macholib.frameworkrZctypes.macholib.dylibr�	itertools�__all__r�
expanduserr%r&rrrrrrrr!r$r'rrr1�__name__rrrr�<module>s8













macholib/__pycache__/dylib.cpython-36.pyc000064400000003600150532450630014265 0ustar003


 \$�@s>dZddlZdgZejd�Zdd�Zdd�Zedkr:e�dS)	z!
Generic dylib path manipulation
�N�
dylib_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
cCstj|�}|sdS|j�S)a1
    A dylib name can take one of the following four forms:
        Location/Name.SomeVersion_Suffix.dylib
        Location/Name.SomeVersion.dylib
        Location/Name_Suffix.dylib
        Location/Name.dylib

    returns None if not found or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.SomeVersion_Suffix.dylib',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present.
    N)�DYLIB_RE�match�	groupdict)�filenameZis_dylib�r�-/usr/lib64/python3.6/ctypes/macholib/dylib.pyrs
cCs�ddd�}td�dkst�td�dks*t�td�|ddd�ksBt�td	�|dd
ddd�ks^t�td
�|dddd�ksxt�td�|dddd�ks�t�td�|ddddd�ks�t�dS)NcSst|||||d�S)N)�location�name�	shortname�version�suffix)�dict)r	r
rrr
rrr�d.sztest_dylib_info.<locals>.dzcompletely/invalidzcompletely/invalide_debugzP/Foo.dylib�Pz	Foo.dylibZFoozP/Foo_debug.dylibzFoo_debug.dylib�debug)r
z
P/Foo.A.dylibzFoo.A.dylib�AzP/Foo_debug.A.dylibzFoo_debug.A.dylibZ	Foo_debugzP/Foo.A_debug.dylibzFoo.A_debug.dylib)NNNNN)r�AssertionError)rrrr�test_dylib_info-s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>smacholib/__pycache__/dylib.cpython-36.opt-2.pyc000064400000001533150532450630015230 0ustar003


 \$�@s:ddlZdgZejd�Zdd�Zdd�Zedkr6e�dS)�N�
dylib_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
cCstj|�}|sdS|j�S)N)�DYLIB_RE�match�	groupdict)�filenameZis_dylib�r�-/usr/lib64/python3.6/ctypes/macholib/dylib.pyrs
cCsddd�}dS)NcSst|||||d�S)N)�location�name�	shortname�version�suffix)�dict)r	r
rrr
rrr�d.sztest_dylib_info.<locals>.d)NNNNNr)rrrr�test_dylib_info-s
r�__main__)�re�__all__�compilerrr�__name__rrrr�<module>smacholib/__pycache__/framework.cpython-36.opt-2.pyc000064400000001621150532450630016120 0ustar003


 \��@s:ddlZdgZejd�Zdd�Zdd�Zedkr6e�dS)�N�framework_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
cCstj|�}|sdS|j�S)N)�STRICT_FRAMEWORK_RE�match�	groupdict)�filenameZis_framework�r�1/usr/lib64/python3.6/ctypes/macholib/framework.pyrs
cCsddd�}dS)NcSst|||||d�S)N)�location�name�	shortname�version�suffix)�dict)r	r
rrr
rrr�d-sztest_framework_info.<locals>.d)NNNNNr)rrrr�test_framework_info,s
r�__main__)�re�__all__�compilerrr�__name__rrrr�<module>smacholib/__pycache__/framework.cpython-36.opt-1.pyc000064400000003111150532450630016113 0ustar003


 \��@s>dZddlZdgZejd�Zdd�Zdd�Zedkr:e�dS)	z%
Generic framework path manipulation
�N�framework_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
cCstj|�}|sdS|j�S)a}
    A framework name can take one of the following four forms:
        Location/Name.framework/Versions/SomeVersion/Name_Suffix
        Location/Name.framework/Versions/SomeVersion/Name
        Location/Name.framework/Name_Suffix
        Location/Name.framework/Name

    returns None if not found, or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.framework/Versions/SomeVersion/Name_Suffix',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present
    N)�STRICT_FRAMEWORK_RE�match�	groupdict)�filenameZis_framework�r�1/usr/lib64/python3.6/ctypes/macholib/framework.pyrs
cCsddd�}dS)NcSst|||||d�S)N)�location�name�	shortname�version�suffix)�dict)r	r
rrr
rrr�d-sztest_framework_info.<locals>.d)NNNNNr)rrrr�test_framework_info,s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>smacholib/__init__.py000064400000000232150532450630010433 0ustar00"""
Enough Mach-O to make your head spin.

See the relevant header files in /usr/include/mach-o

And also Apple's documentation.
"""

__version__ = '1.0'
macholib/README.ctypes000064400000000450150532450630010512 0ustar00Files in this directory come from Bob Ippolito's py2app.

License: Any components of the py2app suite may be distributed under
the MIT or PSF open source licenses.

This is version 1.0, SVN revision 789, from 2006/01/25.
The main repository is http://svn.red-bean.com/bob/macholib/trunk/macholib/__pycache__/__init__.cpython-36.opt-1.pyc000064400000037065150532450630014116 0ustar003

�\dh1@�@s>dZddlZddlZdZddlmZmZm	Z	ddlm
Z
ddlmZddlmZ
ddlmZmZdd	lmZdd
lmZee
kr�edee
��ejdkr�dd
lmZeZejdkr�ejdkr�eej�jjd�d�dkr�eZddlmZmZ m!Z"m#Z$d}dd�Z%d~dd�Z&iZ'dd�Z(ejdk�r\ddlm)Z*ddlm+Z,iZ-dd�Z.e.j�rte(jj/dd�e._nejdk�rtddlm0Z*ddlm1Z1m2Z2m3Z3m4Z4m5Z5ddlm6Z6m7Z7dd lm8Z8dd!d"�Z9Gd#d$�d$e8�Z:e9e:d%�Gd&d'�d'e8�Z;e9e;�Gd(d)�d)e8�Z<e9e<�Gd*d+�d+e8�Z=e9e=�Gd,d-�d-e8�Z>e9e>�ed.�ed/�k�rLe=Z?e>Z@n0Gd0d1�d1e8�Z?e9e?�Gd2d3�d3e8�Z@e9e@�Gd4d5�d5e8�ZAe9eA�Gd6d7�d7e8�ZBe9eB�Gd8d9�d9e8�ZCe1eC�e1eB�k�r�eBZCed/�ed:�k�r�e=ZDe>ZEn0Gd;d<�d<e8�ZDe9eD�Gd=d>�d>e8�ZEe9eE�Gd?d@�d@e8�ZFeFeF_GeF_He9eF�GdAdB�dBe8�ZIeIeI_GeI_He9eI�GdCdD�dDe8�ZJeJeJ_GeJ_He9eJ�GdEdF�dFe8�ZKe9eKd%�GdGdH�dHe8�ZLeLZMe9eL�GdIdJ�dJe8�ZNddKlmOZOmPZPmQZQGdLdM�dMe8�ZRGdNdO�dOe8�ZSdPdQ�ZTd�dRdS�ZUdTdU�ZVdVdW�ZWGdXdY�dYeX�ZYGdZd[�d[eY�ZZejdk�r�Gd\d]�d]eY�Z[dd^lm\Z\m8Z8Gd_d`�d`e8�Z]Gdadb�dbeY�Z^Gdcdd�ddeX�Z_e_eY�Z`e_eZ�Zaejdk�r�eZdedejb�Zcn,ejdfk�r�eZdgejdddh��ZcneZd�Zcejdk�rNe_e[�Zee_e^�Zfejdk�r,eejgjhZhneejijhZhddilmjZjmkZkd�djdk�Zle1e@�e1eL�k�rje@Zme?Znn6e1e>�e1eL�k�r�e>Zme=Znne1eE�e1eL�k�r�eEZmeDZnddllmoZompZpmqZqmrZre(eLeLeLem�eo�Zse(eLeLe?em�ep�Ztdmdn�Zueue:eLe:e:�er�Zvdodp�Zweue:eLe?�eq�Zxd�drds�ZyyddtlmzZzWne{k
�r>YnXeue:eLe?�ez�Z|d�dudv�Z}ejdk�rvdwdx�Z~dydz�Zdd{l�m�Z�m�Z�eIZ�eFZ�xPe;e?e=eDgD]@Z�e1e��dhk�r�e�Z�n&e1e��d|k�r�e�Z�ne1e��dk�r�e�Z��q�WxPe<e@e>eEgD]@Z�e1e��dhk�re�Z�n&e1e��d|k�re�Z�ne1e��dk�r�e�Z��q�W[�eT�dS)�z,create and manipulate C data types in Python�Nz1.1.0)�Union�	Structure�Array)�_Pointer)�CFuncPtr)�__version__)�
RTLD_LOCAL�RTLD_GLOBAL)�
ArgumentError)�calcsizezVersion number mismatch�nt)�FormatError�posix�darwin�.�)�FUNCFLAG_CDECL�FUNCFLAG_PYTHONAPI�FUNCFLAG_USE_ERRNO�FUNCFLAG_USE_LASTERRORcCs^t|t�r6|dkrt|�d}t|}|�}||_|St|t�rRt|}|�}|St|��dS)z�create_string_buffer(aBytes) -> character array
    create_string_buffer(anInteger) -> character array
    create_string_buffer(aBytes, anInteger) -> character array
    N�)�
isinstance�bytes�len�c_char�value�int�	TypeError)�init�size�buftype�buf�r"�'/usr/lib64/python3.6/ctypes/__init__.py�create_string_buffer/s

r$cCs
t||�S)N)r$)rrr"r"r#�c_bufferAsr%cs�t�|jdd�r�tO�|jdd�r,�tO�|r@td|j���yt���fStk
r�G���fdd�dt�}|t���f<|SXdS)a�CFUNCTYPE(restype, *argtypes,
                 use_errno=False, use_last_error=False) -> function prototype.

    restype: the result type
    argtypes: a sequence specifying the argument types

    The function prototype can be called in different ways to create a
    callable object:

    prototype(integer address) -> foreign function
    prototype(callable) -> create and return a C callable function from callable
    prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
    prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
    prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
    �	use_errnoF�use_last_errorz!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z CFUNCTYPE.<locals>.CFunctionTypeN)�__name__�
__module__�__qualname__�
_argtypes_�	_restype_�_flags_r")�argtypes�flags�restyper"r#�
CFunctionTypecsr1N)	�_FUNCFLAG_CDECL�pop�_FUNCFLAG_USE_ERRNO�_FUNCFLAG_USE_LASTERROR�
ValueError�keys�_c_functype_cache�KeyError�	_CFuncPtr)r0r.�kwr1r")r.r/r0r#�	CFUNCTYPEIsr<)�LoadLibrary)�FUNCFLAG_STDCALLcs�t�|jdd�r�tO�|jdd�r,�tO�|r@td|j���yt���fStk
r�G���fdd�dt�}|t���f<|SXdS)Nr&Fr'z!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z$WINFUNCTYPE.<locals>.WinFunctionTypeN)r(r)r*r+r,r-r")r.r/r0r"r#�WinFunctionType{sr?)	�_FUNCFLAG_STDCALLr3r4r5r6r7�_win_functype_cacher9r:)r0r.r;r?r")r.r/r0r#�WINFUNCTYPEosrB)�dlopen)�sizeof�byref�	addressof�	alignment�resize)�	get_errno�	set_errno)�_SimpleCDatacCsJddlm}|dkr|j}t|�||�}}||krFtd|||f��dS)Nr)rz"sizeof(%s) wrong: %d instead of %d)�structr�_type_rD�SystemError)�typ�typecoderZactualZrequiredr"r"r#�_check_size�srQcs eZdZdZ�fdd�Z�ZS)�	py_object�Ocs.y
t�j�Stk
r(dt|�jSXdS)Nz
%s(<NULL>))�super�__repr__r6�typer()�self)�	__class__r"r#rU�s
zpy_object.__repr__)r(r)r*rMrU�
__classcell__r"r")rXr#rR�srR�Pc@seZdZdZdS)�c_short�hN)r(r)r*rMr"r"r"r#r[�sr[c@seZdZdZdS)�c_ushort�HN)r(r)r*rMr"r"r"r#r]�sr]c@seZdZdZdS)�c_long�lN)r(r)r*rMr"r"r"r#r_�sr_c@seZdZdZdS)�c_ulong�LN)r(r)r*rMr"r"r"r#ra�sra�ir`c@seZdZdZdS)�c_intrcN)r(r)r*rMr"r"r"r#rd�srdc@seZdZdZdS)�c_uint�IN)r(r)r*rMr"r"r"r#re�srec@seZdZdZdS)�c_float�fN)r(r)r*rMr"r"r"r#rg�srgc@seZdZdZdS)�c_double�dN)r(r)r*rMr"r"r"r#ri�sric@seZdZdZdS)�c_longdouble�gN)r(r)r*rMr"r"r"r#rk�srk�qc@seZdZdZdS)�
c_longlongrmN)r(r)r*rMr"r"r"r#rn�srnc@seZdZdZdS)�c_ulonglong�QN)r(r)r*rMr"r"r"r#ro�sroc@seZdZdZdS)�c_ubyte�BN)r(r)r*rMr"r"r"r#rq�srqc@seZdZdZdS)�c_byte�bN)r(r)r*rMr"r"r"r#rs�srsc@seZdZdZdS)r�cN)r(r)r*rMr"r"r"r#r�src@seZdZdZdd�ZdS)�c_char_p�zcCsd|jjtj|�jfS)Nz%s(%s))rXr(�c_void_p�from_bufferr)rWr"r"r#rU�szc_char_p.__repr__N)r(r)r*rMrUr"r"r"r#rv�srvc@seZdZdZdS)rxrZN)r(r)r*rMr"r"r"r#rx�srxc@seZdZdZdS)�c_bool�?N)r(r)r*rMr"r"r"r#rz�srz)�POINTER�pointer�_pointer_type_cachec@seZdZdZdd�ZdS)�	c_wchar_p�ZcCsd|jjtj|�jfS)Nz%s(%s))rXr(rxryr)rWr"r"r#rU�szc_wchar_p.__repr__N)r(r)r*rMrUr"r"r"r#r�src@seZdZdZdS)�c_wchar�uN)r(r)r*rMr"r"r"r#r�sr�cCsFtj�tj�tjdkr"tj�tjtt	�_t
jtt�_ttd<dS)Nr)
r~�clearr8�_os�namerArZ
from_paramr|r�rvrrxr"r"r"r#�_reset_caches
r�cCs^t|t�r6|dkrt|�d}t|}|�}||_|St|t�rRt|}|�}|St|��dS)z�create_unicode_buffer(aString) -> character array
    create_unicode_buffer(anInteger) -> character array
    create_unicode_buffer(aString, anInteger) -> character array
    Nr)r�strrr�rrr)rrr r!r"r"r#�create_unicode_buffers

r�cCsLtj|d�dk	rtd��t|�tkr,td��|j|�|t|<tt|�=dS)Nz%This type already exists in the cachezWhat's this???)r~�get�RuntimeError�idZset_type)r}�clsr"r"r#�SetPointerType"s
r�cCs||S)Nr")rOrr"r"r#�ARRAY,sr�c@sNeZdZdZeZeZdZdZ	dZ
edddfdd�Zdd	�Z
d
d�Zdd
�ZdS)�CDLLa�An instance of this class represents a loaded dll/shared
    library, exporting functions using the standard C calling
    convention (named 'cdecl' on Windows).

    The exported functions can be accessed as attributes, or by
    indexing with the function name.  Examples:

    <obj>.qsort -> callable object
    <obj>['qsort'] -> callable object

    Calling the functions releases the Python GIL during the call and
    reacquires it afterwards.
    z<uninitialized>rNFcsb|�_�j�|r�tO�|r$�tO�G��fdd�dt�}|�_|dkrXt�j|��_n|�_dS)NcseZdZ�Z�jZdS)zCDLL.__init__.<locals>._FuncPtrN)r(r)r*r-�_func_restype_r,r")r/rWr"r#�_FuncPtrQsr�)�_name�_func_flags_r4r5r:r��_dlopen�_handle)rWr��modeZhandler&r'r�r")r/rWr#�__init__Gsz
CDLL.__init__cCs8d|jj|j|jtjdd@t|�tjdd@fS)Nz<%s '%s', handle %x at %#x>�r)rXr(r�r��_sys�maxsizer�)rWr"r"r#rU[s
z
CDLL.__repr__cCs6|jd�r|jd�rt|��|j|�}t|||�|S)N�__)�
startswith�endswith�AttributeError�__getitem__�setattr)rWr��funcr"r"r#�__getattr__as

zCDLL.__getattr__cCs"|j||f�}t|t�s||_|S)N)r�rrr()rWZname_or_ordinalr�r"r"r#r�hs
zCDLL.__getitem__)r(r)r*�__doc__r2r�rdr�r�r�r��DEFAULT_MODEr�rUr�r�r"r"r"r#r�2s
r�c@seZdZdZeeBZdS)�PyDLLz�This class represents the Python library itself.  It allows
    accessing Python API functions.  The GIL is not released, and
    Python exceptions are handled correctly.
    N)r(r)r*r�r2�_FUNCFLAG_PYTHONAPIr�r"r"r"r#r�nsr�c@seZdZdZeZdS)�WinDLLznThis class represents a dll exporting functions using the
        Windows stdcall calling convention.
        N)r(r)r*r�r@r�r"r"r"r#r�wsr�)�_check_HRESULTrKc@seZdZdZeZdS)�HRESULTr`N)r(r)r*rMr�Z_check_retval_r"r"r"r#r��s
r�c@seZdZdZeZeZdS)�OleDLLz�This class represents a dll exporting functions using the
        Windows stdcall calling convention, and returning HRESULT.
        HRESULT error values are automatically raised as OSError
        exceptions.
        N)r(r)r*r�r@r�r�r�r"r"r"r#r��sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
LibraryLoadercCs
||_dS)N)�_dlltype)rWZdlltyper"r"r#r��szLibraryLoader.__init__cCs.|ddkrt|��|j|�}t|||�|S)Nr�_)r�r�r�)rWr�Zdllr"r"r#r��s

zLibraryLoader.__getattr__cCs
t||�S)N)�getattr)rWr�r"r"r#r��szLibraryLoader.__getitem__cCs
|j|�S)N)r�)rWr�r"r"r#r=�szLibraryLoader.LoadLibraryN)r(r)r*r�r�r�r=r"r"r"r#r��sr�z
python dll�cygwinzlibpython%d.%d.dllr�)�get_last_error�set_last_errorcCs0|dkrt�}|dkr"t|�j�}td|d|�S)N)�GetLastErrorr
�strip�OSError)�codeZdescrr"r"r#�WinError�s
r�)�
_memmove_addr�_memset_addr�_string_at_addr�
_cast_addrcsG��fdd�dt�}|S)NcseZdZ�Z�ZeeBZdS)z!PYFUNCTYPE.<locals>.CFunctionTypeN)r(r)r*r+r,r2r�r-r")r.r0r"r#r1�sr1)r:)r0r.r1r")r.r0r#�
PYFUNCTYPE�sr�cCst|||�S)N)�_cast)�objrOr"r"r#�cast�sr�rcCs
t||�S)zAstring_at(addr[, size]) -> string

    Return the string at addr.)�
_string_at)�ptrrr"r"r#�	string_at�sr�)�_wstring_at_addrcCs
t||�S)zFwstring_at(addr[, size]) -> string

        Return the string at addr.)�_wstring_at)r�rr"r"r#�
wstring_at�sr�cCs@ytdt�t�dg�}Wntk
r,dSX|j|||�SdS)Nzcomtypes.server.inprocserver�*i�i�)�
__import__�globals�locals�ImportError�DllGetClassObject)ZrclsidZriidZppv�ccomr"r"r#r��s
r�cCs6ytdt�t�dg�}Wntk
r,dSX|j�S)Nzcomtypes.server.inprocserverr�r)r�r�r�r��DllCanUnloadNow)r�r"r"r#r��s
r�)�BigEndianStructure�LittleEndianStructure�)N)N)N)N)NN���)r�r�)r�)�r��osr��sysr�rZ_ctypesrrrrrr:Z_ctypes_versionrr	r
rLrZ	_calcsize�	Exceptionr�r
r��platformr�uname�release�splitrr2rr�rr4rr5r$r%r8r<r=r�r>r@rArB�replacerCrDrErFrGrHrIrJrKrQrRr[r]r_rardrergrirkrnrorqZ__ctype_le__Z__ctype_be__rsrrvrxZc_voidprzr|r}r~rr�r�r�r�r��objectr�r�r�r�r�r�r�ZcdllZpydllZ	dllhandleZ	pythonapi�version_infoZwindllZoledllZkernel32r�Zcoredllr�r�r�Zc_size_tZ	c_ssize_tr�r�r�r�ZmemmoveZmemsetr�r�r�r�r�r�r�r�r�r�r�Zctypes._endianr�r�Zc_int8Zc_uint8ZkindZc_int16Zc_int32Zc_int64Zc_uint16Zc_uint32Zc_uint64r"r"r"r#�<module>s8


!




<
	





__pycache__/wintypes.cpython-36.opt-2.pyc000064400000011751150532450630014234 0ustar003


 \��@sddlZejZejZejZejZej	Z
ejZej
ZejZejZeZejZGdd�dej�ZejZejZejZejZejZZej Z!Z"ej#Z$Z%Z&ej#Z'Z(ej)Z*Z+ej,Z-Z.ej/ej�ej/ej,�kr�ejZ0ejZ1n$ej/ej�ej/ej,�kr�ej Z0ejZ1eZ2eZ3eZ4eZ5eZ6eZ7ej,Z8e8Z9e8Z:e8Z;e8Z<e8Z=e8Z>e8Z?e8Z@e8ZAe8ZBe8ZCe8ZDe8ZEe8ZFe8ZGe8ZHe8ZIe8ZJe8ZKe8ZLe8ZMe8ZNe8ZOe8ZPe8ZQe8ZRe8ZSe8ZTe8ZUe8ZVe8ZWGdd�dejX�ZYeYZZZ[Z\Gdd�dejX�Z]e]Z^Gdd	�d	ejX�Z_Gd
d�dejX�Z`e`ZaZbZcGdd
�d
ejX�ZdedZeZfdd�ZgGdd�dejX�ZhehZiGdd�dejX�ZjejZkdZlGdd�dejX�ZmGdd�dejX�Znejoe�ZpZqejoe�Zrejoe�ZsZtejoe�Zuejoe4�Zvejoe�ZwZxejoeh�ZyZzejoe�Z{ejoe8�Z|Z}ejoeG�Z~ejoeH�Zejoe�Z�Z�ejoe�Z�ejoe7�Z�ejoe�Z�Z�ejoej�Z�Z�ejoe`�Z�Z�ejoec�Z�ejoeY�Z�Z�ejoe\�Z�Z�ejoeV�Z�ejoe�Z�ejoed�Z�Z�ejoef�Z�Z�ejoe^�Z�ejoe�Z�Z�ejoe"�Z�ejoe�Z�ejoe�Z�ejoe
�Z�ejoem�Z�Z�ejoen�Z�Z�ejoe�Z�Z�dS)�Nc@seZdZdZdd�ZdS)�VARIANT_BOOL�vcCsd|jj|jfS)Nz%s(%r))�	__class__�__name__�value)�self�r�'/usr/lib64/python3.6/ctypes/wintypes.py�__repr__szVARIANT_BOOL.__repr__N)r�
__module__�__qualname__Z_type_r
rrrr	rsrc@s(eZdZdefdefdefdefgZdS)�RECT�left�top�rightZbottomN)rrr�LONG�_fields_rrrr	r
asr
c@s(eZdZdefdefdefdefgZdS)�_SMALL_RECTZLeftZTopZRightZBottomN)rrr�SHORTrrrrr	rhsrc@seZdZdefdefgZdS)�_COORD�X�YN)rrrrrrrrr	rosrc@seZdZdefdefgZdS)�POINT�x�yN)rrrrrrrrr	rssrc@seZdZdefdefgZdS)�SIZEZcxZcyN)rrrrrrrrr	rxsrcCs||d>|d>S)N��r)ZredZgreenZbluerrr	�RGB}src@seZdZdefdefgZdS)�FILETIMEZ
dwLowDateTimeZdwHighDateTimeN)rrr�DWORDrrrrr	r�src@s4eZdZdefdefdefdefdefdefgZ	dS)�MSGZhWnd�messageZwParamZlParamZtimeZptN)
rrr�HWND�UINT�WPARAM�LPARAMr rrrrrr	r!�sr!ic@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAA�dwFileAttributes�ftCreationTime�ftLastAccessTime�ftLastWriteTime�
nFileSizeHigh�nFileSizeLow�dwReserved0�dwReserved1�	cFileName�cAlternateFileName�N)rrrr r�CHAR�MAX_PATHrrrrr	r'�s
r'c@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAWr(r)r*r+r,r-r.r/r0r1r2N)rrrr r�WCHARr4rrrrr	r5�s
r5)�ZctypesZc_byteZBYTEZc_ushortZWORDZc_ulongr Zc_charr3Zc_wcharr6Zc_uintr$Zc_intZINTZc_doubleZDOUBLEZc_floatZFLOATZBOOLEANZc_longZBOOLZ_SimpleCDatarZULONGrZUSHORTZc_shortrZ
c_longlongZ_LARGE_INTEGERZ
LARGE_INTEGERZc_ulonglongZ_ULARGE_INTEGERZULARGE_INTEGERZ	c_wchar_pZ	LPCOLESTRZLPOLESTRZOLESTRZLPCWSTRZLPWSTRZc_char_pZLPCSTRZLPSTRZc_void_pZLPCVOIDZLPVOIDZsizeofr%r&ZATOMZLANGIDZCOLORREFZLGRPIDZLCTYPEZLCIDZHANDLEZHACCELZHBITMAPZHBRUSHZHCOLORSPACEZHDCZHDESKZHDWPZHENHMETAFILEZHFONTZHGDIOBJZHGLOBALZHHOOKZHICONZ	HINSTANCEZHKEYZHKLZHLOCALZHMENUZ	HMETAFILEZHMODULEZHMONITORZHPALETTEZHPENZHRGNZHRSRCZHSTRZHTASKZHWINSTAr#Z	SC_HANDLEZSERVICE_STATUS_HANDLEZ	Structurer
ZtagRECTZ_RECTLZRECTLrZ
SMALL_RECTrrZtagPOINTZ_POINTLZPOINTLrZtagSIZEZSIZELrrZ	_FILETIMEr!ZtagMSGr4r'r5ZPOINTERZLPBOOLZPBOOLZPBOOLEANZLPBYTEZPBYTEZPCHARZ
LPCOLORREFZLPDWORDZPDWORDZ
LPFILETIMEZ	PFILETIMEZPFLOATZLPHANDLEZPHANDLEZPHKEYZLPHKLZLPINTZPINTZPLARGE_INTEGERZPLCIDZLPLONGZPLONGZLPMSGZPMSGZLPPOINTZPPOINTZPPOINTLZLPRECTZPRECTZLPRECTLZPRECTLZLPSC_HANDLEZPSHORTZLPSIZEZPSIZEZLPSIZELZPSIZELZPSMALL_RECTZLPUINTZPUINTZPULARGE_INTEGERZPULONGZPUSHORTZPWCHARZLPWIN32_FIND_DATAAZPWIN32_FIND_DATAAZLPWIN32_FIND_DATAWZPWIN32_FIND_DATAWZLPWORDZPWORDrrrr	�<module>s�




















__pycache__/util.cpython-36.opt-1.pyc000064400000016074150532450630013331 0ustar003


 \�-�@sddlZddlZddlZddlZejdkrBdd�Zdd�Zdd�Zejd	krlejd
krlddl	m
Zdd�Zn�ejd	k�rddlZddl
Z
d
d�Zejdkr�dd�Zndd�Zejjd%�r�dd�Zdd�Zn6ejdkr�dd�Zd&dd�Zndd�Zdd �Zd!d�Zd"d#�Zed$k�re�dS)'�N�ntcCs�d}tjj|�}|dkrdS|t|�}tj|d�jdd�\}}t|dd��d}|dkrf|d7}t|dd��d	}|dkr�d
}|dkr�||SdS)
z�Return the version of MSVC that was used to build Python.

        For Python 2.3 and up, the version number is included in
        sys.version.  For earlier versions, assume the compiler is MSVC 6.
        zMSC v.��N� ��
�g$@r������)�sys�version�find�len�split�int)�prefix�i�s�restZmajorVersionZminorVersion�r�#/usr/lib64/python3.6/ctypes/util.py�_get_build_version	srcCs^t�}|dkrdS|dkr d}n|dkr6d|d}ndSddl}d|jjkrV|d	7}|d
S)z%Return the name of the VC runtime dllNr�msvcrtrzmsvcr%d�
rz_d.pyd�dz.dll)r�importlib.machinery�	machinery�EXTENSION_SUFFIXES)rZclibname�	importlibrrr�find_msvcrt"srcCst|dkrt�Sx`tjdjtj�D]J}tjj||�}tjj|�rD|S|j�j	d�rTq"|d}tjj|�r"|Sq"WdS)N�c�m�PATHz.dll)r r!)
r�os�environr�pathsep�path�join�isfile�lower�endswith)�nameZ	directoryZfnamerrr�find_library7sr,�posix�darwin)�	dyld_findcCsLd|d|d||fg}x,|D]$}yt|�Stk
rBw Yq Xq WdS)Nzlib%s.dylibz%s.dylibz%s.framework/%s)�
_dyld_find�
ValueError)r+�possiblerrrr,Hs
c	!Cstjdtj|��}tjd�}|s,tjd�}|s4dStj�}z||dd|jd|g}t	tj
�}d|d<d|d	<ytj|tj
tj|d
�}Wntk
r�dSX|�|jj�}WdQRXWdy|j�Wntk
r�YnXXtj||�}|s�dStj|jd��S)Nz[^\(\)\s]*lib%s\.[^\(\)\s]*�gccZccz-Wl,-tz-oz-l�C�LC_ALL�LANG)�stdout�stderr�envr)r#�fsencode�re�escape�shutil�which�tempfileZNamedTemporaryFiler+�dictr$�
subprocess�Popen�PIPEZSTDOUT�OSErrorr7�read�close�FileNotFoundError�search�fsdecode�group)	r+�exprZ
c_compilerZtemp�argsr9�procZtrace�resrrr�_findLib_gccWs:


rOZsunos5cCsz|sdSytjdd|ftjtjd�}Wntk
r:dSX|�|jj�}WdQRXtjd|�}|sjdSt	j
|jd��S)Nz/usr/ccs/bin/dumpz-Lpv)r7r8s\[.*\]\sSONAME\s+([^\s]+)r)rArBrC�DEVNULLrDr7rEr;rHr#rIrJ)�frM�datarNrrr�_get_soname�srScCs�|sdStjd�}|sdSy"tj|ddd|ftjtjd�}Wntk
rPdSX|�|jj�}WdQRXt	j
d|�}|s�dStj|j
d��S)N�objdumpz-pz-jz.dynamic)r7r8s\sSONAME\s+([^\s]+)r)r=r>rArBrCrPrDr7rEr;rHr#rIrJ)rQrTrM�dumprNrrrrS�s"
�freebsd�openbsd�	dragonflycCsR|jd�}g}y"x|r,|jdt|j���qWWntk
rDYnX|pPtjgS)N�.r)r�insertr�popr1r�maxsize)Zlibname�partsZnumsrrr�_num_version�s
r^cCs�tj|�}d||f}tj|�}ytjdtjtjd�}Wntk
rPd}YnX|�|j	j
�}WdQRXtj||�}|s�tt
|��S|jtd�tj|d	�S)
Nz:-l%s\.\S+ => \S*/(lib%s\.\S+)�/sbin/ldconfig�-r)r7r8�)�keyr)r_r`r	)r;r<r#r:rArBrCrPrDr7rE�findallrSrO�sortr^rI)r+ZenamerKrMrRrNrrrr,�s 


c	Cs�tjjd�sdSttj�}d|d<|r,d
}nd}d}ytj|tjtj|d�}Wnt	k
rbdSX|�:x2|j
D](}|j�}|jd�rrtj
|�j�d}qrWWdQRX|s�dSx4|jd�D]&}tjj|d	|�}tjj|�r�|Sq�WdS)N�
/usr/bin/crler4r5�-64)r7r8r9sDefault Library Path (ELF):��:zlib%s.so)rerf)re)r#r&�existsr@r$rArBrCrPrDr7�strip�
startswithrIrr')	r+�is64r9rL�pathsrM�line�dirZlibfilerrr�
_findLib_crle�s6

 rpFcCstt||�pt|��S)N)rSrprO)r+rlrrrr,�scCs�ddl}|jd�dkr&tj�jd}ntj�jd}dddddd	�}|j|d
�}d}tj|tj|�|f�}yZt	j
dd
gt	jt	jt	jddd�d��,}tj
||jj��}|r�tj|jd��SWdQRXWntk
r�YnXdS)Nr�lrgz-32z-64zlibc6,x86-64zlibc6,64bitzlibc6,IA-64)z	x86_64-64zppc64-64z
sparc64-64zs390x-64zia64-64Zlibc6z\s+(lib%s\.[^\s]+)\s+\(%sz/sbin/ldconfigz-pr4)r5r6)�stdinr8r7r9r)�structZcalcsizer#�uname�machine�getr:r;r<rArBrPrCrHr7rErIrJrD)r+rsruZmach_mapZabi_typeZregex�prNrrr�_findSoname_ldconfig�s.
rxcCs�dtj|�}ddg}tjjd�}|rHx |jd�D]}|jd|g�q2W|jdtjd|g�d}yFtj	|tj
tj
d	d
�}|j�\}}tj|tj
|��}	|	r�|	jd�}Wn"tk
r�}
zWYdd}
~
XnX|S)Nz[^\(\)\s]*lib%s\.[^\(\)\s]*Zldz-tZLD_LIBRARY_PATHrhz-Lz-oz-l%sT)r7r8Zuniversal_newlinesr)r;r<r#r$rvr�extend�devnullrArBrCZcommunicaterHrIrJ�	Exception)r+rK�cmdZlibpathr�resultrw�out�_rN�errr�_findLib_lds&
r�cCst|�ptt|�pt|��S)N)rxrSrOr�)r+rrrr,,scCs�ddlm}tjdkr:t|j�t|jd��ttd��tjdkr�ttd��ttd��ttd��tj	d	kr�t|j
d
��t|j
d��t|j
d��t|j
d
��n(t|j
d��t|j
d��ttd��dS)Nr)�cdllrrr-r!r �bz2r.z
libm.dylibzlibcrypto.dylibzlibSystem.dylibzSystem.framework/Systemzlibm.sozlibcrypt.soZcrypt)Zctypesr�r#r+�printr�loadr,r�platformZLoadLibrary)r�rrr�test4s"



r��__main__)rVrWrX)F)r#r=rArr+rrr,r�Zctypes.macholib.dyldr/r0r;r?rOrSrkr^rprxr�r��__name__rrrr�<module>s8

+



$
__pycache__/__init__.cpython-36.opt-2.pyc000064400000032531150532450630014110 0ustar003

�\dh1@�@s:ddlZddlZdZddlmZmZmZddlm	Z	ddlm
ZddlmZddlm
Z
mZddlmZdd	lmZeekr�ed
ee��ejdkr�ddlmZe
Zejd
kr�ejdkr�eej�jjd�d�dkr�eZddlmZmZm Z!m"Z#d|dd�Z$d}dd�Z%iZ&dd�Z'ejdk�rXddlm(Z)ddlm*Z+iZ,dd�Z-e-j.�rpe'j.j/dd�e-_.nejd
k�rpddlm0Z)ddlm1Z1m2Z2m3Z3m4Z4m5Z5ddlm6Z6m7Z7ddlm8Z8d~d d!�Z9Gd"d#�d#e8�Z:e9e:d$�Gd%d&�d&e8�Z;e9e;�Gd'd(�d(e8�Z<e9e<�Gd)d*�d*e8�Z=e9e=�Gd+d,�d,e8�Z>e9e>�ed-�ed.�k�rHe=Z?e>Z@n0Gd/d0�d0e8�Z?e9e?�Gd1d2�d2e8�Z@e9e@�Gd3d4�d4e8�ZAe9eA�Gd5d6�d6e8�ZBe9eB�Gd7d8�d8e8�ZCe1eC�e1eB�k�r�eBZCed.�ed9�k�r�e=ZDe>ZEn0Gd:d;�d;e8�ZDe9eD�Gd<d=�d=e8�ZEe9eE�Gd>d?�d?e8�ZFeFeF_GeF_He9eF�Gd@dA�dAe8�ZIeIeI_GeI_He9eI�GdBdC�dCe8�ZJeJeJ_GeJ_He9eJ�GdDdE�dEe8�ZKe9eKd$�GdFdG�dGe8�ZLeLZMe9eL�GdHdI�dIe8�ZNddJlmOZOmPZPmQZQGdKdL�dLe8�ZRGdMdN�dNe8�ZSdOdP�ZTddQdR�ZUdSdT�ZVdUdV�ZWGdWdX�dXeX�ZYGdYdZ�dZeY�ZZejdk�r�Gd[d\�d\eY�Z[dd]lm\Z\m8Z8Gd^d_�d_e8�Z]Gd`da�daeY�Z^Gdbdc�dceX�Z_e_eY�Z`e_eZ�Zaejdk�r�eZdddejb�Zcn,ejdek�r�eZdfejdddg��ZcneZd�Zcejdk�rJe_e[�Zee_e^�Zfejdk�r(eejgjhZhneejijhZhddhlmjZjmkZkd�didj�Zle1e@�e1eL�k�rfe@Zme?Znn6e1e>�e1eL�k�r�e>Zme=Znne1eE�e1eL�k�r�eEZmeDZnddklmoZompZpmqZqmrZre'eLeLeLem�eo�Zse'eLeLe?em�ep�Ztdldm�Zueue:eLe:e:�er�Zvdndo�Zweue:eLe?�eq�Zxd�dqdr�ZyyddslmzZzWne{k
�r:YnXeue:eLe?�ez�Z|d�dtdu�Z}ejdk�rrdvdw�Z~dxdy�Zddzl�m�Z�m�Z�eIZ�eFZ�xPe;e?e=eDgD]@Z�e1e��dgk�r�e�Z�n&e1e��d{k�r�e�Z�ne1e��dk�r�e�Z��q�WxPe<e@e>eEgD]@Z�e1e��dgk�re�Z�n&e1e��d{k�re�Z�ne1e��dk�r�e�Z��q�W[�eT�dS)��Nz1.1.0)�Union�	Structure�Array)�_Pointer)�CFuncPtr)�__version__)�
RTLD_LOCAL�RTLD_GLOBAL)�
ArgumentError)�calcsizezVersion number mismatch�nt)�FormatError�posix�darwin�.�)�FUNCFLAG_CDECL�FUNCFLAG_PYTHONAPI�FUNCFLAG_USE_ERRNO�FUNCFLAG_USE_LASTERRORcCs^t|t�r6|dkrt|�d}t|}|�}||_|St|t�rRt|}|�}|St|��dS)N�)�
isinstance�bytes�len�c_char�value�int�	TypeError)�init�size�buftype�buf�r"�'/usr/lib64/python3.6/ctypes/__init__.py�create_string_buffer/s

r$cCs
t||�S)N)r$)rrr"r"r#�c_bufferAsr%cs�t�|jdd�r�tO�|jdd�r,�tO�|r@td|j���yt���fStk
r�G���fdd�dt�}|t���f<|SXdS)N�	use_errnoF�use_last_errorz!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z CFUNCTYPE.<locals>.CFunctionTypeN)�__name__�
__module__�__qualname__�
_argtypes_�	_restype_�_flags_r")�argtypes�flags�restyper"r#�
CFunctionTypecsr1)	�_FUNCFLAG_CDECL�pop�_FUNCFLAG_USE_ERRNO�_FUNCFLAG_USE_LASTERROR�
ValueError�keys�_c_functype_cache�KeyError�	_CFuncPtr)r0r.�kwr1r")r.r/r0r#�	CFUNCTYPEIsr<)�LoadLibrary)�FUNCFLAG_STDCALLcs�t�|jdd�r�tO�|jdd�r,�tO�|r@td|j���yt���fStk
r�G���fdd�dt�}|t���f<|SXdS)Nr&Fr'z!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z$WINFUNCTYPE.<locals>.WinFunctionTypeN)r(r)r*r+r,r-r")r.r/r0r"r#�WinFunctionType{sr?)	�_FUNCFLAG_STDCALLr3r4r5r6r7�_win_functype_cacher9r:)r0r.r;r?r")r.r/r0r#�WINFUNCTYPEosrB)�dlopen)�sizeof�byref�	addressof�	alignment�resize)�	get_errno�	set_errno)�_SimpleCDatacCsJddlm}|dkr|j}t|�||�}}||krFtd|||f��dS)Nr)rz"sizeof(%s) wrong: %d instead of %d)�structr�_type_rD�SystemError)�typ�typecoderZactualZrequiredr"r"r#�_check_size�srQcs eZdZdZ�fdd�Z�ZS)�	py_object�Ocs.y
t�j�Stk
r(dt|�jSXdS)Nz
%s(<NULL>))�super�__repr__r6�typer()�self)�	__class__r"r#rU�s
zpy_object.__repr__)r(r)r*rMrU�
__classcell__r"r")rXr#rR�srR�Pc@seZdZdZdS)�c_short�hN)r(r)r*rMr"r"r"r#r[�sr[c@seZdZdZdS)�c_ushort�HN)r(r)r*rMr"r"r"r#r]�sr]c@seZdZdZdS)�c_long�lN)r(r)r*rMr"r"r"r#r_�sr_c@seZdZdZdS)�c_ulong�LN)r(r)r*rMr"r"r"r#ra�sra�ir`c@seZdZdZdS)�c_intrcN)r(r)r*rMr"r"r"r#rd�srdc@seZdZdZdS)�c_uint�IN)r(r)r*rMr"r"r"r#re�srec@seZdZdZdS)�c_float�fN)r(r)r*rMr"r"r"r#rg�srgc@seZdZdZdS)�c_double�dN)r(r)r*rMr"r"r"r#ri�sric@seZdZdZdS)�c_longdouble�gN)r(r)r*rMr"r"r"r#rk�srk�qc@seZdZdZdS)�
c_longlongrmN)r(r)r*rMr"r"r"r#rn�srnc@seZdZdZdS)�c_ulonglong�QN)r(r)r*rMr"r"r"r#ro�sroc@seZdZdZdS)�c_ubyte�BN)r(r)r*rMr"r"r"r#rq�srqc@seZdZdZdS)�c_byte�bN)r(r)r*rMr"r"r"r#rs�srsc@seZdZdZdS)r�cN)r(r)r*rMr"r"r"r#r�src@seZdZdZdd�ZdS)�c_char_p�zcCsd|jjtj|�jfS)Nz%s(%s))rXr(�c_void_p�from_bufferr)rWr"r"r#rU�szc_char_p.__repr__N)r(r)r*rMrUr"r"r"r#rv�srvc@seZdZdZdS)rxrZN)r(r)r*rMr"r"r"r#rx�srxc@seZdZdZdS)�c_bool�?N)r(r)r*rMr"r"r"r#rz�srz)�POINTER�pointer�_pointer_type_cachec@seZdZdZdd�ZdS)�	c_wchar_p�ZcCsd|jjtj|�jfS)Nz%s(%s))rXr(rxryr)rWr"r"r#rU�szc_wchar_p.__repr__N)r(r)r*rMrUr"r"r"r#r�src@seZdZdZdS)�c_wchar�uN)r(r)r*rMr"r"r"r#r�sr�cCsFtj�tj�tjdkr"tj�tjtt	�_t
jtt�_ttd<dS)Nr)
r~�clearr8�_os�namerArZ
from_paramr|r�rvrrxr"r"r"r#�_reset_caches
r�cCs^t|t�r6|dkrt|�d}t|}|�}||_|St|t�rRt|}|�}|St|��dS)Nr)r�strrr�rrr)rrr r!r"r"r#�create_unicode_buffers

r�cCsLtj|d�dk	rtd��t|�tkr,td��|j|�|t|<tt|�=dS)Nz%This type already exists in the cachezWhat's this???)r~�get�RuntimeError�idZset_type)r}�clsr"r"r#�SetPointerType"s
r�cCs||S)Nr")rOrr"r"r#�ARRAY,sr�c@sJeZdZeZeZdZdZdZ	e
dddfdd�Zdd�Zd	d
�Z
dd�ZdS)
�CDLLz<uninitialized>rNFcsb|�_�j�|r�tO�|r$�tO�G��fdd�dt�}|�_|dkrXt�j|��_n|�_dS)NcseZdZ�Z�jZdS)zCDLL.__init__.<locals>._FuncPtrN)r(r)r*r-�_func_restype_r,r")r/rWr"r#�_FuncPtrQsr�)�_name�_func_flags_r4r5r:r��_dlopen�_handle)rWr��modeZhandler&r'r�r")r/rWr#�__init__Gsz
CDLL.__init__cCs8d|jj|j|jtjdd@t|�tjdd@fS)Nz<%s '%s', handle %x at %#x>�r)rXr(r�r��_sys�maxsizer�)rWr"r"r#rU[s
z
CDLL.__repr__cCs6|jd�r|jd�rt|��|j|�}t|||�|S)N�__)�
startswith�endswith�AttributeError�__getitem__�setattr)rWr��funcr"r"r#�__getattr__as

zCDLL.__getattr__cCs"|j||f�}t|t�s||_|S)N)r�rrr()rWZname_or_ordinalr�r"r"r#r�hs
zCDLL.__getitem__)r(r)r*r2r�rdr�r�r�r��DEFAULT_MODEr�rUr�r�r"r"r"r#r�2sr�c@seZdZeeBZdS)�PyDLLN)r(r)r*r2�_FUNCFLAG_PYTHONAPIr�r"r"r"r#r�nsr�c@seZdZeZdS)�WinDLLN)r(r)r*r@r�r"r"r"r#r�wsr�)�_check_HRESULTrKc@seZdZdZeZdS)�HRESULTr`N)r(r)r*rMr�Z_check_retval_r"r"r"r#r��s
r�c@seZdZeZeZdS)�OleDLLN)r(r)r*r@r�r�r�r"r"r"r#r��sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
LibraryLoadercCs
||_dS)N)�_dlltype)rWZdlltyper"r"r#r��szLibraryLoader.__init__cCs.|ddkrt|��|j|�}t|||�|S)Nr�_)r�r�r�)rWr�Zdllr"r"r#r��s

zLibraryLoader.__getattr__cCs
t||�S)N)�getattr)rWr�r"r"r#r��szLibraryLoader.__getitem__cCs
|j|�S)N)r�)rWr�r"r"r#r=�szLibraryLoader.LoadLibraryN)r(r)r*r�r�r�r=r"r"r"r#r��sr�z
python dll�cygwinzlibpython%d.%d.dllr�)�get_last_error�set_last_errorcCs0|dkrt�}|dkr"t|�j�}td|d|�S)N)�GetLastErrorr
�strip�OSError)�codeZdescrr"r"r#�WinError�s
r�)�
_memmove_addr�_memset_addr�_string_at_addr�
_cast_addrcsG��fdd�dt�}|S)NcseZdZ�Z�ZeeBZdS)z!PYFUNCTYPE.<locals>.CFunctionTypeN)r(r)r*r+r,r2r�r-r")r.r0r"r#r1�sr1)r:)r0r.r1r")r.r0r#�
PYFUNCTYPE�sr�cCst|||�S)N)�_cast)�objrOr"r"r#�cast�sr�rcCs
t||�S)N)�
_string_at)�ptrrr"r"r#�	string_at�sr�)�_wstring_at_addrcCs
t||�S)N)�_wstring_at)r�rr"r"r#�
wstring_at�sr�cCs@ytdt�t�dg�}Wntk
r,dSX|j|||�SdS)Nzcomtypes.server.inprocserver�*i�i�)�
__import__�globals�locals�ImportError�DllGetClassObject)ZrclsidZriidZppv�ccomr"r"r#r��s
r�cCs6ytdt�t�dg�}Wntk
r,dSX|j�S)Nzcomtypes.server.inprocserverr�r)r�r�r�r��DllCanUnloadNow)r�r"r"r#r��s
r�)�BigEndianStructure�LittleEndianStructure�)N)N)N)N)NN���)r�r�)r�)��osr��sysr�rZ_ctypesrrrrrr:Z_ctypes_versionrr	r
rLrZ	_calcsize�	Exceptionr�r
r��platformr�uname�release�splitrr2rr�rr4rr5r$r%r8r<r=r�r>r@rArB�__doc__�replacerCrDrErFrGrHrIrJrKrQrRr[r]r_rardrergrirkrnrorqZ__ctype_le__Z__ctype_be__rsrrvrxZc_voidprzr|r}r~rr�r�r�r�r��objectr�r�r�r�r�r�r�ZcdllZpydllZ	dllhandleZ	pythonapi�version_infoZwindllZoledllZkernel32r�Zcoredllr�r�r�Zc_size_tZ	c_ssize_tr�r�r�r�ZmemmoveZmemsetr�r�r�r�r�r�r�r�r�r�r�Zctypes._endianr�r�Zc_int8Zc_uint8ZkindZc_int16Zc_int32Zc_int64Zc_uint16Zc_uint32Zc_uint64r"r"r"r#�<module>s6


!




<
	





__pycache__/_endian.cpython-36.opt-2.pyc000064400000003054150532450630013744 0ustar003


 \��@s�ddlZddlTee�Zdd�ZGdd�dee��Zejdkr\dZ	eZ
Gd	d
�d
eed�Zn0ejdkr�d
Z	eZGdd�deed�Z
ned��dS)�N)�*cCsLt|t�rt|t�St|t�r.t|j�|jSt|t	�r<|St
d|��dS)Nz+This type does not support other endian: %s)�hasattr�
_OTHER_ENDIAN�getattr�
isinstance�_array_type�
_other_endianZ_type_Z_length_�
issubclass�	Structure�	TypeError)�typ�r
�&/usr/lib64/python3.6/ctypes/_endian.pyrs



rcseZdZ�fdd�Z�ZS)�
_swapped_metacsb|dkrPg}x>|D]6}|d}|d}|dd�}|j|t|�f|�qW|}t�j||�dS)NZ_fields_r��)�appendr�super�__setattr__)�selfZattrname�valueZfieldsZdesc�namer�rest)�	__class__r
rrs
z_swapped_meta.__setattr__)�__name__�
__module__�__qualname__r�
__classcell__r
r
)rrrsr�littleZ__ctype_be__c@seZdZfZdZdS)�BigEndianStructureN)rrr�	__slots__�_swappedbytes_r
r
r
rr.sr)�	metaclassZbigZ__ctype_le__c@seZdZfZdZdS)�LittleEndianStructureN)rrrr r!r
r
r
rr#7sr#zInvalid byteorder)
�sysZctypes�typeZArrayrrr
r�	byteorderrr#r�RuntimeErrorr
r
r
r�<module>s

__pycache__/__init__.cpython-36.pyc000064400000037065150532450630013157 0ustar003

�\dh1@�@s>dZddlZddlZdZddlmZmZm	Z	ddlm
Z
ddlmZddlmZ
ddlmZmZdd	lmZdd
lmZee
kr�edee
��ejdkr�dd
lmZeZejdkr�ejdkr�eej�jjd�d�dkr�eZddlmZmZ m!Z"m#Z$d}dd�Z%d~dd�Z&iZ'dd�Z(ejdk�r\ddlm)Z*ddlm+Z,iZ-dd�Z.e.j�rte(jj/dd�e._nejdk�rtddlm0Z*ddlm1Z1m2Z2m3Z3m4Z4m5Z5ddlm6Z6m7Z7dd lm8Z8dd!d"�Z9Gd#d$�d$e8�Z:e9e:d%�Gd&d'�d'e8�Z;e9e;�Gd(d)�d)e8�Z<e9e<�Gd*d+�d+e8�Z=e9e=�Gd,d-�d-e8�Z>e9e>�ed.�ed/�k�rLe=Z?e>Z@n0Gd0d1�d1e8�Z?e9e?�Gd2d3�d3e8�Z@e9e@�Gd4d5�d5e8�ZAe9eA�Gd6d7�d7e8�ZBe9eB�Gd8d9�d9e8�ZCe1eC�e1eB�k�r�eBZCed/�ed:�k�r�e=ZDe>ZEn0Gd;d<�d<e8�ZDe9eD�Gd=d>�d>e8�ZEe9eE�Gd?d@�d@e8�ZFeFeF_GeF_He9eF�GdAdB�dBe8�ZIeIeI_GeI_He9eI�GdCdD�dDe8�ZJeJeJ_GeJ_He9eJ�GdEdF�dFe8�ZKe9eKd%�GdGdH�dHe8�ZLeLZMe9eL�GdIdJ�dJe8�ZNddKlmOZOmPZPmQZQGdLdM�dMe8�ZRGdNdO�dOe8�ZSdPdQ�ZTd�dRdS�ZUdTdU�ZVdVdW�ZWGdXdY�dYeX�ZYGdZd[�d[eY�ZZejdk�r�Gd\d]�d]eY�Z[dd^lm\Z\m8Z8Gd_d`�d`e8�Z]Gdadb�dbeY�Z^Gdcdd�ddeX�Z_e_eY�Z`e_eZ�Zaejdk�r�eZdedejb�Zcn,ejdfk�r�eZdgejdddh��ZcneZd�Zcejdk�rNe_e[�Zee_e^�Zfejdk�r,eejgjhZhneejijhZhddilmjZjmkZkd�djdk�Zle1e@�e1eL�k�rje@Zme?Znn6e1e>�e1eL�k�r�e>Zme=Znne1eE�e1eL�k�r�eEZmeDZnddllmoZompZpmqZqmrZre(eLeLeLem�eo�Zse(eLeLe?em�ep�Ztdmdn�Zueue:eLe:e:�er�Zvdodp�Zweue:eLe?�eq�Zxd�drds�ZyyddtlmzZzWne{k
�r>YnXeue:eLe?�ez�Z|d�dudv�Z}ejdk�rvdwdx�Z~dydz�Zdd{l�m�Z�m�Z�eIZ�eFZ�xPe;e?e=eDgD]@Z�e1e��dhk�r�e�Z�n&e1e��d|k�r�e�Z�ne1e��dk�r�e�Z��q�WxPe<e@e>eEgD]@Z�e1e��dhk�re�Z�n&e1e��d|k�re�Z�ne1e��dk�r�e�Z��q�W[�eT�dS)�z,create and manipulate C data types in Python�Nz1.1.0)�Union�	Structure�Array)�_Pointer)�CFuncPtr)�__version__)�
RTLD_LOCAL�RTLD_GLOBAL)�
ArgumentError)�calcsizezVersion number mismatch�nt)�FormatError�posix�darwin�.�)�FUNCFLAG_CDECL�FUNCFLAG_PYTHONAPI�FUNCFLAG_USE_ERRNO�FUNCFLAG_USE_LASTERRORcCs^t|t�r6|dkrt|�d}t|}|�}||_|St|t�rRt|}|�}|St|��dS)z�create_string_buffer(aBytes) -> character array
    create_string_buffer(anInteger) -> character array
    create_string_buffer(aBytes, anInteger) -> character array
    N�)�
isinstance�bytes�len�c_char�value�int�	TypeError)�init�size�buftype�buf�r"�'/usr/lib64/python3.6/ctypes/__init__.py�create_string_buffer/s

r$cCs
t||�S)N)r$)rrr"r"r#�c_bufferAsr%cs�t�|jdd�r�tO�|jdd�r,�tO�|r@td|j���yt���fStk
r�G���fdd�dt�}|t���f<|SXdS)a�CFUNCTYPE(restype, *argtypes,
                 use_errno=False, use_last_error=False) -> function prototype.

    restype: the result type
    argtypes: a sequence specifying the argument types

    The function prototype can be called in different ways to create a
    callable object:

    prototype(integer address) -> foreign function
    prototype(callable) -> create and return a C callable function from callable
    prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
    prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
    prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
    �	use_errnoF�use_last_errorz!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z CFUNCTYPE.<locals>.CFunctionTypeN)�__name__�
__module__�__qualname__�
_argtypes_�	_restype_�_flags_r")�argtypes�flags�restyper"r#�
CFunctionTypecsr1N)	�_FUNCFLAG_CDECL�pop�_FUNCFLAG_USE_ERRNO�_FUNCFLAG_USE_LASTERROR�
ValueError�keys�_c_functype_cache�KeyError�	_CFuncPtr)r0r.�kwr1r")r.r/r0r#�	CFUNCTYPEIsr<)�LoadLibrary)�FUNCFLAG_STDCALLcs�t�|jdd�r�tO�|jdd�r,�tO�|r@td|j���yt���fStk
r�G���fdd�dt�}|t���f<|SXdS)Nr&Fr'z!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z$WINFUNCTYPE.<locals>.WinFunctionTypeN)r(r)r*r+r,r-r")r.r/r0r"r#�WinFunctionType{sr?)	�_FUNCFLAG_STDCALLr3r4r5r6r7�_win_functype_cacher9r:)r0r.r;r?r")r.r/r0r#�WINFUNCTYPEosrB)�dlopen)�sizeof�byref�	addressof�	alignment�resize)�	get_errno�	set_errno)�_SimpleCDatacCsJddlm}|dkr|j}t|�||�}}||krFtd|||f��dS)Nr)rz"sizeof(%s) wrong: %d instead of %d)�structr�_type_rD�SystemError)�typ�typecoderZactualZrequiredr"r"r#�_check_size�srQcs eZdZdZ�fdd�Z�ZS)�	py_object�Ocs.y
t�j�Stk
r(dt|�jSXdS)Nz
%s(<NULL>))�super�__repr__r6�typer()�self)�	__class__r"r#rU�s
zpy_object.__repr__)r(r)r*rMrU�
__classcell__r"r")rXr#rR�srR�Pc@seZdZdZdS)�c_short�hN)r(r)r*rMr"r"r"r#r[�sr[c@seZdZdZdS)�c_ushort�HN)r(r)r*rMr"r"r"r#r]�sr]c@seZdZdZdS)�c_long�lN)r(r)r*rMr"r"r"r#r_�sr_c@seZdZdZdS)�c_ulong�LN)r(r)r*rMr"r"r"r#ra�sra�ir`c@seZdZdZdS)�c_intrcN)r(r)r*rMr"r"r"r#rd�srdc@seZdZdZdS)�c_uint�IN)r(r)r*rMr"r"r"r#re�srec@seZdZdZdS)�c_float�fN)r(r)r*rMr"r"r"r#rg�srgc@seZdZdZdS)�c_double�dN)r(r)r*rMr"r"r"r#ri�sric@seZdZdZdS)�c_longdouble�gN)r(r)r*rMr"r"r"r#rk�srk�qc@seZdZdZdS)�
c_longlongrmN)r(r)r*rMr"r"r"r#rn�srnc@seZdZdZdS)�c_ulonglong�QN)r(r)r*rMr"r"r"r#ro�sroc@seZdZdZdS)�c_ubyte�BN)r(r)r*rMr"r"r"r#rq�srqc@seZdZdZdS)�c_byte�bN)r(r)r*rMr"r"r"r#rs�srsc@seZdZdZdS)r�cN)r(r)r*rMr"r"r"r#r�src@seZdZdZdd�ZdS)�c_char_p�zcCsd|jjtj|�jfS)Nz%s(%s))rXr(�c_void_p�from_bufferr)rWr"r"r#rU�szc_char_p.__repr__N)r(r)r*rMrUr"r"r"r#rv�srvc@seZdZdZdS)rxrZN)r(r)r*rMr"r"r"r#rx�srxc@seZdZdZdS)�c_bool�?N)r(r)r*rMr"r"r"r#rz�srz)�POINTER�pointer�_pointer_type_cachec@seZdZdZdd�ZdS)�	c_wchar_p�ZcCsd|jjtj|�jfS)Nz%s(%s))rXr(rxryr)rWr"r"r#rU�szc_wchar_p.__repr__N)r(r)r*rMrUr"r"r"r#r�src@seZdZdZdS)�c_wchar�uN)r(r)r*rMr"r"r"r#r�sr�cCsFtj�tj�tjdkr"tj�tjtt	�_t
jtt�_ttd<dS)Nr)
r~�clearr8�_os�namerArZ
from_paramr|r�rvrrxr"r"r"r#�_reset_caches
r�cCs^t|t�r6|dkrt|�d}t|}|�}||_|St|t�rRt|}|�}|St|��dS)z�create_unicode_buffer(aString) -> character array
    create_unicode_buffer(anInteger) -> character array
    create_unicode_buffer(aString, anInteger) -> character array
    Nr)r�strrr�rrr)rrr r!r"r"r#�create_unicode_buffers

r�cCsLtj|d�dk	rtd��t|�tkr,td��|j|�|t|<tt|�=dS)Nz%This type already exists in the cachezWhat's this???)r~�get�RuntimeError�idZset_type)r}�clsr"r"r#�SetPointerType"s
r�cCs||S)Nr")rOrr"r"r#�ARRAY,sr�c@sNeZdZdZeZeZdZdZ	dZ
edddfdd�Zdd	�Z
d
d�Zdd
�ZdS)�CDLLa�An instance of this class represents a loaded dll/shared
    library, exporting functions using the standard C calling
    convention (named 'cdecl' on Windows).

    The exported functions can be accessed as attributes, or by
    indexing with the function name.  Examples:

    <obj>.qsort -> callable object
    <obj>['qsort'] -> callable object

    Calling the functions releases the Python GIL during the call and
    reacquires it afterwards.
    z<uninitialized>rNFcsb|�_�j�|r�tO�|r$�tO�G��fdd�dt�}|�_|dkrXt�j|��_n|�_dS)NcseZdZ�Z�jZdS)zCDLL.__init__.<locals>._FuncPtrN)r(r)r*r-�_func_restype_r,r")r/rWr"r#�_FuncPtrQsr�)�_name�_func_flags_r4r5r:r��_dlopen�_handle)rWr��modeZhandler&r'r�r")r/rWr#�__init__Gsz
CDLL.__init__cCs8d|jj|j|jtjdd@t|�tjdd@fS)Nz<%s '%s', handle %x at %#x>�r)rXr(r�r��_sys�maxsizer�)rWr"r"r#rU[s
z
CDLL.__repr__cCs6|jd�r|jd�rt|��|j|�}t|||�|S)N�__)�
startswith�endswith�AttributeError�__getitem__�setattr)rWr��funcr"r"r#�__getattr__as

zCDLL.__getattr__cCs"|j||f�}t|t�s||_|S)N)r�rrr()rWZname_or_ordinalr�r"r"r#r�hs
zCDLL.__getitem__)r(r)r*�__doc__r2r�rdr�r�r�r��DEFAULT_MODEr�rUr�r�r"r"r"r#r�2s
r�c@seZdZdZeeBZdS)�PyDLLz�This class represents the Python library itself.  It allows
    accessing Python API functions.  The GIL is not released, and
    Python exceptions are handled correctly.
    N)r(r)r*r�r2�_FUNCFLAG_PYTHONAPIr�r"r"r"r#r�nsr�c@seZdZdZeZdS)�WinDLLznThis class represents a dll exporting functions using the
        Windows stdcall calling convention.
        N)r(r)r*r�r@r�r"r"r"r#r�wsr�)�_check_HRESULTrKc@seZdZdZeZdS)�HRESULTr`N)r(r)r*rMr�Z_check_retval_r"r"r"r#r��s
r�c@seZdZdZeZeZdS)�OleDLLz�This class represents a dll exporting functions using the
        Windows stdcall calling convention, and returning HRESULT.
        HRESULT error values are automatically raised as OSError
        exceptions.
        N)r(r)r*r�r@r�r�r�r"r"r"r#r��sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
LibraryLoadercCs
||_dS)N)�_dlltype)rWZdlltyper"r"r#r��szLibraryLoader.__init__cCs.|ddkrt|��|j|�}t|||�|S)Nr�_)r�r�r�)rWr�Zdllr"r"r#r��s

zLibraryLoader.__getattr__cCs
t||�S)N)�getattr)rWr�r"r"r#r��szLibraryLoader.__getitem__cCs
|j|�S)N)r�)rWr�r"r"r#r=�szLibraryLoader.LoadLibraryN)r(r)r*r�r�r�r=r"r"r"r#r��sr�z
python dll�cygwinzlibpython%d.%d.dllr�)�get_last_error�set_last_errorcCs0|dkrt�}|dkr"t|�j�}td|d|�S)N)�GetLastErrorr
�strip�OSError)�codeZdescrr"r"r#�WinError�s
r�)�
_memmove_addr�_memset_addr�_string_at_addr�
_cast_addrcsG��fdd�dt�}|S)NcseZdZ�Z�ZeeBZdS)z!PYFUNCTYPE.<locals>.CFunctionTypeN)r(r)r*r+r,r2r�r-r")r.r0r"r#r1�sr1)r:)r0r.r1r")r.r0r#�
PYFUNCTYPE�sr�cCst|||�S)N)�_cast)�objrOr"r"r#�cast�sr�rcCs
t||�S)zAstring_at(addr[, size]) -> string

    Return the string at addr.)�
_string_at)�ptrrr"r"r#�	string_at�sr�)�_wstring_at_addrcCs
t||�S)zFwstring_at(addr[, size]) -> string

        Return the string at addr.)�_wstring_at)r�rr"r"r#�
wstring_at�sr�cCs@ytdt�t�dg�}Wntk
r,dSX|j|||�SdS)Nzcomtypes.server.inprocserver�*i�i�)�
__import__�globals�locals�ImportError�DllGetClassObject)ZrclsidZriidZppv�ccomr"r"r#r��s
r�cCs6ytdt�t�dg�}Wntk
r,dSX|j�S)Nzcomtypes.server.inprocserverr�r)r�r�r�r��DllCanUnloadNow)r�r"r"r#r��s
r�)�BigEndianStructure�LittleEndianStructure�)N)N)N)N)NN���)r�r�)r�)�r��osr��sysr�rZ_ctypesrrrrrr:Z_ctypes_versionrr	r
rLrZ	_calcsize�	Exceptionr�r
r��platformr�uname�release�splitrr2rr�rr4rr5r$r%r8r<r=r�r>r@rArB�replacerCrDrErFrGrHrIrJrKrQrRr[r]r_rardrergrirkrnrorqZ__ctype_le__Z__ctype_be__rsrrvrxZc_voidprzr|r}r~rr�r�r�r�r��objectr�r�r�r�r�r�r�ZcdllZpydllZ	dllhandleZ	pythonapi�version_infoZwindllZoledllZkernel32r�Zcoredllr�r�r�Zc_size_tZ	c_ssize_tr�r�r�r�ZmemmoveZmemsetr�r�r�r�r�r�r�r�r�r�r�Zctypes._endianr�r�Zc_int8Zc_uint8ZkindZc_int16Zc_int32Zc_int64Zc_uint16Zc_uint32Zc_uint64r"r"r"r#�<module>s8


!




<
	





__pycache__/_endian.cpython-36.opt-1.pyc000064400000003606150532450630013746 0ustar003


 \��@s�ddlZddlTee�Zdd�ZGdd�dee��Zejdkr\dZ	eZ
Gd	d
�d
eed�Zn0ejdkr�d
Z	eZGdd�deed�Z
ned��dS)�N)�*cCsLt|t�rt|t�St|t�r.t|j�|jSt|t	�r<|St
d|��dS)z�Return the type with the 'other' byte order.  Simple types like
    c_int and so on already have __ctype_be__ and __ctype_le__
    attributes which contain the types, for more complicated types
    arrays and structures are supported.
    z+This type does not support other endian: %sN)�hasattr�
_OTHER_ENDIAN�getattr�
isinstance�_array_type�
_other_endianZ_type_Z_length_�
issubclass�	Structure�	TypeError)�typ�r
�&/usr/lib64/python3.6/ctypes/_endian.pyrs



rcseZdZ�fdd�Z�ZS)�
_swapped_metacsb|dkrPg}x>|D]6}|d}|d}|dd�}|j|t|�f|�qW|}t�j||�dS)NZ_fields_r��)�appendr�super�__setattr__)�selfZattrname�valueZfieldsZdesc�namer�rest)�	__class__r
rrs
z_swapped_meta.__setattr__)�__name__�
__module__�__qualname__r�
__classcell__r
r
)rrrsr�littleZ__ctype_be__c@seZdZdZfZdZdS)�BigEndianStructurez$Structure with big endian byte orderN)rrr�__doc__�	__slots__�_swappedbytes_r
r
r
rr.sr)�	metaclassZbigZ__ctype_le__c@seZdZdZfZdZdS)�LittleEndianStructurez'Structure with little endian byte orderN)rrrr r!r"r
r
r
rr$7sr$zInvalid byteorder)
�sysZctypes�typeZArrayrrr
r�	byteorderrr$r�RuntimeErrorr
r
r
r�<module>s

__pycache__/util.cpython-36.opt-2.pyc000064400000015504150532450630013327 0ustar003


 \�-�@sddlZddlZddlZddlZejdkrBdd�Zdd�Zdd�Zejd	krlejd
krlddl	m
Zdd�Zn�ejd	k�rddlZddl
Z
d
d�Zejdkr�dd�Zndd�Zejjd%�r�dd�Zdd�Zn6ejdkr�dd�Zd&dd�Zndd�Zdd �Zd!d�Zd"d#�Zed$k�re�dS)'�N�ntcCs�d}tjj|�}|d
krdS|t|�}tj|d�jdd�\}}t|dd��d}|dkrf|d7}t|dd��d}|dkr�d	}|dkr�||SdS)NzMSC v.��� ��
�g$@r������)�sys�version�find�len�split�int)�prefix�i�s�restZmajorVersionZminorVersion�r�#/usr/lib64/python3.6/ctypes/util.py�_get_build_version	srcCs^t�}|dkrdS|dkr d}n|dkr6d|d}ndSddl}d|jjkrV|d7}|d	S)
Nr�msvcrtrzmsvcr%d�
rz_d.pyd�dz.dll)r�importlib.machinery�	machinery�EXTENSION_SUFFIXES)rZclibname�	importlibrrr�find_msvcrt"srcCst|dkrt�Sx`tjdjtj�D]J}tjj||�}tjj|�rD|S|j�j	d�rTq"|d}tjj|�r"|Sq"WdS)N�c�m�PATHz.dll)r r!)
r�os�environr�pathsep�path�join�isfile�lower�endswith)�nameZ	directoryZfnamerrr�find_library7sr,�posix�darwin)�	dyld_findcCsLd|d|d||fg}x,|D]$}yt|�Stk
rBw Yq Xq WdS)Nzlib%s.dylibz%s.dylibz%s.framework/%s)�
_dyld_find�
ValueError)r+�possiblerrrr,Hs
c	!Cstjdtj|��}tjd�}|s,tjd�}|s4dStj�}z||dd|jd|g}t	tj
�}d|d<d|d	<ytj|tj
tj|d
�}Wntk
r�dSX|�|jj�}WdQRXWdy|j�Wntk
r�YnXXtj||�}|s�dStj|jd��S)Nz[^\(\)\s]*lib%s\.[^\(\)\s]*�gccZccz-Wl,-tz-oz-l�C�LC_ALL�LANG)�stdout�stderr�envr)r#�fsencode�re�escape�shutil�which�tempfileZNamedTemporaryFiler+�dictr$�
subprocess�Popen�PIPEZSTDOUT�OSErrorr7�read�close�FileNotFoundError�search�fsdecode�group)	r+�exprZ
c_compilerZtemp�argsr9�procZtrace�resrrr�_findLib_gccWs:


rOZsunos5cCsz|sdSytjdd|ftjtjd�}Wntk
r:dSX|�|jj�}WdQRXtjd|�}|sjdSt	j
|jd��S)Nz/usr/ccs/bin/dumpz-Lpv)r7r8s\[.*\]\sSONAME\s+([^\s]+)r)rArBrC�DEVNULLrDr7rEr;rHr#rIrJ)�frM�datarNrrr�_get_soname�srScCs�|sdStjd�}|sdSy"tj|ddd|ftjtjd�}Wntk
rPdSX|�|jj�}WdQRXt	j
d|�}|s�dStj|j
d��S)N�objdumpz-pz-jz.dynamic)r7r8s\sSONAME\s+([^\s]+)r)r=r>rArBrCrPrDr7rEr;rHr#rIrJ)rQrTrM�dumprNrrrrS�s"
�freebsd�openbsd�	dragonflycCsR|jd�}g}y"x|r,|jdt|j���qWWntk
rDYnX|pPtjgS)N�.r)r�insertr�popr1r�maxsize)Zlibname�partsZnumsrrr�_num_version�s
r^cCs�tj|�}d||f}tj|�}ytjdtjtjd�}Wntk
rPd}YnX|�|j	j
�}WdQRXtj||�}|s�tt
|��S|jtd�tj|d	�S)
Nz:-l%s\.\S+ => \S*/(lib%s\.\S+)�/sbin/ldconfig�-r)r7r8�)�keyr)r_r`r	)r;r<r#r:rArBrCrPrDr7rE�findallrSrO�sortr^rI)r+ZenamerKrMrRrNrrrr,�s 


c	Cs�tjjd�sdSttj�}d|d<|r,d
}nd}d}ytj|tjtj|d�}Wnt	k
rbdSX|�:x2|j
D](}|j�}|jd�rrtj
|�j�d}qrWWdQRX|s�dSx4|jd�D]&}tjj|d	|�}tjj|�r�|Sq�WdS)N�
/usr/bin/crler4r5�-64)r7r8r9sDefault Library Path (ELF):��:zlib%s.so)rerf)re)r#r&�existsr@r$rArBrCrPrDr7�strip�
startswithrIrr')	r+�is64r9rL�pathsrM�line�dirZlibfilerrr�
_findLib_crle�s6

 rpFcCstt||�pt|��S)N)rSrprO)r+rlrrrr,�scCs�ddl}|jd�dkr&tj�jd}ntj�jd}dddddd	�}|j|d
�}d}tj|tj|�|f�}yZt	j
dd
gt	jt	jt	jddd�d��,}tj
||jj��}|r�tj|jd��SWdQRXWntk
r�YnXdS)Nr�lrgz-32z-64zlibc6,x86-64zlibc6,64bitzlibc6,IA-64)z	x86_64-64zppc64-64z
sparc64-64zs390x-64zia64-64Zlibc6z\s+(lib%s\.[^\s]+)\s+\(%sz/sbin/ldconfigz-pr4)r5r6)�stdinr8r7r9r)�structZcalcsizer#�uname�machine�getr:r;r<rArBrPrCrHr7rErIrJrD)r+rsruZmach_mapZabi_typeZregex�prNrrr�_findSoname_ldconfig�s.
rxcCs�dtj|�}ddg}tjjd�}|rHx |jd�D]}|jd|g�q2W|jdtjd|g�d}yFtj	|tj
tj
d	d
�}|j�\}}tj|tj
|��}	|	r�|	jd�}Wn"tk
r�}
zWYdd}
~
XnX|S)Nz[^\(\)\s]*lib%s\.[^\(\)\s]*Zldz-tZLD_LIBRARY_PATHrhz-Lz-oz-l%sT)r7r8Zuniversal_newlinesr)r;r<r#r$rvr�extend�devnullrArBrCZcommunicaterHrIrJ�	Exception)r+rK�cmdZlibpathr�resultrw�out�_rN�errr�_findLib_lds&
r�cCst|�ptt|�pt|��S)N)rxrSrOr�)r+rrrr,,scCs�ddlm}tjdkr:t|j�t|jd��ttd��tjdkr�ttd��ttd��ttd��tj	d	kr�t|j
d
��t|j
d��t|j
d��t|j
d
��n(t|j
d��t|j
d��ttd��dS)Nr)�cdllrrr-r!r �bz2r.z
libm.dylibzlibcrypto.dylibzlibSystem.dylibzSystem.framework/Systemzlibm.sozlibcrypt.soZcrypt)Zctypesr�r#r+�printr�loadr,r�platformZLoadLibrary)r�rrr�test4s"



r��__main__)rVrWrX)F)r#r=rArr+rrr,r�Zctypes.macholib.dyldr/r0r;r?rOrSrkr^rprxr�r��__name__rrrr�<module>s8

+



$
__pycache__/wintypes.cpython-36.pyc000064400000011751150532450630013274 0ustar003


 \��@sddlZejZejZejZejZej	Z
ejZej
ZejZejZeZejZGdd�dej�ZejZejZejZejZejZZej Z!Z"ej#Z$Z%Z&ej#Z'Z(ej)Z*Z+ej,Z-Z.ej/ej�ej/ej,�kr�ejZ0ejZ1n$ej/ej�ej/ej,�kr�ej Z0ejZ1eZ2eZ3eZ4eZ5eZ6eZ7ej,Z8e8Z9e8Z:e8Z;e8Z<e8Z=e8Z>e8Z?e8Z@e8ZAe8ZBe8ZCe8ZDe8ZEe8ZFe8ZGe8ZHe8ZIe8ZJe8ZKe8ZLe8ZMe8ZNe8ZOe8ZPe8ZQe8ZRe8ZSe8ZTe8ZUe8ZVe8ZWGdd�dejX�ZYeYZZZ[Z\Gdd�dejX�Z]e]Z^Gdd	�d	ejX�Z_Gd
d�dejX�Z`e`ZaZbZcGdd
�d
ejX�ZdedZeZfdd�ZgGdd�dejX�ZhehZiGdd�dejX�ZjejZkdZlGdd�dejX�ZmGdd�dejX�Znejoe�ZpZqejoe�Zrejoe�ZsZtejoe�Zuejoe4�Zvejoe�ZwZxejoeh�ZyZzejoe�Z{ejoe8�Z|Z}ejoeG�Z~ejoeH�Zejoe�Z�Z�ejoe�Z�ejoe7�Z�ejoe�Z�Z�ejoej�Z�Z�ejoe`�Z�Z�ejoec�Z�ejoeY�Z�Z�ejoe\�Z�Z�ejoeV�Z�ejoe�Z�ejoed�Z�Z�ejoef�Z�Z�ejoe^�Z�ejoe�Z�Z�ejoe"�Z�ejoe�Z�ejoe�Z�ejoe
�Z�ejoem�Z�Z�ejoen�Z�Z�ejoe�Z�Z�dS)�Nc@seZdZdZdd�ZdS)�VARIANT_BOOL�vcCsd|jj|jfS)Nz%s(%r))�	__class__�__name__�value)�self�r�'/usr/lib64/python3.6/ctypes/wintypes.py�__repr__szVARIANT_BOOL.__repr__N)r�
__module__�__qualname__Z_type_r
rrrr	rsrc@s(eZdZdefdefdefdefgZdS)�RECT�left�top�rightZbottomN)rrr�LONG�_fields_rrrr	r
asr
c@s(eZdZdefdefdefdefgZdS)�_SMALL_RECTZLeftZTopZRightZBottomN)rrr�SHORTrrrrr	rhsrc@seZdZdefdefgZdS)�_COORD�X�YN)rrrrrrrrr	rosrc@seZdZdefdefgZdS)�POINT�x�yN)rrrrrrrrr	rssrc@seZdZdefdefgZdS)�SIZEZcxZcyN)rrrrrrrrr	rxsrcCs||d>|d>S)N��r)ZredZgreenZbluerrr	�RGB}src@seZdZdefdefgZdS)�FILETIMEZ
dwLowDateTimeZdwHighDateTimeN)rrr�DWORDrrrrr	r�src@s4eZdZdefdefdefdefdefdefgZ	dS)�MSGZhWnd�messageZwParamZlParamZtimeZptN)
rrr�HWND�UINT�WPARAM�LPARAMr rrrrrr	r!�sr!ic@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAA�dwFileAttributes�ftCreationTime�ftLastAccessTime�ftLastWriteTime�
nFileSizeHigh�nFileSizeLow�dwReserved0�dwReserved1�	cFileName�cAlternateFileName�N)rrrr r�CHAR�MAX_PATHrrrrr	r'�s
r'c@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAWr(r)r*r+r,r-r.r/r0r1r2N)rrrr r�WCHARr4rrrrr	r5�s
r5)�ZctypesZc_byteZBYTEZc_ushortZWORDZc_ulongr Zc_charr3Zc_wcharr6Zc_uintr$Zc_intZINTZc_doubleZDOUBLEZc_floatZFLOATZBOOLEANZc_longZBOOLZ_SimpleCDatarZULONGrZUSHORTZc_shortrZ
c_longlongZ_LARGE_INTEGERZ
LARGE_INTEGERZc_ulonglongZ_ULARGE_INTEGERZULARGE_INTEGERZ	c_wchar_pZ	LPCOLESTRZLPOLESTRZOLESTRZLPCWSTRZLPWSTRZc_char_pZLPCSTRZLPSTRZc_void_pZLPCVOIDZLPVOIDZsizeofr%r&ZATOMZLANGIDZCOLORREFZLGRPIDZLCTYPEZLCIDZHANDLEZHACCELZHBITMAPZHBRUSHZHCOLORSPACEZHDCZHDESKZHDWPZHENHMETAFILEZHFONTZHGDIOBJZHGLOBALZHHOOKZHICONZ	HINSTANCEZHKEYZHKLZHLOCALZHMENUZ	HMETAFILEZHMODULEZHMONITORZHPALETTEZHPENZHRGNZHRSRCZHSTRZHTASKZHWINSTAr#Z	SC_HANDLEZSERVICE_STATUS_HANDLEZ	Structurer
ZtagRECTZ_RECTLZRECTLrZ
SMALL_RECTrrZtagPOINTZ_POINTLZPOINTLrZtagSIZEZSIZELrrZ	_FILETIMEr!ZtagMSGr4r'r5ZPOINTERZLPBOOLZPBOOLZPBOOLEANZLPBYTEZPBYTEZPCHARZ
LPCOLORREFZLPDWORDZPDWORDZ
LPFILETIMEZ	PFILETIMEZPFLOATZLPHANDLEZPHANDLEZPHKEYZLPHKLZLPINTZPINTZPLARGE_INTEGERZPLCIDZLPLONGZPLONGZLPMSGZPMSGZLPPOINTZPPOINTZPPOINTLZLPRECTZPRECTZLPRECTLZPRECTLZLPSC_HANDLEZPSHORTZLPSIZEZPSIZEZLPSIZELZPSIZELZPSMALL_RECTZLPUINTZPUINTZPULARGE_INTEGERZPULONGZPUSHORTZPWCHARZLPWIN32_FIND_DATAAZPWIN32_FIND_DATAAZLPWIN32_FIND_DATAWZPWIN32_FIND_DATAWZLPWORDZPWORDrrrr	�<module>s�




















__pycache__/wintypes.cpython-36.opt-1.pyc000064400000011751150532450630014233 0ustar003


 \��@sddlZejZejZejZejZej	Z
ejZej
ZejZejZeZejZGdd�dej�ZejZejZejZejZejZZej Z!Z"ej#Z$Z%Z&ej#Z'Z(ej)Z*Z+ej,Z-Z.ej/ej�ej/ej,�kr�ejZ0ejZ1n$ej/ej�ej/ej,�kr�ej Z0ejZ1eZ2eZ3eZ4eZ5eZ6eZ7ej,Z8e8Z9e8Z:e8Z;e8Z<e8Z=e8Z>e8Z?e8Z@e8ZAe8ZBe8ZCe8ZDe8ZEe8ZFe8ZGe8ZHe8ZIe8ZJe8ZKe8ZLe8ZMe8ZNe8ZOe8ZPe8ZQe8ZRe8ZSe8ZTe8ZUe8ZVe8ZWGdd�dejX�ZYeYZZZ[Z\Gdd�dejX�Z]e]Z^Gdd	�d	ejX�Z_Gd
d�dejX�Z`e`ZaZbZcGdd
�d
ejX�ZdedZeZfdd�ZgGdd�dejX�ZhehZiGdd�dejX�ZjejZkdZlGdd�dejX�ZmGdd�dejX�Znejoe�ZpZqejoe�Zrejoe�ZsZtejoe�Zuejoe4�Zvejoe�ZwZxejoeh�ZyZzejoe�Z{ejoe8�Z|Z}ejoeG�Z~ejoeH�Zejoe�Z�Z�ejoe�Z�ejoe7�Z�ejoe�Z�Z�ejoej�Z�Z�ejoe`�Z�Z�ejoec�Z�ejoeY�Z�Z�ejoe\�Z�Z�ejoeV�Z�ejoe�Z�ejoed�Z�Z�ejoef�Z�Z�ejoe^�Z�ejoe�Z�Z�ejoe"�Z�ejoe�Z�ejoe�Z�ejoe
�Z�ejoem�Z�Z�ejoen�Z�Z�ejoe�Z�Z�dS)�Nc@seZdZdZdd�ZdS)�VARIANT_BOOL�vcCsd|jj|jfS)Nz%s(%r))�	__class__�__name__�value)�self�r�'/usr/lib64/python3.6/ctypes/wintypes.py�__repr__szVARIANT_BOOL.__repr__N)r�
__module__�__qualname__Z_type_r
rrrr	rsrc@s(eZdZdefdefdefdefgZdS)�RECT�left�top�rightZbottomN)rrr�LONG�_fields_rrrr	r
asr
c@s(eZdZdefdefdefdefgZdS)�_SMALL_RECTZLeftZTopZRightZBottomN)rrr�SHORTrrrrr	rhsrc@seZdZdefdefgZdS)�_COORD�X�YN)rrrrrrrrr	rosrc@seZdZdefdefgZdS)�POINT�x�yN)rrrrrrrrr	rssrc@seZdZdefdefgZdS)�SIZEZcxZcyN)rrrrrrrrr	rxsrcCs||d>|d>S)N��r)ZredZgreenZbluerrr	�RGB}src@seZdZdefdefgZdS)�FILETIMEZ
dwLowDateTimeZdwHighDateTimeN)rrr�DWORDrrrrr	r�src@s4eZdZdefdefdefdefdefdefgZ	dS)�MSGZhWnd�messageZwParamZlParamZtimeZptN)
rrr�HWND�UINT�WPARAM�LPARAMr rrrrrr	r!�sr!ic@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAA�dwFileAttributes�ftCreationTime�ftLastAccessTime�ftLastWriteTime�
nFileSizeHigh�nFileSizeLow�dwReserved0�dwReserved1�	cFileName�cAlternateFileName�N)rrrr r�CHAR�MAX_PATHrrrrr	r'�s
r'c@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAWr(r)r*r+r,r-r.r/r0r1r2N)rrrr r�WCHARr4rrrrr	r5�s
r5)�ZctypesZc_byteZBYTEZc_ushortZWORDZc_ulongr Zc_charr3Zc_wcharr6Zc_uintr$Zc_intZINTZc_doubleZDOUBLEZc_floatZFLOATZBOOLEANZc_longZBOOLZ_SimpleCDatarZULONGrZUSHORTZc_shortrZ
c_longlongZ_LARGE_INTEGERZ
LARGE_INTEGERZc_ulonglongZ_ULARGE_INTEGERZULARGE_INTEGERZ	c_wchar_pZ	LPCOLESTRZLPOLESTRZOLESTRZLPCWSTRZLPWSTRZc_char_pZLPCSTRZLPSTRZc_void_pZLPCVOIDZLPVOIDZsizeofr%r&ZATOMZLANGIDZCOLORREFZLGRPIDZLCTYPEZLCIDZHANDLEZHACCELZHBITMAPZHBRUSHZHCOLORSPACEZHDCZHDESKZHDWPZHENHMETAFILEZHFONTZHGDIOBJZHGLOBALZHHOOKZHICONZ	HINSTANCEZHKEYZHKLZHLOCALZHMENUZ	HMETAFILEZHMODULEZHMONITORZHPALETTEZHPENZHRGNZHRSRCZHSTRZHTASKZHWINSTAr#Z	SC_HANDLEZSERVICE_STATUS_HANDLEZ	Structurer
ZtagRECTZ_RECTLZRECTLrZ
SMALL_RECTrrZtagPOINTZ_POINTLZPOINTLrZtagSIZEZSIZELrrZ	_FILETIMEr!ZtagMSGr4r'r5ZPOINTERZLPBOOLZPBOOLZPBOOLEANZLPBYTEZPBYTEZPCHARZ
LPCOLORREFZLPDWORDZPDWORDZ
LPFILETIMEZ	PFILETIMEZPFLOATZLPHANDLEZPHANDLEZPHKEYZLPHKLZLPINTZPINTZPLARGE_INTEGERZPLCIDZLPLONGZPLONGZLPMSGZPMSGZLPPOINTZPPOINTZPPOINTLZLPRECTZPRECTZLPRECTLZPRECTLZLPSC_HANDLEZPSHORTZLPSIZEZPSIZEZLPSIZELZPSIZELZPSMALL_RECTZLPUINTZPUINTZPULARGE_INTEGERZPULONGZPUSHORTZPWCHARZLPWIN32_FIND_DATAAZPWIN32_FIND_DATAAZLPWIN32_FIND_DATAWZPWIN32_FIND_DATAWZLPWORDZPWORDrrrr	�<module>s�




















__pycache__/util.cpython-36.pyc000064400000016074150532450630012372 0ustar003


 \�-�@sddlZddlZddlZddlZejdkrBdd�Zdd�Zdd�Zejd	krlejd
krlddl	m
Zdd�Zn�ejd	k�rddlZddl
Z
d
d�Zejdkr�dd�Zndd�Zejjd%�r�dd�Zdd�Zn6ejdkr�dd�Zd&dd�Zndd�Zdd �Zd!d�Zd"d#�Zed$k�re�dS)'�N�ntcCs�d}tjj|�}|dkrdS|t|�}tj|d�jdd�\}}t|dd��d}|dkrf|d7}t|dd��d	}|dkr�d
}|dkr�||SdS)
z�Return the version of MSVC that was used to build Python.

        For Python 2.3 and up, the version number is included in
        sys.version.  For earlier versions, assume the compiler is MSVC 6.
        zMSC v.��N� ��
�g$@r������)�sys�version�find�len�split�int)�prefix�i�s�restZmajorVersionZminorVersion�r�#/usr/lib64/python3.6/ctypes/util.py�_get_build_version	srcCs^t�}|dkrdS|dkr d}n|dkr6d|d}ndSddl}d|jjkrV|d	7}|d
S)z%Return the name of the VC runtime dllNr�msvcrtrzmsvcr%d�
rz_d.pyd�dz.dll)r�importlib.machinery�	machinery�EXTENSION_SUFFIXES)rZclibname�	importlibrrr�find_msvcrt"srcCst|dkrt�Sx`tjdjtj�D]J}tjj||�}tjj|�rD|S|j�j	d�rTq"|d}tjj|�r"|Sq"WdS)N�c�m�PATHz.dll)r r!)
r�os�environr�pathsep�path�join�isfile�lower�endswith)�nameZ	directoryZfnamerrr�find_library7sr,�posix�darwin)�	dyld_findcCsLd|d|d||fg}x,|D]$}yt|�Stk
rBw Yq Xq WdS)Nzlib%s.dylibz%s.dylibz%s.framework/%s)�
_dyld_find�
ValueError)r+�possiblerrrr,Hs
c	!Cstjdtj|��}tjd�}|s,tjd�}|s4dStj�}z||dd|jd|g}t	tj
�}d|d<d|d	<ytj|tj
tj|d
�}Wntk
r�dSX|�|jj�}WdQRXWdy|j�Wntk
r�YnXXtj||�}|s�dStj|jd��S)Nz[^\(\)\s]*lib%s\.[^\(\)\s]*�gccZccz-Wl,-tz-oz-l�C�LC_ALL�LANG)�stdout�stderr�envr)r#�fsencode�re�escape�shutil�which�tempfileZNamedTemporaryFiler+�dictr$�
subprocess�Popen�PIPEZSTDOUT�OSErrorr7�read�close�FileNotFoundError�search�fsdecode�group)	r+�exprZ
c_compilerZtemp�argsr9�procZtrace�resrrr�_findLib_gccWs:


rOZsunos5cCsz|sdSytjdd|ftjtjd�}Wntk
r:dSX|�|jj�}WdQRXtjd|�}|sjdSt	j
|jd��S)Nz/usr/ccs/bin/dumpz-Lpv)r7r8s\[.*\]\sSONAME\s+([^\s]+)r)rArBrC�DEVNULLrDr7rEr;rHr#rIrJ)�frM�datarNrrr�_get_soname�srScCs�|sdStjd�}|sdSy"tj|ddd|ftjtjd�}Wntk
rPdSX|�|jj�}WdQRXt	j
d|�}|s�dStj|j
d��S)N�objdumpz-pz-jz.dynamic)r7r8s\sSONAME\s+([^\s]+)r)r=r>rArBrCrPrDr7rEr;rHr#rIrJ)rQrTrM�dumprNrrrrS�s"
�freebsd�openbsd�	dragonflycCsR|jd�}g}y"x|r,|jdt|j���qWWntk
rDYnX|pPtjgS)N�.r)r�insertr�popr1r�maxsize)Zlibname�partsZnumsrrr�_num_version�s
r^cCs�tj|�}d||f}tj|�}ytjdtjtjd�}Wntk
rPd}YnX|�|j	j
�}WdQRXtj||�}|s�tt
|��S|jtd�tj|d	�S)
Nz:-l%s\.\S+ => \S*/(lib%s\.\S+)�/sbin/ldconfig�-r)r7r8�)�keyr)r_r`r	)r;r<r#r:rArBrCrPrDr7rE�findallrSrO�sortr^rI)r+ZenamerKrMrRrNrrrr,�s 


c	Cs�tjjd�sdSttj�}d|d<|r,d
}nd}d}ytj|tjtj|d�}Wnt	k
rbdSX|�:x2|j
D](}|j�}|jd�rrtj
|�j�d}qrWWdQRX|s�dSx4|jd�D]&}tjj|d	|�}tjj|�r�|Sq�WdS)N�
/usr/bin/crler4r5�-64)r7r8r9sDefault Library Path (ELF):��:zlib%s.so)rerf)re)r#r&�existsr@r$rArBrCrPrDr7�strip�
startswithrIrr')	r+�is64r9rL�pathsrM�line�dirZlibfilerrr�
_findLib_crle�s6

 rpFcCstt||�pt|��S)N)rSrprO)r+rlrrrr,�scCs�ddl}|jd�dkr&tj�jd}ntj�jd}dddddd	�}|j|d
�}d}tj|tj|�|f�}yZt	j
dd
gt	jt	jt	jddd�d��,}tj
||jj��}|r�tj|jd��SWdQRXWntk
r�YnXdS)Nr�lrgz-32z-64zlibc6,x86-64zlibc6,64bitzlibc6,IA-64)z	x86_64-64zppc64-64z
sparc64-64zs390x-64zia64-64Zlibc6z\s+(lib%s\.[^\s]+)\s+\(%sz/sbin/ldconfigz-pr4)r5r6)�stdinr8r7r9r)�structZcalcsizer#�uname�machine�getr:r;r<rArBrPrCrHr7rErIrJrD)r+rsruZmach_mapZabi_typeZregex�prNrrr�_findSoname_ldconfig�s.
rxcCs�dtj|�}ddg}tjjd�}|rHx |jd�D]}|jd|g�q2W|jdtjd|g�d}yFtj	|tj
tj
d	d
�}|j�\}}tj|tj
|��}	|	r�|	jd�}Wn"tk
r�}
zWYdd}
~
XnX|S)Nz[^\(\)\s]*lib%s\.[^\(\)\s]*Zldz-tZLD_LIBRARY_PATHrhz-Lz-oz-l%sT)r7r8Zuniversal_newlinesr)r;r<r#r$rvr�extend�devnullrArBrCZcommunicaterHrIrJ�	Exception)r+rK�cmdZlibpathr�resultrw�out�_rN�errr�_findLib_lds&
r�cCst|�ptt|�pt|��S)N)rxrSrOr�)r+rrrr,,scCs�ddlm}tjdkr:t|j�t|jd��ttd��tjdkr�ttd��ttd��ttd��tj	d	kr�t|j
d
��t|j
d��t|j
d��t|j
d
��n(t|j
d��t|j
d��ttd��dS)Nr)�cdllrrr-r!r �bz2r.z
libm.dylibzlibcrypto.dylibzlibSystem.dylibzSystem.framework/Systemzlibm.sozlibcrypt.soZcrypt)Zctypesr�r#r+�printr�loadr,r�platformZLoadLibrary)r�rrr�test4s"



r��__main__)rVrWrX)F)r#r=rArr+rrr,r�Zctypes.macholib.dyldr/r0r;r?rOrSrkr^rprxr�r��__name__rrrr�<module>s8

+



$
__pycache__/_endian.cpython-36.pyc000064400000003606150532450630013007 0ustar003


 \��@s�ddlZddlTee�Zdd�ZGdd�dee��Zejdkr\dZ	eZ
Gd	d
�d
eed�Zn0ejdkr�d
Z	eZGdd�deed�Z
ned��dS)�N)�*cCsLt|t�rt|t�St|t�r.t|j�|jSt|t	�r<|St
d|��dS)z�Return the type with the 'other' byte order.  Simple types like
    c_int and so on already have __ctype_be__ and __ctype_le__
    attributes which contain the types, for more complicated types
    arrays and structures are supported.
    z+This type does not support other endian: %sN)�hasattr�
_OTHER_ENDIAN�getattr�
isinstance�_array_type�
_other_endianZ_type_Z_length_�
issubclass�	Structure�	TypeError)�typ�r
�&/usr/lib64/python3.6/ctypes/_endian.pyrs



rcseZdZ�fdd�Z�ZS)�
_swapped_metacsb|dkrPg}x>|D]6}|d}|d}|dd�}|j|t|�f|�qW|}t�j||�dS)NZ_fields_r��)�appendr�super�__setattr__)�selfZattrname�valueZfieldsZdesc�namer�rest)�	__class__r
rrs
z_swapped_meta.__setattr__)�__name__�
__module__�__qualname__r�
__classcell__r
r
)rrrsr�littleZ__ctype_be__c@seZdZdZfZdZdS)�BigEndianStructurez$Structure with big endian byte orderN)rrr�__doc__�	__slots__�_swappedbytes_r
r
r
rr.sr)�	metaclassZbigZ__ctype_le__c@seZdZdZfZdZdS)�LittleEndianStructurez'Structure with little endian byte orderN)rrrr r!r"r
r
r
rr$7sr$zInvalid byteorder)
�sysZctypes�typeZArrayrrr
r�	byteorderrr$r�RuntimeErrorr
r
r
r�<module>s

_endian.py000064400000003720150532450630006520 0ustar00import sys
from ctypes import *

_array_type = type(Array)

def _other_endian(typ):
    """Return the type with the 'other' byte order.  Simple types like
    c_int and so on already have __ctype_be__ and __ctype_le__
    attributes which contain the types, for more complicated types
    arrays and structures are supported.
    """
    # check _OTHER_ENDIAN attribute (present if typ is primitive type)
    if hasattr(typ, _OTHER_ENDIAN):
        return getattr(typ, _OTHER_ENDIAN)
    # if typ is array
    if isinstance(typ, _array_type):
        return _other_endian(typ._type_) * typ._length_
    # if typ is structure
    if issubclass(typ, Structure):
        return typ
    raise TypeError("This type does not support other endian: %s" % typ)

class _swapped_meta(type(Structure)):
    def __setattr__(self, attrname, value):
        if attrname == "_fields_":
            fields = []
            for desc in value:
                name = desc[0]
                typ = desc[1]
                rest = desc[2:]
                fields.append((name, _other_endian(typ)) + rest)
            value = fields
        super().__setattr__(attrname, value)

################################################################

# Note: The Structure metaclass checks for the *presence* (not the
# value!) of a _swapped_bytes_ attribute to determine the bit order in
# structures containing bit fields.

if sys.byteorder == "little":
    _OTHER_ENDIAN = "__ctype_be__"

    LittleEndianStructure = Structure

    class BigEndianStructure(Structure, metaclass=_swapped_meta):
        """Structure with big endian byte order"""
        __slots__ = ()
        _swappedbytes_ = None

elif sys.byteorder == "big":
    _OTHER_ENDIAN = "__ctype_le__"

    BigEndianStructure = Structure
    class LittleEndianStructure(Structure, metaclass=_swapped_meta):
        """Structure with little endian byte order"""
        __slots__ = ()
        _swappedbytes_ = None

else:
    raise RuntimeError("Invalid byteorder")
__init__.py000064400000042763150532450630006674 0ustar00"""create and manipulate C data types in Python"""

import os as _os, sys as _sys

__version__ = "1.1.0"

from _ctypes import Union, Structure, Array
from _ctypes import _Pointer
from _ctypes import CFuncPtr as _CFuncPtr
from _ctypes import __version__ as _ctypes_version
from _ctypes import RTLD_LOCAL, RTLD_GLOBAL
from _ctypes import ArgumentError

from struct import calcsize as _calcsize

if __version__ != _ctypes_version:
    raise Exception("Version number mismatch", __version__, _ctypes_version)

if _os.name == "nt":
    from _ctypes import FormatError

DEFAULT_MODE = RTLD_LOCAL
if _os.name == "posix" and _sys.platform == "darwin":
    # On OS X 10.3, we use RTLD_GLOBAL as default mode
    # because RTLD_LOCAL does not work at least on some
    # libraries.  OS X 10.3 is Darwin 7, so we check for
    # that.

    if int(_os.uname().release.split('.')[0]) < 8:
        DEFAULT_MODE = RTLD_GLOBAL

from _ctypes import FUNCFLAG_CDECL as _FUNCFLAG_CDECL, \
     FUNCFLAG_PYTHONAPI as _FUNCFLAG_PYTHONAPI, \
     FUNCFLAG_USE_ERRNO as _FUNCFLAG_USE_ERRNO, \
     FUNCFLAG_USE_LASTERROR as _FUNCFLAG_USE_LASTERROR

# WINOLEAPI -> HRESULT
# WINOLEAPI_(type)
#
# STDMETHODCALLTYPE
#
# STDMETHOD(name)
# STDMETHOD_(type, name)
#
# STDAPICALLTYPE

def create_string_buffer(init, size=None):
    """create_string_buffer(aBytes) -> character array
    create_string_buffer(anInteger) -> character array
    create_string_buffer(aBytes, anInteger) -> character array
    """
    if isinstance(init, bytes):
        if size is None:
            size = len(init)+1
        _sys.audit("ctypes.create_string_buffer", init, size)
        buftype = c_char * size
        buf = buftype()
        buf.value = init
        return buf
    elif isinstance(init, int):
        _sys.audit("ctypes.create_string_buffer", None, init)
        buftype = c_char * init
        buf = buftype()
        return buf
    raise TypeError(init)

def c_buffer(init, size=None):
##    "deprecated, use create_string_buffer instead"
##    import warnings
##    warnings.warn("c_buffer is deprecated, use create_string_buffer instead",
##                  DeprecationWarning, stacklevel=2)
    return create_string_buffer(init, size)

_c_functype_cache = {}
def CFUNCTYPE(restype, *argtypes, **kw):
    """CFUNCTYPE(restype, *argtypes,
                 use_errno=False, use_last_error=False) -> function prototype.

    restype: the result type
    argtypes: a sequence specifying the argument types

    The function prototype can be called in different ways to create a
    callable object:

    prototype(integer address) -> foreign function
    prototype(callable) -> create and return a C callable function from callable
    prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
    prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
    prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
    """
    flags = _FUNCFLAG_CDECL
    if kw.pop("use_errno", False):
        flags |= _FUNCFLAG_USE_ERRNO
    if kw.pop("use_last_error", False):
        flags |= _FUNCFLAG_USE_LASTERROR
    if kw:
        raise ValueError("unexpected keyword argument(s) %s" % kw.keys())
    try:
        return _c_functype_cache[(restype, argtypes, flags)]
    except KeyError:
        class CFunctionType(_CFuncPtr):
            _argtypes_ = argtypes
            _restype_ = restype
            _flags_ = flags
        _c_functype_cache[(restype, argtypes, flags)] = CFunctionType
        return CFunctionType

if _os.name == "nt":
    from _ctypes import LoadLibrary as _dlopen
    from _ctypes import FUNCFLAG_STDCALL as _FUNCFLAG_STDCALL

    _win_functype_cache = {}
    def WINFUNCTYPE(restype, *argtypes, **kw):
        # docstring set later (very similar to CFUNCTYPE.__doc__)
        flags = _FUNCFLAG_STDCALL
        if kw.pop("use_errno", False):
            flags |= _FUNCFLAG_USE_ERRNO
        if kw.pop("use_last_error", False):
            flags |= _FUNCFLAG_USE_LASTERROR
        if kw:
            raise ValueError("unexpected keyword argument(s) %s" % kw.keys())
        try:
            return _win_functype_cache[(restype, argtypes, flags)]
        except KeyError:
            class WinFunctionType(_CFuncPtr):
                _argtypes_ = argtypes
                _restype_ = restype
                _flags_ = flags
            _win_functype_cache[(restype, argtypes, flags)] = WinFunctionType
            return WinFunctionType
    if WINFUNCTYPE.__doc__:
        WINFUNCTYPE.__doc__ = CFUNCTYPE.__doc__.replace("CFUNCTYPE", "WINFUNCTYPE")

elif _os.name == "posix":
    from _ctypes import dlopen as _dlopen

from _ctypes import sizeof, byref, addressof, alignment, resize
from _ctypes import get_errno, set_errno
from _ctypes import _SimpleCData

def _check_size(typ, typecode=None):
    # Check if sizeof(ctypes_type) against struct.calcsize.  This
    # should protect somewhat against a misconfigured libffi.
    from struct import calcsize
    if typecode is None:
        # Most _type_ codes are the same as used in struct
        typecode = typ._type_
    actual, required = sizeof(typ), calcsize(typecode)
    if actual != required:
        raise SystemError("sizeof(%s) wrong: %d instead of %d" % \
                          (typ, actual, required))

class py_object(_SimpleCData):
    _type_ = "O"
    def __repr__(self):
        try:
            return super().__repr__()
        except ValueError:
            return "%s(<NULL>)" % type(self).__name__
_check_size(py_object, "P")

class c_short(_SimpleCData):
    _type_ = "h"
_check_size(c_short)

class c_ushort(_SimpleCData):
    _type_ = "H"
_check_size(c_ushort)

class c_long(_SimpleCData):
    _type_ = "l"
_check_size(c_long)

class c_ulong(_SimpleCData):
    _type_ = "L"
_check_size(c_ulong)

if _calcsize("i") == _calcsize("l"):
    # if int and long have the same size, make c_int an alias for c_long
    c_int = c_long
    c_uint = c_ulong
else:
    class c_int(_SimpleCData):
        _type_ = "i"
    _check_size(c_int)

    class c_uint(_SimpleCData):
        _type_ = "I"
    _check_size(c_uint)

class c_float(_SimpleCData):
    _type_ = "f"
_check_size(c_float)

class c_double(_SimpleCData):
    _type_ = "d"
_check_size(c_double)

class c_longdouble(_SimpleCData):
    _type_ = "g"
if sizeof(c_longdouble) == sizeof(c_double):
    c_longdouble = c_double

if _calcsize("l") == _calcsize("q"):
    # if long and long long have the same size, make c_longlong an alias for c_long
    c_longlong = c_long
    c_ulonglong = c_ulong
else:
    class c_longlong(_SimpleCData):
        _type_ = "q"
    _check_size(c_longlong)

    class c_ulonglong(_SimpleCData):
        _type_ = "Q"
    ##    def from_param(cls, val):
    ##        return ('d', float(val), val)
    ##    from_param = classmethod(from_param)
    _check_size(c_ulonglong)

class c_ubyte(_SimpleCData):
    _type_ = "B"
c_ubyte.__ctype_le__ = c_ubyte.__ctype_be__ = c_ubyte
# backward compatibility:
##c_uchar = c_ubyte
_check_size(c_ubyte)

class c_byte(_SimpleCData):
    _type_ = "b"
c_byte.__ctype_le__ = c_byte.__ctype_be__ = c_byte
_check_size(c_byte)

class c_char(_SimpleCData):
    _type_ = "c"
c_char.__ctype_le__ = c_char.__ctype_be__ = c_char
_check_size(c_char)

class c_char_p(_SimpleCData):
    _type_ = "z"
    def __repr__(self):
        return "%s(%s)" % (self.__class__.__name__, c_void_p.from_buffer(self).value)
_check_size(c_char_p, "P")

class c_void_p(_SimpleCData):
    _type_ = "P"
c_voidp = c_void_p # backwards compatibility (to a bug)
_check_size(c_void_p)

class c_bool(_SimpleCData):
    _type_ = "?"

from _ctypes import POINTER, pointer, _pointer_type_cache

class c_wchar_p(_SimpleCData):
    _type_ = "Z"
    def __repr__(self):
        return "%s(%s)" % (self.__class__.__name__, c_void_p.from_buffer(self).value)

class c_wchar(_SimpleCData):
    _type_ = "u"

def _reset_cache():
    _pointer_type_cache.clear()
    _c_functype_cache.clear()
    if _os.name == "nt":
        _win_functype_cache.clear()
    # _SimpleCData.c_wchar_p_from_param
    POINTER(c_wchar).from_param = c_wchar_p.from_param
    # _SimpleCData.c_char_p_from_param
    POINTER(c_char).from_param = c_char_p.from_param
    _pointer_type_cache[None] = c_void_p

def create_unicode_buffer(init, size=None):
    """create_unicode_buffer(aString) -> character array
    create_unicode_buffer(anInteger) -> character array
    create_unicode_buffer(aString, anInteger) -> character array
    """
    if isinstance(init, str):
        if size is None:
            if sizeof(c_wchar) == 2:
                # UTF-16 requires a surrogate pair (2 wchar_t) for non-BMP
                # characters (outside [U+0000; U+FFFF] range). +1 for trailing
                # NUL character.
                size = sum(2 if ord(c) > 0xFFFF else 1 for c in init) + 1
            else:
                # 32-bit wchar_t (1 wchar_t per Unicode character). +1 for
                # trailing NUL character.
                size = len(init) + 1
        _sys.audit("ctypes.create_unicode_buffer", init, size)
        buftype = c_wchar * size
        buf = buftype()
        buf.value = init
        return buf
    elif isinstance(init, int):
        _sys.audit("ctypes.create_unicode_buffer", None, init)
        buftype = c_wchar * init
        buf = buftype()
        return buf
    raise TypeError(init)


# XXX Deprecated
def SetPointerType(pointer, cls):
    if _pointer_type_cache.get(cls, None) is not None:
        raise RuntimeError("This type already exists in the cache")
    if id(pointer) not in _pointer_type_cache:
        raise RuntimeError("What's this???")
    pointer.set_type(cls)
    _pointer_type_cache[cls] = pointer
    del _pointer_type_cache[id(pointer)]

# XXX Deprecated
def ARRAY(typ, len):
    return typ * len

################################################################


class CDLL(object):
    """An instance of this class represents a loaded dll/shared
    library, exporting functions using the standard C calling
    convention (named 'cdecl' on Windows).

    The exported functions can be accessed as attributes, or by
    indexing with the function name.  Examples:

    <obj>.qsort -> callable object
    <obj>['qsort'] -> callable object

    Calling the functions releases the Python GIL during the call and
    reacquires it afterwards.
    """
    _func_flags_ = _FUNCFLAG_CDECL
    _func_restype_ = c_int
    # default values for repr
    _name = '<uninitialized>'
    _handle = 0
    _FuncPtr = None

    def __init__(self, name, mode=DEFAULT_MODE, handle=None,
                 use_errno=False,
                 use_last_error=False,
                 winmode=None):
        self._name = name
        flags = self._func_flags_
        if use_errno:
            flags |= _FUNCFLAG_USE_ERRNO
        if use_last_error:
            flags |= _FUNCFLAG_USE_LASTERROR
        if _sys.platform.startswith("aix"):
            """When the name contains ".a(" and ends with ")",
               e.g., "libFOO.a(libFOO.so)" - this is taken to be an
               archive(member) syntax for dlopen(), and the mode is adjusted.
               Otherwise, name is presented to dlopen() as a file argument.
            """
            if name and name.endswith(")") and ".a(" in name:
                mode |= ( _os.RTLD_MEMBER | _os.RTLD_NOW )
        if _os.name == "nt":
            if winmode is not None:
                mode = winmode
            else:
                import nt
                mode = nt._LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
                if '/' in name or '\\' in name:
                    self._name = nt._getfullpathname(self._name)
                    mode |= nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR

        class _FuncPtr(_CFuncPtr):
            _flags_ = flags
            _restype_ = self._func_restype_
        self._FuncPtr = _FuncPtr

        if handle is None:
            self._handle = _dlopen(self._name, mode)
        else:
            self._handle = handle

    def __repr__(self):
        return "<%s '%s', handle %x at %#x>" % \
               (self.__class__.__name__, self._name,
                (self._handle & (_sys.maxsize*2 + 1)),
                id(self) & (_sys.maxsize*2 + 1))

    def __getattr__(self, name):
        if name.startswith('__') and name.endswith('__'):
            raise AttributeError(name)
        func = self.__getitem__(name)
        setattr(self, name, func)
        return func

    def __getitem__(self, name_or_ordinal):
        func = self._FuncPtr((name_or_ordinal, self))
        if not isinstance(name_or_ordinal, int):
            func.__name__ = name_or_ordinal
        return func

class PyDLL(CDLL):
    """This class represents the Python library itself.  It allows
    accessing Python API functions.  The GIL is not released, and
    Python exceptions are handled correctly.
    """
    _func_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI

if _os.name == "nt":

    class WinDLL(CDLL):
        """This class represents a dll exporting functions using the
        Windows stdcall calling convention.
        """
        _func_flags_ = _FUNCFLAG_STDCALL

    # XXX Hm, what about HRESULT as normal parameter?
    # Mustn't it derive from c_long then?
    from _ctypes import _check_HRESULT, _SimpleCData
    class HRESULT(_SimpleCData):
        _type_ = "l"
        # _check_retval_ is called with the function's result when it
        # is used as restype.  It checks for the FAILED bit, and
        # raises an OSError if it is set.
        #
        # The _check_retval_ method is implemented in C, so that the
        # method definition itself is not included in the traceback
        # when it raises an error - that is what we want (and Python
        # doesn't have a way to raise an exception in the caller's
        # frame).
        _check_retval_ = _check_HRESULT

    class OleDLL(CDLL):
        """This class represents a dll exporting functions using the
        Windows stdcall calling convention, and returning HRESULT.
        HRESULT error values are automatically raised as OSError
        exceptions.
        """
        _func_flags_ = _FUNCFLAG_STDCALL
        _func_restype_ = HRESULT

class LibraryLoader(object):
    def __init__(self, dlltype):
        self._dlltype = dlltype

    def __getattr__(self, name):
        if name[0] == '_':
            raise AttributeError(name)
        dll = self._dlltype(name)
        setattr(self, name, dll)
        return dll

    def __getitem__(self, name):
        return getattr(self, name)

    def LoadLibrary(self, name):
        return self._dlltype(name)

cdll = LibraryLoader(CDLL)
pydll = LibraryLoader(PyDLL)

if _os.name == "nt":
    pythonapi = PyDLL("python dll", None, _sys.dllhandle)
elif _sys.platform == "cygwin":
    pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])
else:
    pythonapi = PyDLL(None)


if _os.name == "nt":
    windll = LibraryLoader(WinDLL)
    oledll = LibraryLoader(OleDLL)

    GetLastError = windll.kernel32.GetLastError
    from _ctypes import get_last_error, set_last_error

    def WinError(code=None, descr=None):
        if code is None:
            code = GetLastError()
        if descr is None:
            descr = FormatError(code).strip()
        return OSError(None, descr, None, code)

if sizeof(c_uint) == sizeof(c_void_p):
    c_size_t = c_uint
    c_ssize_t = c_int
elif sizeof(c_ulong) == sizeof(c_void_p):
    c_size_t = c_ulong
    c_ssize_t = c_long
elif sizeof(c_ulonglong) == sizeof(c_void_p):
    c_size_t = c_ulonglong
    c_ssize_t = c_longlong

# functions

from _ctypes import _memmove_addr, _memset_addr, _string_at_addr, _cast_addr

## void *memmove(void *, const void *, size_t);
memmove = CFUNCTYPE(c_void_p, c_void_p, c_void_p, c_size_t)(_memmove_addr)

## void *memset(void *, int, size_t)
memset = CFUNCTYPE(c_void_p, c_void_p, c_int, c_size_t)(_memset_addr)

def PYFUNCTYPE(restype, *argtypes):
    class CFunctionType(_CFuncPtr):
        _argtypes_ = argtypes
        _restype_ = restype
        _flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI
    return CFunctionType

_cast = PYFUNCTYPE(py_object, c_void_p, py_object, py_object)(_cast_addr)
def cast(obj, typ):
    return _cast(obj, obj, typ)

_string_at = PYFUNCTYPE(py_object, c_void_p, c_int)(_string_at_addr)
def string_at(ptr, size=-1):
    """string_at(addr[, size]) -> string

    Return the string at addr."""
    return _string_at(ptr, size)

try:
    from _ctypes import _wstring_at_addr
except ImportError:
    pass
else:
    _wstring_at = PYFUNCTYPE(py_object, c_void_p, c_int)(_wstring_at_addr)
    def wstring_at(ptr, size=-1):
        """wstring_at(addr[, size]) -> string

        Return the string at addr."""
        return _wstring_at(ptr, size)


if _os.name == "nt": # COM stuff
    def DllGetClassObject(rclsid, riid, ppv):
        try:
            ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
        except ImportError:
            return -2147221231 # CLASS_E_CLASSNOTAVAILABLE
        else:
            return ccom.DllGetClassObject(rclsid, riid, ppv)

    def DllCanUnloadNow():
        try:
            ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
        except ImportError:
            return 0 # S_OK
        return ccom.DllCanUnloadNow()

from ctypes._endian import BigEndianStructure, LittleEndianStructure

# Fill in specifically-sized types
c_int8 = c_byte
c_uint8 = c_ubyte
for kind in [c_short, c_int, c_long, c_longlong]:
    if sizeof(kind) == 2: c_int16 = kind
    elif sizeof(kind) == 4: c_int32 = kind
    elif sizeof(kind) == 8: c_int64 = kind
for kind in [c_ushort, c_uint, c_ulong, c_ulonglong]:
    if sizeof(kind) == 2: c_uint16 = kind
    elif sizeof(kind) == 4: c_uint32 = kind
    elif sizeof(kind) == 8: c_uint64 = kind
del(kind)

_reset_cache()
util.pyo000064400000020547150532450640006266 0ustar00�
{fc@s�ddlZddlZddlZejdkrQd�Zd�Zd�Znejdkrld�Znejdkr�ejd	kr�dd
lm	Z
d�Zn�ejdkr�ddlZddlZddl
Z
d�Zejd
kr�d�Zn	d�Zejjd�s<ejjd�s<ejjd�rQd�Zd�Zq�ejd
krxd�Zed�Zq�d�Zd�Znd�Zedkr�e�ndS(i����NtntcCs�d}tjj|�}|dkr(dS|t|�}tj|jdd�\}}t|d �d}t|dd!�d	}|dkr�d
}n|dkr�||SdS(s�Return the version of MSVC that was used to build Python.

        For Python 2.3 and up, the version number is included in
        sys.version.  For earlier versions, assume the compiler is MSVC 6.
        sMSC v.i����it ii����iig$@iN(tsystversiontfindtlentsplittinttNone(tprefixtitstresttmajorVersiontminorVersion((s#/usr/lib64/python2.7/ctypes/util.pyt_get_build_versions	cCswt�}|dkrdS|dkr.d}nd|d}ddl}|j�dddkro|d	7}n|d
S(s%Return the name of the VC runtime dllitmsvcrtsmsvcr%di
i����Nis_d.pydtds.dll(RRtimptget_suffixes(RtclibnameR((s#/usr/lib64/python2.7/ctypes/util.pytfind_msvcrts		
cCs�|dkrt�Sx�tjdjtj�D]l}tjj||�}tjj|�r^|S|j�j	d�ryq-n|d}tjj|�r-|Sq-WdS(NtctmtPATHs.dll(RR(RtostenvironRtpathseptpathtjointisfiletlowertendswithR(tnamet	directorytfname((s#/usr/lib64/python2.7/ctypes/util.pytfind_library0s 
tcecCs|S(N((R!((s#/usr/lib64/python2.7/ctypes/util.pyR$Fstposixtdarwin(t	dyld_findcCs[d|d|d||fg}x3|D]+}yt|�SWq(tk
rRq(q(Xq(WdS(Nslib%s.dylibs%s.dylibs%s.framework/%s(t
_dyld_findt
ValueErrorR(R!tpossible((s#/usr/lib64/python2.7/ctypes/util.pyR$Ks

c	Cs�dtj|�}d}tj�}zCtj|d||jfdtdtj�}|j	�\}}Wdy|j
�Wn+tk
r�}|jtj
kr��q�nXXtj||�}|s�dS|jd�S(Ns[^\(\)\s]*lib%s\.[^\(\)\s]*s�if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit; fi;LANG=C LC_ALL=C $CC -Wl,-t -o "$2" 2>&1 -l"$1"t_findLib_gcctshelltstdouti(tretescapettempfiletNamedTemporaryFilet
subprocesstPopenR!tTruetPIPEtcommunicatetclosetOSErrorterrnotENOENTtsearchRtgroup(	R!texprtcmdttemptprocttracet_tetres((s#/usr/lib64/python2.7/ctypes/util.pyR,Zs"tsunos5c
Cs�|s
dSttjd�}y8|�,tjdd|fdtjd|�}WdQXWntk
rhdSX|j�\}}t	j
d|�}|s�dS|jd�S(Ntwbs/usr/ccs/bin/dumps-LpvR.tstderrs\[.*\]\sSONAME\s+([^\s]+)i(RtopenRtdevnullR3R4R6R9R7R/R<R=(tftnullRAtdataRCRE((s#/usr/lib64/python2.7/ctypes/util.pyt_get_sonameys	
cCs�|s
dSd}tj|d|fdtdtj�}|j�\}}|jdkrhtjj	|�St
jd|�}|s�dS|jd�S(Ns[if ! type objdump >/dev/null 2>&1; then exit 10; fi;objdump -p -j .dynamic 2>/dev/null "$1"RNR-R.i
s\sSONAME\s+([^\s]+)i(
RR3R4R5R6R7t
returncodeRRtbasenameR/R<R=(RKR?RAtdumpRCRE((s#/usr/lib64/python2.7/ctypes/util.pyRN�stfreebsdtopenbsdt	dragonflycCsf|jd�}g}y-x&|r@|jdt|j���qWWntk
rUnX|petjgS(Nt.i(RtinsertRtpopR*Rtmaxint(tlibnametpartstnums((s#/usr/lib64/python2.7/ctypes/util.pyt_num_version�s	$
c
Cs�tj|�}d||f}ttjd�}y/|�#tjd
dtjd|�}WdQXWntk
ryd}nX|j	�\}}tj
||�}|s�tt|��S|j
dt�|d	S(Ns:-l%s\.\S+ => \S*/(lib%s\.\S+)RGs/sbin/ldconfigs-rR.RHttkeyi����(s/sbin/ldconfigs-r(R/R0RIRRJR3R4R6R9R7tfindallRNR,tsortR\(R!tenameR>RLRARMRCRE((s#/usr/lib64/python2.7/ctypes/util.pyR$�s 	

c
Cs^tjjd�sdSttj�}d|d<|r>d
}nd}d}ttjd�}y5|�)tj	|dtj
d|d|�}WdQXWntk
r�dSXzFx?|jD]4}|j
�}|jd	�r�|j�d
}q�q�WWd|jj�|j�X|sdSxF|jd�D]5}tjj|d|�}	tjj|	�r!|	Sq!WdS(Ns
/usr/bin/crletCtLC_ALLs-64RGR.RHtenvsDefault Library Path (ELF):it:slib%s.so(s
/usr/bin/crles-64(s
/usr/bin/crle(RRtexistsRtdictRRIRJR3R4R6R9R.tstript
startswithRR8twaitR(
R!tis64RdtargstpathsRLRAtlinetdirtlibfile((s#/usr/lib64/python2.7/ctypes/util.pyt
_findLib_crle�s>
		

cCstt||�pt|��S(N(RNRqR,(R!Rk((s#/usr/lib64/python2.7/ctypes/util.pyR$�scCs`ddl}|jd�dkr8tj�dd}ntj�dd}idd6dd	6dd
6dd6dd
6}|j|d�}dtj|�|f}ttj�}d|d<d|d<t	tj
d�}y;|�/tjddgd|dtj
d|�}WdQXWntk
r$dSX|j�\}	}
tj||	�}|sSdS|jd�S(Ni����tlis-32s-64slibc6,x86-64s	x86_64-64slibc6,64bitsppc64-64s
sparc64-64ss390x-64slibc6,IA-64sia64-64tlibc6s\s+(lib%s\.[^\s]+)\s+\(%sRbRctLANGRGs/sbin/ldconfigs-pRHR.Rdi(tstructtcalcsizeRtunametgetR/R0RgRRIRJR3R4R6R9RR7R<R=(R!Rutmachinetmach_maptabi_typeR>RdRLtpRMRCRE((s#/usr/lib64/python2.7/ctypes/util.pyt_findSoname_ldconfig�s:


	
cCst|�ptt|��S(N(R}RNR,(R!((s#/usr/lib64/python2.7/ctypes/util.pyR$scCs�ddlm}tjdkrC|jGH|jd�GHtd�GHntjdkr�td�GHtd�GHtd�GHtjd	kr�|j	d
�GH|j	d�GH|j	d�GH|j	d
�GHq�|j	d�GH|j	d�GHtd�GHndS(Ni����(tcdllRRR&RRtbz2R's
libm.dylibslibcrypto.dylibslibSystem.dylibsSystem.framework/Systemslibm.soslibcrypt.sotcrypt(
tctypesR~RR!RtloadR$RtplatformtLoadLibrary(R~((s#/usr/lib64/python2.7/ctypes/util.pyttests"t__main__(RR3RR!RRR$R�tctypes.macholib.dyldR(R)R/R1R:R,RNRiR\RqtFalseR}R�t__name__(((s#/usr/lib64/python2.7/ctypes/util.pyt<module>s<		$				)	$	wintypes.pyc000064400000013503150532450640007151 0ustar00�
{fcZ@sddlTeZeZeZeZe	Z
eZe
ZeZeZeZddlmZdefd��YZeZeZeZeZeZZeZZ e!Z"Z#Z$e!Z%Z&e'Z(Z)e*Z+Z,e-e�e-e*�kr�eZ.eZ/n'e-e�e-e*�kreZ.eZ/neZ0eZ1eZ2eZ3eZ4eZ5e*Z6e6Z7e6Z8e6Z9e6Z:e6Z;e6Z<e6Z=e6Z>e6Z?e6Z@e6ZAe6ZBe6ZCe6ZDe6ZEe6ZFe6ZGe6ZHe6ZIe6ZJe6ZKe6ZLe6ZMe6ZNe6ZOe6ZPe6ZQe6ZRe6ZSe6ZTe6ZUdeVfd��YZWeWZXZYZZdeVfd��YZ[e[Z\d	eVfd
��YZ]deVfd��YZ^e^Z_Z`Zad
eVfd��YZbebZcZdd�ZedeVfd��YZfefZgdeVfd��YZhehZidZjdeVfd��YZkdeVfd��YZlddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOddPddQddRdSdTdUdVd
dWdXdYdZd[d\dd]ddd^d_d	d`dadbdcddddedfdgdhgZZmdiS(ji����(t*(t_SimpleCDatatVARIANT_BOOLcBseZdZd�ZRS(tvcCsd|jj|jfS(Ns%s(%r)(t	__class__t__name__tvalue(tself((s'/usr/lib64/python2.7/ctypes/wintypes.pyt__repr__s(Rt
__module__t_type_R(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRstRECTcBs2eZdefdefdefdefgZRS(tleftttoptrighttbottom(RR	tc_longt_fields_(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR`s			t_SMALL_RECTcBs2eZdefdefdefdefgZRS(tLefttToptRighttBottom(RR	tc_shortR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRgs			t_COORDcBs eZdefdefgZRS(tXtY(RR	RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRns	tPOINTcBs eZdefdefgZRS(txty(RR	RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRrs	tSIZEcBs eZdefdefgZRS(tcxtcy(RR	RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRws	cCs||d>|d>S(Nii((tredtgreentblue((s'/usr/lib64/python2.7/ctypes/wintypes.pytRGB|stFILETIMEcBs eZdefdefgZRS(t
dwLowDateTimetdwHighDateTime(RR	tDWORDR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR%s	tMSGcBsDeZdefdefdefdefdefdefgZRS(thWndtmessagetwParamtlParamttimetpt(	RR	tHWNDtc_uinttWPARAMtLPARAMR(RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR)�s					itWIN32_FIND_DATAAcBspeZdefdefdefdefdefdefdefdefdeefd	ed
fg
ZRS(tdwFileAttributestftCreationTimetftLastAccessTimetftLastWriteTimet
nFileSizeHightnFileSizeLowtdwReserved0tdwReserved1t	cFileNametcAlternateFileNamei(RR	R(R%tc_chartMAX_PATHR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR4�s								
tWIN32_FIND_DATAWcBspeZdefdefdefdefdefdefdefdefdeefd	ed
fg
ZRS(R5R6R7R8R9R:R;R<R=R>i(RR	R(R%tc_wcharR@R(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRA�s								
tATOMtBOOLtBOOLEANtBYTEtCOLORREFtDOUBLER(tFLOATtHACCELtHANDLEtHBITMAPtHBRUSHtHCOLORSPACEtHDCtHDESKtHDWPtHENHMETAFILEtHFONTtHGDIOBJtHGLOBALtHHOOKtHICONt	HINSTANCEtHKEYtHKLtHLOCALtHMENUt	HMETAFILEtHMODULEtHMONITORtHPALETTEtHPENtHRGNtHRSRCtHSTRtHTASKtHWINSTAR0tINTtLANGIDt
LARGE_INTEGERtLCIDtLCTYPEtLGRPIDtLONGR3t	LPCOLESTRtLPCSTRtLPCVOIDtLPCWSTRtLPOLESTRtLPSTRtLPVOIDtLPWSTRR@tOLESTRtPOINTLtRECTLR$t	SC_HANDLEtSERVICE_STATUS_HANDLEtSHORTtSIZELt
SMALL_RECTtUINTtULARGE_INTEGERtULONGtUSHORTtWCHARtWORDR2t	_FILETIMEt_LARGE_INTEGERt_POINTLt_RECTLt_ULARGE_INTEGERttagMSGttagPOINTttagRECTttagSIZEN(ntctypestc_byteRFtc_ushortR�tc_ulongR(RBR�R1R~tc_intRgtc_doubleRHtc_floatRIRERRDRRR�RmR�RR{t
c_longlongR�Ritc_ulonglongR�Rt	c_wchar_pRnRrRvRqRutc_char_pRoRstc_void_pRpRttsizeofR2R3RCRhRGRlRkRjRKRJRLRMRNRORPRQRRRSRTRURVRWRXRYRZR[R\R]R^R_R`RaRbRcRdReRfR0RyRzt	StructureRR�R�RxRR}RRR�R�RwRR�R|R$R%R�R)R�R@R4RAt__all__(((s'/usr/lib64/python2.7/ctypes/wintypes.pyt<module>s�





		
	_endian.pyo000064400000004403150532450640006677 0ustar00�
{fc@s�ddlZddlTee�Zd�Zdee�fd��YZejdkr{dZ	eZ
defd	��YZn@ejd
kr�dZ	eZdefd
��YZ
ned��dS(i����N(t*cCsft|t�rt|t�St|t�r?t|j�|jSt|t	�rR|St
d|��dS(s�Return the type with the 'other' byte order.  Simple types like
    c_int and so on already have __ctype_be__ and __ctype_le__
    attributes which contain the types, for more complicated types
    arrays and structures are supported.
    s+This type does not support other endian: %sN(thasattrt
_OTHER_ENDIANtgetattrt
isinstancet_array_typet
_other_endiant_type_t_length_t
issubclasst	Structuret	TypeError(ttyp((s&/usr/lib64/python2.7/ctypes/_endian.pyRs
t
_swapped_metacBseZd�ZRS(cCs�|dkrgg}xI|D]A}|d}|d}|d}|j|t|�f|�qW|}ntt|�j||�dS(Nt_fields_iii(tappendRtsuperR
t__setattr__(tselftattrnametvaluetfieldstdesctnameRtrest((s&/usr/lib64/python2.7/ctypes/_endian.pyRs



!	(t__name__t
__module__R(((s&/usr/lib64/python2.7/ctypes/_endian.pyR
stlittlet__ctype_be__tBigEndianStructurecBseZdZeZdZRS(s$Structure with big endian byte orderN(RRt__doc__R
t
__metaclass__tNonet_swappedbytes_(((s&/usr/lib64/python2.7/ctypes/_endian.pyR.stbigt__ctype_le__tLittleEndianStructurecBseZdZeZdZRS(s'Structure with little endian byte orderN(RRRR
RR R!(((s&/usr/lib64/python2.7/ctypes/_endian.pyR$7ssInvalid byteorder(
tsystctypesttypetArrayRRR
R
t	byteorderRR$RtRuntimeError(((s&/usr/lib64/python2.7/ctypes/_endian.pyt<module>s
	macholib/framework.pyc000064400000005101150532450640011035 0ustar00�
{fc@sVdZddlZdgZejd�Zd�Zd�ZedkrRe�ndS(s%
Generic framework path manipulation
i����Ntframework_infos�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
cCs#tj|�}|sdS|j�S(s}
    A framework name can take one of the following four forms:
        Location/Name.framework/Versions/SomeVersion/Name_Suffix
        Location/Name.framework/Versions/SomeVersion/Name
        Location/Name.framework/Name_Suffix
        Location/Name.framework/Name

    returns None if not found, or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.framework/Versions/SomeVersion/Name_Suffix',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present
    N(tSTRICT_FRAMEWORK_REtmatchtNonet	groupdict(tfilenametis_framework((s1/usr/lib64/python2.7/ctypes/macholib/framework.pyRscCsKdddddd�}td�dks0t�td�dksHt�td�dks`t�td�dksxt�td�|ddd	�ks�t�td
�|ddd	dd
�ks�t�td�dks�t�td�dks�t�td�|ddd	d�kst�td�|ddd	dd
�ksGt�dS(NcSs%td|d|d|d|d|�S(Ntlocationtnamet	shortnametversiontsuffix(tdict(RRR	R
R((s1/usr/lib64/python2.7/ctypes/macholib/framework.pytd-sscompletely/invalidscompletely/invalid/_debugs
P/F.frameworksP/F.framework/_debugsP/F.framework/FtPs
F.framework/FtFsP/F.framework/F_debugsF.framework/F_debugRtdebugsP/F.framework/VersionssP/F.framework/Versions/AsP/F.framework/Versions/A/FsF.framework/Versions/A/FtAs P/F.framework/Versions/A/F_debugsF.framework/Versions/A/F_debug(RRtAssertionError(R
((s1/usr/lib64/python2.7/ctypes/macholib/framework.pyttest_framework_info,s$*'t__main__(t__doc__tret__all__tcompileRRRt__name__(((s1/usr/lib64/python2.7/ctypes/macholib/framework.pyt<module>s				macholib/dyld.pyc000064400000013233150532450640010001 0ustar00�
{fc@sIdZddlZddlmZddlmZddlTdddd	gZejj	d
�ddd
gZ
ejj	d�dddgZd�Zd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zddd�Zddd�Zd�Zed krEe�ndS(!s
dyld emulation
i����N(tframework_info(t
dylib_info(t*t	dyld_findtframework_findRRs~/Library/Frameworkss/Library/Frameworkss/Network/Library/Frameworkss/System/Library/Frameworkss~/libs/usr/local/libs/libs/usr/libcCs t|t�r|jd�S|S(sCNot all of PyObjC and Python understand unicode paths very well yettutf8(t
isinstancetunicodetencode(ts((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytensure_utf8s
cCsD|dkrtj}n|j|�}|dkr7gS|jd�S(Nt:(tNonetostenvirontgettsplit(tenvtvartrval((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_env%scCs%|dkrtj}n|jd�S(NtDYLD_IMAGE_SUFFIX(RR
RR(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_image_suffix-scCs
t|d�S(NtDYLD_FRAMEWORK_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_framework_path2scCs
t|d�S(NtDYLD_LIBRARY_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_library_path5scCs
t|d�S(NtDYLD_FALLBACK_FRAMEWORK_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_fallback_framework_path8scCs
t|d�S(NtDYLD_FALLBACK_LIBRARY_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_fallback_library_path;scCs2t|�}|dkr|S||d�}|�S(s>For a potential path iterator, add DYLD_IMAGE_SUFFIX semanticscssMxF|D]>}|jd�r7|td� |dVn	||V|VqWdS(Ns.dylib(tendswithtlen(titeratortsuffixtpath((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyt_injectCs

	N(RR(R!RR"R$((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_image_suffix_search>s
ccs�t|�}|dk	rJx/t|�D]}tjj||d�Vq%Wnx4t|�D]&}tjj|tjj|��VqWWdS(Ntname(RRRR
R#tjoinRtbasename(R&Rt	frameworkR#((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_override_searchLsccs@|jd�r<|dk	r<tjj||td��VndS(Ns@executable_path/(t
startswithRR
R#R'R (R&texecutable_path((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_executable_path_search]sccs|Vt|�}|dk	rUt|�}x)|D]}tjj||d�Vq0Wnt|�}x.|D]&}tjj|tjj|��VqhW|dk	r�|r�x)tD]}tjj||d�Vq�Wn|sx1t	D]&}tjj|tjj|��Vq�WndS(NR&(
RRRR
R#R'RR(tDEFAULT_FRAMEWORK_FALLBACKtDEFAULT_LIBRARY_FALLBACK(R&RR)tfallback_framework_pathR#tfallback_library_path((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_default_searchds

$

cCs�t|�}t|�}xTttt||�t||�t||��|�D]}tjj|�rO|SqOWt	d|f��dS(s:
    Find a library or framework using dyld semantics
    sdylib %s could not be foundN(
R
R%tchainR*R-R2R
R#tisfilet
ValueError(R&R,RR#((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyRzs	
cCs�yt|d|d|�SWntk
r/}nX|jd�}|dkrdt|�}|d7}ntjj|tjj|| ��}yt|d|d|�SWntk
r�|�nXdS(s�
    Find a framework using dyld semantics in a very loose manner.

    Will take input such as:
        Python
        Python.framework
        Python.framework/Versions/Current
    R,Rs
.frameworki����N(RR5trfindR R
R#R'R((tfnR,Rtet
fmwk_index((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyR�s	
%
cCs:i}td�dkst�td�dks6t�dS(NslibSystem.dylibs/usr/lib/libSystem.dylibsSystem.framework/Systems2/System/Library/Frameworks/System.framework/System(RtAssertionError(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyttest_dyld_find�st__main__(t__doc__R
R)RtdylibRt	itertoolst__all__R#t
expanduserR.R/R
RRRRRRRR%R*R-R2RRR;t__name__(((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyt<module>s<
					macholib/dylib.pyc000064400000004413150532450640010150 0ustar00�
{fc@sVdZddlZdgZejd�Zd�Zd�ZedkrRe�ndS(s!
Generic dylib path manipulation
i����Nt
dylib_infos�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
cCs#tj|�}|sdS|j�S(s1
    A dylib name can take one of the following four forms:
        Location/Name.SomeVersion_Suffix.dylib
        Location/Name.SomeVersion.dylib
        Location/Name_Suffix.dylib
        Location/Name.dylib

    returns None if not found or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.SomeVersion_Suffix.dylib',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present.
    N(tDYLIB_REtmatchtNonet	groupdict(tfilenametis_dylib((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pyRscCsdddddd�}td�dks0t�td�dksHt�td�|ddd�kslt�td�|dd	dd
d�ks�t�td�|dd
dd�ks�t�td�|dddd�ks�t�td�|ddddd�kst�dS(NcSs%td|d|d|d|d|�S(Ntlocationtnamet	shortnametversiontsuffix(tdict(RRR	R
R((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pytd.sscompletely/invalidscompletely/invalide_debugsP/Foo.dylibtPs	Foo.dylibtFoosP/Foo_debug.dylibsFoo_debug.dylibRtdebugs
P/Foo.A.dylibsFoo.A.dylibtAsP/Foo_debug.A.dylibsFoo_debug.A.dylibt	Foo_debugsP/Foo.A_debug.dylibsFoo.A_debug.dylib(RRtAssertionError(R
((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pyttest_dylib_info-s$*''t__main__(t__doc__tret__all__tcompileRRRt__name__(((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pyt<module>s				macholib/__init__.pyo000064400000000474150532450640010623 0ustar00�
{fc@sdZdZdS(s~
Enough Mach-O to make your head spin.

See the relevant header files in /usr/include/mach-o

And also Apple's documentation.
s1.0N(t__doc__t__version__(((s0/usr/lib64/python2.7/ctypes/macholib/__init__.pyt<module>smacholib/dyld.pyo000064400000012715150532450640010021 0ustar00�
{fc@sIdZddlZddlmZddlmZddlTdddd	gZejj	d
�ddd
gZ
ejj	d�dddgZd�Zd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zddd�Zddd�Zd�Zed krEe�ndS(!s
dyld emulation
i����N(tframework_info(t
dylib_info(t*t	dyld_findtframework_findRRs~/Library/Frameworkss/Library/Frameworkss/Network/Library/Frameworkss/System/Library/Frameworkss~/libs/usr/local/libs/libs/usr/libcCs t|t�r|jd�S|S(sCNot all of PyObjC and Python understand unicode paths very well yettutf8(t
isinstancetunicodetencode(ts((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytensure_utf8s
cCsD|dkrtj}n|j|�}|dkr7gS|jd�S(Nt:(tNonetostenvirontgettsplit(tenvtvartrval((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_env%scCs%|dkrtj}n|jd�S(NtDYLD_IMAGE_SUFFIX(RR
RR(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_image_suffix-scCs
t|d�S(NtDYLD_FRAMEWORK_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_framework_path2scCs
t|d�S(NtDYLD_LIBRARY_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_library_path5scCs
t|d�S(NtDYLD_FALLBACK_FRAMEWORK_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_fallback_framework_path8scCs
t|d�S(NtDYLD_FALLBACK_LIBRARY_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_fallback_library_path;scCs2t|�}|dkr|S||d�}|�S(s>For a potential path iterator, add DYLD_IMAGE_SUFFIX semanticscssMxF|D]>}|jd�r7|td� |dVn	||V|VqWdS(Ns.dylib(tendswithtlen(titeratortsuffixtpath((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyt_injectCs

	N(RR(R!RR"R$((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_image_suffix_search>s
ccs�t|�}|dk	rJx/t|�D]}tjj||d�Vq%Wnx4t|�D]&}tjj|tjj|��VqWWdS(Ntname(RRRR
R#tjoinRtbasename(R&Rt	frameworkR#((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_override_searchLsccs@|jd�r<|dk	r<tjj||td��VndS(Ns@executable_path/(t
startswithRR
R#R'R (R&texecutable_path((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_executable_path_search]sccs|Vt|�}|dk	rUt|�}x)|D]}tjj||d�Vq0Wnt|�}x.|D]&}tjj|tjj|��VqhW|dk	r�|r�x)tD]}tjj||d�Vq�Wn|sx1t	D]&}tjj|tjj|��Vq�WndS(NR&(
RRRR
R#R'RR(tDEFAULT_FRAMEWORK_FALLBACKtDEFAULT_LIBRARY_FALLBACK(R&RR)tfallback_framework_pathR#tfallback_library_path((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_default_searchds

$

cCs�t|�}t|�}xTttt||�t||�t||��|�D]}tjj|�rO|SqOWt	d|f��dS(s:
    Find a library or framework using dyld semantics
    sdylib %s could not be foundN(
R
R%tchainR*R-R2R
R#tisfilet
ValueError(R&R,RR#((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyRzs	
cCs�yt|d|d|�SWntk
r/}nX|jd�}|dkrdt|�}|d7}ntjj|tjj|| ��}yt|d|d|�SWntk
r�|�nXdS(s�
    Find a framework using dyld semantics in a very loose manner.

    Will take input such as:
        Python
        Python.framework
        Python.framework/Versions/Current
    R,Rs
.frameworki����N(RR5trfindR R
R#R'R((tfnR,Rtet
fmwk_index((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyR�s	
%
cCs
i}dS(N((R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyttest_dyld_find�st__main__(t__doc__R
R)RtdylibRt	itertoolst__all__R#t
expanduserR.R/R
RRRRRRRR%R*R-R2RRR:t__name__(((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyt<module>s<
					macholib/dylib.pyo000064400000003305150532450640010163 0ustar00�
{fc@sVdZddlZdgZejd�Zd�Zd�ZedkrRe�ndS(s!
Generic dylib path manipulation
i����Nt
dylib_infos�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
cCs#tj|�}|sdS|j�S(s1
    A dylib name can take one of the following four forms:
        Location/Name.SomeVersion_Suffix.dylib
        Location/Name.SomeVersion.dylib
        Location/Name_Suffix.dylib
        Location/Name.dylib

    returns None if not found or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.SomeVersion_Suffix.dylib',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present.
    N(tDYLIB_REtmatchtNonet	groupdict(tfilenametis_dylib((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pyRscCsdddddd�}dS(NcSs%td|d|d|d|d|�S(Ntlocationtnamet	shortnametversiontsuffix(tdict(RRR	R
R((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pytd.s(R(R
((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pyttest_dylib_info-st__main__(t__doc__tret__all__tcompileRRRt__name__(((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pyt<module>s				macholib/__init__.pyc000064400000000474150532450640010607 0ustar00�
{fc@sdZdZdS(s~
Enough Mach-O to make your head spin.

See the relevant header files in /usr/include/mach-o

And also Apple's documentation.
s1.0N(t__doc__t__version__(((s0/usr/lib64/python2.7/ctypes/macholib/__init__.pyt<module>smacholib/framework.pyo000064400000003523150532450640011057 0ustar00�
{fc@sVdZddlZdgZejd�Zd�Zd�ZedkrRe�ndS(s%
Generic framework path manipulation
i����Ntframework_infos�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
cCs#tj|�}|sdS|j�S(s}
    A framework name can take one of the following four forms:
        Location/Name.framework/Versions/SomeVersion/Name_Suffix
        Location/Name.framework/Versions/SomeVersion/Name
        Location/Name.framework/Name_Suffix
        Location/Name.framework/Name

    returns None if not found, or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.framework/Versions/SomeVersion/Name_Suffix',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present
    N(tSTRICT_FRAMEWORK_REtmatchtNonet	groupdict(tfilenametis_framework((s1/usr/lib64/python2.7/ctypes/macholib/framework.pyRscCsdddddd�}dS(NcSs%td|d|d|d|d|�S(Ntlocationtnamet	shortnametversiontsuffix(tdict(RRR	R
R((s1/usr/lib64/python2.7/ctypes/macholib/framework.pytd-s(R(R
((s1/usr/lib64/python2.7/ctypes/macholib/framework.pyttest_framework_info,st__main__(t__doc__tret__all__tcompileRRRt__name__(((s1/usr/lib64/python2.7/ctypes/macholib/framework.pyt<module>s				__init__.pyo000064400000047344150532450640007054 0ustar00�
{fc@sQ
dZddlZddlZdZddlmZmZm	Z	ddlm
Z
ddlmZddlmZ
ddlmZmZdd	lmZdd
lmZee
kr�edee
��nejdukr�ddlmZneZejdkrBejdkrBeej�djd�d�dkrBeZqBnddlmZmZm Z!m"Z#dd�Z%dd�Z&iZ'd�Z(ejdvkrddlm)Z*ddlm+Z,ejd
kr�eZ,niZ-d�Z.e.jr*e(jj/dd�e._q*n"ejdkr*ddlm0Z*nddlm1Z1m2Z2m3Z3m4Z4m5Z5dd lm6Z6m7Z7dd!lm8Z8dd"�Z9d#e8fd$��YZ:e9e:d%�d&e8fd'��YZ;e9e;�d(e8fd)��YZ<e9e<�d*e8fd+��YZ=e9e=�d,e8fd-��YZ>e9e>�ed.�ed/�krNe=Z?e>Z@n@d0e8fd1��YZ?e9e?�d2e8fd3��YZ@e9e@�d4e8fd5��YZAe9eA�d6e8fd7��YZBe9eB�d8e8fd9��YZCe1eC�e1eB�kreBZCned/�ed:�kr,e=ZDe>ZEn@d;e8fd<��YZDe9eD�d=e8fd>��YZEe9eE�d?e8fd@��YZFeFeF_GeF_He9eF�dAe8fdB��YZIeIeI_GeI_He9eI�dCe8fdD��YZJeJeJ_GeJ_He9eJ�dEe8fdF��YZKe9eKd%�dGe8fdH��YZLeLZMe9eL�dIe8fdJ��YZNddKlmOZOmPZPmQZQdL�ZRyddMlmSZSWneTk
r�neXejdwkr�eSdNdO�n
eSdPdQ�dRe8fdS��YZUdTe8fdU��YZVddV�ZWdW�ZXdX�ZYdYeZfdZ��YZ[d[e[fd\��YZ\ejdxkr�d]e[fd^��YZ]dd_lm^Z^m8Z8d`e8fda��YZ_dbe[fdc��YZ`nddeZfde��YZaeae[�Zbeae\�Zcejdykr	e\dfdejd�Zen5ejdgkr2e\dhejfd �Zene\d�Zeejdzkr�eae]�Zgeae`�Zhejdkr�egjijjZjnegjkjjZjddilmlZlmmZmdddj�Znne1e@�e1eL�kr�e@Zoe?ZpnNe1e>�e1eL�kre>Zoe=Zpn'e1eE�e1eL�kr,eEZoeDZpnddklmqZqmrZrmsZsmtZte(eLeLeLeo�eq�Zue(eLeLe?eo�er�Zvdl�Zwewe:eLe:e:�et�Zxdm�Zyewe:eLe?�es�Zzddn�Z{yddolm|Z|WneTk
r�n%Xewe:eLe?�e|�Z}ddp�Z~ejd{krE	dq�Zdr�Z�nddsl�m�Z�m�Z�eIZ�eFZ�xke;e?e=eDgD]WZ�e1e��dkr�	e�Z�qz	e1e��dtkr�	e�Z�qz	e1e��dkrz	e�Z�qz	qz	Wxke<e@e>eEgD]WZ�e1e��dkr	
e�Z�q�	e1e��dtkr$
e�Z�q�	e1e��dkr�	e�Z�q�	q�	W[�eR�dS(|s,create and manipulate C data types in Pythoni����Ns1.1.0(tUniont	StructuretArray(t_Pointer(tCFuncPtr(t__version__(t
RTLD_LOCALtRTLD_GLOBAL(t
ArgumentError(tcalcsizesVersion number mismatchtnttce(tFormatErrortposixtdarwinit.ii(tFUNCFLAG_CDECLtFUNCFLAG_PYTHONAPItFUNCFLAG_USE_ERRNOtFUNCFLAG_USE_LASTERRORcCs�t|ttf�rT|dkr4t|�d}nt|}|�}||_|St|ttf�r�t|}|�}|St	|��dS(s�create_string_buffer(aString) -> character array
    create_string_buffer(anInteger) -> character array
    create_string_buffer(aString, anInteger) -> character array
    iN(
t
isinstancetstrtunicodetNonetlentc_chartvaluetinttlongt	TypeError(tinittsizetbuftypetbuf((s'/usr/lib64/python2.7/ctypes/__init__.pytcreate_string_buffer1s
		
	cCs
t||�S(N(R"(RR((s'/usr/lib64/python2.7/ctypes/__init__.pytc_bufferCscs�t�|jdt�r%�tO�n|jdt�rD�tO�n|rctd|j���nyt���fSWnGtk
r�dt	f���fd��Y}|t���f<|SXdS(s�CFUNCTYPE(restype, *argtypes,
                 use_errno=False, use_last_error=False) -> function prototype.

    restype: the result type
    argtypes: a sequence specifying the argument types

    The function prototype can be called in different ways to create a
    callable object:

    prototype(integer address) -> foreign function
    prototype(callable) -> create and return a C callable function from callable
    prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
    prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
    prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
    t	use_errnotuse_last_errors!unexpected keyword argument(s) %st
CFunctionTypecseZ�Z�Z�ZRS((t__name__t
__module__t
_argtypes_t	_restype_t_flags_((targtypestflagstrestype(s'/usr/lib64/python2.7/ctypes/__init__.pyR&esN(
t_FUNCFLAG_CDECLtpoptFalset_FUNCFLAG_USE_ERRNOt_FUNCFLAG_USE_LASTERRORt
ValueErrortkeyst_c_functype_cachetKeyErrort	_CFuncPtr(R.R,tkwR&((R,R-R.s'/usr/lib64/python2.7/ctypes/__init__.pyt	CFUNCTYPEKs


"(tLoadLibrary(tFUNCFLAG_STDCALLcs�t�|jdt�r%�tO�n|jdt�rD�tO�n|rctd|j���nyt���fSWnGtk
r�dt	f���fd��Y}|t���f<|SXdS(NR$R%s!unexpected keyword argument(s) %stWinFunctionTypecseZ�Z�Z�ZRS((R'R(R)R*R+((R,R-R.(s'/usr/lib64/python2.7/ctypes/__init__.pyR=�s(
t_FUNCFLAG_STDCALLR0R1R2R3R4R5t_win_functype_cacheR7R8(R.R,R9R=((R,R-R.s'/usr/lib64/python2.7/ctypes/__init__.pytWINFUNCTYPEts


"R:R@(tdlopen(tsizeoftbyreft	addressoft	alignmenttresize(t	get_errnot	set_errno(t_SimpleCDatacCsmddlm}|dkr(|j}nt|�||�}}||kritd|||f��ndS(Ni����(R	s"sizeof(%s) wrong: %d instead of %d(tstructR	Rt_type_RBtSystemError(ttypttypecodeR	tactualtrequired((s'/usr/lib64/python2.7/ctypes/__init__.pyt_check_size�st	py_objectcBseZdZd�ZRS(tOcCs=ytt|�j�SWntk
r8dt|�jSXdS(Ns
%s(<NULL>)(tsuperRRt__repr__R4ttypeR'(tself((s'/usr/lib64/python2.7/ctypes/__init__.pyRU�s
(R'R(RKRU(((s'/usr/lib64/python2.7/ctypes/__init__.pyRR�stPtc_shortcBseZdZRS(th(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRY�stc_ushortcBseZdZRS(tH(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR[�stc_longcBseZdZRS(tl(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR]�stc_ulongcBseZdZRS(tL(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR_�stiR^tc_intcBseZdZRS(Ra(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRb�stc_uintcBseZdZRS(tI(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRc�stc_floatcBseZdZRS(tf(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRe�stc_doublecBseZdZRS(td(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRg�stc_longdoublecBseZdZRS(tg(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRi�stqt
c_longlongcBseZdZRS(Rk(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRl�stc_ulonglongcBseZdZRS(tQ(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRm�stc_ubytecBseZdZRS(tB(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRo�stc_bytecBseZdZRS(tb(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRq�sRcBseZdZRS(tc(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR�stc_char_pcBs2eZdZejdkr'd�Zn	d�ZRS(tzR
cCsLtjj|d�s,d|jj|jfSd|jjt|t�jfS(Ni����s%s(%r)s%s(%s)(twindlltkernel32tIsBadStringPtrAt	__class__R'Rtcasttc_void_p(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRU�scCs d|jjt|t�jfS(Ns%s(%s)(RyR'RzR{R(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRU�s(R'R(RKt_ostnameRU(((s'/usr/lib64/python2.7/ctypes/__init__.pyRt�sR{cBseZdZRS(RX(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR{�stc_boolcBseZdZRS(t?(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR~s(tPOINTERtpointert_pointer_type_cachecCsbtj�tj�tjdkr0tj�ntjtt	�_t
jtt�_ttd<dS(NR
R(R
R(R�tclearR6R|R}R?t	c_wchar_pt
from_paramR�tc_wcharRtRR{R(((s'/usr/lib64/python2.7/ctypes/__init__.pyt_reset_caches


(tset_conversion_modetmbcstignoretasciitstrictR�cBseZdZRS(tZ(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR�sR�cBseZdZRS(tu(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR�scCs�t|ttf�rT|dkr4t|�d}nt|}|�}||_|St|ttf�r�t|}|�}|St	|��dS(s�create_unicode_buffer(aString) -> character array
        create_unicode_buffer(anInteger) -> character array
        create_unicode_buffer(aString, anInteger) -> character array
        iN(
RRRRRR�RRRR(RRR R!((s'/usr/lib64/python2.7/ctypes/__init__.pytcreate_unicode_buffer!s
		
	cCsptj|d�dk	r'td��nt|�tkrHtd��n|j|�|t|<tt|�=dS(Ns%This type already exists in the cachesWhat's this???(R�tgetRtRuntimeErrortidtset_type(R�tcls((s'/usr/lib64/python2.7/ctypes/__init__.pytSetPointerType4s

cCs||S(N((RMR((s'/usr/lib64/python2.7/ctypes/__init__.pytARRAY>stCDLLcBs\eZdZeZeZdZdZdZ
edeed�Z
d�Zd�Zd�ZRS(s�An instance of this class represents a loaded dll/shared
    library, exporting functions using the standard C calling
    convention (named 'cdecl' on Windows).

    The exported functions can be accessed as attributes, or by
    indexing with the function name.  Examples:

    <obj>.qsort -> callable object
    <obj>['qsort'] -> callable object

    Calling the functions releases the Python GIL during the call and
    reacquires it afterwards.
    s<uninitialized>ics�|�_�j�|r%�tO�n|r8�tO�ndtf��fd��Y}|�_|dkr�t�j|��_n	|�_dS(Nt_FuncPtrcseZ�Z�jZRS((R'R(R+t_func_restype_R*((R-RW(s'/usr/lib64/python2.7/ctypes/__init__.pyR�cs(	t_namet_func_flags_R2R3R8R�Rt_dlopent_handle(RWR}tmodethandleR$R%R�((R-RWs'/usr/lib64/python2.7/ctypes/__init__.pyt__init__Ys		

	cCsDd|jj|j|jtjdd@t|�tjdd@fS(Ns<%s '%s', handle %x at %x>ii(RyR'R�R�t_systmaxintR�(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRUmscCsP|jd�r-|jd�r-t|��n|j|�}t|||�|S(Nt__(t
startswithtendswithtAttributeErrort__getitem__tsetattr(RWR}tfunc((s'/usr/lib64/python2.7/ctypes/__init__.pyt__getattr__ss
cCs:|j||f�}t|ttf�s6||_n|S(N(R�RRRR'(RWtname_or_ordinalR�((s'/usr/lib64/python2.7/ctypes/__init__.pyR�zsN(R'R(t__doc__R/R�RbR�R�R�RR�tDEFAULT_MODER1R�RUR�R�(((s'/usr/lib64/python2.7/ctypes/__init__.pyR�Ds
		tPyDLLcBseZdZeeBZRS(s�This class represents the Python library itself.  It allows
    accessing Python API functions.  The GIL is not released, and
    Python exceptions are handled correctly.
    (R'R(R�R/t_FUNCFLAG_PYTHONAPIR�(((s'/usr/lib64/python2.7/ctypes/__init__.pyR��stWinDLLcBseZdZeZRS(snThis class represents a dll exporting functions using the
        Windows stdcall calling convention.
        (R'R(R�R>R�(((s'/usr/lib64/python2.7/ctypes/__init__.pyR��s(t_check_HRESULTRItHRESULTcBseZdZeZRS(R^(R'R(RKR�t_check_retval_(((s'/usr/lib64/python2.7/ctypes/__init__.pyR��s
tOleDLLcBseZdZeZeZRS(s�This class represents a dll exporting functions using the
        Windows stdcall calling convention, and returning HRESULT.
        HRESULT error values are automatically raised as WindowsError
        exceptions.
        (R'R(R�R>R�R�R�(((s'/usr/lib64/python2.7/ctypes/__init__.pyR��st
LibraryLoadercBs,eZd�Zd�Zd�Zd�ZRS(cCs
||_dS(N(t_dlltype(RWtdlltype((s'/usr/lib64/python2.7/ctypes/__init__.pyR��scCsB|ddkrt|��n|j|�}t|||�|S(Nit_(R�R�R�(RWR}tdll((s'/usr/lib64/python2.7/ctypes/__init__.pyR��s
cCs
t||�S(N(tgetattr(RWR}((s'/usr/lib64/python2.7/ctypes/__init__.pyR��scCs
|j|�S(N(R�(RWR}((s'/usr/lib64/python2.7/ctypes/__init__.pyR;�s(R'R(R�R�R�R;(((s'/usr/lib64/python2.7/ctypes/__init__.pyR��s			s
python dlltcygwinslibpython%d.%d.dll(tget_last_errortset_last_errorcCsF|dkrt�}n|dkr9t|�j�}nt||�S(N(RtGetLastErrorRtstriptWindowsError(tcodetdescr((s'/usr/lib64/python2.7/ctypes/__init__.pytWinError�s
(t
_memmove_addrt_memset_addrt_string_at_addrt
_cast_addrcs#dtf��fd��Y}|S(NR&cseZ�Z�ZeeBZRS((R'R(R)R*R/R�R+((R,R.(s'/usr/lib64/python2.7/ctypes/__init__.pyR&�s(R8(R.R,R&((R,R.s'/usr/lib64/python2.7/ctypes/__init__.pyt
PYFUNCTYPE�scCst|||�S(N(t_cast(tobjRM((s'/usr/lib64/python2.7/ctypes/__init__.pyRz�scCs
t||�S(sAstring_at(addr[, size]) -> string

    Return the string at addr.(t
_string_at(tptrR((s'/usr/lib64/python2.7/ctypes/__init__.pyt	string_at�s(t_wstring_at_addrcCs
t||�S(sFwstring_at(addr[, size]) -> string

        Return the string at addr.(t_wstring_at(R�R((s'/usr/lib64/python2.7/ctypes/__init__.pyt
wstring_atscCsNy"tdt�t�dg�}Wntk
r6dSX|j|||�SdS(Nscomtypes.server.inprocservert*i�(t
__import__tglobalstlocalstImportErrortDllGetClassObject(trclsidtriidtppvtccom((s'/usr/lib64/python2.7/ctypes/__init__.pyR�	s
"
cCsAy"tdt�t�dg�}Wntk
r6dSX|j�S(Nscomtypes.server.inprocserverR�i(R�R�R�R�tDllCanUnloadNow(R�((s'/usr/lib64/python2.7/ctypes/__init__.pyR�s
"
(tBigEndianStructuretLittleEndianStructurei(R
R(R
R(R
R(R
R(R
R(R
R(R
R(�R�tosR|tsysR�Rt_ctypesRRRRRR8t_ctypes_versionRRRRJR	t	_calcsizet	ExceptionR}RR�tplatformRtunametsplitRR/RR�RR2RR3RR"R#R6R:R;R�R<R>R?R@treplaceRARBRCRDRERFRGRHRIRQRRRYR[R]R_RbRcReRgRiRlRmRot__ctype_le__t__ctype_be__RqRRtR{tc_voidpR~R�R�R�R�R�R�R�R�R�R�R�tobjectR�R�R�R�R�R�R�tcdlltpydllt	dllhandlet	pythonapitversion_infoRvtoledllRwR�tcoredllR�R�R�tc_size_tt	c_ssize_tR�R�R�R�tmemmovetmemsetR�R�RzR�R�R�R�R�R�R�tctypes._endianR�R�tc_int8tc_uint8tkindtc_int16tc_int32tc_int64tc_uint16tc_uint32tc_uint64(((s'/usr/lib64/python2.7/ctypes/__init__.pyt<module>sJ)"	!			(




	



		







	

	
	<
				"		
			
		
_endian.pyc000064400000004403150532450640006663 0ustar00�
{fc@s�ddlZddlTee�Zd�Zdee�fd��YZejdkr{dZ	eZ
defd	��YZn@ejd
kr�dZ	eZdefd
��YZ
ned��dS(i����N(t*cCsft|t�rt|t�St|t�r?t|j�|jSt|t	�rR|St
d|��dS(s�Return the type with the 'other' byte order.  Simple types like
    c_int and so on already have __ctype_be__ and __ctype_le__
    attributes which contain the types, for more complicated types
    arrays and structures are supported.
    s+This type does not support other endian: %sN(thasattrt
_OTHER_ENDIANtgetattrt
isinstancet_array_typet
_other_endiant_type_t_length_t
issubclasst	Structuret	TypeError(ttyp((s&/usr/lib64/python2.7/ctypes/_endian.pyRs
t
_swapped_metacBseZd�ZRS(cCs�|dkrgg}xI|D]A}|d}|d}|d}|j|t|�f|�qW|}ntt|�j||�dS(Nt_fields_iii(tappendRtsuperR
t__setattr__(tselftattrnametvaluetfieldstdesctnameRtrest((s&/usr/lib64/python2.7/ctypes/_endian.pyRs



!	(t__name__t
__module__R(((s&/usr/lib64/python2.7/ctypes/_endian.pyR
stlittlet__ctype_be__tBigEndianStructurecBseZdZeZdZRS(s$Structure with big endian byte orderN(RRt__doc__R
t
__metaclass__tNonet_swappedbytes_(((s&/usr/lib64/python2.7/ctypes/_endian.pyR.stbigt__ctype_le__tLittleEndianStructurecBseZdZeZdZRS(s'Structure with little endian byte orderN(RRRR
RR R!(((s&/usr/lib64/python2.7/ctypes/_endian.pyR$7ssInvalid byteorder(
tsystctypesttypetArrayRRR
R
t	byteorderRR$RtRuntimeError(((s&/usr/lib64/python2.7/ctypes/_endian.pyt<module>s
	util.py.binutils-no-dep000064400000024440150532450640011113 0ustar00import os
import subprocess
import sys

# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":

    def _get_build_version():
        """Return the version of MSVC that was used to build Python.

        For Python 2.3 and up, the version number is included in
        sys.version.  For earlier versions, assume the compiler is MSVC 6.
        """
        # This function was copied from Lib/distutils/msvccompiler.py
        prefix = "MSC v."
        i = sys.version.find(prefix)
        if i == -1:
            return 6
        i = i + len(prefix)
        s, rest = sys.version[i:].split(" ", 1)
        majorVersion = int(s[:-2]) - 6
        minorVersion = int(s[2:3]) / 10.0
        # I don't think paths are affected by minor version in version 6
        if majorVersion == 6:
            minorVersion = 0
        if majorVersion >= 6:
            return majorVersion + minorVersion
        # else we don't know what version of the compiler this is
        return None

    def find_msvcrt():
        """Return the name of the VC runtime dll"""
        version = _get_build_version()
        if version is None:
            # better be safe than sorry
            return None
        if version <= 6:
            clibname = 'msvcrt'
        else:
            clibname = 'msvcr%d' % (version * 10)

        # If python was built with in debug mode
        import imp
        if imp.get_suffixes()[0][0] == '_d.pyd':
            clibname += 'd'
        return clibname+'.dll'

    def find_library(name):
        if name in ('c', 'm'):
            return find_msvcrt()
        # See MSDN for the REAL search order.
        for directory in os.environ['PATH'].split(os.pathsep):
            fname = os.path.join(directory, name)
            if os.path.isfile(fname):
                return fname
            if fname.lower().endswith(".dll"):
                continue
            fname = fname + ".dll"
            if os.path.isfile(fname):
                return fname
        return None

if os.name == "ce":
    # search path according to MSDN:
    # - absolute path specified by filename
    # - The .exe launch directory
    # - the Windows directory
    # - ROM dll files (where are they?)
    # - OEM specified search path: HKLM\Loader\SystemPath
    def find_library(name):
        return name

if os.name == "posix" and sys.platform == "darwin":
    from ctypes.macholib.dyld import dyld_find as _dyld_find
    def find_library(name):
        possible = ['lib%s.dylib' % name,
                    '%s.dylib' % name,
                    '%s.framework/%s' % (name, name)]
        for name in possible:
            try:
                return _dyld_find(name)
            except ValueError:
                continue
        return None

elif os.name == "posix":
    # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
    import re, tempfile, errno

    def _findLib_gcc(name):
        # Run GCC's linker with the -t (aka --trace) option and examine the
        # library name it prints out. The GCC command will fail because we
        # haven't supplied a proper program with main(), but that does not
        # matter.
        expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
        cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit; fi;' \
              'LANG=C LC_ALL=C $CC -Wl,-t -o "$2" 2>&1 -l"$1"'

        temp = tempfile.NamedTemporaryFile()
        try:
            proc = subprocess.Popen((cmd, '_findLib_gcc', name, temp.name),
                                    shell=True,
                                    stdout=subprocess.PIPE)
            [trace, _] = proc.communicate()
        finally:
            try:
                temp.close()
            except OSError, e:
                # ENOENT is raised if the file was already removed, which is
                # the normal behaviour of GCC if linking fails
                if e.errno != errno.ENOENT:
                    raise
        res = re.search(expr, trace)
        if not res:
            return None
        return res.group(0)


    if sys.platform == "sunos5":
        # use /usr/ccs/bin/dump on solaris
        def _get_soname(f):
            if not f:
                return None

            null = open(os.devnull, "wb")
            try:
                with null:
                    proc = subprocess.Popen(("/usr/ccs/bin/dump", "-Lpv", f),
                                            stdout=subprocess.PIPE,
                                            stderr=null)
            except OSError:  # E.g. command not found
                return None
            [data, _] = proc.communicate()
            res = re.search(br'\[.*\]\sSONAME\s+([^\s]+)', data)
            if not res:
                return None
            return res.group(1)
    else:
        def _get_soname(f):
            # assuming GNU binutils / ELF
            if not f:
                return None
            cmd = 'if ! type objdump >/dev/null 2>&1; then exit; fi;' \
                  'objdump -p -j .dynamic 2>/dev/null "$1"'
            proc = subprocess.Popen((cmd, '_get_soname', f), shell=True,
                                    stdout=subprocess.PIPE)
            [dump, _] = proc.communicate()
            res = re.search(br'\sSONAME\s+([^\s]+)', dump)
            if not res:
                return None
            return res.group(1)

    if (sys.platform.startswith("freebsd")
        or sys.platform.startswith("openbsd")
        or sys.platform.startswith("dragonfly")):

        def _num_version(libname):
            # "libxyz.so.MAJOR.MINOR" => [ MAJOR, MINOR ]
            parts = libname.split(b".")
            nums = []
            try:
                while parts:
                    nums.insert(0, int(parts.pop()))
            except ValueError:
                pass
            return nums or [sys.maxint]

        def find_library(name):
            ename = re.escape(name)
            expr = r':-l%s\.\S+ => \S*/(lib%s\.\S+)' % (ename, ename)

            null = open(os.devnull, 'wb')
            try:
                with null:
                    proc = subprocess.Popen(('/sbin/ldconfig', '-r'),
                                            stdout=subprocess.PIPE,
                                            stderr=null)
            except OSError:  # E.g. command not found
                data = b''
            else:
                [data, _] = proc.communicate()

            res = re.findall(expr, data)
            if not res:
                return _get_soname(_findLib_gcc(name))
            res.sort(key=_num_version)
            return res[-1]

    elif sys.platform == "sunos5":

        def _findLib_crle(name, is64):
            if not os.path.exists('/usr/bin/crle'):
                return None

            env = dict(os.environ)
            env['LC_ALL'] = 'C'

            if is64:
                args = ('/usr/bin/crle', '-64')
            else:
                args = ('/usr/bin/crle',)

            paths = None
            null = open(os.devnull, 'wb')
            try:
                with null:
                    proc = subprocess.Popen(args,
                                            stdout=subprocess.PIPE,
                                            stderr=null,
                                            env=env)
            except OSError:  # E.g. bad executable
                return None
            try:
                for line in proc.stdout:
                    line = line.strip()
                    if line.startswith(b'Default Library Path (ELF):'):
                        paths = line.split()[4]
            finally:
                proc.stdout.close()
                proc.wait()

            if not paths:
                return None

            for dir in paths.split(":"):
                libfile = os.path.join(dir, "lib%s.so" % name)
                if os.path.exists(libfile):
                    return libfile

            return None

        def find_library(name, is64 = False):
            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))

    else:

        def _findSoname_ldconfig(name):
            import struct
            if struct.calcsize('l') == 4:
                machine = os.uname()[4] + '-32'
            else:
                machine = os.uname()[4] + '-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',
                }
            abi_type = mach_map.get(machine, 'libc6')

            # XXX assuming GLIBC's ldconfig (with option -p)
            expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)

            env = dict(os.environ)
            env['LC_ALL'] = 'C'
            env['LANG'] = 'C'
            null = open(os.devnull, 'wb')
            try:
                with null:
                    p = subprocess.Popen(['/sbin/ldconfig', '-p'],
                                          stderr=null,
                                          stdout=subprocess.PIPE,
                                          env=env)
            except OSError:  # E.g. command not found
                return None
            [data, _] = p.communicate()
            res = re.search(expr, data)
            if not res:
                return None
            return res.group(1)

        def find_library(name):
            return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))

################################################################
# test code

def test():
    from ctypes import cdll
    if os.name == "nt":
        print cdll.msvcrt
        print cdll.load("msvcrt")
        print find_library("msvcrt")

    if os.name == "posix":
        # find and load_version
        print find_library("m")
        print find_library("c")
        print find_library("bz2")

        # getattr
##        print cdll.m
##        print cdll.bz2

        # load
        if sys.platform == "darwin":
            print cdll.LoadLibrary("libm.dylib")
            print cdll.LoadLibrary("libcrypto.dylib")
            print cdll.LoadLibrary("libSystem.dylib")
            print cdll.LoadLibrary("System.framework/System")
        else:
            print cdll.LoadLibrary("libm.so")
            print cdll.LoadLibrary("libcrypt.so")
            print find_library("crypt")

if __name__ == "__main__":
    test()
__init__.pyc000064400000047344150532450640007040 0ustar00�
{fc@sQ
dZddlZddlZdZddlmZmZm	Z	ddlm
Z
ddlmZddlmZ
ddlmZmZdd	lmZdd
lmZee
kr�edee
��nejdukr�ddlmZneZejdkrBejdkrBeej�djd�d�dkrBeZqBnddlmZmZm Z!m"Z#dd�Z%dd�Z&iZ'd�Z(ejdvkrddlm)Z*ddlm+Z,ejd
kr�eZ,niZ-d�Z.e.jr*e(jj/dd�e._q*n"ejdkr*ddlm0Z*nddlm1Z1m2Z2m3Z3m4Z4m5Z5dd lm6Z6m7Z7dd!lm8Z8dd"�Z9d#e8fd$��YZ:e9e:d%�d&e8fd'��YZ;e9e;�d(e8fd)��YZ<e9e<�d*e8fd+��YZ=e9e=�d,e8fd-��YZ>e9e>�ed.�ed/�krNe=Z?e>Z@n@d0e8fd1��YZ?e9e?�d2e8fd3��YZ@e9e@�d4e8fd5��YZAe9eA�d6e8fd7��YZBe9eB�d8e8fd9��YZCe1eC�e1eB�kreBZCned/�ed:�kr,e=ZDe>ZEn@d;e8fd<��YZDe9eD�d=e8fd>��YZEe9eE�d?e8fd@��YZFeFeF_GeF_He9eF�dAe8fdB��YZIeIeI_GeI_He9eI�dCe8fdD��YZJeJeJ_GeJ_He9eJ�dEe8fdF��YZKe9eKd%�dGe8fdH��YZLeLZMe9eL�dIe8fdJ��YZNddKlmOZOmPZPmQZQdL�ZRyddMlmSZSWneTk
r�neXejdwkr�eSdNdO�n
eSdPdQ�dRe8fdS��YZUdTe8fdU��YZVddV�ZWdW�ZXdX�ZYdYeZfdZ��YZ[d[e[fd\��YZ\ejdxkr�d]e[fd^��YZ]dd_lm^Z^m8Z8d`e8fda��YZ_dbe[fdc��YZ`nddeZfde��YZaeae[�Zbeae\�Zcejdykr	e\dfdejd�Zen5ejdgkr2e\dhejfd �Zene\d�Zeejdzkr�eae]�Zgeae`�Zhejdkr�egjijjZjnegjkjjZjddilmlZlmmZmdddj�Znne1e@�e1eL�kr�e@Zoe?ZpnNe1e>�e1eL�kre>Zoe=Zpn'e1eE�e1eL�kr,eEZoeDZpnddklmqZqmrZrmsZsmtZte(eLeLeLeo�eq�Zue(eLeLe?eo�er�Zvdl�Zwewe:eLe:e:�et�Zxdm�Zyewe:eLe?�es�Zzddn�Z{yddolm|Z|WneTk
r�n%Xewe:eLe?�e|�Z}ddp�Z~ejd{krE	dq�Zdr�Z�nddsl�m�Z�m�Z�eIZ�eFZ�xke;e?e=eDgD]WZ�e1e��dkr�	e�Z�qz	e1e��dtkr�	e�Z�qz	e1e��dkrz	e�Z�qz	qz	Wxke<e@e>eEgD]WZ�e1e��dkr	
e�Z�q�	e1e��dtkr$
e�Z�q�	e1e��dkr�	e�Z�q�	q�	W[�eR�dS(|s,create and manipulate C data types in Pythoni����Ns1.1.0(tUniont	StructuretArray(t_Pointer(tCFuncPtr(t__version__(t
RTLD_LOCALtRTLD_GLOBAL(t
ArgumentError(tcalcsizesVersion number mismatchtnttce(tFormatErrortposixtdarwinit.ii(tFUNCFLAG_CDECLtFUNCFLAG_PYTHONAPItFUNCFLAG_USE_ERRNOtFUNCFLAG_USE_LASTERRORcCs�t|ttf�rT|dkr4t|�d}nt|}|�}||_|St|ttf�r�t|}|�}|St	|��dS(s�create_string_buffer(aString) -> character array
    create_string_buffer(anInteger) -> character array
    create_string_buffer(aString, anInteger) -> character array
    iN(
t
isinstancetstrtunicodetNonetlentc_chartvaluetinttlongt	TypeError(tinittsizetbuftypetbuf((s'/usr/lib64/python2.7/ctypes/__init__.pytcreate_string_buffer1s
		
	cCs
t||�S(N(R"(RR((s'/usr/lib64/python2.7/ctypes/__init__.pytc_bufferCscs�t�|jdt�r%�tO�n|jdt�rD�tO�n|rctd|j���nyt���fSWnGtk
r�dt	f���fd��Y}|t���f<|SXdS(s�CFUNCTYPE(restype, *argtypes,
                 use_errno=False, use_last_error=False) -> function prototype.

    restype: the result type
    argtypes: a sequence specifying the argument types

    The function prototype can be called in different ways to create a
    callable object:

    prototype(integer address) -> foreign function
    prototype(callable) -> create and return a C callable function from callable
    prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
    prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
    prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
    t	use_errnotuse_last_errors!unexpected keyword argument(s) %st
CFunctionTypecseZ�Z�Z�ZRS((t__name__t
__module__t
_argtypes_t	_restype_t_flags_((targtypestflagstrestype(s'/usr/lib64/python2.7/ctypes/__init__.pyR&esN(
t_FUNCFLAG_CDECLtpoptFalset_FUNCFLAG_USE_ERRNOt_FUNCFLAG_USE_LASTERRORt
ValueErrortkeyst_c_functype_cachetKeyErrort	_CFuncPtr(R.R,tkwR&((R,R-R.s'/usr/lib64/python2.7/ctypes/__init__.pyt	CFUNCTYPEKs


"(tLoadLibrary(tFUNCFLAG_STDCALLcs�t�|jdt�r%�tO�n|jdt�rD�tO�n|rctd|j���nyt���fSWnGtk
r�dt	f���fd��Y}|t���f<|SXdS(NR$R%s!unexpected keyword argument(s) %stWinFunctionTypecseZ�Z�Z�ZRS((R'R(R)R*R+((R,R-R.(s'/usr/lib64/python2.7/ctypes/__init__.pyR=�s(
t_FUNCFLAG_STDCALLR0R1R2R3R4R5t_win_functype_cacheR7R8(R.R,R9R=((R,R-R.s'/usr/lib64/python2.7/ctypes/__init__.pytWINFUNCTYPEts


"R:R@(tdlopen(tsizeoftbyreft	addressoft	alignmenttresize(t	get_errnot	set_errno(t_SimpleCDatacCsmddlm}|dkr(|j}nt|�||�}}||kritd|||f��ndS(Ni����(R	s"sizeof(%s) wrong: %d instead of %d(tstructR	Rt_type_RBtSystemError(ttypttypecodeR	tactualtrequired((s'/usr/lib64/python2.7/ctypes/__init__.pyt_check_size�st	py_objectcBseZdZd�ZRS(tOcCs=ytt|�j�SWntk
r8dt|�jSXdS(Ns
%s(<NULL>)(tsuperRRt__repr__R4ttypeR'(tself((s'/usr/lib64/python2.7/ctypes/__init__.pyRU�s
(R'R(RKRU(((s'/usr/lib64/python2.7/ctypes/__init__.pyRR�stPtc_shortcBseZdZRS(th(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRY�stc_ushortcBseZdZRS(tH(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR[�stc_longcBseZdZRS(tl(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR]�stc_ulongcBseZdZRS(tL(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR_�stiR^tc_intcBseZdZRS(Ra(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRb�stc_uintcBseZdZRS(tI(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRc�stc_floatcBseZdZRS(tf(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRe�stc_doublecBseZdZRS(td(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRg�stc_longdoublecBseZdZRS(tg(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRi�stqt
c_longlongcBseZdZRS(Rk(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRl�stc_ulonglongcBseZdZRS(tQ(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRm�stc_ubytecBseZdZRS(tB(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRo�stc_bytecBseZdZRS(tb(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRq�sRcBseZdZRS(tc(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR�stc_char_pcBs2eZdZejdkr'd�Zn	d�ZRS(tzR
cCsLtjj|d�s,d|jj|jfSd|jjt|t�jfS(Ni����s%s(%r)s%s(%s)(twindlltkernel32tIsBadStringPtrAt	__class__R'Rtcasttc_void_p(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRU�scCs d|jjt|t�jfS(Ns%s(%s)(RyR'RzR{R(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRU�s(R'R(RKt_ostnameRU(((s'/usr/lib64/python2.7/ctypes/__init__.pyRt�sR{cBseZdZRS(RX(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR{�stc_boolcBseZdZRS(t?(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR~s(tPOINTERtpointert_pointer_type_cachecCsbtj�tj�tjdkr0tj�ntjtt	�_t
jtt�_ttd<dS(NR
R(R
R(R�tclearR6R|R}R?t	c_wchar_pt
from_paramR�tc_wcharRtRR{R(((s'/usr/lib64/python2.7/ctypes/__init__.pyt_reset_caches


(tset_conversion_modetmbcstignoretasciitstrictR�cBseZdZRS(tZ(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR�sR�cBseZdZRS(tu(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR�scCs�t|ttf�rT|dkr4t|�d}nt|}|�}||_|St|ttf�r�t|}|�}|St	|��dS(s�create_unicode_buffer(aString) -> character array
        create_unicode_buffer(anInteger) -> character array
        create_unicode_buffer(aString, anInteger) -> character array
        iN(
RRRRRR�RRRR(RRR R!((s'/usr/lib64/python2.7/ctypes/__init__.pytcreate_unicode_buffer!s
		
	cCsptj|d�dk	r'td��nt|�tkrHtd��n|j|�|t|<tt|�=dS(Ns%This type already exists in the cachesWhat's this???(R�tgetRtRuntimeErrortidtset_type(R�tcls((s'/usr/lib64/python2.7/ctypes/__init__.pytSetPointerType4s

cCs||S(N((RMR((s'/usr/lib64/python2.7/ctypes/__init__.pytARRAY>stCDLLcBs\eZdZeZeZdZdZdZ
edeed�Z
d�Zd�Zd�ZRS(s�An instance of this class represents a loaded dll/shared
    library, exporting functions using the standard C calling
    convention (named 'cdecl' on Windows).

    The exported functions can be accessed as attributes, or by
    indexing with the function name.  Examples:

    <obj>.qsort -> callable object
    <obj>['qsort'] -> callable object

    Calling the functions releases the Python GIL during the call and
    reacquires it afterwards.
    s<uninitialized>ics�|�_�j�|r%�tO�n|r8�tO�ndtf��fd��Y}|�_|dkr�t�j|��_n	|�_dS(Nt_FuncPtrcseZ�Z�jZRS((R'R(R+t_func_restype_R*((R-RW(s'/usr/lib64/python2.7/ctypes/__init__.pyR�cs(	t_namet_func_flags_R2R3R8R�Rt_dlopent_handle(RWR}tmodethandleR$R%R�((R-RWs'/usr/lib64/python2.7/ctypes/__init__.pyt__init__Ys		

	cCsDd|jj|j|jtjdd@t|�tjdd@fS(Ns<%s '%s', handle %x at %x>ii(RyR'R�R�t_systmaxintR�(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRUmscCsP|jd�r-|jd�r-t|��n|j|�}t|||�|S(Nt__(t
startswithtendswithtAttributeErrort__getitem__tsetattr(RWR}tfunc((s'/usr/lib64/python2.7/ctypes/__init__.pyt__getattr__ss
cCs:|j||f�}t|ttf�s6||_n|S(N(R�RRRR'(RWtname_or_ordinalR�((s'/usr/lib64/python2.7/ctypes/__init__.pyR�zsN(R'R(t__doc__R/R�RbR�R�R�RR�tDEFAULT_MODER1R�RUR�R�(((s'/usr/lib64/python2.7/ctypes/__init__.pyR�Ds
		tPyDLLcBseZdZeeBZRS(s�This class represents the Python library itself.  It allows
    accessing Python API functions.  The GIL is not released, and
    Python exceptions are handled correctly.
    (R'R(R�R/t_FUNCFLAG_PYTHONAPIR�(((s'/usr/lib64/python2.7/ctypes/__init__.pyR��stWinDLLcBseZdZeZRS(snThis class represents a dll exporting functions using the
        Windows stdcall calling convention.
        (R'R(R�R>R�(((s'/usr/lib64/python2.7/ctypes/__init__.pyR��s(t_check_HRESULTRItHRESULTcBseZdZeZRS(R^(R'R(RKR�t_check_retval_(((s'/usr/lib64/python2.7/ctypes/__init__.pyR��s
tOleDLLcBseZdZeZeZRS(s�This class represents a dll exporting functions using the
        Windows stdcall calling convention, and returning HRESULT.
        HRESULT error values are automatically raised as WindowsError
        exceptions.
        (R'R(R�R>R�R�R�(((s'/usr/lib64/python2.7/ctypes/__init__.pyR��st
LibraryLoadercBs,eZd�Zd�Zd�Zd�ZRS(cCs
||_dS(N(t_dlltype(RWtdlltype((s'/usr/lib64/python2.7/ctypes/__init__.pyR��scCsB|ddkrt|��n|j|�}t|||�|S(Nit_(R�R�R�(RWR}tdll((s'/usr/lib64/python2.7/ctypes/__init__.pyR��s
cCs
t||�S(N(tgetattr(RWR}((s'/usr/lib64/python2.7/ctypes/__init__.pyR��scCs
|j|�S(N(R�(RWR}((s'/usr/lib64/python2.7/ctypes/__init__.pyR;�s(R'R(R�R�R�R;(((s'/usr/lib64/python2.7/ctypes/__init__.pyR��s			s
python dlltcygwinslibpython%d.%d.dll(tget_last_errortset_last_errorcCsF|dkrt�}n|dkr9t|�j�}nt||�S(N(RtGetLastErrorRtstriptWindowsError(tcodetdescr((s'/usr/lib64/python2.7/ctypes/__init__.pytWinError�s
(t
_memmove_addrt_memset_addrt_string_at_addrt
_cast_addrcs#dtf��fd��Y}|S(NR&cseZ�Z�ZeeBZRS((R'R(R)R*R/R�R+((R,R.(s'/usr/lib64/python2.7/ctypes/__init__.pyR&�s(R8(R.R,R&((R,R.s'/usr/lib64/python2.7/ctypes/__init__.pyt
PYFUNCTYPE�scCst|||�S(N(t_cast(tobjRM((s'/usr/lib64/python2.7/ctypes/__init__.pyRz�scCs
t||�S(sAstring_at(addr[, size]) -> string

    Return the string at addr.(t
_string_at(tptrR((s'/usr/lib64/python2.7/ctypes/__init__.pyt	string_at�s(t_wstring_at_addrcCs
t||�S(sFwstring_at(addr[, size]) -> string

        Return the string at addr.(t_wstring_at(R�R((s'/usr/lib64/python2.7/ctypes/__init__.pyt
wstring_atscCsNy"tdt�t�dg�}Wntk
r6dSX|j|||�SdS(Nscomtypes.server.inprocservert*i�(t
__import__tglobalstlocalstImportErrortDllGetClassObject(trclsidtriidtppvtccom((s'/usr/lib64/python2.7/ctypes/__init__.pyR�	s
"
cCsAy"tdt�t�dg�}Wntk
r6dSX|j�S(Nscomtypes.server.inprocserverR�i(R�R�R�R�tDllCanUnloadNow(R�((s'/usr/lib64/python2.7/ctypes/__init__.pyR�s
"
(tBigEndianStructuretLittleEndianStructurei(R
R(R
R(R
R(R
R(R
R(R
R(R
R(�R�tosR|tsysR�Rt_ctypesRRRRRR8t_ctypes_versionRRRRJR	t	_calcsizet	ExceptionR}RR�tplatformRtunametsplitRR/RR�RR2RR3RR"R#R6R:R;R�R<R>R?R@treplaceRARBRCRDRERFRGRHRIRQRRRYR[R]R_RbRcReRgRiRlRmRot__ctype_le__t__ctype_be__RqRRtR{tc_voidpR~R�R�R�R�R�R�R�R�R�R�R�tobjectR�R�R�R�R�R�R�tcdlltpydllt	dllhandlet	pythonapitversion_infoRvtoledllRwR�tcoredllR�R�R�tc_size_tt	c_ssize_tR�R�R�R�tmemmovetmemsetR�R�RzR�R�R�R�R�R�R�tctypes._endianR�R�tc_int8tc_uint8tkindtc_int16tc_int32tc_int64tc_uint16tc_uint32tc_uint64(((s'/usr/lib64/python2.7/ctypes/__init__.pyt<module>sJ)"	!			(




	



		







	

	
	<
				"		
			
		
wintypes.pyo000064400000013503150532450640007165 0ustar00�
{fcZ@sddlTeZeZeZeZe	Z
eZe
ZeZeZeZddlmZdefd��YZeZeZeZeZeZZeZZ e!Z"Z#Z$e!Z%Z&e'Z(Z)e*Z+Z,e-e�e-e*�kr�eZ.eZ/n'e-e�e-e*�kreZ.eZ/neZ0eZ1eZ2eZ3eZ4eZ5e*Z6e6Z7e6Z8e6Z9e6Z:e6Z;e6Z<e6Z=e6Z>e6Z?e6Z@e6ZAe6ZBe6ZCe6ZDe6ZEe6ZFe6ZGe6ZHe6ZIe6ZJe6ZKe6ZLe6ZMe6ZNe6ZOe6ZPe6ZQe6ZRe6ZSe6ZTe6ZUdeVfd��YZWeWZXZYZZdeVfd��YZ[e[Z\d	eVfd
��YZ]deVfd��YZ^e^Z_Z`Zad
eVfd��YZbebZcZdd�ZedeVfd��YZfefZgdeVfd��YZhehZidZjdeVfd��YZkdeVfd��YZlddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOddPddQddRdSdTdUdVd
dWdXdYdZd[d\dd]ddd^d_d	d`dadbdcddddedfdgdhgZZmdiS(ji����(t*(t_SimpleCDatatVARIANT_BOOLcBseZdZd�ZRS(tvcCsd|jj|jfS(Ns%s(%r)(t	__class__t__name__tvalue(tself((s'/usr/lib64/python2.7/ctypes/wintypes.pyt__repr__s(Rt
__module__t_type_R(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRstRECTcBs2eZdefdefdefdefgZRS(tleftttoptrighttbottom(RR	tc_longt_fields_(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR`s			t_SMALL_RECTcBs2eZdefdefdefdefgZRS(tLefttToptRighttBottom(RR	tc_shortR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRgs			t_COORDcBs eZdefdefgZRS(tXtY(RR	RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRns	tPOINTcBs eZdefdefgZRS(txty(RR	RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRrs	tSIZEcBs eZdefdefgZRS(tcxtcy(RR	RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRws	cCs||d>|d>S(Nii((tredtgreentblue((s'/usr/lib64/python2.7/ctypes/wintypes.pytRGB|stFILETIMEcBs eZdefdefgZRS(t
dwLowDateTimetdwHighDateTime(RR	tDWORDR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR%s	tMSGcBsDeZdefdefdefdefdefdefgZRS(thWndtmessagetwParamtlParamttimetpt(	RR	tHWNDtc_uinttWPARAMtLPARAMR(RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR)�s					itWIN32_FIND_DATAAcBspeZdefdefdefdefdefdefdefdefdeefd	ed
fg
ZRS(tdwFileAttributestftCreationTimetftLastAccessTimetftLastWriteTimet
nFileSizeHightnFileSizeLowtdwReserved0tdwReserved1t	cFileNametcAlternateFileNamei(RR	R(R%tc_chartMAX_PATHR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR4�s								
tWIN32_FIND_DATAWcBspeZdefdefdefdefdefdefdefdefdeefd	ed
fg
ZRS(R5R6R7R8R9R:R;R<R=R>i(RR	R(R%tc_wcharR@R(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRA�s								
tATOMtBOOLtBOOLEANtBYTEtCOLORREFtDOUBLER(tFLOATtHACCELtHANDLEtHBITMAPtHBRUSHtHCOLORSPACEtHDCtHDESKtHDWPtHENHMETAFILEtHFONTtHGDIOBJtHGLOBALtHHOOKtHICONt	HINSTANCEtHKEYtHKLtHLOCALtHMENUt	HMETAFILEtHMODULEtHMONITORtHPALETTEtHPENtHRGNtHRSRCtHSTRtHTASKtHWINSTAR0tINTtLANGIDt
LARGE_INTEGERtLCIDtLCTYPEtLGRPIDtLONGR3t	LPCOLESTRtLPCSTRtLPCVOIDtLPCWSTRtLPOLESTRtLPSTRtLPVOIDtLPWSTRR@tOLESTRtPOINTLtRECTLR$t	SC_HANDLEtSERVICE_STATUS_HANDLEtSHORTtSIZELt
SMALL_RECTtUINTtULARGE_INTEGERtULONGtUSHORTtWCHARtWORDR2t	_FILETIMEt_LARGE_INTEGERt_POINTLt_RECTLt_ULARGE_INTEGERttagMSGttagPOINTttagRECTttagSIZEN(ntctypestc_byteRFtc_ushortR�tc_ulongR(RBR�R1R~tc_intRgtc_doubleRHtc_floatRIRERRDRRR�RmR�RR{t
c_longlongR�Ritc_ulonglongR�Rt	c_wchar_pRnRrRvRqRutc_char_pRoRstc_void_pRpRttsizeofR2R3RCRhRGRlRkRjRKRJRLRMRNRORPRQRRRSRTRURVRWRXRYRZR[R\R]R^R_R`RaRbRcRdReRfR0RyRzt	StructureRR�R�RxRR}RRR�R�RwRR�R|R$R%R�R)R�R@R4RAt__all__(((s'/usr/lib64/python2.7/ctypes/wintypes.pyt<module>s�





		
	util.pyc000064400000020547150532450640006252 0ustar00�
{fc@s�ddlZddlZddlZejdkrQd�Zd�Zd�Znejdkrld�Znejdkr�ejd	kr�dd
lm	Z
d�Zn�ejdkr�ddlZddlZddl
Z
d�Zejd
kr�d�Zn	d�Zejjd�s<ejjd�s<ejjd�rQd�Zd�Zq�ejd
krxd�Zed�Zq�d�Zd�Znd�Zedkr�e�ndS(i����NtntcCs�d}tjj|�}|dkr(dS|t|�}tj|jdd�\}}t|d �d}t|dd!�d	}|dkr�d
}n|dkr�||SdS(s�Return the version of MSVC that was used to build Python.

        For Python 2.3 and up, the version number is included in
        sys.version.  For earlier versions, assume the compiler is MSVC 6.
        sMSC v.i����it ii����iig$@iN(tsystversiontfindtlentsplittinttNone(tprefixtitstresttmajorVersiontminorVersion((s#/usr/lib64/python2.7/ctypes/util.pyt_get_build_versions	cCswt�}|dkrdS|dkr.d}nd|d}ddl}|j�dddkro|d	7}n|d
S(s%Return the name of the VC runtime dllitmsvcrtsmsvcr%di
i����Nis_d.pydtds.dll(RRtimptget_suffixes(RtclibnameR((s#/usr/lib64/python2.7/ctypes/util.pytfind_msvcrts		
cCs�|dkrt�Sx�tjdjtj�D]l}tjj||�}tjj|�r^|S|j�j	d�ryq-n|d}tjj|�r-|Sq-WdS(NtctmtPATHs.dll(RR(RtostenvironRtpathseptpathtjointisfiletlowertendswithR(tnamet	directorytfname((s#/usr/lib64/python2.7/ctypes/util.pytfind_library0s 
tcecCs|S(N((R!((s#/usr/lib64/python2.7/ctypes/util.pyR$Fstposixtdarwin(t	dyld_findcCs[d|d|d||fg}x3|D]+}yt|�SWq(tk
rRq(q(Xq(WdS(Nslib%s.dylibs%s.dylibs%s.framework/%s(t
_dyld_findt
ValueErrorR(R!tpossible((s#/usr/lib64/python2.7/ctypes/util.pyR$Ks

c	Cs�dtj|�}d}tj�}zCtj|d||jfdtdtj�}|j	�\}}Wdy|j
�Wn+tk
r�}|jtj
kr��q�nXXtj||�}|s�dS|jd�S(Ns[^\(\)\s]*lib%s\.[^\(\)\s]*s�if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit; fi;LANG=C LC_ALL=C $CC -Wl,-t -o "$2" 2>&1 -l"$1"t_findLib_gcctshelltstdouti(tretescapettempfiletNamedTemporaryFilet
subprocesstPopenR!tTruetPIPEtcommunicatetclosetOSErrorterrnotENOENTtsearchRtgroup(	R!texprtcmdttemptprocttracet_tetres((s#/usr/lib64/python2.7/ctypes/util.pyR,Zs"tsunos5c
Cs�|s
dSttjd�}y8|�,tjdd|fdtjd|�}WdQXWntk
rhdSX|j�\}}t	j
d|�}|s�dS|jd�S(Ntwbs/usr/ccs/bin/dumps-LpvR.tstderrs\[.*\]\sSONAME\s+([^\s]+)i(RtopenRtdevnullR3R4R6R9R7R/R<R=(tftnullRAtdataRCRE((s#/usr/lib64/python2.7/ctypes/util.pyt_get_sonameys	
cCs�|s
dSd}tj|d|fdtdtj�}|j�\}}|jdkrhtjj	|�St
jd|�}|s�dS|jd�S(Ns[if ! type objdump >/dev/null 2>&1; then exit 10; fi;objdump -p -j .dynamic 2>/dev/null "$1"RNR-R.i
s\sSONAME\s+([^\s]+)i(
RR3R4R5R6R7t
returncodeRRtbasenameR/R<R=(RKR?RAtdumpRCRE((s#/usr/lib64/python2.7/ctypes/util.pyRN�stfreebsdtopenbsdt	dragonflycCsf|jd�}g}y-x&|r@|jdt|j���qWWntk
rUnX|petjgS(Nt.i(RtinsertRtpopR*Rtmaxint(tlibnametpartstnums((s#/usr/lib64/python2.7/ctypes/util.pyt_num_version�s	$
c
Cs�tj|�}d||f}ttjd�}y/|�#tjd
dtjd|�}WdQXWntk
ryd}nX|j	�\}}tj
||�}|s�tt|��S|j
dt�|d	S(Ns:-l%s\.\S+ => \S*/(lib%s\.\S+)RGs/sbin/ldconfigs-rR.RHttkeyi����(s/sbin/ldconfigs-r(R/R0RIRRJR3R4R6R9R7tfindallRNR,tsortR\(R!tenameR>RLRARMRCRE((s#/usr/lib64/python2.7/ctypes/util.pyR$�s 	

c
Cs^tjjd�sdSttj�}d|d<|r>d
}nd}d}ttjd�}y5|�)tj	|dtj
d|d|�}WdQXWntk
r�dSXzFx?|jD]4}|j
�}|jd	�r�|j�d
}q�q�WWd|jj�|j�X|sdSxF|jd�D]5}tjj|d|�}	tjj|	�r!|	Sq!WdS(Ns
/usr/bin/crletCtLC_ALLs-64RGR.RHtenvsDefault Library Path (ELF):it:slib%s.so(s
/usr/bin/crles-64(s
/usr/bin/crle(RRtexistsRtdictRRIRJR3R4R6R9R.tstript
startswithRR8twaitR(
R!tis64RdtargstpathsRLRAtlinetdirtlibfile((s#/usr/lib64/python2.7/ctypes/util.pyt
_findLib_crle�s>
		

cCstt||�pt|��S(N(RNRqR,(R!Rk((s#/usr/lib64/python2.7/ctypes/util.pyR$�scCs`ddl}|jd�dkr8tj�dd}ntj�dd}idd6dd	6dd
6dd6dd
6}|j|d�}dtj|�|f}ttj�}d|d<d|d<t	tj
d�}y;|�/tjddgd|dtj
d|�}WdQXWntk
r$dSX|j�\}	}
tj||	�}|sSdS|jd�S(Ni����tlis-32s-64slibc6,x86-64s	x86_64-64slibc6,64bitsppc64-64s
sparc64-64ss390x-64slibc6,IA-64sia64-64tlibc6s\s+(lib%s\.[^\s]+)\s+\(%sRbRctLANGRGs/sbin/ldconfigs-pRHR.Rdi(tstructtcalcsizeRtunametgetR/R0RgRRIRJR3R4R6R9RR7R<R=(R!Rutmachinetmach_maptabi_typeR>RdRLtpRMRCRE((s#/usr/lib64/python2.7/ctypes/util.pyt_findSoname_ldconfig�s:


	
cCst|�ptt|��S(N(R}RNR,(R!((s#/usr/lib64/python2.7/ctypes/util.pyR$scCs�ddlm}tjdkrC|jGH|jd�GHtd�GHntjdkr�td�GHtd�GHtd�GHtjd	kr�|j	d
�GH|j	d�GH|j	d�GH|j	d
�GHq�|j	d�GH|j	d�GHtd�GHndS(Ni����(tcdllRRR&RRtbz2R's
libm.dylibslibcrypto.dylibslibSystem.dylibsSystem.framework/Systemslibm.soslibcrypt.sotcrypt(
tctypesR~RR!RtloadR$RtplatformtLoadLibrary(R~((s#/usr/lib64/python2.7/ctypes/util.pyttests"t__main__(RR3RR!RRR$R�tctypes.macholib.dyldR(R)R/R1R:R,RNRiR\RqtFalseR}R�t__name__(((s#/usr/lib64/python2.7/ctypes/util.pyt<module>s<		$				)	$	_aix.py000064400000030427150532450670006053 0ustar00"""
Lib/ctypes.util.find_library() support for AIX
Similar approach as done for Darwin support by using separate files
but unlike Darwin - no extension such as ctypes.macholib.*

dlopen() is an interface to AIX initAndLoad() - primary documentation at:
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/dlopen.htm
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/load.htm

AIX supports two styles for dlopen(): svr4 (System V Release 4) which is common on posix
platforms, but also a BSD style - aka SVR3.

From AIX 5.3 Difference Addendum (December 2004)
2.9 SVR4 linking affinity
Nowadays, there are two major object file formats used by the operating systems:
XCOFF: The COFF enhanced by IBM and others. The original COFF (Common
Object File Format) was the base of SVR3 and BSD 4.2 systems.
ELF:   Executable and Linking Format that was developed by AT&T and is a
base for SVR4 UNIX.

While the shared library content is identical on AIX - one is located as a filepath name
(svr4 style) and the other is located as a member of an archive (and the archive
is located as a filepath name).

The key difference arises when supporting multiple abi formats (i.e., 32 and 64 bit).
For svr4 either only one ABI is supported, or there are two directories, or there
are different file names. The most common solution for multiple ABI is multiple
directories.

For the XCOFF (aka AIX) style - one directory (one archive file) is sufficient
as multiple shared libraries can be in the archive - even sharing the same name.
In documentation the archive is also referred to as the "base" and the shared
library object is referred to as the "member".

For dlopen() on AIX (read initAndLoad()) the calls are similar.
Default activity occurs when no path information is provided. When path
information is provided dlopen() does not search any other directories.

For SVR4 - the shared library name is the name of the file expected: libFOO.so
For AIX - the shared library is expressed as base(member). The search is for the
base (e.g., libFOO.a) and once the base is found the shared library - identified by
member (e.g., libFOO.so, or shr.o) is located and loaded.

The mode bit RTLD_MEMBER tells initAndLoad() that it needs to use the AIX (SVR3)
naming style.
"""
__author__ = "Michael Felt <aixtools@felt.demon.nl>"

import re
from os import environ, path
from sys import executable
from ctypes import c_void_p, sizeof
from subprocess import Popen, PIPE, DEVNULL

# Executable bit size - 32 or 64
# Used to filter the search in an archive by size, e.g., -X64
AIX_ABI = sizeof(c_void_p) * 8


from sys import maxsize
def _last_version(libnames, sep):
    def _num_version(libname):
        # "libxyz.so.MAJOR.MINOR" => [MAJOR, MINOR]
        parts = libname.split(sep)
        nums = []
        try:
            while parts:
                nums.insert(0, int(parts.pop()))
        except ValueError:
            pass
        return nums or [maxsize]
    return max(reversed(libnames), key=_num_version)

def get_ld_header(p):
    # "nested-function, but placed at module level
    ld_header = None
    for line in p.stdout:
        if line.startswith(('/', './', '../')):
            ld_header = line
        elif "INDEX" in line:
            return ld_header.rstrip('\n')
    return None

def get_ld_header_info(p):
    # "nested-function, but placed at module level
    # as an ld_header was found, return known paths, archives and members
    # these lines start with a digit
    info = []
    for line in p.stdout:
        if re.match("[0-9]", line):
            info.append(line)
        else:
            # blank line (separator), consume line and end for loop
            break
    return info

def get_ld_headers(file):
    """
    Parse the header of the loader section of executable and archives
    This function calls /usr/bin/dump -H as a subprocess
    and returns a list of (ld_header, ld_header_info) tuples.
    """
    # get_ld_headers parsing:
    # 1. Find a line that starts with /, ./, or ../ - set as ld_header
    # 2. If "INDEX" in occurs in a following line - return ld_header
    # 3. get info (lines starting with [0-9])
    ldr_headers = []
    p = Popen(["/usr/bin/dump", f"-X{AIX_ABI}", "-H", file],
        universal_newlines=True, stdout=PIPE, stderr=DEVNULL)
    # be sure to read to the end-of-file - getting all entries
    while True:
        ld_header = get_ld_header(p)
        if ld_header:
            ldr_headers.append((ld_header, get_ld_header_info(p)))
        else:
            break
    p.stdout.close()
    p.wait()
    return ldr_headers

def get_shared(ld_headers):
    """
    extract the shareable objects from ld_headers
    character "[" is used to strip off the path information.
    Note: the "[" and "]" characters that are part of dump -H output
    are not removed here.
    """
    shared = []
    for (line, _) in ld_headers:
        # potential member lines contain "["
        # otherwise, no processing needed
        if "[" in line:
            # Strip off trailing colon (:)
            shared.append(line[line.index("["):-1])
    return shared

def get_one_match(expr, lines):
    """
    Must be only one match, otherwise result is None.
    When there is a match, strip leading "[" and trailing "]"
    """
    # member names in the ld_headers output are between square brackets
    expr = rf'\[({expr})\]'
    matches = list(filter(None, (re.search(expr, line) for line in lines)))
    if len(matches) == 1:
        return matches[0].group(1)
    else:
        return None

# additional processing to deal with AIX legacy names for 64-bit members
def get_legacy(members):
    """
    This routine provides historical aka legacy naming schemes started
    in AIX4 shared library support for library members names.
    e.g., in /usr/lib/libc.a the member name shr.o for 32-bit binary and
    shr_64.o for 64-bit binary.
    """
    if AIX_ABI == 64:
        # AIX 64-bit member is one of shr64.o, shr_64.o, or shr4_64.o
        expr = r'shr4?_?64\.o'
        member = get_one_match(expr, members)
        if member:
            return member
    else:
        # 32-bit legacy names - both shr.o and shr4.o exist.
        # shr.o is the preffered name so we look for shr.o first
        #  i.e., shr4.o is returned only when shr.o does not exist
        for name in ['shr.o', 'shr4.o']:
            member = get_one_match(re.escape(name), members)
            if member:
                return member
    return None

def get_version(name, members):
    """
    Sort list of members and return highest numbered version - if it exists.
    This function is called when an unversioned libFOO.a(libFOO.so) has
    not been found.

    Versioning for the member name is expected to follow
    GNU LIBTOOL conventions: the highest version (x, then X.y, then X.Y.z)
     * find [libFoo.so.X]
     * find [libFoo.so.X.Y]
     * find [libFoo.so.X.Y.Z]

    Before the GNU convention became the standard scheme regardless of
    binary size AIX packagers used GNU convention "as-is" for 32-bit
    archive members but used an "distinguishing" name for 64-bit members.
    This scheme inserted either 64 or _64 between libFOO and .so
    - generally libFOO_64.so, but occasionally libFOO64.so
    """
    # the expression ending for versions must start as
    # '.so.[0-9]', i.e., *.so.[at least one digit]
    # while multiple, more specific expressions could be specified
    # to search for .so.X, .so.X.Y and .so.X.Y.Z
    # after the first required 'dot' digit
    # any combination of additional 'dot' digits pairs are accepted
    # anything more than libFOO.so.digits.digits.digits
    # should be seen as a member name outside normal expectations
    exprs = [rf'lib{name}\.so\.[0-9]+[0-9.]*',
        rf'lib{name}_?64\.so\.[0-9]+[0-9.]*']
    for expr in exprs:
        versions = []
        for line in members:
            m = re.search(expr, line)
            if m:
                versions.append(m.group(0))
        if versions:
            return _last_version(versions, '.')
    return None

def get_member(name, members):
    """
    Return an archive member matching the request in name.
    Name is the library name without any prefix like lib, suffix like .so,
    or version number.
    Given a list of members find and return the most appropriate result
    Priority is given to generic libXXX.so, then a versioned libXXX.so.a.b.c
    and finally, legacy AIX naming scheme.
    """
    # look first for a generic match - prepend lib and append .so
    expr = rf'lib{name}\.so'
    member = get_one_match(expr, members)
    if member:
        return member
    elif AIX_ABI == 64:
        expr = rf'lib{name}64\.so'
        member = get_one_match(expr, members)
    if member:
        return member
    # since an exact match with .so as suffix was not found
    # look for a versioned name
    # If a versioned name is not found, look for AIX legacy member name
    member = get_version(name, members)
    if member:
        return member
    else:
        return get_legacy(members)

def get_libpaths():
    """
    On AIX, the buildtime searchpath is stored in the executable.
    as "loader header information".
    The command /usr/bin/dump -H extracts this info.
    Prefix searched libraries with LD_LIBRARY_PATH (preferred),
    or LIBPATH if defined. These paths are appended to the paths
    to libraries the python executable is linked with.
    This mimics AIX dlopen() behavior.
    """
    libpaths = environ.get("LD_LIBRARY_PATH")
    if libpaths is None:
        libpaths = environ.get("LIBPATH")
    if libpaths is None:
        libpaths = []
    else:
        libpaths = libpaths.split(":")
    objects = get_ld_headers(executable)
    for (_, lines) in objects:
        for line in lines:
            # the second (optional) argument is PATH if it includes a /
            path = line.split()[1]
            if "/" in path:
                libpaths.extend(path.split(":"))
    return libpaths

def find_shared(paths, name):
    """
    paths is a list of directories to search for an archive.
    name is the abbreviated name given to find_library().
    Process: search "paths" for archive, and if an archive is found
    return the result of get_member().
    If an archive is not found then return None
    """
    for dir in paths:
        # /lib is a symbolic link to /usr/lib, skip it
        if dir == "/lib":
            continue
        # "lib" is prefixed to emulate compiler name resolution,
        # e.g., -lc to libc
        base = f'lib{name}.a'
        archive = path.join(dir, base)
        if path.exists(archive):
            members = get_shared(get_ld_headers(archive))
            member = get_member(re.escape(name), members)
            if member != None:
                return (base, member)
            else:
                return (None, None)
    return (None, None)

def find_library(name):
    """AIX implementation of ctypes.util.find_library()
    Find an archive member that will dlopen(). If not available,
    also search for a file (or link) with a .so suffix.

    AIX supports two types of schemes that can be used with dlopen().
    The so-called SystemV Release4 (svr4) format is commonly suffixed
    with .so while the (default) AIX scheme has the library (archive)
    ending with the suffix .a
    As an archive has multiple members (e.g., 32-bit and 64-bit) in one file
    the argument passed to dlopen must include both the library and
    the member names in a single string.

    find_library() looks first for an archive (.a) with a suitable member.
    If no archive+member pair is found, look for a .so file.
    """

    libpaths = get_libpaths()
    (base, member) = find_shared(libpaths, name)
    if base != None:
        return f"{base}({member})"

    # To get here, a member in an archive has not been found
    # In other words, either:
    # a) a .a file was not found
    # b) a .a file did not have a suitable member
    # So, look for a .so file
    # Check libpaths for .so file
    # Note, the installation must prepare a link from a .so
    # to a versioned file
    # This is common practice by GNU libtool on other platforms
    soname = f"lib{name}.so"
    for dir in libpaths:
        # /lib is a symbolic link to /usr/lib, skip it
        if dir == "/lib":
            continue
        shlib = path.join(dir, soname)
        if path.exists(shlib):
            return soname
    # if we are here, we have not found anything plausible
    return None
macholib/__pycache__/dylib.cpython-38.opt-1.pyc000064400000002701150532450670015233 0ustar00U

e5d$�@s>dZddlZdgZe�d�Zdd�Zdd�Zedkr:e�dS)	z!
Generic dylib path manipulation
�N�
dylib_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
cCst�|�}|sdS|��S)a1
    A dylib name can take one of the following four forms:
        Location/Name.SomeVersion_Suffix.dylib
        Location/Name.SomeVersion.dylib
        Location/Name_Suffix.dylib
        Location/Name.dylib

    returns None if not found or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.SomeVersion_Suffix.dylib',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present.
    N)�DYLIB_RE�match�	groupdict)�filenameZis_dylib�r�-/usr/lib64/python3.8/ctypes/macholib/dylib.pyrs
cCsddd�}dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d.s�ztest_dylib_info.<locals>.d)NNNNNr)rrrr�test_dylib_info-s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>s

macholib/__pycache__/dyld.cpython-38.pyc000064400000011074150532450670014130 0ustar00U

e5d��@s dZddlZddlmZddlmZddlTzddlmZWne	k
rXdd�ZYnXd	d
ddgZ
ej�d
�dddgZ
ej�d�dddgZdd�Zd.dd�Zd/dd�Zd0dd�Zd1dd�Zd2dd �Zd3d!d"�Zd4d#d$�Zd5d%d&�Zd6d'd(�Zd7d)d	�Zd8d*d
�Zd+d,�Zed-k�re�dS)9z
dyld emulation
�N)�framework_info)�
dylib_info)�*)� _dyld_shared_cache_contains_pathcGst�dS)N)�NotImplementedError)�args�r�,/usr/lib64/python3.8/ctypes/macholib/dyld.pyrsr�	dyld_find�framework_findrrz~/Library/Frameworksz/Library/Frameworksz/Network/Library/Frameworksz/System/Library/Frameworksz~/libz/usr/local/libz/libz/usr/libcCs.|dkrtj}|�|�}|dkr$gS|�d�S)N�:)�os�environ�get�split)�env�varZrvalrrr	�dyld_env$s
rcCs|dkrtj}|�d�S)NZDYLD_IMAGE_SUFFIX)r
rr�rrrr	�dyld_image_suffix,srcCs
t|d�S)NZDYLD_FRAMEWORK_PATH�rrrrr	�dyld_framework_path1srcCs
t|d�S)NZDYLD_LIBRARY_PATHrrrrr	�dyld_library_path4srcCs
t|d�S)NZDYLD_FALLBACK_FRAMEWORK_PATHrrrrr	�dyld_fallback_framework_path7srcCs
t|d�S)NZDYLD_FALLBACK_LIBRARY_PATHrrrrr	�dyld_fallback_library_path:srcCs(t|�}|dkr|S||fdd�}|�S)z>For a potential path iterator, add DYLD_IMAGE_SUFFIX semanticsNcssF|D]<}|�d�r0|dtd��|dVn
||V|VqdS)Nz.dylib)�endswith�len)�iterator�suffix�pathrrr	�_injectBs


z)dyld_image_suffix_search.<locals>._inject)r)rrrr rrr	�dyld_image_suffix_search=s
r!ccs\t|�}|dk	r2t|�D]}tj�||d�Vqt|�D]}tj�|tj�|��Vq:dS�N�name)rrr
r�joinr�basename)r#r�	frameworkrrrr	�dyld_override_searchKsr'ccs2|�d�r.|dk	r.tj�||td�d��VdS)Nz@executable_path/)�
startswithr
rr$r)r#�executable_pathrrr	�dyld_executable_path_search\sr*ccs�|Vt|�}|dk	r<t|�}|D]}tj�||d�Vq"t|�}|D]}tj�|tj�|��VqH|dk	r�|s�tD]}tj�||d�Vqv|s�tD]}tj�|tj�|��Vq�dSr")	rrr
rr$rr%�DEFAULT_FRAMEWORK_FALLBACK�DEFAULT_LIBRARY_FALLBACK)r#rr&Zfallback_framework_pathrZfallback_library_pathrrr	�dyld_default_searchcsr-c	Cs|ttt||�t||�t||��|�D]D}tj�|�r<|Szt|�rP|WSWq$t	k
rfYq$Xq$t
d|f��dS)z:
    Find a library or framework using dyld semantics
    zdylib %s could not be foundN)r!�chainr'r*r-r
r�isfilerr�
ValueError)r#r)rrrrr	r
ys��c
Cs�d}zt|||d�WStk
r:}z|}W5d}~XYnX|�d�}|dkr^t|�}|d7}tj�|tj�|d|���}z2zt|||d�WW�Stk
r�|�YnXW5d}XdS)z�
    Find a framework using dyld semantics in a very loose manner.

    Will take input such as:
        Python
        Python.framework
        Python.framework/Versions/Current
    N)r)rz
.framework���)r
r0�rfindrr
rr$r%)�fnr)r�error�eZ
fmwk_indexrrr	r�s	
cCs(i}td�dkst�td�dks$t�dS)NzlibSystem.dylibz/usr/lib/libSystem.dylibzSystem.framework/Systemz2/System/Library/Frameworks/System.framework/System)r
�AssertionErrorrrrr	�test_dyld_find�sr7�__main__)N)N)N)N)N)N)N)N)N)NN)NN)�__doc__r
Zctypes.macholib.frameworkrZctypes.macholib.dylibr�	itertoolsZ_ctypesr�ImportError�__all__r�
expanduserr+r,rrrrrrr!r'r*r-r
rr7�__name__rrrr	�<module>sL�
�
�











macholib/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000236150532450670015671 0ustar00U

e5d��@sdZdS)z1.0N)�__version__�rr�0/usr/lib64/python3.8/ctypes/macholib/__init__.py�<module>	�macholib/__pycache__/framework.cpython-38.opt-2.pyc000064400000001617150532450670016133 0ustar00U

e5d��@s:ddlZdgZe�d�Zdd�Zdd�Zedkr6e�dS)�N�framework_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
cCst�|�}|sdS|��S)N)�STRICT_FRAMEWORK_RE�match�	groupdict)�filenameZis_framework�r�1/usr/lib64/python3.8/ctypes/macholib/framework.pyrs
cCsddd�}dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d-s�ztest_framework_info.<locals>.d)NNNNNr)rrrr�test_framework_info,s
r�__main__)�re�__all__�compilerrr�__name__rrrr�<module>s

macholib/__pycache__/dylib.cpython-38.pyc000064400000003576150532450670014307 0ustar00U

e5d$�@s>dZddlZdgZe�d�Zdd�Zdd�Zedkr:e�dS)	z!
Generic dylib path manipulation
�N�
dylib_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
cCst�|�}|sdS|��S)a1
    A dylib name can take one of the following four forms:
        Location/Name.SomeVersion_Suffix.dylib
        Location/Name.SomeVersion.dylib
        Location/Name_Suffix.dylib
        Location/Name.dylib

    returns None if not found or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.SomeVersion_Suffix.dylib',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present.
    N)�DYLIB_RE�match�	groupdict)�filenameZis_dylib�r�-/usr/lib64/python3.8/ctypes/macholib/dylib.pyrs
cCs�ddd�}td�dkst�td�dks*t�td�|ddd�ksBt�td	�|dd
ddd�ks^t�td
�|dddd�ksxt�td�|dddd�ks�t�td�|ddddd�ks�t�dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d.s�ztest_dylib_info.<locals>.dzcompletely/invalidzcompletely/invalide_debugzP/Foo.dylib�Pz	Foo.dylibZFoozP/Foo_debug.dylibzFoo_debug.dylib�debug)r
z
P/Foo.A.dylibzFoo.A.dylib�AzP/Foo_debug.A.dylibzFoo_debug.A.dylibZ	Foo_debugzP/Foo.A_debug.dylibzFoo.A_debug.dylib)NNNNN)r�AssertionError)rrrr�test_dylib_info-s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>s

macholib/__pycache__/dyld.cpython-38.opt-2.pyc000064400000010074150532450670015067 0ustar00U

e5d��@sddlZddlmZddlmZddlTzddlmZWnek
rTdd�ZYnXdd	d
dgZ	ej
�d�d
ddgZej
�d�dddgZ
dd�Zd-dd�Zd.dd�Zd/dd�Zd0dd�Zd1dd�Zd2d d!�Zd3d"d#�Zd4d$d%�Zd5d&d'�Zd6d(d�Zd7d)d	�Zd*d+�Zed,k�re�dS)8�N)�framework_info)�
dylib_info)�*)� _dyld_shared_cache_contains_pathcGst�dS�N)�NotImplementedError)�args�r	�,/usr/lib64/python3.8/ctypes/macholib/dyld.pyrsr�	dyld_find�framework_findrrz~/Library/Frameworksz/Library/Frameworksz/Network/Library/Frameworksz/System/Library/Frameworksz~/libz/usr/local/libz/libz/usr/libcCs.|dkrtj}|�|�}|dkr$gS|�d�S)N�:)�os�environ�get�split)�env�varZrvalr	r	r
�dyld_env$s
rcCs|dkrtj}|�d�S)NZDYLD_IMAGE_SUFFIX)rrr�rr	r	r
�dyld_image_suffix,srcCs
t|d�S)NZDYLD_FRAMEWORK_PATH�rrr	r	r
�dyld_framework_path1srcCs
t|d�S)NZDYLD_LIBRARY_PATHrrr	r	r
�dyld_library_path4srcCs
t|d�S)NZDYLD_FALLBACK_FRAMEWORK_PATHrrr	r	r
�dyld_fallback_framework_path7srcCs
t|d�S)NZDYLD_FALLBACK_LIBRARY_PATHrrr	r	r
�dyld_fallback_library_path:srcCs(t|�}|dkr|S||fdd�}|�S)NcssF|D]<}|�d�r0|dtd��|dVn
||V|VqdS)Nz.dylib)�endswith�len)�iterator�suffix�pathr	r	r
�_injectBs


z)dyld_image_suffix_search.<locals>._inject)r)rrrr!r	r	r
�dyld_image_suffix_search=s
r"ccs\t|�}|dk	r2t|�D]}tj�||d�Vqt|�D]}tj�|tj�|��Vq:dS�N�name)rrrr �joinr�basename)r$r�	frameworkr r	r	r
�dyld_override_searchKsr(ccs2|�d�r.|dk	r.tj�||td�d��VdS)Nz@executable_path/)�
startswithrr r%r)r$�executable_pathr	r	r
�dyld_executable_path_search\sr+ccs�|Vt|�}|dk	r<t|�}|D]}tj�||d�Vq"t|�}|D]}tj�|tj�|��VqH|dk	r�|s�tD]}tj�||d�Vqv|s�tD]}tj�|tj�|��Vq�dSr#)	rrrr r%rr&�DEFAULT_FRAMEWORK_FALLBACK�DEFAULT_LIBRARY_FALLBACK)r$rr'Zfallback_framework_pathr Zfallback_library_pathr	r	r
�dyld_default_searchcsr.c	Cs|ttt||�t||�t||��|�D]D}tj�|�r<|Szt|�rP|WSWq$t	k
rfYq$Xq$t
d|f��dS)Nzdylib %s could not be found)r"�chainr(r+r.rr �isfilerr�
ValueError)r$r*rr r	r	r
rys��c
Cs�d}zt|||d�WStk
r:}z|}W5d}~XYnX|�d�}|dkr^t|�}|d7}tj�|tj�|d|���}z2zt|||d�WW�Stk
r�|�YnXW5d}XdS)N)r*rz
.framework���)rr1�rfindrrr r%r&)�fnr*r�error�eZ
fmwk_indexr	r	r
r�s	
cCsi}dSrr	rr	r	r
�test_dyld_find�sr7�__main__)N)N)N)N)N)N)N)N)N)NN)NN)rZctypes.macholib.frameworkrZctypes.macholib.dylibr�	itertoolsZ_ctypesr�ImportError�__all__r �
expanduserr,r-rrrrrrr"r(r+r.rrr7�__name__r	r	r	r
�<module>sJ�
�
�











macholib/__pycache__/dyld.cpython-38.opt-1.pyc000064400000010622150532450670015065 0ustar00U

e5d��@s dZddlZddlmZddlmZddlTzddlmZWne	k
rXdd�ZYnXd	d
ddgZ
ej�d
�dddgZ
ej�d�dddgZdd�Zd.dd�Zd/dd�Zd0dd�Zd1dd�Zd2dd �Zd3d!d"�Zd4d#d$�Zd5d%d&�Zd6d'd(�Zd7d)d	�Zd8d*d
�Zd+d,�Zed-k�re�dS)9z
dyld emulation
�N)�framework_info)�
dylib_info)�*)� _dyld_shared_cache_contains_pathcGst�dS�N)�NotImplementedError)�args�r	�,/usr/lib64/python3.8/ctypes/macholib/dyld.pyrsr�	dyld_find�framework_findrrz~/Library/Frameworksz/Library/Frameworksz/Network/Library/Frameworksz/System/Library/Frameworksz~/libz/usr/local/libz/libz/usr/libcCs.|dkrtj}|�|�}|dkr$gS|�d�S)N�:)�os�environ�get�split)�env�varZrvalr	r	r
�dyld_env$s
rcCs|dkrtj}|�d�S)NZDYLD_IMAGE_SUFFIX)rrr�rr	r	r
�dyld_image_suffix,srcCs
t|d�S)NZDYLD_FRAMEWORK_PATH�rrr	r	r
�dyld_framework_path1srcCs
t|d�S)NZDYLD_LIBRARY_PATHrrr	r	r
�dyld_library_path4srcCs
t|d�S)NZDYLD_FALLBACK_FRAMEWORK_PATHrrr	r	r
�dyld_fallback_framework_path7srcCs
t|d�S)NZDYLD_FALLBACK_LIBRARY_PATHrrr	r	r
�dyld_fallback_library_path:srcCs(t|�}|dkr|S||fdd�}|�S)z>For a potential path iterator, add DYLD_IMAGE_SUFFIX semanticsNcssF|D]<}|�d�r0|dtd��|dVn
||V|VqdS)Nz.dylib)�endswith�len)�iterator�suffix�pathr	r	r
�_injectBs


z)dyld_image_suffix_search.<locals>._inject)r)rrrr!r	r	r
�dyld_image_suffix_search=s
r"ccs\t|�}|dk	r2t|�D]}tj�||d�Vqt|�D]}tj�|tj�|��Vq:dS�N�name)rrrr �joinr�basename)r$r�	frameworkr r	r	r
�dyld_override_searchKsr(ccs2|�d�r.|dk	r.tj�||td�d��VdS)Nz@executable_path/)�
startswithrr r%r)r$�executable_pathr	r	r
�dyld_executable_path_search\sr+ccs�|Vt|�}|dk	r<t|�}|D]}tj�||d�Vq"t|�}|D]}tj�|tj�|��VqH|dk	r�|s�tD]}tj�||d�Vqv|s�tD]}tj�|tj�|��Vq�dSr#)	rrrr r%rr&�DEFAULT_FRAMEWORK_FALLBACK�DEFAULT_LIBRARY_FALLBACK)r$rr'Zfallback_framework_pathr Zfallback_library_pathr	r	r
�dyld_default_searchcsr.c	Cs|ttt||�t||�t||��|�D]D}tj�|�r<|Szt|�rP|WSWq$t	k
rfYq$Xq$t
d|f��dS)z:
    Find a library or framework using dyld semantics
    zdylib %s could not be foundN)r"�chainr(r+r.rr �isfilerr�
ValueError)r$r*rr r	r	r
rys��c
Cs�d}zt|||d�WStk
r:}z|}W5d}~XYnX|�d�}|dkr^t|�}|d7}tj�|tj�|d|���}z2zt|||d�WW�Stk
r�|�YnXW5d}XdS)z�
    Find a framework using dyld semantics in a very loose manner.

    Will take input such as:
        Python
        Python.framework
        Python.framework/Versions/Current
    N)r*rz
.framework���)rr1�rfindrrr r%r&)�fnr*r�error�eZ
fmwk_indexr	r	r
r�s	
cCsi}dSrr	rr	r	r
�test_dyld_find�sr7�__main__)N)N)N)N)N)N)N)N)N)NN)NN)�__doc__rZctypes.macholib.frameworkrZctypes.macholib.dylibr�	itertoolsZ_ctypesr�ImportError�__all__r �
expanduserr,r-rrrrrrr"r(r+r.rrr7�__name__r	r	r	r
�<module>sL�
�
�











macholib/__pycache__/framework.cpython-38.pyc000064400000004226150532450670015172 0ustar00U

e5d��@s>dZddlZdgZe�d�Zdd�Zdd�Zedkr:e�dS)	z%
Generic framework path manipulation
�N�framework_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
cCst�|�}|sdS|��S)a}
    A framework name can take one of the following four forms:
        Location/Name.framework/Versions/SomeVersion/Name_Suffix
        Location/Name.framework/Versions/SomeVersion/Name
        Location/Name.framework/Name_Suffix
        Location/Name.framework/Name

    returns None if not found, or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.framework/Versions/SomeVersion/Name_Suffix',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present
    N)�STRICT_FRAMEWORK_RE�match�	groupdict)�filenameZis_framework�r�1/usr/lib64/python3.8/ctypes/macholib/framework.pyrs
cCs�ddd�}td�dkst�td�dks*t�td�dks:t�td�dksJt�td�|dd	d
�ksbt�td�|ddd
d
d�ks~t�td�dks�t�td�dks�t�td�|ddd
d�ks�t�td�|ddd
dd
�ks�t�dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d-s�ztest_framework_info.<locals>.dzcompletely/invalidzcompletely/invalid/_debugz
P/F.frameworkzP/F.framework/_debugzP/F.framework/F�Pz
F.framework/F�FzP/F.framework/F_debugzF.framework/F_debug�debug)r
zP/F.framework/VersionszP/F.framework/Versions/AzP/F.framework/Versions/A/FzF.framework/Versions/A/F�Az P/F.framework/Versions/A/F_debugzF.framework/Versions/A/F_debug)NNNNN)r�AssertionError)rrrr�test_framework_info,s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>s

macholib/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000455150532450670015673 0ustar00U

e5d��@sdZdZdS)z~
Enough Mach-O to make your head spin.

See the relevant header files in /usr/include/mach-o

And also Apple's documentation.
z1.0N)�__doc__�__version__�rr�0/usr/lib64/python3.8/ctypes/macholib/__init__.py�<module>smacholib/__pycache__/__init__.cpython-38.pyc000064400000000455150532450670014734 0ustar00U

e5d��@sdZdZdS)z~
Enough Mach-O to make your head spin.

See the relevant header files in /usr/include/mach-o

And also Apple's documentation.
z1.0N)�__doc__�__version__�rr�0/usr/lib64/python3.8/ctypes/macholib/__init__.py�<module>smacholib/__pycache__/framework.cpython-38.opt-1.pyc000064400000003107150532450670016126 0ustar00U

e5d��@s>dZddlZdgZe�d�Zdd�Zdd�Zedkr:e�dS)	z%
Generic framework path manipulation
�N�framework_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
cCst�|�}|sdS|��S)a}
    A framework name can take one of the following four forms:
        Location/Name.framework/Versions/SomeVersion/Name_Suffix
        Location/Name.framework/Versions/SomeVersion/Name
        Location/Name.framework/Name_Suffix
        Location/Name.framework/Name

    returns None if not found, or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.framework/Versions/SomeVersion/Name_Suffix',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present
    N)�STRICT_FRAMEWORK_RE�match�	groupdict)�filenameZis_framework�r�1/usr/lib64/python3.8/ctypes/macholib/framework.pyrs
cCsddd�}dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d-s�ztest_framework_info.<locals>.d)NNNNNr)rrrr�test_framework_info,s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>s

macholib/__pycache__/dylib.cpython-38.opt-2.pyc000064400000001531150532450670015234 0ustar00U

e5d$�@s:ddlZdgZe�d�Zdd�Zdd�Zedkr6e�dS)�N�
dylib_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
cCst�|�}|sdS|��S)N)�DYLIB_RE�match�	groupdict)�filenameZis_dylib�r�-/usr/lib64/python3.8/ctypes/macholib/dylib.pyrs
cCsddd�}dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d.s�ztest_dylib_info.<locals>.d)NNNNNr)rrrr�test_dylib_info-s
r�__main__)�re�__all__�compilerrr�__name__rrrr�<module>s

__pycache__/_endian.cpython-38.opt-2.pyc000064400000003066150532450670013755 0ustar00U

e5d��@s�ddlZddlTee�Zdd�ZGdd�dee��Zejdkr\dZ	eZ
Gd	d
�d
eed�Zn0ejdkr�d
Z	eZGdd�deed�Z
ned��dS)�N)�*cCsLt|t�rt|t�St|t�r.t|j�|jSt|t	�r<|St
d|��dS)Nz+This type does not support other endian: %s)�hasattr�
_OTHER_ENDIAN�getattr�
isinstance�_array_type�
_other_endianZ_type_Z_length_�
issubclass�	Structure�	TypeError)�typ�r
�&/usr/lib64/python3.8/ctypes/_endian.pyrs



rcseZdZ�fdd�Z�ZS)�
_swapped_metacs^|dkrLg}|D]6}|d}|d}|dd�}|�|t|�f|�q|}t��||�dS)NZ_fields_r��)�appendr�super�__setattr__)�self�attrname�valueZfieldsZdesc�namer�rest��	__class__r
rrsz_swapped_meta.__setattr__)�__name__�
__module__�__qualname__r�
__classcell__r
r
rrrsr�littleZ__ctype_be__c@seZdZdZdZdS)�BigEndianStructurer
N�rrr�	__slots__Z_swappedbytes_r
r
r
rr!.sr!)�	metaclassZbigZ__ctype_le__c@seZdZdZdZdS)�LittleEndianStructurer
Nr"r
r
r
rr%7sr%zInvalid byteorder)
�sysZctypes�typeZArrayrrr
r�	byteorderrr%r!�RuntimeErrorr
r
r
r�<module>s

__pycache__/_aix.cpython-38.pyc000064400000023166150532450670012343 0ustar00U

e5d1�@s�dZdZddlZddlmZmZddlmZddlm	Z	m
Z
ddlmZm
Z
mZe
e	�dZdd	lmZd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�ZdS)"a�
Lib/ctypes.util.find_library() support for AIX
Similar approach as done for Darwin support by using separate files
but unlike Darwin - no extension such as ctypes.macholib.*

dlopen() is an interface to AIX initAndLoad() - primary documentation at:
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/dlopen.htm
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/load.htm

AIX supports two styles for dlopen(): svr4 (System V Release 4) which is common on posix
platforms, but also a BSD style - aka SVR3.

From AIX 5.3 Difference Addendum (December 2004)
2.9 SVR4 linking affinity
Nowadays, there are two major object file formats used by the operating systems:
XCOFF: The COFF enhanced by IBM and others. The original COFF (Common
Object File Format) was the base of SVR3 and BSD 4.2 systems.
ELF:   Executable and Linking Format that was developed by AT&T and is a
base for SVR4 UNIX.

While the shared library content is identical on AIX - one is located as a filepath name
(svr4 style) and the other is located as a member of an archive (and the archive
is located as a filepath name).

The key difference arises when supporting multiple abi formats (i.e., 32 and 64 bit).
For svr4 either only one ABI is supported, or there are two directories, or there
are different file names. The most common solution for multiple ABI is multiple
directories.

For the XCOFF (aka AIX) style - one directory (one archive file) is sufficient
as multiple shared libraries can be in the archive - even sharing the same name.
In documentation the archive is also referred to as the "base" and the shared
library object is referred to as the "member".

For dlopen() on AIX (read initAndLoad()) the calls are similar.
Default activity occurs when no path information is provided. When path
information is provided dlopen() does not search any other directories.

For SVR4 - the shared library name is the name of the file expected: libFOO.so
For AIX - the shared library is expressed as base(member). The search is for the
base (e.g., libFOO.a) and once the base is found the shared library - identified by
member (e.g., libFOO.so, or shr.o) is located and loaded.

The mode bit RTLD_MEMBER tells initAndLoad() that it needs to use the AIX (SVR3)
naming style.
z%Michael Felt <aixtools@felt.demon.nl>�N)�environ�path)�
executable)�c_void_p�sizeof)�Popen�PIPE�DEVNULL�)�maxsizecs�fdd�}tt|�|d�S)NcsL|���}g}z|r*|�dt|����qWntk
r@YnX|pJtgS)Nr)�split�insert�int�pop�
ValueErrorr)Zlibname�partsZnums��sep��#/usr/lib64/python3.8/ctypes/_aix.py�_num_version>s
z#_last_version.<locals>._num_version)�key)�max�reversed)Zlibnamesrrrrr�
_last_version=s
rcCs:d}|jD]*}|�d�r|}q
d|kr
|�d�Sq
dS)N)�/z./z../ZINDEX�
)�stdout�
startswith�rstrip)�p�	ld_header�linerrr�
get_ld_headerJs

r#cCs0g}|jD] }t�d|�r&|�|�q
q,q
|S)Nz[0-9])r�re�match�append)r �infor"rrr�get_ld_header_infoTs
r(cCs\g}tddt��d|gdttd�}t|�}|rF|�|t|�f�q"qFq"|j��|�	�|S)z�
    Parse the header of the loader section of executable and archives
    This function calls /usr/bin/dump -H as a subprocess
    and returns a list of (ld_header, ld_header_info) tuples.
    z
/usr/bin/dumpz-Xz-HT)Zuniversal_newlinesr�stderr)
r�AIX_ABIrr	r#r&r(r�close�wait)�fileZldr_headersr r!rrr�get_ld_headersas
�
r.cCs6g}|D](\}}d|kr|�||�d�d��q|S)z�
    extract the shareable objects from ld_headers
    character "[" is used to strip off the path information.
    Note: the "[" and "]" characters that are part of dump -H output
    are not removed here.
    �[���)r&�index)Z
ld_headersZsharedr"�_rrr�
get_sharedys
r3csJd��d��ttd�fdd�|D���}t|�dkrB|d�d�SdSdS)zy
    Must be only one match, otherwise result is None.
    When there is a match, strip leading "[" and trailing "]"
    z\[(z)\]Nc3s|]}t��|�VqdS)N)r$�search)�.0r"��exprrr�	<genexpr>�sz get_one_match.<locals>.<genexpr>�r)�list�filter�len�group)r7�linesZmatchesrr6r�
get_one_match�s
r?cCsJtdkr d}t||�}|rF|Sn&dD] }tt�|�|�}|r$|Sq$dS)z�
    This routine provides historical aka legacy naming schemes started
    in AIX4 shared library support for library members names.
    e.g., in /usr/lib/libc.a the member name shr.o for 32-bit binary and
    shr_64.o for 64-bit binary.
    �@zshr4?_?64\.o)zshr.ozshr4.oN)r*r?r$�escape)�membersr7�member�namerrr�
get_legacy�s

rEcCsfd|�d�d|�d�g}|D]D}g}|D]$}t�||�}|r(|�|�d��q(|rt|d�SqdS)a�
    Sort list of members and return highest numbered version - if it exists.
    This function is called when an unversioned libFOO.a(libFOO.so) has
    not been found.

    Versioning for the member name is expected to follow
    GNU LIBTOOL conventions: the highest version (x, then X.y, then X.Y.z)
     * find [libFoo.so.X]
     * find [libFoo.so.X.Y]
     * find [libFoo.so.X.Y.Z]

    Before the GNU convention became the standard scheme regardless of
    binary size AIX packagers used GNU convention "as-is" for 32-bit
    archive members but used an "distinguishing" name for 64-bit members.
    This scheme inserted either 64 or _64 between libFOO and .so
    - generally libFOO_64.so, but occasionally libFOO64.so
    �libz\.so\.[0-9]+[0-9.]*z_?64\.so\.[0-9]+[0-9.]*r�.N)r$r4r&r=r)rDrBZexprsr7Zversionsr"�mrrr�get_version�s

�rIcCsbd|�d�}t||�}|r|Stdkr<d|�d�}t||�}|rD|St||�}|rV|St|�SdS)ab
    Return an archive member matching the request in name.
    Name is the library name without any prefix like lib, suffix like .so,
    or version number.
    Given a list of members find and return the most appropriate result
    Priority is given to generic libXXX.so, then a versioned libXXX.so.a.b.c
    and finally, legacy AIX naming scheme.
    rFz\.sor@z64\.soN)r?r*rIrE)rDrBr7rCrrr�
get_member�s



rJcCs|t�d�}|dkrt�d�}|dkr*g}n
|�d�}tt�}|D]6\}}|D](}|��d}d|krL|�|�d��qLq@|S)a
    On AIX, the buildtime searchpath is stored in the executable.
    as "loader header information".
    The command /usr/bin/dump -H extracts this info.
    Prefix searched libraries with LD_LIBRARY_PATH (preferred),
    or LIBPATH if defined. These paths are appended to the paths
    to libraries the python executable is linked with.
    This mimics AIX dlopen() behavior.
    ZLD_LIBRARY_PATHNZLIBPATH�:r9r)r�getrr.r�extend)�libpathsZobjectsr2r>r"rrrr�get_libpaths�s



rOcCsp|D]f}|dkrqd|�d�}t�||�}t�|�rtt|��}tt�|�|�}|dkrd||fSdSqdS)a
    paths is a list of directories to search for an archive.
    name is the abbreviated name given to find_library().
    Process: search "paths" for archive, and if an archive is found
    return the result of get_member().
    If an archive is not found then return None
    �/librFz.aN)NN)r�join�existsr3r.rJr$rA)�pathsrD�dir�base�archiverBrCrrr�find_shared
s
rWcCsnt�}t||�\}}|dkr,|�d|�d�Sd|�d�}|D],}|dkrJq<t�||�}t�|�r<|Sq<dS)a�AIX implementation of ctypes.util.find_library()
    Find an archive member that will dlopen(). If not available,
    also search for a file (or link) with a .so suffix.

    AIX supports two types of schemes that can be used with dlopen().
    The so-called SystemV Release4 (svr4) format is commonly suffixed
    with .so while the (default) AIX scheme has the library (archive)
    ending with the suffix .a
    As an archive has multiple members (e.g., 32-bit and 64-bit) in one file
    the argument passed to dlopen must include both the library and
    the member names in a single string.

    find_library() looks first for an archive (.a) with a suitable member.
    If no archive+member pair is found, look for a .so file.
    N�(�)rFz.sorP)rOrWrrQrR)rDrNrUrCZsonamerTZshlibrrr�find_library#s

rZ)�__doc__�
__author__r$�osrr�sysrZctypesrr�
subprocessrrr	r*rrr#r(r.r3r?rErIrJrOrWrZrrrr�<module>s(.


&__pycache__/__init__.cpython-38.opt-2.pyc000064400000033436150532450670014123 0ustar00U

e5d�E�@sddlZddlZdZddlmZmZmZddlm	Z	ddlm
ZddlmZddlm
Z
mZddlmZdd	lmZeekr�ed
ee��ejdkr�ddlmZe
Zejd
kr�ejdkr�ee��j�d�d�dkr�eZddlmZmZm Z!m"Z#d|dd�Z$d}dd�Z%iZ&dd�Z'ejdk�rXddlm(Z)ddlm*Z+iZ,dd�Z-e-j.�rpe'j.�/dd�e-_.nejd
k�rpddlm0Z)ddlm1Z1m2Z2m3Z3m4Z4m5Z5ddlm6Z6m7Z7ddlm8Z8d~d d!�Z9Gd"d#�d#e8�Z:e9e:d$�Gd%d&�d&e8�Z;e9e;�Gd'd(�d(e8�Z<e9e<�Gd)d*�d*e8�Z=e9e=�Gd+d,�d,e8�Z>e9e>�ed-�ed.�k�rHe=Z?e>Z@n0Gd/d0�d0e8�Z?e9e?�Gd1d2�d2e8�Z@e9e@�Gd3d4�d4e8�ZAe9eA�Gd5d6�d6e8�ZBe9eB�Gd7d8�d8e8�ZCe1eC�e1eB�k�r�eBZCed.�ed9�k�r�e=ZDe>ZEn0Gd:d;�d;e8�ZDe9eD�Gd<d=�d=e8�ZEe9eE�Gd>d?�d?e8�ZFeFeF_GeF_He9eF�Gd@dA�dAe8�ZIeIeI_GeI_He9eI�GdBdC�dCe8�ZJeJeJ_GeJ_He9eJ�GdDdE�dEe8�ZKe9eKd$�GdFdG�dGe8�ZLeLZMe9eL�GdHdI�dIe8�ZNddJlmOZOmPZPmQZQGdKdL�dLe8�ZRGdMdN�dNe8�ZSdOdP�ZTddQdR�ZUdSdT�ZVdUdV�ZWGdWdX�dXeX�ZYGdYdZ�dZeY�ZZejdk�r�Gd[d\�d\eY�Z[dd]lm\Z\m8Z8Gd^d_�d_e8�Z]Gd`da�daeY�Z^Gdbdc�dceX�Z_e_eY�Z`e_eZ�Zaejdk�r�eZdddejb�Zcn,ejdek�r�eZdfejdddg��ZcneZd�Zcejdk�r4e_e[�Zee_e^�ZfeejgjhZhddhlmiZimjZjd�didj�Zke1e@�e1eL�k�rPe@Zle?Zmn6e1e>�e1eL�k�rle>Zle=Zmne1eE�e1eL�k�r�eEZleDZmddklmnZnmoZompZpmqZqe'eLeLeLel�en�Zre'eLeLe?el�eo�Zsdldm�Ztete:eLe:e:�eq�Zudndo�Zvete:eLe?�ep�Zwd�dqdr�ZxzddslmyZyWnezk
�r$YnXete:eLe?�ey�Z{d�dtdu�Z|ejdk�r\dvdw�Z}dxdy�Z~ddzlm�Z�m�Z�eIZ�eFZ�e;e?e=eDfD]@Z�e1e��dgk�r�e�Z�n&e1e��d{k�r�e�Z�ne1e��dk�r�e�Z��q�e<e@e>eEfD]@Z�e1e��dgk�r�e�Z�n&e1e��d{k�r�e�Z�ne1e��dk�r�e�Z��q�[�eT�dS)��Nz1.1.0)�Union�	Structure�Array)�_Pointer)�CFuncPtr)�__version__)�
RTLD_LOCAL�RTLD_GLOBAL)�
ArgumentError��calcsizezVersion number mismatch�nt)�FormatError�posix�darwin�.�)�FUNCFLAG_CDECL�FUNCFLAG_PYTHONAPI�FUNCFLAG_USE_ERRNO�FUNCFLAG_USE_LASTERRORcCszt|t�rD|dkrt|�d}t�d||�t|}|�}||_|St|t�rnt�dd|�t|}|�}|St|��dS)N�zctypes.create_string_buffer)	�
isinstance�bytes�len�_sys�audit�c_char�value�int�	TypeError��init�sizeZbuftypeZbuf�r$�'/usr/lib64/python3.8/ctypes/__init__.py�create_string_buffer/s

r&cCs
t||�S�N)r&)r"r#r$r$r%�c_bufferCsr(cs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)N�	use_errnoF�use_last_error�!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z CFUNCTYPE.<locals>.CFunctionTypeN��__name__�
__module__�__qualname__�
_argtypes_�	_restype_�_flags_r$��argtypes�flags�restyper$r%�
CFunctionTypeesr7)	�_FUNCFLAG_CDECL�pop�_FUNCFLAG_USE_ERRNO�_FUNCFLAG_USE_LASTERROR�
ValueError�keys�_c_functype_cache�KeyError�	_CFuncPtr)r6r4�kwr7r$r3r%�	CFUNCTYPEKsrB)�LoadLibrary)�FUNCFLAG_STDCALLcs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)Nr)Fr*r+cseZdZ�Z�Z�ZdS)z$WINFUNCTYPE.<locals>.WinFunctionTypeNr,r$r3r$r%�WinFunctionType}srE)	�_FUNCFLAG_STDCALLr9r:r;r<r=�_win_functype_cacher?r@)r6r4rArEr$r3r%�WINFUNCTYPEqsrH)�dlopen)�sizeof�byref�	addressof�	alignment�resize)�	get_errno�	set_errno)�_SimpleCDatacCsJddlm}|dkr|j}t|�||�}}||krFtd|||f��dS)Nrrz"sizeof(%s) wrong: %d instead of %d)�structr�_type_rJ�SystemError)�typ�typecoderZactualZrequiredr$r$r%�_check_size�s�rWcs eZdZdZ�fdd�Z�ZS)�	py_object�Ocs4zt���WStk
r.dt|�jYSXdS)Nz
%s(<NULL>))�super�__repr__r<�typer-��self��	__class__r$r%r[�szpy_object.__repr__)r-r.r/rSr[�
__classcell__r$r$r_r%rX�srX�Pc@seZdZdZdS)�c_short�hN�r-r.r/rSr$r$r$r%rc�srcc@seZdZdZdS)�c_ushort�HNrer$r$r$r%rf�srfc@seZdZdZdS)�c_long�lNrer$r$r$r%rh�srhc@seZdZdZdS)�c_ulong�LNrer$r$r$r%rj�srj�iric@seZdZdZdS)�c_intrlNrer$r$r$r%rm�srmc@seZdZdZdS)�c_uint�INrer$r$r$r%rn�srnc@seZdZdZdS)�c_float�fNrer$r$r$r%rp�srpc@seZdZdZdS)�c_double�dNrer$r$r$r%rr�srrc@seZdZdZdS)�c_longdouble�gNrer$r$r$r%rt�srt�qc@seZdZdZdS)�
c_longlongrvNrer$r$r$r%rw�srwc@seZdZdZdS)�c_ulonglong�QNrer$r$r$r%rx�srxc@seZdZdZdS)�c_ubyte�BNrer$r$r$r%rz�srzc@seZdZdZdS)�c_byte�bNrer$r$r$r%r|�sr|c@seZdZdZdS)r�cNrer$r$r$r%r�src@seZdZdZdd�ZdS)�c_char_p�zcCsd|jjt�|�jfS�Nz%s(%s)�r`r-�c_void_pZfrom_bufferrr]r$r$r%r[�szc_char_p.__repr__N�r-r.r/rSr[r$r$r$r%r�src@seZdZdZdS)r�rbNrer$r$r$r%r��sr�c@seZdZdZdS)�c_bool�?Nrer$r$r$r%r��sr�)�POINTER�pointer�_pointer_type_cachec@seZdZdZdd�ZdS)�	c_wchar_p�ZcCsd|jjt�|�jfSr�r�r]r$r$r%r[�szc_wchar_p.__repr__Nr�r$r$r$r%r��sr�c@seZdZdZdS)�c_wchar�uNrer$r$r$r%r�sr�cCsFt��t��tjdkr"t��tjtt	�_t
jtt�_ttd<dS)Nr
)
r��clearr>�_os�namerGr�Z
from_paramr�r�rrr�r$r$r$r%�_reset_caches
r�cCs�t|t�rh|dkrBtt�dkr6tdd�|D��d}nt|�d}t�d||�t|}|�}||_|St|t	�r�t�dd|�t|}|�}|St
|��dS)N�css"|]}t|�dkrdndVqdS)i��r�rN)�ord)�.0r~r$r$r%�	<genexpr>sz(create_unicode_buffer.<locals>.<genexpr>rzctypes.create_unicode_buffer)r�strrJr��sumrrrrrr r!r$r$r%�create_unicode_buffers 

r�cCsLt�|d�dk	rtd��t|�tkr,td��|�|�|t|<tt|�=dS)Nz%This type already exists in the cachezWhat's this???)r��get�RuntimeError�idZset_type)r��clsr$r$r%�SetPointerType.s
r�cCs||Sr'r$)rUrr$r$r%�ARRAY8sr�c@sLeZdZeZeZdZdZdZ	e
ddddfdd�Zdd�Zd	d
�Z
dd�ZdS)
�CDLLz<uninitialized>rNFc	s�|�_�j�|r�tO�|r$�tO�tj�d�rV|rV|�d�rVd|krV|tj	tj
BO}tjdkr�|dk	rn|}n6ddl}|j
}d|ks�d|kr�|��j��_||jO}G��fdd	�d	t�}|�_|dkr�t�j|��_n|�_dS)
NZaix�)z.a(r
r�/�\cseZdZ�Z�jZdS)zCDLL.__init__.<locals>._FuncPtrN)r-r.r/r2�_func_restype_r1r$�r5r^r$r%�_FuncPtrosr�)�_name�_func_flags_r:r;r�platform�
startswith�endswithr�ZRTLD_MEMBER�RTLD_NOWr�r
Z!_LOAD_LIBRARY_SEARCH_DEFAULT_DIRSZ_getfullpathnameZ!_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIRr@r��_dlopen�_handle)	r^r��modeZhandler)r*Zwinmoder
r�r$r�r%�__init__Ss,

z
CDLL.__init__cCs8d|jj|j|jtjdd@t|�tjdd@fS)Nz<%s '%s', handle %x at %#x>r�r)r`r-r�r�r�maxsizer�r]r$r$r%r[ys
��z
CDLL.__repr__cCs6|�d�r|�d�rt|��|�|�}t|||�|S)N�__)r�r��AttributeError�__getitem__�setattr)r^r��funcr$r$r%�__getattr__s

zCDLL.__getattr__cCs"|�||f�}t|t�s||_|Sr')r�rrr-)r^Zname_or_ordinalr�r$r$r%r��s
zCDLL.__getitem__)r-r.r/r8r�rmr�r�r�r��DEFAULT_MODEr�r[r�r�r$r$r$r%r�>s�
&r�c@seZdZeeBZdS)�PyDLLN)r-r.r/r8�_FUNCFLAG_PYTHONAPIr�r$r$r$r%r��sr�c@seZdZeZdS)�WinDLLN)r-r.r/rFr�r$r$r$r%r��sr�)�_check_HRESULTrQc@seZdZdZeZdS)�HRESULTriN)r-r.r/rSr�Z_check_retval_r$r$r$r%r��s
r�c@seZdZeZeZdS)�OleDLLN)r-r.r/rFr�r�r�r$r$r$r%r��sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
LibraryLoadercCs
||_dSr'��_dlltype)r^Zdlltyper$r$r%r��szLibraryLoader.__init__cCs.|ddkrt|��|�|�}t|||�|S)Nr�_)r�r�r�)r^r�Zdllr$r$r%r��s

zLibraryLoader.__getattr__cCs
t||�Sr')�getattr�r^r�r$r$r%r��szLibraryLoader.__getitem__cCs
|�|�Sr'r�r�r$r$r%rC�szLibraryLoader.LoadLibraryN)r-r.r/r�r�r�rCr$r$r$r%r��sr�z
python dll�cygwinzlibpython%d.%d.dllr�)�get_last_error�set_last_errorcCs0|dkrt�}|dkr"t|���}td|d|�Sr')�GetLastErrorr�strip�OSError)�codeZdescrr$r$r%�WinError�s
r�)�
_memmove_addr�_memset_addr�_string_at_addr�
_cast_addrcsG��fdd�dt�}|S)NcseZdZ�Z�ZeeBZdS)z!PYFUNCTYPE.<locals>.CFunctionTypeN)r-r.r/r0r1r8r�r2r$�r4r6r$r%r7�sr7)r@)r6r4r7r$r�r%�
PYFUNCTYPE�sr�cCst|||�Sr')�_cast)�objrUr$r$r%�cast�sr����cCs
t||�Sr')�
_string_at�Zptrr#r$r$r%�	string_at�sr�)�_wstring_at_addrcCs
t||�Sr')�_wstring_atr�r$r$r%�
wstring_at
sr�cCsBztdt�t�dg�}Wntk
r.YdSX|�|||�SdS)N�comtypes.server.inprocserver�*i�)�
__import__�globals�locals�ImportError�DllGetClassObject)ZrclsidZriidZppv�ccomr$r$r%r�s
r�cCs8ztdt�t�dg�}Wntk
r.YdSX|��S)Nr�r�r)r�r�r�r��DllCanUnloadNow)r�r$r$r%r�s
r�)�BigEndianStructure�LittleEndianStructure�)N)N)N)N)NN)r�)r�)��osr��sysrrZ_ctypesrrrrrr@Z_ctypes_versionrr	r
rRrZ	_calcsize�	Exceptionr�rr�r�r�uname�release�splitrr8rr�rr:rr;r&r(r>rBrCr�rDrFrGrH�__doc__�replacerIrJrKrLrMrNrOrPrQrWrXrcrfrhrjrmrnrprrrtrwrxrzZ__ctype_le__Z__ctype_be__r|rrr�Zc_voidpr�r�r�r�r�r�r�r�r�r��objectr�r�r�r�r�r�r�ZcdllZpydllZ	dllhandleZ	pythonapi�version_infoZwindllZoledllZkernel32r�r�r�r�Zc_size_tZ	c_ssize_tr�r�r�r�ZmemmoveZmemsetr�r�r�r�r�r�r�r�r�r�r�Zctypes._endianr�r�Zc_int8Zc_uint8ZkindZc_int16Zc_int32Zc_int64Zc_uint16Zc_uint32Zc_uint64r$r$r$r%�<module>s2


!




N
	


__pycache__/util.cpython-38.pyc000064400000017577150532450670012411 0ustar00U

e5d76�@sBddlZddlZddlZddlZejdkrDdd�Zdd�Zdd�Zn�ejd	krnejd
krnddl	m
Zdd�Zn�ej�d
�r�ddl
mZn�ejd	k�r&ddlZddlZdd�Zdd�Zejdkr�dd�Zndd�Zej�d�r�dd�Zdd�Zn8ejdk�rdd�Zd'dd�Zndd �Zd!d"�Zd#d�Zd$d%�Zed&k�r>e�dS)(�N�ntcCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|d	d
��d}|dkr�d}|dkr�||SdS)
z�Return the version of MSVC that was used to build Python.

        For Python 2.3 and up, the version number is included in
        sys.version.  For earlier versions, assume the compiler is MSVC 6.
        zMSC v.����N� �����
��g$@r)�sys�version�find�len�split�int)�prefix�i�s�restZmajorVersionZminorVersion�r�#/usr/lib64/python3.8/ctypes/util.py�_get_build_version	srcCs^t�}|dkrdS|dkr d}n|dkr6d|d}ndSddl}d|jjkrV|d	7}|d
S)z%Return the name of the VC runtime dllNr�msvcrtrzmsvcr%d�
rz_d.pyd�d�.dll)r�importlib.machinery�	machinery�EXTENSION_SUFFIXES)rZclibname�	importlibrrr�find_msvcrt"sr cCsx|dkrt�Stjd�tj�D]R}tj�||�}tj�|�rF|S|���	d�rVq |d}tj�|�r |Sq dS)N)�c�m�PATHr)
r �os�environr�pathsep�path�join�isfile�lower�endswith)�nameZ	directoryZfnamerrr�find_library7s
r-�posix�darwin)�	dyld_findc	CsPd|d|d||fg}|D],}zt|�WStk
rHYqYqXqdS)Nzlib%s.dylibz%s.dylibz%s.framework/%s)�
_dyld_find�
ValueError)r,�possiblerrrr-Hs
��aix)r-c
Cs4d}t|d��}|�d�|kW5QR�SQRXdS)z,Return True if the given file is an ELF filesELF�br�N)�open�read)�filenameZ
elf_headerZthefilerrr�_is_elf`sr:c
Cs t�dt�|��}t�d�}|s,t�d�}|s4dSt��}z�|dd|j
d|g}ttj�}d|d<d|d	<zt
j|t
jt
j|d
�}Wntk
r�YW�$dSX|�|j��}W5QRXW5z|��Wnt	k
r�YnXXt�||�}|s�dS|D]}	t|	��s�q�t�|	�SdS)N�[^\(\)\s]*lib%s\.[^\(\)\s]*ZgccZccz-Wl,-t�-oz-l�C�LC_ALL�LANG��stdout�stderr�env)r$�fsencode�re�escape�shutil�which�tempfileZNamedTemporaryFile�close�FileNotFoundErrorr,�dictr%�
subprocess�Popen�PIPEZSTDOUT�OSErrorrAr8�findallr:�fsdecode)
r,�exprZ
c_compilerZtemp�argsrC�procZtrace�res�filerrr�_findLib_gccfsB


�

rXZsunos5c	Cs||sdSztjdd|ftjtjd�}Wntk
r<YdSX|�|j��}W5QRXt�d|�}|sldSt	�
|�d��S)Nz/usr/ccs/bin/dumpz-Lpv�rArBs\[.*\]\sSONAME\s+([^\s]+)r)rMrNrO�DEVNULLrPrAr8rE�searchr$rR�group)�frU�datarVrrr�_get_soname�s�
r_c	Cs�|sdSt�d�}|sdSz"tj|ddd|ftjtjd�}Wntk
rRYdSX|�|j��}W5QRXt	�
d|�}|s�dSt�|�
d��S)N�objdump�-pz-jz.dynamicrYs\sSONAME\s+([^\s]+)r)rGrHrMrNrOrZrPrAr8rEr[r$rRr\)r]r`rU�dumprVrrrr_�s$
�
)ZfreebsdZopenbsdZ	dragonflycCsN|�d�}g}z|r*|�dt|����qWntk
r@YnX|pLtjgS)N�.r)r�insertr�popr2r�maxsize)Zlibname�partsZnumsrrr�_num_version�s
rhc	Cs�t�|�}d||f}t�|�}ztjdtjtjd�}Wntk
rPd}YnX|�|j	�
�}W5QRXt�||�}|s�tt
|��S|jtd�t�|d�S)Nz:-l%s\.\S+ => \S*/(lib%s\.\S+))�/sbin/ldconfigz-rrY�)�keyr)rErFr$rDrMrNrOrZrPrAr8rQr_rX�sortrhrR)r,ZenamerSrUr^rVrrrr-�s"

�

c		Cs�tj�d�sdSttj�}d|d<|r,d}nd}d}ztj|tjtj|d�}Wnt	k
rdYdSX|�6|j
D](}|��}|�d�rrt�
|���d}qrW5QRX|s�dS|�d	�D]*}tj�|d
|�}tj�|�r�|Sq�dS)N�
/usr/bin/crler=r>)rm�-64)rmr@sDefault Library Path (ELF):r6�:zlib%s.so)r$r'�existsrLr%rMrNrOrZrPrA�strip�
startswithrRrr()	r,�is64rCrT�pathsrU�line�dirZlibfilerrr�
_findLib_crle�s8
�



rwFcCstt||�pt|��S�N)r_rwrX)r,rsrrrr-	sc
Cs�ddl}|�d�dkr&t��jd}nt��jd}dddddd	�}|�|d
�}d}t�|t�|�|f�}zht	j
dd
gt	jt	jt	jddd�d��:}t�
||j���}|r�t�|�d��W5QR�WSW5QRXWntk
r�YnXdS)Nr�lr6z-32rnzlibc6,x86-64zlibc6,64bitzlibc6,IA-64)z	x86_64-64zppc64-64z
sparc64-64zs390x-64zia64-64Zlibc6z\s+(lib%s\.[^\s]+)\s+\(%srirar=)r>r?)�stdinrBrArCr)�structZcalcsizer$�uname�machine�getrDrErFrMrNrZrOr[rAr8rRr\rP)r,r{r}Zmach_mapZabi_typeZregex�prVrrr�_findSoname_ldconfigs4�
�,r�cCs�dt�|�}ddg}tj�d�}|rD|�d�D]}|�d|g�q0|�dtjd|g�d}zZtj	|tj
tj
d	d
�}|��\}}t�|t�
|��}	|	D]}
t|
�s�q�t�
|
�WSWntk
r�YnX|S)Nr;Zldz-tZLD_LIBRARY_PATHroz-Lr<z-l%sT)rArBZuniversal_newlines)rErFr$r%r~r�extend�devnullrMrNrOZcommunicaterQrRr:�	Exception)r,rS�cmdZlibpathr�resultr�out�_rVrWrrr�_findLib_ld,s,
�r�cCs t|�ptt|��ptt|��Srx)r�r_rXr�)r,rrrr-Gs

�
�cCs�ddlm}tjdkr:t|j�t|�d��ttd��tjdk�r�ttd��ttd��ttd��tj	d	kr�t|�
d
��t|�
d��t|�
d��t|�
d
���ntj	�d��r�ddlm}tj
dk�rtd|dtj����td|�
d����ttd��t|�
d��n*td|dtj����td|�
d����tdtd����td|�
td�����tdtd����td|�
td�����n(t|�
d��t|�
d��ttd��dS)Nr)�cdllrrr.r"r!�bz2r/z
libm.dylibzlibcrypto.dylibzlibSystem.dylibzSystem.framework/Systemr4)�CDLLlz"Using CDLL(name, os.RTLD_MEMBER): z
libc.a(shr.o)zUsing cdll.LoadLibrary(): Zrpmz	librpm.sozlibc.a(shr_64.o)z	crypt	:: Zcryptz
crypto	:: Zcryptozlibm.sozlibcrypt.so)Zctypesr�r$r,�printr�loadr-r�platformZLoadLibraryrrr�rfZRTLD_MEMBER)r�r�rrr�testOs<


r��__main__)F)r$rGrMrr,rr r-r�Zctypes.macholib.dyldr0r1rrZctypes._aixrErIr:rXr_rhrwr�r�r��__name__rrrr�<module>s>


2


$(
__pycache__/util.cpython-38.opt-1.pyc000064400000017577150532450670013350 0ustar00U

e5d76�@sBddlZddlZddlZddlZejdkrDdd�Zdd�Zdd�Zn�ejd	krnejd
krnddl	m
Zdd�Zn�ej�d
�r�ddl
mZn�ejd	k�r&ddlZddlZdd�Zdd�Zejdkr�dd�Zndd�Zej�d�r�dd�Zdd�Zn8ejdk�rdd�Zd'dd�Zndd �Zd!d"�Zd#d�Zd$d%�Zed&k�r>e�dS)(�N�ntcCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|d	d
��d}|dkr�d}|dkr�||SdS)
z�Return the version of MSVC that was used to build Python.

        For Python 2.3 and up, the version number is included in
        sys.version.  For earlier versions, assume the compiler is MSVC 6.
        zMSC v.����N� �����
��g$@r)�sys�version�find�len�split�int)�prefix�i�s�restZmajorVersionZminorVersion�r�#/usr/lib64/python3.8/ctypes/util.py�_get_build_version	srcCs^t�}|dkrdS|dkr d}n|dkr6d|d}ndSddl}d|jjkrV|d	7}|d
S)z%Return the name of the VC runtime dllNr�msvcrtrzmsvcr%d�
rz_d.pyd�d�.dll)r�importlib.machinery�	machinery�EXTENSION_SUFFIXES)rZclibname�	importlibrrr�find_msvcrt"sr cCsx|dkrt�Stjd�tj�D]R}tj�||�}tj�|�rF|S|���	d�rVq |d}tj�|�r |Sq dS)N)�c�m�PATHr)
r �os�environr�pathsep�path�join�isfile�lower�endswith)�nameZ	directoryZfnamerrr�find_library7s
r-�posix�darwin)�	dyld_findc	CsPd|d|d||fg}|D],}zt|�WStk
rHYqYqXqdS)Nzlib%s.dylibz%s.dylibz%s.framework/%s)�
_dyld_find�
ValueError)r,�possiblerrrr-Hs
��aix)r-c
Cs4d}t|d��}|�d�|kW5QR�SQRXdS)z,Return True if the given file is an ELF filesELF�br�N)�open�read)�filenameZ
elf_headerZthefilerrr�_is_elf`sr:c
Cs t�dt�|��}t�d�}|s,t�d�}|s4dSt��}z�|dd|j
d|g}ttj�}d|d<d|d	<zt
j|t
jt
j|d
�}Wntk
r�YW�$dSX|�|j��}W5QRXW5z|��Wnt	k
r�YnXXt�||�}|s�dS|D]}	t|	��s�q�t�|	�SdS)N�[^\(\)\s]*lib%s\.[^\(\)\s]*ZgccZccz-Wl,-t�-oz-l�C�LC_ALL�LANG��stdout�stderr�env)r$�fsencode�re�escape�shutil�which�tempfileZNamedTemporaryFile�close�FileNotFoundErrorr,�dictr%�
subprocess�Popen�PIPEZSTDOUT�OSErrorrAr8�findallr:�fsdecode)
r,�exprZ
c_compilerZtemp�argsrC�procZtrace�res�filerrr�_findLib_gccfsB


�

rXZsunos5c	Cs||sdSztjdd|ftjtjd�}Wntk
r<YdSX|�|j��}W5QRXt�d|�}|sldSt	�
|�d��S)Nz/usr/ccs/bin/dumpz-Lpv�rArBs\[.*\]\sSONAME\s+([^\s]+)r)rMrNrO�DEVNULLrPrAr8rE�searchr$rR�group)�frU�datarVrrr�_get_soname�s�
r_c	Cs�|sdSt�d�}|sdSz"tj|ddd|ftjtjd�}Wntk
rRYdSX|�|j��}W5QRXt	�
d|�}|s�dSt�|�
d��S)N�objdump�-pz-jz.dynamicrYs\sSONAME\s+([^\s]+)r)rGrHrMrNrOrZrPrAr8rEr[r$rRr\)r]r`rU�dumprVrrrr_�s$
�
)ZfreebsdZopenbsdZ	dragonflycCsN|�d�}g}z|r*|�dt|����qWntk
r@YnX|pLtjgS)N�.r)r�insertr�popr2r�maxsize)Zlibname�partsZnumsrrr�_num_version�s
rhc	Cs�t�|�}d||f}t�|�}ztjdtjtjd�}Wntk
rPd}YnX|�|j	�
�}W5QRXt�||�}|s�tt
|��S|jtd�t�|d�S)Nz:-l%s\.\S+ => \S*/(lib%s\.\S+))�/sbin/ldconfigz-rrY�)�keyr)rErFr$rDrMrNrOrZrPrAr8rQr_rX�sortrhrR)r,ZenamerSrUr^rVrrrr-�s"

�

c		Cs�tj�d�sdSttj�}d|d<|r,d}nd}d}ztj|tjtj|d�}Wnt	k
rdYdSX|�6|j
D](}|��}|�d�rrt�
|���d}qrW5QRX|s�dS|�d	�D]*}tj�|d
|�}tj�|�r�|Sq�dS)N�
/usr/bin/crler=r>)rm�-64)rmr@sDefault Library Path (ELF):r6�:zlib%s.so)r$r'�existsrLr%rMrNrOrZrPrA�strip�
startswithrRrr()	r,�is64rCrT�pathsrU�line�dirZlibfilerrr�
_findLib_crle�s8
�



rwFcCstt||�pt|��S�N)r_rwrX)r,rsrrrr-	sc
Cs�ddl}|�d�dkr&t��jd}nt��jd}dddddd	�}|�|d
�}d}t�|t�|�|f�}zht	j
dd
gt	jt	jt	jddd�d��:}t�
||j���}|r�t�|�d��W5QR�WSW5QRXWntk
r�YnXdS)Nr�lr6z-32rnzlibc6,x86-64zlibc6,64bitzlibc6,IA-64)z	x86_64-64zppc64-64z
sparc64-64zs390x-64zia64-64Zlibc6z\s+(lib%s\.[^\s]+)\s+\(%srirar=)r>r?)�stdinrBrArCr)�structZcalcsizer$�uname�machine�getrDrErFrMrNrZrOr[rAr8rRr\rP)r,r{r}Zmach_mapZabi_typeZregex�prVrrr�_findSoname_ldconfigs4�
�,r�cCs�dt�|�}ddg}tj�d�}|rD|�d�D]}|�d|g�q0|�dtjd|g�d}zZtj	|tj
tj
d	d
�}|��\}}t�|t�
|��}	|	D]}
t|
�s�q�t�
|
�WSWntk
r�YnX|S)Nr;Zldz-tZLD_LIBRARY_PATHroz-Lr<z-l%sT)rArBZuniversal_newlines)rErFr$r%r~r�extend�devnullrMrNrOZcommunicaterQrRr:�	Exception)r,rS�cmdZlibpathr�resultr�out�_rVrWrrr�_findLib_ld,s,
�r�cCs t|�ptt|��ptt|��Srx)r�r_rXr�)r,rrrr-Gs

�
�cCs�ddlm}tjdkr:t|j�t|�d��ttd��tjdk�r�ttd��ttd��ttd��tj	d	kr�t|�
d
��t|�
d��t|�
d��t|�
d
���ntj	�d��r�ddlm}tj
dk�rtd|dtj����td|�
d����ttd��t|�
d��n*td|dtj����td|�
d����tdtd����td|�
td�����tdtd����td|�
td�����n(t|�
d��t|�
d��ttd��dS)Nr)�cdllrrr.r"r!�bz2r/z
libm.dylibzlibcrypto.dylibzlibSystem.dylibzSystem.framework/Systemr4)�CDLLlz"Using CDLL(name, os.RTLD_MEMBER): z
libc.a(shr.o)zUsing cdll.LoadLibrary(): Zrpmz	librpm.sozlibc.a(shr_64.o)z	crypt	:: Zcryptz
crypto	:: Zcryptozlibm.sozlibcrypt.so)Zctypesr�r$r,�printr�loadr-r�platformZLoadLibraryrrr�rfZRTLD_MEMBER)r�r�rrr�testOs<


r��__main__)F)r$rGrMrr,rr r-r�Zctypes.macholib.dyldr0r1rrZctypes._aixrErIr:rXr_rhrwr�r�r��__name__rrrr�<module>s>


2


$(
__pycache__/_endian.cpython-38.pyc000064400000003613150532450670013013 0ustar00U

e5d��@s�ddlZddlTee�Zdd�ZGdd�dee��Zejdkr\dZ	eZ
Gd	d
�d
eed�Zn0ejdkr�d
Z	eZGdd�deed�Z
ned��dS)�N)�*cCsLt|t�rt|t�St|t�r.t|j�|jSt|t	�r<|St
d|��dS)z�Return the type with the 'other' byte order.  Simple types like
    c_int and so on already have __ctype_be__ and __ctype_le__
    attributes which contain the types, for more complicated types
    arrays and structures are supported.
    z+This type does not support other endian: %sN)�hasattr�
_OTHER_ENDIAN�getattr�
isinstance�_array_type�
_other_endianZ_type_Z_length_�
issubclass�	Structure�	TypeError)�typ�r
�&/usr/lib64/python3.8/ctypes/_endian.pyrs



rcseZdZ�fdd�Z�ZS)�
_swapped_metacs^|dkrLg}|D]6}|d}|d}|dd�}|�|t|�f|�q|}t��||�dS)NZ_fields_r��)�appendr�super�__setattr__)�self�attrname�valueZfieldsZdesc�namer�rest��	__class__r
rrsz_swapped_meta.__setattr__)�__name__�
__module__�__qualname__r�
__classcell__r
r
rrrsr�littleZ__ctype_be__c@seZdZdZdZdZdS)�BigEndianStructurez$Structure with big endian byte orderr
N�rrr�__doc__�	__slots__Z_swappedbytes_r
r
r
rr!.sr!)�	metaclassZbigZ__ctype_le__c@seZdZdZdZdZdS)�LittleEndianStructurez'Structure with little endian byte orderr
Nr"r
r
r
rr&7sr&zInvalid byteorder)
�sysZctypes�typeZArrayrrr
r�	byteorderrr&r!�RuntimeErrorr
r
r
r�<module>s

__pycache__/wintypes.cpython-38.pyc000064400000011761150532450670013303 0ustar00U

e5d��@sddlZejZejZejZejZej	Z
ejZej
ZejZejZeZejZGdd�dej�ZejZejZejZejZejZZej Z!Z"ej#Z$Z%Z&ej#Z'Z(ej)Z*Z+ej,Z-Z.e�/ej�e�/ej,�kr�ejZ0ejZ1n$e�/ej�e�/ej,�kr�ej Z0ejZ1eZ2eZ3eZ4eZ5eZ6eZ7ej,Z8e8Z9e8Z:e8Z;e8Z<e8Z=e8Z>e8Z?e8Z@e8ZAe8ZBe8ZCe8ZDe8ZEe8ZFe8ZGe8ZHe8ZIe8ZJe8ZKe8ZLe8ZMe8ZNe8ZOe8ZPe8ZQe8ZRe8ZSe8ZTe8ZUe8ZVe8ZWGdd�dejX�ZYeYZZZ[Z\Gdd�dejX�Z]e]Z^Gdd	�d	ejX�Z_Gd
d�dejX�Z`e`ZaZbZcGdd
�d
ejX�ZdedZeZfdd�ZgGdd�dejX�ZhehZiGdd�dejX�ZjejZkdZlGdd�dejX�ZmGdd�dejX�Zne�oe�ZpZqe�oe�Zre�oe�ZsZte�oe�Zue�oe4�Zve�oe�ZwZxe�oeh�ZyZze�oe�Z{e�oe8�Z|Z}e�oeG�Z~e�oeH�Ze�oe�Z�Z�e�oe�Z�e�oe7�Z�e�oe�Z�Z�e�oej�Z�Z�e�oe`�Z�Z�e�oec�Z�e�oeY�Z�Z�e�oe\�Z�Z�e�oeV�Z�e�oe�Z�e�oed�Z�Z�e�oef�Z�Z�e�oe^�Z�e�oe�Z�Z�e�oe"�Z�e�oe�Z�e�oe�Z�e�oe
�Z�e�oem�Z�Z�e�oen�Z�Z�e�oe�Z�Z�dS)�Nc@seZdZdZdd�ZdS)�VARIANT_BOOL�vcCsd|jj|jfS)Nz%s(%r))�	__class__�__name__�value)�self�r�'/usr/lib64/python3.8/ctypes/wintypes.py�__repr__szVARIANT_BOOL.__repr__N)r�
__module__�__qualname__Z_type_r
rrrr	rsrc@s(eZdZdefdefdefdefgZdS)�RECT�left�top�rightZbottomN�rrr�LONG�_fields_rrrr	r
as
�r
c@s(eZdZdefdefdefdefgZdS)�_SMALL_RECTZLeftZTopZRightZBottomN�rrr�SHORTrrrrr	rhs
�rc@seZdZdefdefgZdS)�_COORD�X�YNrrrrr	ros�rc@seZdZdefdefgZdS)�POINT�x�yNrrrrr	rss�rc@seZdZdefdefgZdS)�SIZEZcxZcyNrrrrr	rxs�rcCs||d>|d>S)N��r)ZredZgreenZbluerrr	�RGB}sr c@seZdZdefdefgZdS)�FILETIMEZ
dwLowDateTimeZdwHighDateTimeN)rrr�DWORDrrrrr	r!�s�r!c@s4eZdZdefdefdefdefdefdefgZ	dS)�MSGZhWnd�messageZwParamZlParam�timeZptN)
rrr�HWND�UINT�WPARAM�LPARAMr"rrrrrr	r#�s�r#ic@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAA�dwFileAttributes�ftCreationTime�ftLastAccessTime�ftLastWriteTime�
nFileSizeHigh�nFileSizeLow�dwReserved0�dwReserved1�	cFileName�cAlternateFileName�N)rrrr"r!�CHAR�MAX_PATHrrrrr	r*�s

�r*c@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAWr+r,r-r.r/r0r1r2r3r4r5N)rrrr"r!�WCHARr7rrrrr	r8�s

�r8)�ZctypesZc_byteZBYTEZc_ushortZWORDZc_ulongr"Zc_charr6Zc_wcharr9Zc_uintr'Zc_intZINTZc_doubleZDOUBLEZc_floatZFLOATZBOOLEANZc_longZBOOLZ_SimpleCDatarZULONGrZUSHORTZc_shortrZ
c_longlongZ_LARGE_INTEGERZ
LARGE_INTEGERZc_ulonglongZ_ULARGE_INTEGERZULARGE_INTEGERZ	c_wchar_pZ	LPCOLESTRZLPOLESTRZOLESTRZLPCWSTRZLPWSTRZc_char_pZLPCSTRZLPSTRZc_void_pZLPCVOIDZLPVOIDZsizeofr(r)ZATOMZLANGIDZCOLORREFZLGRPIDZLCTYPEZLCIDZHANDLEZHACCELZHBITMAPZHBRUSHZHCOLORSPACEZHDCZHDESKZHDWPZHENHMETAFILEZHFONTZHGDIOBJZHGLOBALZHHOOKZHICONZ	HINSTANCEZHKEYZHKLZHLOCALZHMENUZ	HMETAFILEZHMODULEZHMONITORZHPALETTEZHPENZHRGNZHRSRCZHSTRZHTASKZHWINSTAr&Z	SC_HANDLEZSERVICE_STATUS_HANDLEZ	Structurer
ZtagRECTZ_RECTLZRECTLrZ
SMALL_RECTrrZtagPOINTZ_POINTLZPOINTLrZtagSIZEZSIZELr r!Z	_FILETIMEr#ZtagMSGr7r*r8ZPOINTERZLPBOOLZPBOOLZPBOOLEANZLPBYTEZPBYTEZPCHARZ
LPCOLORREFZLPDWORDZPDWORDZ
LPFILETIMEZ	PFILETIMEZPFLOATZLPHANDLEZPHANDLEZPHKEYZLPHKLZLPINTZPINTZPLARGE_INTEGERZPLCIDZLPLONGZPLONGZLPMSGZPMSGZLPPOINTZPPOINTZPPOINTLZLPRECTZPRECTZLPRECTLZPRECTLZLPSC_HANDLEZPSHORTZLPSIZEZPSIZEZLPSIZELZPSIZELZPSMALL_RECTZLPUINTZPUINTZPULARGE_INTEGERZPULONGZPUSHORTZPWCHARZLPWIN32_FIND_DATAAZPWIN32_FIND_DATAAZLPWIN32_FIND_DATAWZPWIN32_FIND_DATAWZLPWORDZPWORDrrrr	�<module>s�




















__pycache__/__init__.cpython-38.opt-1.pyc000064400000037766150532450670014134 0ustar00U

e5d�E�@s dZddlZddlZdZddlmZmZm	Z	ddlm
Z
ddlmZddlmZ
ddlmZmZdd	lmZdd
lmZee
kr�edee
��ejdkr�dd
lmZeZejdkr�ejdkr�ee��j�d�d�dkr�eZddlmZmZ m!Z"m#Z$d}dd�Z%d~dd�Z&iZ'dd�Z(ejdk�r\ddlm)Z*ddlm+Z,iZ-dd�Z.e.j�rte(j�/dd�e._nejdk�rtddlm0Z*ddlm1Z1m2Z2m3Z3m4Z4m5Z5ddlm6Z6m7Z7dd lm8Z8dd!d"�Z9Gd#d$�d$e8�Z:e9e:d%�Gd&d'�d'e8�Z;e9e;�Gd(d)�d)e8�Z<e9e<�Gd*d+�d+e8�Z=e9e=�Gd,d-�d-e8�Z>e9e>�ed.�ed/�k�rLe=Z?e>Z@n0Gd0d1�d1e8�Z?e9e?�Gd2d3�d3e8�Z@e9e@�Gd4d5�d5e8�ZAe9eA�Gd6d7�d7e8�ZBe9eB�Gd8d9�d9e8�ZCe1eC�e1eB�k�r�eBZCed/�ed:�k�r�e=ZDe>ZEn0Gd;d<�d<e8�ZDe9eD�Gd=d>�d>e8�ZEe9eE�Gd?d@�d@e8�ZFeFeF_GeF_He9eF�GdAdB�dBe8�ZIeIeI_GeI_He9eI�GdCdD�dDe8�ZJeJeJ_GeJ_He9eJ�GdEdF�dFe8�ZKe9eKd%�GdGdH�dHe8�ZLeLZMe9eL�GdIdJ�dJe8�ZNddKlmOZOmPZPmQZQGdLdM�dMe8�ZRGdNdO�dOe8�ZSdPdQ�ZTd�dRdS�ZUdTdU�ZVdVdW�ZWGdXdY�dYeX�ZYGdZd[�d[eY�ZZejdk�r�Gd\d]�d]eY�Z[dd^lm\Z\m8Z8Gd_d`�d`e8�Z]Gdadb�dbeY�Z^Gdcdd�ddeX�Z_e_eY�Z`e_eZ�Zaejdk�r�eZdedejb�Zcn,ejdfk�r�eZdgejdddh��ZcneZd�Zcejdk�r8e_e[�Zee_e^�ZfeejgjhZhddilmiZimjZjd�djdk�Zke1e@�e1eL�k�rTe@Zle?Zmn6e1e>�e1eL�k�rpe>Zle=Zmne1eE�e1eL�k�r�eEZleDZmddllmnZnmoZompZpmqZqe(eLeLeLel�en�Zre(eLeLe?el�eo�Zsdmdn�Ztete:eLe:e:�eq�Zudodp�Zvete:eLe?�ep�Zwd�drds�ZxzddtlmyZyWnezk
�r(YnXete:eLe?�ey�Z{d�dudv�Z|ejdk�r`dwdx�Z}dydz�Z~dd{lm�Z�m�Z�eIZ�eFZ�e;e?e=eDfD]@Z�e1e��dhk�r�e�Z�n&e1e��d|k�r�e�Z�ne1e��dk�r�e�Z��q�e<e@e>eEfD]@Z�e1e��dhk�r�e�Z�n&e1e��d|k�r�e�Z�ne1e��dk�r�e�Z��q�[�eT�dS)�z,create and manipulate C data types in Python�Nz1.1.0)�Union�	Structure�Array)�_Pointer)�CFuncPtr)�__version__)�
RTLD_LOCAL�RTLD_GLOBAL)�
ArgumentError��calcsizezVersion number mismatch�nt)�FormatError�posix�darwin�.�)�FUNCFLAG_CDECL�FUNCFLAG_PYTHONAPI�FUNCFLAG_USE_ERRNO�FUNCFLAG_USE_LASTERRORcCszt|t�rD|dkrt|�d}t�d||�t|}|�}||_|St|t�rnt�dd|�t|}|�}|St|��dS)z�create_string_buffer(aBytes) -> character array
    create_string_buffer(anInteger) -> character array
    create_string_buffer(aBytes, anInteger) -> character array
    N�zctypes.create_string_buffer)	�
isinstance�bytes�len�_sys�audit�c_char�value�int�	TypeError��init�sizeZbuftypeZbuf�r$�'/usr/lib64/python3.8/ctypes/__init__.py�create_string_buffer/s

r&cCs
t||�S�N)r&)r"r#r$r$r%�c_bufferCsr(cs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)a�CFUNCTYPE(restype, *argtypes,
                 use_errno=False, use_last_error=False) -> function prototype.

    restype: the result type
    argtypes: a sequence specifying the argument types

    The function prototype can be called in different ways to create a
    callable object:

    prototype(integer address) -> foreign function
    prototype(callable) -> create and return a C callable function from callable
    prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
    prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
    prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
    �	use_errnoF�use_last_error�!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z CFUNCTYPE.<locals>.CFunctionTypeN��__name__�
__module__�__qualname__�
_argtypes_�	_restype_�_flags_r$��argtypes�flags�restyper$r%�
CFunctionTypeesr7N)	�_FUNCFLAG_CDECL�pop�_FUNCFLAG_USE_ERRNO�_FUNCFLAG_USE_LASTERROR�
ValueError�keys�_c_functype_cache�KeyError�	_CFuncPtr)r6r4�kwr7r$r3r%�	CFUNCTYPEKsrB)�LoadLibrary)�FUNCFLAG_STDCALLcs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)Nr)Fr*r+cseZdZ�Z�Z�ZdS)z$WINFUNCTYPE.<locals>.WinFunctionTypeNr,r$r3r$r%�WinFunctionType}srE)	�_FUNCFLAG_STDCALLr9r:r;r<r=�_win_functype_cacher?r@)r6r4rArEr$r3r%�WINFUNCTYPEqsrH)�dlopen)�sizeof�byref�	addressof�	alignment�resize)�	get_errno�	set_errno)�_SimpleCDatacCsJddlm}|dkr|j}t|�||�}}||krFtd|||f��dS)Nrrz"sizeof(%s) wrong: %d instead of %d)�structr�_type_rJ�SystemError)�typ�typecoderZactualZrequiredr$r$r%�_check_size�s�rWcs eZdZdZ�fdd�Z�ZS)�	py_object�Ocs4zt���WStk
r.dt|�jYSXdS)Nz
%s(<NULL>))�super�__repr__r<�typer-��self��	__class__r$r%r[�szpy_object.__repr__)r-r.r/rSr[�
__classcell__r$r$r_r%rX�srX�Pc@seZdZdZdS)�c_short�hN�r-r.r/rSr$r$r$r%rc�srcc@seZdZdZdS)�c_ushort�HNrer$r$r$r%rf�srfc@seZdZdZdS)�c_long�lNrer$r$r$r%rh�srhc@seZdZdZdS)�c_ulong�LNrer$r$r$r%rj�srj�iric@seZdZdZdS)�c_intrlNrer$r$r$r%rm�srmc@seZdZdZdS)�c_uint�INrer$r$r$r%rn�srnc@seZdZdZdS)�c_float�fNrer$r$r$r%rp�srpc@seZdZdZdS)�c_double�dNrer$r$r$r%rr�srrc@seZdZdZdS)�c_longdouble�gNrer$r$r$r%rt�srt�qc@seZdZdZdS)�
c_longlongrvNrer$r$r$r%rw�srwc@seZdZdZdS)�c_ulonglong�QNrer$r$r$r%rx�srxc@seZdZdZdS)�c_ubyte�BNrer$r$r$r%rz�srzc@seZdZdZdS)�c_byte�bNrer$r$r$r%r|�sr|c@seZdZdZdS)r�cNrer$r$r$r%r�src@seZdZdZdd�ZdS)�c_char_p�zcCsd|jjt�|�jfS�Nz%s(%s)�r`r-�c_void_pZfrom_bufferrr]r$r$r%r[�szc_char_p.__repr__N�r-r.r/rSr[r$r$r$r%r�src@seZdZdZdS)r�rbNrer$r$r$r%r��sr�c@seZdZdZdS)�c_bool�?Nrer$r$r$r%r��sr�)�POINTER�pointer�_pointer_type_cachec@seZdZdZdd�ZdS)�	c_wchar_p�ZcCsd|jjt�|�jfSr�r�r]r$r$r%r[�szc_wchar_p.__repr__Nr�r$r$r$r%r��sr�c@seZdZdZdS)�c_wchar�uNrer$r$r$r%r�sr�cCsFt��t��tjdkr"t��tjtt	�_t
jtt�_ttd<dS)Nr
)
r��clearr>�_os�namerGr�Z
from_paramr�r�rrr�r$r$r$r%�_reset_caches
r�cCs�t|t�rh|dkrBtt�dkr6tdd�|D��d}nt|�d}t�d||�t|}|�}||_|St|t	�r�t�dd|�t|}|�}|St
|��dS)z�create_unicode_buffer(aString) -> character array
    create_unicode_buffer(anInteger) -> character array
    create_unicode_buffer(aString, anInteger) -> character array
    N�css"|]}t|�dkrdndVqdS)i��r�rN)�ord)�.0r~r$r$r%�	<genexpr>sz(create_unicode_buffer.<locals>.<genexpr>rzctypes.create_unicode_buffer)r�strrJr��sumrrrrrr r!r$r$r%�create_unicode_buffers 

r�cCsLt�|d�dk	rtd��t|�tkr,td��|�|�|t|<tt|�=dS)Nz%This type already exists in the cachezWhat's this???)r��get�RuntimeError�idZset_type)r��clsr$r$r%�SetPointerType.s
r�cCs||Sr'r$)rUrr$r$r%�ARRAY8sr�c@sPeZdZdZeZeZdZdZ	dZ
eddddfdd�Zdd	�Z
d
d�Zdd
�ZdS)�CDLLa�An instance of this class represents a loaded dll/shared
    library, exporting functions using the standard C calling
    convention (named 'cdecl' on Windows).

    The exported functions can be accessed as attributes, or by
    indexing with the function name.  Examples:

    <obj>.qsort -> callable object
    <obj>['qsort'] -> callable object

    Calling the functions releases the Python GIL during the call and
    reacquires it afterwards.
    z<uninitialized>rNFc	s�|�_�j�|r�tO�|r$�tO�tj�d�rV|rV|�d�rVd|krV|tj	tj
BO}tjdkr�|dk	rn|}n6ddl}|j
}d|ks�d|kr�|��j��_||jO}G��fdd	�d	t�}|�_|dkr�t�j|��_n|�_dS)
NZaix�)z.a(r
r�/�\cseZdZ�Z�jZdS)zCDLL.__init__.<locals>._FuncPtrN)r-r.r/r2�_func_restype_r1r$�r5r^r$r%�_FuncPtrosr�)�_name�_func_flags_r:r;r�platform�
startswith�endswithr�ZRTLD_MEMBER�RTLD_NOWr�r
Z!_LOAD_LIBRARY_SEARCH_DEFAULT_DIRSZ_getfullpathnameZ!_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIRr@r��_dlopen�_handle)	r^r��modeZhandler)r*Zwinmoder
r�r$r�r%�__init__Ss,

z
CDLL.__init__cCs8d|jj|j|jtjdd@t|�tjdd@fS)Nz<%s '%s', handle %x at %#x>r�r)r`r-r�r�r�maxsizer�r]r$r$r%r[ys
��z
CDLL.__repr__cCs6|�d�r|�d�rt|��|�|�}t|||�|S)N�__)r�r��AttributeError�__getitem__�setattr)r^r��funcr$r$r%�__getattr__s

zCDLL.__getattr__cCs"|�||f�}t|t�s||_|Sr')r�rrr-)r^Zname_or_ordinalr�r$r$r%r��s
zCDLL.__getitem__)r-r.r/�__doc__r8r�rmr�r�r�r��DEFAULT_MODEr�r[r�r�r$r$r$r%r�>s
�
&r�c@seZdZdZeeBZdS)�PyDLLz�This class represents the Python library itself.  It allows
    accessing Python API functions.  The GIL is not released, and
    Python exceptions are handled correctly.
    N)r-r.r/r�r8�_FUNCFLAG_PYTHONAPIr�r$r$r$r%r��sr�c@seZdZdZeZdS)�WinDLLznThis class represents a dll exporting functions using the
        Windows stdcall calling convention.
        N)r-r.r/r�rFr�r$r$r$r%r��sr�)�_check_HRESULTrQc@seZdZdZeZdS)�HRESULTriN)r-r.r/rSr�Z_check_retval_r$r$r$r%r��s
r�c@seZdZdZeZeZdS)�OleDLLz�This class represents a dll exporting functions using the
        Windows stdcall calling convention, and returning HRESULT.
        HRESULT error values are automatically raised as OSError
        exceptions.
        N)r-r.r/r�rFr�r�r�r$r$r$r%r��sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
LibraryLoadercCs
||_dSr'��_dlltype)r^Zdlltyper$r$r%r��szLibraryLoader.__init__cCs.|ddkrt|��|�|�}t|||�|S)Nr�_)r�r�r�)r^r�Zdllr$r$r%r��s

zLibraryLoader.__getattr__cCs
t||�Sr')�getattr�r^r�r$r$r%r��szLibraryLoader.__getitem__cCs
|�|�Sr'r�r�r$r$r%rC�szLibraryLoader.LoadLibraryN)r-r.r/r�r�r�rCr$r$r$r%r��sr�z
python dll�cygwinzlibpython%d.%d.dllr�)�get_last_error�set_last_errorcCs0|dkrt�}|dkr"t|���}td|d|�Sr')�GetLastErrorr�strip�OSError)�codeZdescrr$r$r%�WinError�s
r�)�
_memmove_addr�_memset_addr�_string_at_addr�
_cast_addrcsG��fdd�dt�}|S)NcseZdZ�Z�ZeeBZdS)z!PYFUNCTYPE.<locals>.CFunctionTypeN)r-r.r/r0r1r8r�r2r$�r4r6r$r%r7�sr7)r@)r6r4r7r$r�r%�
PYFUNCTYPE�sr�cCst|||�Sr')�_cast)�objrUr$r$r%�cast�sr����cCs
t||�S)zAstring_at(addr[, size]) -> string

    Return the string at addr.)�
_string_at�Zptrr#r$r$r%�	string_at�sr�)�_wstring_at_addrcCs
t||�S)zFwstring_at(addr[, size]) -> string

        Return the string at addr.)�_wstring_atr�r$r$r%�
wstring_at
sr�cCsBztdt�t�dg�}Wntk
r.YdSX|�|||�SdS)N�comtypes.server.inprocserver�*i�)�
__import__�globals�locals�ImportError�DllGetClassObject)ZrclsidZriidZppv�ccomr$r$r%r�s
r�cCs8ztdt�t�dg�}Wntk
r.YdSX|��S)Nr�r�r)r�r�r�r��DllCanUnloadNow)r�r$r$r%r�s
r�)�BigEndianStructure�LittleEndianStructure�)N)N)N)N)NN)r�)r�)�r��osr��sysrrZ_ctypesrrrrrr@Z_ctypes_versionrr	r
rRrZ	_calcsize�	Exceptionr�rr�r�r�uname�release�splitrr8rr�rr:rr;r&r(r>rBrCr�rDrFrGrH�replacerIrJrKrLrMrNrOrPrQrWrXrcrfrhrjrmrnrprrrtrwrxrzZ__ctype_le__Z__ctype_be__r|rrr�Zc_voidpr�r�r�r�r�r�r�r�r�r��objectr�r�r�r�r�r�r�ZcdllZpydllZ	dllhandleZ	pythonapi�version_infoZwindllZoledllZkernel32r�r�r�r�Zc_size_tZ	c_ssize_tr�r�r�r�ZmemmoveZmemsetr�r�r�r�r�r�r�r�r�r�r�Zctypes._endianr�r�Zc_int8Zc_uint8ZkindZc_int16Zc_int32Zc_int64Zc_uint16Zc_uint32Zc_uint64r$r$r$r%�<module>s4


!




N
	


__pycache__/__init__.cpython-38.pyc000064400000037766150532450670013175 0ustar00U

e5d�E�@s dZddlZddlZdZddlmZmZm	Z	ddlm
Z
ddlmZddlmZ
ddlmZmZdd	lmZdd
lmZee
kr�edee
��ejdkr�dd
lmZeZejdkr�ejdkr�ee��j�d�d�dkr�eZddlmZmZ m!Z"m#Z$d}dd�Z%d~dd�Z&iZ'dd�Z(ejdk�r\ddlm)Z*ddlm+Z,iZ-dd�Z.e.j�rte(j�/dd�e._nejdk�rtddlm0Z*ddlm1Z1m2Z2m3Z3m4Z4m5Z5ddlm6Z6m7Z7dd lm8Z8dd!d"�Z9Gd#d$�d$e8�Z:e9e:d%�Gd&d'�d'e8�Z;e9e;�Gd(d)�d)e8�Z<e9e<�Gd*d+�d+e8�Z=e9e=�Gd,d-�d-e8�Z>e9e>�ed.�ed/�k�rLe=Z?e>Z@n0Gd0d1�d1e8�Z?e9e?�Gd2d3�d3e8�Z@e9e@�Gd4d5�d5e8�ZAe9eA�Gd6d7�d7e8�ZBe9eB�Gd8d9�d9e8�ZCe1eC�e1eB�k�r�eBZCed/�ed:�k�r�e=ZDe>ZEn0Gd;d<�d<e8�ZDe9eD�Gd=d>�d>e8�ZEe9eE�Gd?d@�d@e8�ZFeFeF_GeF_He9eF�GdAdB�dBe8�ZIeIeI_GeI_He9eI�GdCdD�dDe8�ZJeJeJ_GeJ_He9eJ�GdEdF�dFe8�ZKe9eKd%�GdGdH�dHe8�ZLeLZMe9eL�GdIdJ�dJe8�ZNddKlmOZOmPZPmQZQGdLdM�dMe8�ZRGdNdO�dOe8�ZSdPdQ�ZTd�dRdS�ZUdTdU�ZVdVdW�ZWGdXdY�dYeX�ZYGdZd[�d[eY�ZZejdk�r�Gd\d]�d]eY�Z[dd^lm\Z\m8Z8Gd_d`�d`e8�Z]Gdadb�dbeY�Z^Gdcdd�ddeX�Z_e_eY�Z`e_eZ�Zaejdk�r�eZdedejb�Zcn,ejdfk�r�eZdgejdddh��ZcneZd�Zcejdk�r8e_e[�Zee_e^�ZfeejgjhZhddilmiZimjZjd�djdk�Zke1e@�e1eL�k�rTe@Zle?Zmn6e1e>�e1eL�k�rpe>Zle=Zmne1eE�e1eL�k�r�eEZleDZmddllmnZnmoZompZpmqZqe(eLeLeLel�en�Zre(eLeLe?el�eo�Zsdmdn�Ztete:eLe:e:�eq�Zudodp�Zvete:eLe?�ep�Zwd�drds�ZxzddtlmyZyWnezk
�r(YnXete:eLe?�ey�Z{d�dudv�Z|ejdk�r`dwdx�Z}dydz�Z~dd{lm�Z�m�Z�eIZ�eFZ�e;e?e=eDfD]@Z�e1e��dhk�r�e�Z�n&e1e��d|k�r�e�Z�ne1e��dk�r�e�Z��q�e<e@e>eEfD]@Z�e1e��dhk�r�e�Z�n&e1e��d|k�r�e�Z�ne1e��dk�r�e�Z��q�[�eT�dS)�z,create and manipulate C data types in Python�Nz1.1.0)�Union�	Structure�Array)�_Pointer)�CFuncPtr)�__version__)�
RTLD_LOCAL�RTLD_GLOBAL)�
ArgumentError��calcsizezVersion number mismatch�nt)�FormatError�posix�darwin�.�)�FUNCFLAG_CDECL�FUNCFLAG_PYTHONAPI�FUNCFLAG_USE_ERRNO�FUNCFLAG_USE_LASTERRORcCszt|t�rD|dkrt|�d}t�d||�t|}|�}||_|St|t�rnt�dd|�t|}|�}|St|��dS)z�create_string_buffer(aBytes) -> character array
    create_string_buffer(anInteger) -> character array
    create_string_buffer(aBytes, anInteger) -> character array
    N�zctypes.create_string_buffer)	�
isinstance�bytes�len�_sys�audit�c_char�value�int�	TypeError��init�sizeZbuftypeZbuf�r$�'/usr/lib64/python3.8/ctypes/__init__.py�create_string_buffer/s

r&cCs
t||�S�N)r&)r"r#r$r$r%�c_bufferCsr(cs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)a�CFUNCTYPE(restype, *argtypes,
                 use_errno=False, use_last_error=False) -> function prototype.

    restype: the result type
    argtypes: a sequence specifying the argument types

    The function prototype can be called in different ways to create a
    callable object:

    prototype(integer address) -> foreign function
    prototype(callable) -> create and return a C callable function from callable
    prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
    prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
    prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
    �	use_errnoF�use_last_error�!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z CFUNCTYPE.<locals>.CFunctionTypeN��__name__�
__module__�__qualname__�
_argtypes_�	_restype_�_flags_r$��argtypes�flags�restyper$r%�
CFunctionTypeesr7N)	�_FUNCFLAG_CDECL�pop�_FUNCFLAG_USE_ERRNO�_FUNCFLAG_USE_LASTERROR�
ValueError�keys�_c_functype_cache�KeyError�	_CFuncPtr)r6r4�kwr7r$r3r%�	CFUNCTYPEKsrB)�LoadLibrary)�FUNCFLAG_STDCALLcs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)Nr)Fr*r+cseZdZ�Z�Z�ZdS)z$WINFUNCTYPE.<locals>.WinFunctionTypeNr,r$r3r$r%�WinFunctionType}srE)	�_FUNCFLAG_STDCALLr9r:r;r<r=�_win_functype_cacher?r@)r6r4rArEr$r3r%�WINFUNCTYPEqsrH)�dlopen)�sizeof�byref�	addressof�	alignment�resize)�	get_errno�	set_errno)�_SimpleCDatacCsJddlm}|dkr|j}t|�||�}}||krFtd|||f��dS)Nrrz"sizeof(%s) wrong: %d instead of %d)�structr�_type_rJ�SystemError)�typ�typecoderZactualZrequiredr$r$r%�_check_size�s�rWcs eZdZdZ�fdd�Z�ZS)�	py_object�Ocs4zt���WStk
r.dt|�jYSXdS)Nz
%s(<NULL>))�super�__repr__r<�typer-��self��	__class__r$r%r[�szpy_object.__repr__)r-r.r/rSr[�
__classcell__r$r$r_r%rX�srX�Pc@seZdZdZdS)�c_short�hN�r-r.r/rSr$r$r$r%rc�srcc@seZdZdZdS)�c_ushort�HNrer$r$r$r%rf�srfc@seZdZdZdS)�c_long�lNrer$r$r$r%rh�srhc@seZdZdZdS)�c_ulong�LNrer$r$r$r%rj�srj�iric@seZdZdZdS)�c_intrlNrer$r$r$r%rm�srmc@seZdZdZdS)�c_uint�INrer$r$r$r%rn�srnc@seZdZdZdS)�c_float�fNrer$r$r$r%rp�srpc@seZdZdZdS)�c_double�dNrer$r$r$r%rr�srrc@seZdZdZdS)�c_longdouble�gNrer$r$r$r%rt�srt�qc@seZdZdZdS)�
c_longlongrvNrer$r$r$r%rw�srwc@seZdZdZdS)�c_ulonglong�QNrer$r$r$r%rx�srxc@seZdZdZdS)�c_ubyte�BNrer$r$r$r%rz�srzc@seZdZdZdS)�c_byte�bNrer$r$r$r%r|�sr|c@seZdZdZdS)r�cNrer$r$r$r%r�src@seZdZdZdd�ZdS)�c_char_p�zcCsd|jjt�|�jfS�Nz%s(%s)�r`r-�c_void_pZfrom_bufferrr]r$r$r%r[�szc_char_p.__repr__N�r-r.r/rSr[r$r$r$r%r�src@seZdZdZdS)r�rbNrer$r$r$r%r��sr�c@seZdZdZdS)�c_bool�?Nrer$r$r$r%r��sr�)�POINTER�pointer�_pointer_type_cachec@seZdZdZdd�ZdS)�	c_wchar_p�ZcCsd|jjt�|�jfSr�r�r]r$r$r%r[�szc_wchar_p.__repr__Nr�r$r$r$r%r��sr�c@seZdZdZdS)�c_wchar�uNrer$r$r$r%r�sr�cCsFt��t��tjdkr"t��tjtt	�_t
jtt�_ttd<dS)Nr
)
r��clearr>�_os�namerGr�Z
from_paramr�r�rrr�r$r$r$r%�_reset_caches
r�cCs�t|t�rh|dkrBtt�dkr6tdd�|D��d}nt|�d}t�d||�t|}|�}||_|St|t	�r�t�dd|�t|}|�}|St
|��dS)z�create_unicode_buffer(aString) -> character array
    create_unicode_buffer(anInteger) -> character array
    create_unicode_buffer(aString, anInteger) -> character array
    N�css"|]}t|�dkrdndVqdS)i��r�rN)�ord)�.0r~r$r$r%�	<genexpr>sz(create_unicode_buffer.<locals>.<genexpr>rzctypes.create_unicode_buffer)r�strrJr��sumrrrrrr r!r$r$r%�create_unicode_buffers 

r�cCsLt�|d�dk	rtd��t|�tkr,td��|�|�|t|<tt|�=dS)Nz%This type already exists in the cachezWhat's this???)r��get�RuntimeError�idZset_type)r��clsr$r$r%�SetPointerType.s
r�cCs||Sr'r$)rUrr$r$r%�ARRAY8sr�c@sPeZdZdZeZeZdZdZ	dZ
eddddfdd�Zdd	�Z
d
d�Zdd
�ZdS)�CDLLa�An instance of this class represents a loaded dll/shared
    library, exporting functions using the standard C calling
    convention (named 'cdecl' on Windows).

    The exported functions can be accessed as attributes, or by
    indexing with the function name.  Examples:

    <obj>.qsort -> callable object
    <obj>['qsort'] -> callable object

    Calling the functions releases the Python GIL during the call and
    reacquires it afterwards.
    z<uninitialized>rNFc	s�|�_�j�|r�tO�|r$�tO�tj�d�rV|rV|�d�rVd|krV|tj	tj
BO}tjdkr�|dk	rn|}n6ddl}|j
}d|ks�d|kr�|��j��_||jO}G��fdd	�d	t�}|�_|dkr�t�j|��_n|�_dS)
NZaix�)z.a(r
r�/�\cseZdZ�Z�jZdS)zCDLL.__init__.<locals>._FuncPtrN)r-r.r/r2�_func_restype_r1r$�r5r^r$r%�_FuncPtrosr�)�_name�_func_flags_r:r;r�platform�
startswith�endswithr�ZRTLD_MEMBER�RTLD_NOWr�r
Z!_LOAD_LIBRARY_SEARCH_DEFAULT_DIRSZ_getfullpathnameZ!_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIRr@r��_dlopen�_handle)	r^r��modeZhandler)r*Zwinmoder
r�r$r�r%�__init__Ss,

z
CDLL.__init__cCs8d|jj|j|jtjdd@t|�tjdd@fS)Nz<%s '%s', handle %x at %#x>r�r)r`r-r�r�r�maxsizer�r]r$r$r%r[ys
��z
CDLL.__repr__cCs6|�d�r|�d�rt|��|�|�}t|||�|S)N�__)r�r��AttributeError�__getitem__�setattr)r^r��funcr$r$r%�__getattr__s

zCDLL.__getattr__cCs"|�||f�}t|t�s||_|Sr')r�rrr-)r^Zname_or_ordinalr�r$r$r%r��s
zCDLL.__getitem__)r-r.r/�__doc__r8r�rmr�r�r�r��DEFAULT_MODEr�r[r�r�r$r$r$r%r�>s
�
&r�c@seZdZdZeeBZdS)�PyDLLz�This class represents the Python library itself.  It allows
    accessing Python API functions.  The GIL is not released, and
    Python exceptions are handled correctly.
    N)r-r.r/r�r8�_FUNCFLAG_PYTHONAPIr�r$r$r$r%r��sr�c@seZdZdZeZdS)�WinDLLznThis class represents a dll exporting functions using the
        Windows stdcall calling convention.
        N)r-r.r/r�rFr�r$r$r$r%r��sr�)�_check_HRESULTrQc@seZdZdZeZdS)�HRESULTriN)r-r.r/rSr�Z_check_retval_r$r$r$r%r��s
r�c@seZdZdZeZeZdS)�OleDLLz�This class represents a dll exporting functions using the
        Windows stdcall calling convention, and returning HRESULT.
        HRESULT error values are automatically raised as OSError
        exceptions.
        N)r-r.r/r�rFr�r�r�r$r$r$r%r��sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
LibraryLoadercCs
||_dSr'��_dlltype)r^Zdlltyper$r$r%r��szLibraryLoader.__init__cCs.|ddkrt|��|�|�}t|||�|S)Nr�_)r�r�r�)r^r�Zdllr$r$r%r��s

zLibraryLoader.__getattr__cCs
t||�Sr')�getattr�r^r�r$r$r%r��szLibraryLoader.__getitem__cCs
|�|�Sr'r�r�r$r$r%rC�szLibraryLoader.LoadLibraryN)r-r.r/r�r�r�rCr$r$r$r%r��sr�z
python dll�cygwinzlibpython%d.%d.dllr�)�get_last_error�set_last_errorcCs0|dkrt�}|dkr"t|���}td|d|�Sr')�GetLastErrorr�strip�OSError)�codeZdescrr$r$r%�WinError�s
r�)�
_memmove_addr�_memset_addr�_string_at_addr�
_cast_addrcsG��fdd�dt�}|S)NcseZdZ�Z�ZeeBZdS)z!PYFUNCTYPE.<locals>.CFunctionTypeN)r-r.r/r0r1r8r�r2r$�r4r6r$r%r7�sr7)r@)r6r4r7r$r�r%�
PYFUNCTYPE�sr�cCst|||�Sr')�_cast)�objrUr$r$r%�cast�sr����cCs
t||�S)zAstring_at(addr[, size]) -> string

    Return the string at addr.)�
_string_at�Zptrr#r$r$r%�	string_at�sr�)�_wstring_at_addrcCs
t||�S)zFwstring_at(addr[, size]) -> string

        Return the string at addr.)�_wstring_atr�r$r$r%�
wstring_at
sr�cCsBztdt�t�dg�}Wntk
r.YdSX|�|||�SdS)N�comtypes.server.inprocserver�*i�)�
__import__�globals�locals�ImportError�DllGetClassObject)ZrclsidZriidZppv�ccomr$r$r%r�s
r�cCs8ztdt�t�dg�}Wntk
r.YdSX|��S)Nr�r�r)r�r�r�r��DllCanUnloadNow)r�r$r$r%r�s
r�)�BigEndianStructure�LittleEndianStructure�)N)N)N)N)NN)r�)r�)�r��osr��sysrrZ_ctypesrrrrrr@Z_ctypes_versionrr	r
rRrZ	_calcsize�	Exceptionr�rr�r�r�uname�release�splitrr8rr�rr:rr;r&r(r>rBrCr�rDrFrGrH�replacerIrJrKrLrMrNrOrPrQrWrXrcrfrhrjrmrnrprrrtrwrxrzZ__ctype_le__Z__ctype_be__r|rrr�Zc_voidpr�r�r�r�r�r�r�r�r�r��objectr�r�r�r�r�r�r�ZcdllZpydllZ	dllhandleZ	pythonapi�version_infoZwindllZoledllZkernel32r�r�r�r�Zc_size_tZ	c_ssize_tr�r�r�r�ZmemmoveZmemsetr�r�r�r�r�r�r�r�r�r�r�Zctypes._endianr�r�Zc_int8Zc_uint8ZkindZc_int16Zc_int32Zc_int64Zc_uint16Zc_uint32Zc_uint64r$r$r$r%�<module>s4


!




N
	


__pycache__/_aix.cpython-38.opt-2.pyc000064400000010217150532450670013274 0ustar00U

e5d1�@s�dZddlZddlmZmZddlmZddlmZm	Z	ddl
mZmZm
Z
e	e�dZddlmZd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �ZdS)!z%Michael Felt <aixtools@felt.demon.nl>�N)�environ�path)�
executable)�c_void_p�sizeof)�Popen�PIPE�DEVNULL�)�maxsizecs�fdd�}tt|�|d�S)NcsL|���}g}z|r*|�dt|����qWntk
r@YnX|pJtgS)Nr)�split�insert�int�pop�
ValueErrorr)Zlibname�partsZnums��sep��#/usr/lib64/python3.8/ctypes/_aix.py�_num_version>s
z#_last_version.<locals>._num_version)�key)�max�reversed)Zlibnamesrrrrr�
_last_version=s
rcCs:d}|jD]*}|�d�r|}q
d|kr
|�d�Sq
dS)N)�/z./z../ZINDEX�
)�stdout�
startswith�rstrip)�p�	ld_header�linerrr�
get_ld_headerJs

r#cCs0g}|jD] }t�d|�r&|�|�q
q,q
|S)Nz[0-9])r�re�match�append)r �infor"rrr�get_ld_header_infoTs
r(cCs\g}tddt��d|gdttd�}t|�}|rF|�|t|�f�q"qFq"|j��|�	�|S)Nz
/usr/bin/dumpz-Xz-HT)Zuniversal_newlinesr�stderr)
r�AIX_ABIrr	r#r&r(r�close�wait)�fileZldr_headersr r!rrr�get_ld_headersas
�
r.cCs6g}|D](\}}d|kr|�||�d�d��q|S)N�[���)r&�index)Z
ld_headersZsharedr"�_rrr�
get_sharedys
r3csJd��d��ttd�fdd�|D���}t|�dkrB|d�d�SdSdS)Nz\[(z)\]c3s|]}t��|�VqdS)N)r$�search)�.0r"��exprrr�	<genexpr>�sz get_one_match.<locals>.<genexpr>�r)�list�filter�len�group)r7�linesZmatchesrr6r�
get_one_match�s
r?cCsJtdkr d}t||�}|rF|Sn&dD] }tt�|�|�}|r$|Sq$dS)N�@zshr4?_?64\.o)zshr.ozshr4.o)r*r?r$�escape)�membersr7�member�namerrr�
get_legacy�s

rEcCsfd|�d�d|�d�g}|D]D}g}|D]$}t�||�}|r(|�|�d��q(|rt|d�SqdS)N�libz\.so\.[0-9]+[0-9.]*z_?64\.so\.[0-9]+[0-9.]*r�.)r$r4r&r=r)rDrBZexprsr7Zversionsr"�mrrr�get_version�s

�rIcCsbd|�d�}t||�}|r|Stdkr<d|�d�}t||�}|rD|St||�}|rV|St|�SdS)NrFz\.sor@z64\.so)r?r*rIrE)rDrBr7rCrrr�
get_member�s



rJcCs|t�d�}|dkrt�d�}|dkr*g}n
|�d�}tt�}|D]6\}}|D](}|��d}d|krL|�|�d��qLq@|S)NZLD_LIBRARY_PATHZLIBPATH�:r9r)r�getrr.r�extend)�libpathsZobjectsr2r>r"rrrr�get_libpaths�s



rOcCsp|D]f}|dkrqd|�d�}t�||�}t�|�rtt|��}tt�|�|�}|dkrd||fSdSqdS)N�/librFz.a)NN)r�join�existsr3r.rJr$rA)�pathsrD�dir�base�archiverBrCrrr�find_shared
s
rWcCsnt�}t||�\}}|dkr,|�d|�d�Sd|�d�}|D],}|dkrJq<t�||�}t�|�r<|Sq<dS)N�(�)rFz.sorP)rOrWrrQrR)rDrNrUrCZsonamerTZshlibrrr�find_library#s

rZ)�
__author__r$�osrr�sysrZctypesrr�
subprocessrrr	r*rrr#r(r.r3r?rErIrJrOrWrZrrrr�<module>/s&


&__pycache__/wintypes.cpython-38.opt-1.pyc000064400000011761150532450670014242 0ustar00U

e5d��@sddlZejZejZejZejZej	Z
ejZej
ZejZejZeZejZGdd�dej�ZejZejZejZejZejZZej Z!Z"ej#Z$Z%Z&ej#Z'Z(ej)Z*Z+ej,Z-Z.e�/ej�e�/ej,�kr�ejZ0ejZ1n$e�/ej�e�/ej,�kr�ej Z0ejZ1eZ2eZ3eZ4eZ5eZ6eZ7ej,Z8e8Z9e8Z:e8Z;e8Z<e8Z=e8Z>e8Z?e8Z@e8ZAe8ZBe8ZCe8ZDe8ZEe8ZFe8ZGe8ZHe8ZIe8ZJe8ZKe8ZLe8ZMe8ZNe8ZOe8ZPe8ZQe8ZRe8ZSe8ZTe8ZUe8ZVe8ZWGdd�dejX�ZYeYZZZ[Z\Gdd�dejX�Z]e]Z^Gdd	�d	ejX�Z_Gd
d�dejX�Z`e`ZaZbZcGdd
�d
ejX�ZdedZeZfdd�ZgGdd�dejX�ZhehZiGdd�dejX�ZjejZkdZlGdd�dejX�ZmGdd�dejX�Zne�oe�ZpZqe�oe�Zre�oe�ZsZte�oe�Zue�oe4�Zve�oe�ZwZxe�oeh�ZyZze�oe�Z{e�oe8�Z|Z}e�oeG�Z~e�oeH�Ze�oe�Z�Z�e�oe�Z�e�oe7�Z�e�oe�Z�Z�e�oej�Z�Z�e�oe`�Z�Z�e�oec�Z�e�oeY�Z�Z�e�oe\�Z�Z�e�oeV�Z�e�oe�Z�e�oed�Z�Z�e�oef�Z�Z�e�oe^�Z�e�oe�Z�Z�e�oe"�Z�e�oe�Z�e�oe�Z�e�oe
�Z�e�oem�Z�Z�e�oen�Z�Z�e�oe�Z�Z�dS)�Nc@seZdZdZdd�ZdS)�VARIANT_BOOL�vcCsd|jj|jfS)Nz%s(%r))�	__class__�__name__�value)�self�r�'/usr/lib64/python3.8/ctypes/wintypes.py�__repr__szVARIANT_BOOL.__repr__N)r�
__module__�__qualname__Z_type_r
rrrr	rsrc@s(eZdZdefdefdefdefgZdS)�RECT�left�top�rightZbottomN�rrr�LONG�_fields_rrrr	r
as
�r
c@s(eZdZdefdefdefdefgZdS)�_SMALL_RECTZLeftZTopZRightZBottomN�rrr�SHORTrrrrr	rhs
�rc@seZdZdefdefgZdS)�_COORD�X�YNrrrrr	ros�rc@seZdZdefdefgZdS)�POINT�x�yNrrrrr	rss�rc@seZdZdefdefgZdS)�SIZEZcxZcyNrrrrr	rxs�rcCs||d>|d>S)N��r)ZredZgreenZbluerrr	�RGB}sr c@seZdZdefdefgZdS)�FILETIMEZ
dwLowDateTimeZdwHighDateTimeN)rrr�DWORDrrrrr	r!�s�r!c@s4eZdZdefdefdefdefdefdefgZ	dS)�MSGZhWnd�messageZwParamZlParam�timeZptN)
rrr�HWND�UINT�WPARAM�LPARAMr"rrrrrr	r#�s�r#ic@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAA�dwFileAttributes�ftCreationTime�ftLastAccessTime�ftLastWriteTime�
nFileSizeHigh�nFileSizeLow�dwReserved0�dwReserved1�	cFileName�cAlternateFileName�N)rrrr"r!�CHAR�MAX_PATHrrrrr	r*�s

�r*c@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAWr+r,r-r.r/r0r1r2r3r4r5N)rrrr"r!�WCHARr7rrrrr	r8�s

�r8)�ZctypesZc_byteZBYTEZc_ushortZWORDZc_ulongr"Zc_charr6Zc_wcharr9Zc_uintr'Zc_intZINTZc_doubleZDOUBLEZc_floatZFLOATZBOOLEANZc_longZBOOLZ_SimpleCDatarZULONGrZUSHORTZc_shortrZ
c_longlongZ_LARGE_INTEGERZ
LARGE_INTEGERZc_ulonglongZ_ULARGE_INTEGERZULARGE_INTEGERZ	c_wchar_pZ	LPCOLESTRZLPOLESTRZOLESTRZLPCWSTRZLPWSTRZc_char_pZLPCSTRZLPSTRZc_void_pZLPCVOIDZLPVOIDZsizeofr(r)ZATOMZLANGIDZCOLORREFZLGRPIDZLCTYPEZLCIDZHANDLEZHACCELZHBITMAPZHBRUSHZHCOLORSPACEZHDCZHDESKZHDWPZHENHMETAFILEZHFONTZHGDIOBJZHGLOBALZHHOOKZHICONZ	HINSTANCEZHKEYZHKLZHLOCALZHMENUZ	HMETAFILEZHMODULEZHMONITORZHPALETTEZHPENZHRGNZHRSRCZHSTRZHTASKZHWINSTAr&Z	SC_HANDLEZSERVICE_STATUS_HANDLEZ	Structurer
ZtagRECTZ_RECTLZRECTLrZ
SMALL_RECTrrZtagPOINTZ_POINTLZPOINTLrZtagSIZEZSIZELr r!Z	_FILETIMEr#ZtagMSGr7r*r8ZPOINTERZLPBOOLZPBOOLZPBOOLEANZLPBYTEZPBYTEZPCHARZ
LPCOLORREFZLPDWORDZPDWORDZ
LPFILETIMEZ	PFILETIMEZPFLOATZLPHANDLEZPHANDLEZPHKEYZLPHKLZLPINTZPINTZPLARGE_INTEGERZPLCIDZLPLONGZPLONGZLPMSGZPMSGZLPPOINTZPPOINTZPPOINTLZLPRECTZPRECTZLPRECTLZPRECTLZLPSC_HANDLEZPSHORTZLPSIZEZPSIZEZLPSIZELZPSIZELZPSMALL_RECTZLPUINTZPUINTZPULARGE_INTEGERZPULONGZPUSHORTZPWCHARZLPWIN32_FIND_DATAAZPWIN32_FIND_DATAAZLPWIN32_FIND_DATAWZPWIN32_FIND_DATAWZLPWORDZPWORDrrrr	�<module>s�




















__pycache__/_endian.cpython-38.opt-1.pyc000064400000003613150532450670013752 0ustar00U

e5d��@s�ddlZddlTee�Zdd�ZGdd�dee��Zejdkr\dZ	eZ
Gd	d
�d
eed�Zn0ejdkr�d
Z	eZGdd�deed�Z
ned��dS)�N)�*cCsLt|t�rt|t�St|t�r.t|j�|jSt|t	�r<|St
d|��dS)z�Return the type with the 'other' byte order.  Simple types like
    c_int and so on already have __ctype_be__ and __ctype_le__
    attributes which contain the types, for more complicated types
    arrays and structures are supported.
    z+This type does not support other endian: %sN)�hasattr�
_OTHER_ENDIAN�getattr�
isinstance�_array_type�
_other_endianZ_type_Z_length_�
issubclass�	Structure�	TypeError)�typ�r
�&/usr/lib64/python3.8/ctypes/_endian.pyrs



rcseZdZ�fdd�Z�ZS)�
_swapped_metacs^|dkrLg}|D]6}|d}|d}|dd�}|�|t|�f|�q|}t��||�dS)NZ_fields_r��)�appendr�super�__setattr__)�self�attrname�valueZfieldsZdesc�namer�rest��	__class__r
rrsz_swapped_meta.__setattr__)�__name__�
__module__�__qualname__r�
__classcell__r
r
rrrsr�littleZ__ctype_be__c@seZdZdZdZdZdS)�BigEndianStructurez$Structure with big endian byte orderr
N�rrr�__doc__�	__slots__Z_swappedbytes_r
r
r
rr!.sr!)�	metaclassZbigZ__ctype_le__c@seZdZdZdZdZdS)�LittleEndianStructurez'Structure with little endian byte orderr
Nr"r
r
r
rr&7sr&zInvalid byteorder)
�sysZctypes�typeZArrayrrr
r�	byteorderrr&r!�RuntimeErrorr
r
r
r�<module>s

__pycache__/wintypes.cpython-38.opt-2.pyc000064400000011761150532450670014243 0ustar00U

e5d��@sddlZejZejZejZejZej	Z
ejZej
ZejZejZeZejZGdd�dej�ZejZejZejZejZejZZej Z!Z"ej#Z$Z%Z&ej#Z'Z(ej)Z*Z+ej,Z-Z.e�/ej�e�/ej,�kr�ejZ0ejZ1n$e�/ej�e�/ej,�kr�ej Z0ejZ1eZ2eZ3eZ4eZ5eZ6eZ7ej,Z8e8Z9e8Z:e8Z;e8Z<e8Z=e8Z>e8Z?e8Z@e8ZAe8ZBe8ZCe8ZDe8ZEe8ZFe8ZGe8ZHe8ZIe8ZJe8ZKe8ZLe8ZMe8ZNe8ZOe8ZPe8ZQe8ZRe8ZSe8ZTe8ZUe8ZVe8ZWGdd�dejX�ZYeYZZZ[Z\Gdd�dejX�Z]e]Z^Gdd	�d	ejX�Z_Gd
d�dejX�Z`e`ZaZbZcGdd
�d
ejX�ZdedZeZfdd�ZgGdd�dejX�ZhehZiGdd�dejX�ZjejZkdZlGdd�dejX�ZmGdd�dejX�Zne�oe�ZpZqe�oe�Zre�oe�ZsZte�oe�Zue�oe4�Zve�oe�ZwZxe�oeh�ZyZze�oe�Z{e�oe8�Z|Z}e�oeG�Z~e�oeH�Ze�oe�Z�Z�e�oe�Z�e�oe7�Z�e�oe�Z�Z�e�oej�Z�Z�e�oe`�Z�Z�e�oec�Z�e�oeY�Z�Z�e�oe\�Z�Z�e�oeV�Z�e�oe�Z�e�oed�Z�Z�e�oef�Z�Z�e�oe^�Z�e�oe�Z�Z�e�oe"�Z�e�oe�Z�e�oe�Z�e�oe
�Z�e�oem�Z�Z�e�oen�Z�Z�e�oe�Z�Z�dS)�Nc@seZdZdZdd�ZdS)�VARIANT_BOOL�vcCsd|jj|jfS)Nz%s(%r))�	__class__�__name__�value)�self�r�'/usr/lib64/python3.8/ctypes/wintypes.py�__repr__szVARIANT_BOOL.__repr__N)r�
__module__�__qualname__Z_type_r
rrrr	rsrc@s(eZdZdefdefdefdefgZdS)�RECT�left�top�rightZbottomN�rrr�LONG�_fields_rrrr	r
as
�r
c@s(eZdZdefdefdefdefgZdS)�_SMALL_RECTZLeftZTopZRightZBottomN�rrr�SHORTrrrrr	rhs
�rc@seZdZdefdefgZdS)�_COORD�X�YNrrrrr	ros�rc@seZdZdefdefgZdS)�POINT�x�yNrrrrr	rss�rc@seZdZdefdefgZdS)�SIZEZcxZcyNrrrrr	rxs�rcCs||d>|d>S)N��r)ZredZgreenZbluerrr	�RGB}sr c@seZdZdefdefgZdS)�FILETIMEZ
dwLowDateTimeZdwHighDateTimeN)rrr�DWORDrrrrr	r!�s�r!c@s4eZdZdefdefdefdefdefdefgZ	dS)�MSGZhWnd�messageZwParamZlParam�timeZptN)
rrr�HWND�UINT�WPARAM�LPARAMr"rrrrrr	r#�s�r#ic@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAA�dwFileAttributes�ftCreationTime�ftLastAccessTime�ftLastWriteTime�
nFileSizeHigh�nFileSizeLow�dwReserved0�dwReserved1�	cFileName�cAlternateFileName�N)rrrr"r!�CHAR�MAX_PATHrrrrr	r*�s

�r*c@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAWr+r,r-r.r/r0r1r2r3r4r5N)rrrr"r!�WCHARr7rrrrr	r8�s

�r8)�ZctypesZc_byteZBYTEZc_ushortZWORDZc_ulongr"Zc_charr6Zc_wcharr9Zc_uintr'Zc_intZINTZc_doubleZDOUBLEZc_floatZFLOATZBOOLEANZc_longZBOOLZ_SimpleCDatarZULONGrZUSHORTZc_shortrZ
c_longlongZ_LARGE_INTEGERZ
LARGE_INTEGERZc_ulonglongZ_ULARGE_INTEGERZULARGE_INTEGERZ	c_wchar_pZ	LPCOLESTRZLPOLESTRZOLESTRZLPCWSTRZLPWSTRZc_char_pZLPCSTRZLPSTRZc_void_pZLPCVOIDZLPVOIDZsizeofr(r)ZATOMZLANGIDZCOLORREFZLGRPIDZLCTYPEZLCIDZHANDLEZHACCELZHBITMAPZHBRUSHZHCOLORSPACEZHDCZHDESKZHDWPZHENHMETAFILEZHFONTZHGDIOBJZHGLOBALZHHOOKZHICONZ	HINSTANCEZHKEYZHKLZHLOCALZHMENUZ	HMETAFILEZHMODULEZHMONITORZHPALETTEZHPENZHRGNZHRSRCZHSTRZHTASKZHWINSTAr&Z	SC_HANDLEZSERVICE_STATUS_HANDLEZ	Structurer
ZtagRECTZ_RECTLZRECTLrZ
SMALL_RECTrrZtagPOINTZ_POINTLZPOINTLrZtagSIZEZSIZELr r!Z	_FILETIMEr#ZtagMSGr7r*r8ZPOINTERZLPBOOLZPBOOLZPBOOLEANZLPBYTEZPBYTEZPCHARZ
LPCOLORREFZLPDWORDZPDWORDZ
LPFILETIMEZ	PFILETIMEZPFLOATZLPHANDLEZPHANDLEZPHKEYZLPHKLZLPINTZPINTZPLARGE_INTEGERZPLCIDZLPLONGZPLONGZLPMSGZPMSGZLPPOINTZPPOINTZPPOINTLZLPRECTZPRECTZLPRECTLZPRECTLZLPSC_HANDLEZPSHORTZLPSIZEZPSIZEZLPSIZELZPSIZELZPSMALL_RECTZLPUINTZPUINTZPULARGE_INTEGERZPULONGZPUSHORTZPWCHARZLPWIN32_FIND_DATAAZPWIN32_FIND_DATAAZLPWIN32_FIND_DATAWZPWIN32_FIND_DATAWZLPWORDZPWORDrrrr	�<module>s�




















__pycache__/_aix.cpython-38.opt-1.pyc000064400000023166150532450670013302 0ustar00U

e5d1�@s�dZdZddlZddlmZmZddlmZddlm	Z	m
Z
ddlmZm
Z
mZe
e	�dZdd	lmZd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�ZdS)"a�
Lib/ctypes.util.find_library() support for AIX
Similar approach as done for Darwin support by using separate files
but unlike Darwin - no extension such as ctypes.macholib.*

dlopen() is an interface to AIX initAndLoad() - primary documentation at:
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/dlopen.htm
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/load.htm

AIX supports two styles for dlopen(): svr4 (System V Release 4) which is common on posix
platforms, but also a BSD style - aka SVR3.

From AIX 5.3 Difference Addendum (December 2004)
2.9 SVR4 linking affinity
Nowadays, there are two major object file formats used by the operating systems:
XCOFF: The COFF enhanced by IBM and others. The original COFF (Common
Object File Format) was the base of SVR3 and BSD 4.2 systems.
ELF:   Executable and Linking Format that was developed by AT&T and is a
base for SVR4 UNIX.

While the shared library content is identical on AIX - one is located as a filepath name
(svr4 style) and the other is located as a member of an archive (and the archive
is located as a filepath name).

The key difference arises when supporting multiple abi formats (i.e., 32 and 64 bit).
For svr4 either only one ABI is supported, or there are two directories, or there
are different file names. The most common solution for multiple ABI is multiple
directories.

For the XCOFF (aka AIX) style - one directory (one archive file) is sufficient
as multiple shared libraries can be in the archive - even sharing the same name.
In documentation the archive is also referred to as the "base" and the shared
library object is referred to as the "member".

For dlopen() on AIX (read initAndLoad()) the calls are similar.
Default activity occurs when no path information is provided. When path
information is provided dlopen() does not search any other directories.

For SVR4 - the shared library name is the name of the file expected: libFOO.so
For AIX - the shared library is expressed as base(member). The search is for the
base (e.g., libFOO.a) and once the base is found the shared library - identified by
member (e.g., libFOO.so, or shr.o) is located and loaded.

The mode bit RTLD_MEMBER tells initAndLoad() that it needs to use the AIX (SVR3)
naming style.
z%Michael Felt <aixtools@felt.demon.nl>�N)�environ�path)�
executable)�c_void_p�sizeof)�Popen�PIPE�DEVNULL�)�maxsizecs�fdd�}tt|�|d�S)NcsL|���}g}z|r*|�dt|����qWntk
r@YnX|pJtgS)Nr)�split�insert�int�pop�
ValueErrorr)Zlibname�partsZnums��sep��#/usr/lib64/python3.8/ctypes/_aix.py�_num_version>s
z#_last_version.<locals>._num_version)�key)�max�reversed)Zlibnamesrrrrr�
_last_version=s
rcCs:d}|jD]*}|�d�r|}q
d|kr
|�d�Sq
dS)N)�/z./z../ZINDEX�
)�stdout�
startswith�rstrip)�p�	ld_header�linerrr�
get_ld_headerJs

r#cCs0g}|jD] }t�d|�r&|�|�q
q,q
|S)Nz[0-9])r�re�match�append)r �infor"rrr�get_ld_header_infoTs
r(cCs\g}tddt��d|gdttd�}t|�}|rF|�|t|�f�q"qFq"|j��|�	�|S)z�
    Parse the header of the loader section of executable and archives
    This function calls /usr/bin/dump -H as a subprocess
    and returns a list of (ld_header, ld_header_info) tuples.
    z
/usr/bin/dumpz-Xz-HT)Zuniversal_newlinesr�stderr)
r�AIX_ABIrr	r#r&r(r�close�wait)�fileZldr_headersr r!rrr�get_ld_headersas
�
r.cCs6g}|D](\}}d|kr|�||�d�d��q|S)z�
    extract the shareable objects from ld_headers
    character "[" is used to strip off the path information.
    Note: the "[" and "]" characters that are part of dump -H output
    are not removed here.
    �[���)r&�index)Z
ld_headersZsharedr"�_rrr�
get_sharedys
r3csJd��d��ttd�fdd�|D���}t|�dkrB|d�d�SdSdS)zy
    Must be only one match, otherwise result is None.
    When there is a match, strip leading "[" and trailing "]"
    z\[(z)\]Nc3s|]}t��|�VqdS)N)r$�search)�.0r"��exprrr�	<genexpr>�sz get_one_match.<locals>.<genexpr>�r)�list�filter�len�group)r7�linesZmatchesrr6r�
get_one_match�s
r?cCsJtdkr d}t||�}|rF|Sn&dD] }tt�|�|�}|r$|Sq$dS)z�
    This routine provides historical aka legacy naming schemes started
    in AIX4 shared library support for library members names.
    e.g., in /usr/lib/libc.a the member name shr.o for 32-bit binary and
    shr_64.o for 64-bit binary.
    �@zshr4?_?64\.o)zshr.ozshr4.oN)r*r?r$�escape)�membersr7�member�namerrr�
get_legacy�s

rEcCsfd|�d�d|�d�g}|D]D}g}|D]$}t�||�}|r(|�|�d��q(|rt|d�SqdS)a�
    Sort list of members and return highest numbered version - if it exists.
    This function is called when an unversioned libFOO.a(libFOO.so) has
    not been found.

    Versioning for the member name is expected to follow
    GNU LIBTOOL conventions: the highest version (x, then X.y, then X.Y.z)
     * find [libFoo.so.X]
     * find [libFoo.so.X.Y]
     * find [libFoo.so.X.Y.Z]

    Before the GNU convention became the standard scheme regardless of
    binary size AIX packagers used GNU convention "as-is" for 32-bit
    archive members but used an "distinguishing" name for 64-bit members.
    This scheme inserted either 64 or _64 between libFOO and .so
    - generally libFOO_64.so, but occasionally libFOO64.so
    �libz\.so\.[0-9]+[0-9.]*z_?64\.so\.[0-9]+[0-9.]*r�.N)r$r4r&r=r)rDrBZexprsr7Zversionsr"�mrrr�get_version�s

�rIcCsbd|�d�}t||�}|r|Stdkr<d|�d�}t||�}|rD|St||�}|rV|St|�SdS)ab
    Return an archive member matching the request in name.
    Name is the library name without any prefix like lib, suffix like .so,
    or version number.
    Given a list of members find and return the most appropriate result
    Priority is given to generic libXXX.so, then a versioned libXXX.so.a.b.c
    and finally, legacy AIX naming scheme.
    rFz\.sor@z64\.soN)r?r*rIrE)rDrBr7rCrrr�
get_member�s



rJcCs|t�d�}|dkrt�d�}|dkr*g}n
|�d�}tt�}|D]6\}}|D](}|��d}d|krL|�|�d��qLq@|S)a
    On AIX, the buildtime searchpath is stored in the executable.
    as "loader header information".
    The command /usr/bin/dump -H extracts this info.
    Prefix searched libraries with LD_LIBRARY_PATH (preferred),
    or LIBPATH if defined. These paths are appended to the paths
    to libraries the python executable is linked with.
    This mimics AIX dlopen() behavior.
    ZLD_LIBRARY_PATHNZLIBPATH�:r9r)r�getrr.r�extend)�libpathsZobjectsr2r>r"rrrr�get_libpaths�s



rOcCsp|D]f}|dkrqd|�d�}t�||�}t�|�rtt|��}tt�|�|�}|dkrd||fSdSqdS)a
    paths is a list of directories to search for an archive.
    name is the abbreviated name given to find_library().
    Process: search "paths" for archive, and if an archive is found
    return the result of get_member().
    If an archive is not found then return None
    �/librFz.aN)NN)r�join�existsr3r.rJr$rA)�pathsrD�dir�base�archiverBrCrrr�find_shared
s
rWcCsnt�}t||�\}}|dkr,|�d|�d�Sd|�d�}|D],}|dkrJq<t�||�}t�|�r<|Sq<dS)a�AIX implementation of ctypes.util.find_library()
    Find an archive member that will dlopen(). If not available,
    also search for a file (or link) with a .so suffix.

    AIX supports two types of schemes that can be used with dlopen().
    The so-called SystemV Release4 (svr4) format is commonly suffixed
    with .so while the (default) AIX scheme has the library (archive)
    ending with the suffix .a
    As an archive has multiple members (e.g., 32-bit and 64-bit) in one file
    the argument passed to dlopen must include both the library and
    the member names in a single string.

    find_library() looks first for an archive (.a) with a suitable member.
    If no archive+member pair is found, look for a .so file.
    N�(�)rFz.sorP)rOrWrrQrR)rDrNrUrCZsonamerTZshlibrrr�find_library#s

rZ)�__doc__�
__author__r$�osrr�sysrZctypesrr�
subprocessrrr	r*rrr#r(r.r3r?rErIrJrOrWrZrrrr�<module>s(.


&__pycache__/util.cpython-38.opt-2.pyc000064400000017131150532450670013333 0ustar00U

e5d76�@sBddlZddlZddlZddlZejdkrDdd�Zdd�Zdd�Zn�ejd	krnejd
krnddl	m
Zdd�Zn�ej�d
�r�ddl
mZn�ejd	k�r&ddlZddlZdd�Zdd�Zejdkr�dd�Zndd�Zej�d�r�dd�Zdd�Zn8ejdk�rdd�Zd'dd�Zndd �Zd!d"�Zd#d�Zd$d%�Zed&k�r>e�dS)(�N�ntcCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|dd	��d
}|dkr�d}|dkr�||SdS)NzMSC v.����� �����
��g$@r)�sys�version�find�len�split�int)�prefix�i�s�restZmajorVersionZminorVersion�r�#/usr/lib64/python3.8/ctypes/util.py�_get_build_version	srcCs^t�}|dkrdS|dkr d}n|dkr6d|d}ndSddl}d|jjkrV|d7}|d	S)
Nr�msvcrtrzmsvcr%d�
rz_d.pyd�d�.dll)r�importlib.machinery�	machinery�EXTENSION_SUFFIXES)rZclibname�	importlibrrr�find_msvcrt"sr cCsx|dkrt�Stjd�tj�D]R}tj�||�}tj�|�rF|S|���	d�rVq |d}tj�|�r |Sq dS)N)�c�m�PATHr)
r �os�environr�pathsep�path�join�isfile�lower�endswith)�nameZ	directoryZfnamerrr�find_library7s
r-�posix�darwin)�	dyld_findc	CsPd|d|d||fg}|D],}zt|�WStk
rHYqYqXqdS)Nzlib%s.dylibz%s.dylibz%s.framework/%s)�
_dyld_find�
ValueError)r,�possiblerrrr-Hs
��aix)r-c
Cs4d}t|d��}|�d�|kW5QR�SQRXdS)NsELF�br�)�open�read)�filenameZ
elf_headerZthefilerrr�_is_elf`sr:c
Cs t�dt�|��}t�d�}|s,t�d�}|s4dSt��}z�|dd|j
d|g}ttj�}d|d<d|d	<zt
j|t
jt
j|d
�}Wntk
r�YW�$dSX|�|j��}W5QRXW5z|��Wnt	k
r�YnXXt�||�}|s�dS|D]}	t|	��s�q�t�|	�SdS)N�[^\(\)\s]*lib%s\.[^\(\)\s]*ZgccZccz-Wl,-t�-oz-l�C�LC_ALL�LANG��stdout�stderr�env)r$�fsencode�re�escape�shutil�which�tempfileZNamedTemporaryFile�close�FileNotFoundErrorr,�dictr%�
subprocess�Popen�PIPEZSTDOUT�OSErrorrAr8�findallr:�fsdecode)
r,�exprZ
c_compilerZtemp�argsrC�procZtrace�res�filerrr�_findLib_gccfsB


�

rXZsunos5c	Cs||sdSztjdd|ftjtjd�}Wntk
r<YdSX|�|j��}W5QRXt�d|�}|sldSt	�
|�d��S)Nz/usr/ccs/bin/dumpz-Lpv�rArBs\[.*\]\sSONAME\s+([^\s]+)r)rMrNrO�DEVNULLrPrAr8rE�searchr$rR�group)�frU�datarVrrr�_get_soname�s�
r_c	Cs�|sdSt�d�}|sdSz"tj|ddd|ftjtjd�}Wntk
rRYdSX|�|j��}W5QRXt	�
d|�}|s�dSt�|�
d��S)N�objdump�-pz-jz.dynamicrYs\sSONAME\s+([^\s]+)r)rGrHrMrNrOrZrPrAr8rEr[r$rRr\)r]r`rU�dumprVrrrr_�s$
�
)ZfreebsdZopenbsdZ	dragonflycCsN|�d�}g}z|r*|�dt|����qWntk
r@YnX|pLtjgS)N�.r)r�insertr�popr2r�maxsize)Zlibname�partsZnumsrrr�_num_version�s
rhc	Cs�t�|�}d||f}t�|�}ztjdtjtjd�}Wntk
rPd}YnX|�|j	�
�}W5QRXt�||�}|s�tt
|��S|jtd�t�|d�S)Nz:-l%s\.\S+ => \S*/(lib%s\.\S+))�/sbin/ldconfigz-rrY�)�keyr)rErFr$rDrMrNrOrZrPrAr8rQr_rX�sortrhrR)r,ZenamerSrUr^rVrrrr-�s"

�

c		Cs�tj�d�sdSttj�}d|d<|r,d}nd}d}ztj|tjtj|d�}Wnt	k
rdYdSX|�6|j
D](}|��}|�d�rrt�
|���d}qrW5QRX|s�dS|�d	�D]*}tj�|d
|�}tj�|�r�|Sq�dS)N�
/usr/bin/crler=r>)rm�-64)rmr@sDefault Library Path (ELF):r6�:zlib%s.so)r$r'�existsrLr%rMrNrOrZrPrA�strip�
startswithrRrr()	r,�is64rCrT�pathsrU�line�dirZlibfilerrr�
_findLib_crle�s8
�



rwFcCstt||�pt|��S�N)r_rwrX)r,rsrrrr-	sc
Cs�ddl}|�d�dkr&t��jd}nt��jd}dddddd	�}|�|d
�}d}t�|t�|�|f�}zht	j
dd
gt	jt	jt	jddd�d��:}t�
||j���}|r�t�|�d��W5QR�WSW5QRXWntk
r�YnXdS)Nr�lr6z-32rnzlibc6,x86-64zlibc6,64bitzlibc6,IA-64)z	x86_64-64zppc64-64z
sparc64-64zs390x-64zia64-64Zlibc6z\s+(lib%s\.[^\s]+)\s+\(%srirar=)r>r?)�stdinrBrArCr)�structZcalcsizer$�uname�machine�getrDrErFrMrNrZrOr[rAr8rRr\rP)r,r{r}Zmach_mapZabi_typeZregex�prVrrr�_findSoname_ldconfigs4�
�,r�cCs�dt�|�}ddg}tj�d�}|rD|�d�D]}|�d|g�q0|�dtjd|g�d}zZtj	|tj
tj
d	d
�}|��\}}t�|t�
|��}	|	D]}
t|
�s�q�t�
|
�WSWntk
r�YnX|S)Nr;Zldz-tZLD_LIBRARY_PATHroz-Lr<z-l%sT)rArBZuniversal_newlines)rErFr$r%r~r�extend�devnullrMrNrOZcommunicaterQrRr:�	Exception)r,rS�cmdZlibpathr�resultr�out�_rVrWrrr�_findLib_ld,s,
�r�cCs t|�ptt|��ptt|��Srx)r�r_rXr�)r,rrrr-Gs

�
�cCs�ddlm}tjdkr:t|j�t|�d��ttd��tjdk�r�ttd��ttd��ttd��tj	d	kr�t|�
d
��t|�
d��t|�
d��t|�
d
���ntj	�d��r�ddlm}tj
dk�rtd|dtj����td|�
d����ttd��t|�
d��n*td|dtj����td|�
d����tdtd����td|�
td�����tdtd����td|�
td�����n(t|�
d��t|�
d��ttd��dS)Nr)�cdllrrr.r"r!�bz2r/z
libm.dylibzlibcrypto.dylibzlibSystem.dylibzSystem.framework/Systemr4)�CDLLlz"Using CDLL(name, os.RTLD_MEMBER): z
libc.a(shr.o)zUsing cdll.LoadLibrary(): Zrpmz	librpm.sozlibc.a(shr_64.o)z	crypt	:: Zcryptz
crypto	:: Zcryptozlibm.sozlibcrypt.so)Zctypesr�r$r,�printr�loadr-r�platformZLoadLibraryrrr�rfZRTLD_MEMBER)r�r�rrr�testOs<


r��__main__)F)r$rGrMrr,rr r-r�Zctypes.macholib.dyldr0r1rrZctypes._aixrErIr:rXr_rhrwr�r�r��__name__rrrr�<module>s>


2


$(