Your IP : 216.73.216.86


Current Path : /home/emeraadmin/public_html/4d695/
Upload File :
Current File : /home/emeraadmin/public_html/4d695/ctypes.tar

macholib/README.ctypes000064400000000450151706132130010506 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/macholib/__init__.py000064400000000232151706132130010427 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/__init__.pyc000064400000000474151706132130010602 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/__init__.pyo000064400000000474151706132130010616 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.py000064400000011505151706132130007631 0ustar00"""
dyld emulation
"""

import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *

__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
    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

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/dyld.pyc000064400000013233151706132130007774 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/dyld.pyo000064400000012715151706132130010014 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.py000064400000003444151706132130010003 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/dylib.pyc000064400000004413151706132130010143 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/dylib.pyo000064400000003305151706132130010156 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/fetch_macholib000075500000000124151706132130011173 0ustar00#!/bin/sh
svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ .
macholib/framework.py000064400000004231151706132130010670 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/framework.pyc000064400000005101151706132130011030 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/framework.pyo000064400000003523151706132130011052 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__.py000064400000040061151706132130006655 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
        buftype = c_char * size
        buf = buftype()
        buf.value = init
        return buf
    elif isinstance(init, int):
        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:
            size = len(init)+1
        buftype = c_wchar * size
        buf = buftype()
        buf.value = init
        return buf
    elif isinstance(init, int):
        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):
        self._name = name
        flags = self._func_flags_
        if use_errno:
            flags |= _FUNCFLAG_USE_ERRNO
        if use_last_error:
            flags |= _FUNCFLAG_USE_LASTERROR

        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)

    if _os.name == "nt":
        GetLastError = windll.kernel32.GetLastError
    else:
        GetLastError = windll.coredll.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()
__init__.pyc000064400000047344151706132130007033 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)"	!			(




	



		







	

	
	<
				"		
			
		
__init__.pyo000064400000047344151706132130007047 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.py000064400000003720151706132130006514 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")
_endian.pyc000064400000004403151706132130006656 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
	_endian.pyo000064400000004403151706132130006672 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.py000064400000026745151706132130006110 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

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

    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.search(expr, trace)
        if not res:
            return None
        return os.fsdecode(res.group(0))


    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.search(expr, os.fsdecode(out))
                if res:
                    result = res.group(0)
            except Exception as e:
                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 _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"))

        # 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()
util.py.binutils-no-dep000064400000024440151706132130011106 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()
util.pyc000064400000020547151706132130006245 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<		$				)	$	util.pyo000064400000020547151706132130006261 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.py000064400000012774151706132130007012 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)
wintypes.pyc000064400000013503151706132130007144 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�





		
	wintypes.pyo000064400000013503151706132130007160 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�





		
	__pycache__/__init__.cpython-36.opt-1.pyc000064400000037065151706161130014114 0ustar003

���i1@�@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__/__init__.cpython-36.opt-2.pyc000064400000032531151706161130014106 0ustar003

���i1@�@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__/__init__.cpython-36.pyc000064400000037065151706161130013155 0ustar003

���i1@�@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.pyc000064400000003606151706161130013744 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__/_endian.cpython-36.opt-2.pyc000064400000003054151706161130013742 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__/_endian.cpython-36.pyc000064400000003606151706161130013005 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-1.pyc000064400000016074151706161130013327 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__/util.cpython-36.opt-2.pyc000064400000015504151706161130013325 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__/util.cpython-36.pyc000064400000016074151706161130012370 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__/wintypes.cpython-36.opt-1.pyc000064400000011751151706161130014231 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-2.pyc000064400000011751151706161130014232 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.pyc000064400000011751151706161130013272 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�




















macholib/__pycache__/__init__.cpython-36.opt-1.pyc000064400000000445151706161130015662 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__/__init__.cpython-36.opt-2.pyc000064400000000226151706161130015660 0ustar003


 \��@sdZdS)z1.0N)�__version__�rr�0/usr/lib64/python3.6/ctypes/macholib/__init__.py�<module>	smacholib/__pycache__/__init__.cpython-36.pyc000064400000000445151706161130014723 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.opt-1.pyc000064400000010101151706161130015045 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__/dyld.cpython-36.opt-2.pyc000064400000007353151706161130015065 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__/dyld.cpython-36.pyc000064400000010355151706161130014121 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.pyc000064400000002703151706161130015225 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__/dylib.cpython-36.opt-2.pyc000064400000001533151706161130015226 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__/dylib.cpython-36.pyc000064400000003600151706161130014263 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__/framework.cpython-36.opt-1.pyc000064400000003111151706161130016111 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/__pycache__/framework.cpython-36.opt-2.pyc000064400000001621151706161130016116 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.pyc000064400000004230151706161130015155 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>s