PK!KkCkC __init__.pynu[###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """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 in ("nt", "ce"): 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()[2].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(aString) -> character array create_string_buffer(anInteger) -> character array create_string_buffer(aString, anInteger) -> character array """ if isinstance(init, (str, unicode)): if size is None: size = len(init)+1 buftype = c_char * size buf = buftype() buf.value = init return buf elif isinstance(init, (int, long)): 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 in ("nt", "ce"): from _ctypes import LoadLibrary as _dlopen from _ctypes import FUNCFLAG_STDCALL as _FUNCFLAG_STDCALL if _os.name == "ce": # 'ce' doesn't have the stdcall calling convention _FUNCFLAG_STDCALL = _FUNCFLAG_CDECL _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(py_object, self).__repr__() except ValueError: return "%s()" % 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" if _os.name == "nt": def __repr__(self): if not windll.kernel32.IsBadStringPtrA(self, -1): return "%s(%r)" % (self.__class__.__name__, self.value) return "%s(%s)" % (self.__class__.__name__, cast(self, c_void_p).value) else: def __repr__(self): return "%s(%s)" % (self.__class__.__name__, cast(self, c_void_p).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 def _reset_cache(): _pointer_type_cache.clear() _c_functype_cache.clear() if _os.name in ("nt", "ce"): _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 try: from _ctypes import set_conversion_mode except ImportError: pass else: if _os.name in ("nt", "ce"): set_conversion_mode("mbcs", "ignore") else: set_conversion_mode("ascii", "strict") class c_wchar_p(_SimpleCData): _type_ = "Z" class c_wchar(_SimpleCData): _type_ = "u" 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, unicode)): if size is None: size = len(init)+1 buftype = c_wchar * size buf = buftype() buf.value = init return buf elif isinstance(init, (int, long)): 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: .qsort -> callable object ['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 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.maxint*2 + 1)), id(self) & (_sys.maxint*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, long)): func.__name__ = name_or_ordinal return func class PyDLL(CDLL): """This class represents the Python library itself. It allows to access Python API functions. The GIL is not released, and Python exceptions are handled correctly. """ _func_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI if _os.name in ("nt", "ce"): 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 a WindowsError 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 WindowsError 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 in ("nt", "ce"): 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 in ("nt", "ce"): 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 WindowsError(code, descr) 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 in ("nt", "ce"): # 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() PK!\ϙ _endian.pynu[###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### import 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(_swapped_meta, self).__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): """Structure with big endian byte order""" __metaclass__ = _swapped_meta _swappedbytes_ = None elif sys.byteorder == "big": _OTHER_ENDIAN = "__ctype_le__" BigEndianStructure = Structure class LittleEndianStructure(Structure): """Structure with little endian byte order""" __metaclass__ = _swapped_meta _swappedbytes_ = None else: raise RuntimeError("Invalid byteorder") PK!٨%NN __init__.pycnu[ pfc@sQ dZddlZddlZdZddlmZmZm Z ddlm Z ddlm Z ddlmZ ddlmZmZdd lmZdd lmZee kred ee nejdukrddlmZneZejdkrBejdkrBeejdjdddkrBeZqBnddlmZmZm Z!m"Z#ddZ%ddZ&iZ'dZ(ejdvkrddlm)Z*ddlm+Z,ejd kreZ,niZ-dZ.e.jr*e(jj/dde._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@d0e8fd1YZ?e9e?d2e8fd3YZ@e9e@d4e8fd5YZAe9eAd6e8fd7YZBe9eBd8e8fd9YZCe1eCe1eBkreBZCned/ed:kr,e=ZDe>ZEn@d;e8fd<YZDe9eDd=e8fd>YZEe9eEd?e8fd@YZFeFeF_GeF_He9eFdAe8fdBYZIeIeI_GeI_He9eIdCe8fdDYZJeJeJ_GeJ_He9eJdEe8fdFYZKe9eKd%dGe8fdHYZLeLZMe9eLdIe8fdJYZNddKlmOZOmPZPmQZQdLZRyddMlmSZSWneTk rneXejdwkreSdNdOn eSdPdQdRe8fdSYZUdTe8fdUYZVddVZWdWZXdXZYdYeZfdZYZ[d[e[fd\YZ\ejdxkrd]e[fd^YZ]dd_lm^Z^m8Z8d`e8fdaYZ_dbe[fdcYZ`nddeZfdeYZaeae[Zbeae\Zcejdykr e\dfdejdZen5ejdgkr2e\dhejfd Zen e\dZeejdzkreae]Zgeae`Zhejd kregjijjZjn egjkjjZjddilmlZlmmZmdddjZnne1e@e1eLkre@Zoe?ZpnNe1e>e1eLkre>Zoe=Zpn'e1eEe1eLkr,eEZoeDZpnddklmqZqmrZrmsZsmtZte(eLeLeLeoeqZue(eLeLe?eoerZvdlZwewe:eLe:e:etZxdmZyewe:eLe?esZzddnZ{yddolm|Z|WneTk rn%Xewe:eLe?e|Z}ddpZ~ejd{krE dqZdrZnddslmZmZeIZeFZxke;e?e=eDgD]WZe1edkr eZqz e1edtkr eZqz e1edkrz eZqz qz Wxke<e@e>eEgD]WZe1edkr eZq e1edtkr$ eZq e1edkr eZq q W[eRdS(|s,create and manipulate C data types in PythoniNs1.1.0(tUniont StructuretArray(t_Pointer(tCFuncPtr(t __version__(t RTLD_LOCALt RTLD_GLOBAL(t ArgumentError(tcalcsizesVersion number mismatchtnttce(t FormatErrortposixtdarwinit.ii(tFUNCFLAG_CDECLtFUNCFLAG_PYTHONAPItFUNCFLAG_USE_ERRNOtFUNCFLAG_USE_LASTERRORcCst|ttfrT|dkr4t|d}nt|}|}||_|St|ttfrt|}|}|St |dS(screate_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_buffer4s      cCs t||S(N(R"(RR((s'/usr/lib64/python2.7/ctypes/__init__.pytc_bufferFscst|jdtr%tOn|jdtrDtOn|rctd|jnytfSWnGtk rdt ffdY}|tf<|SXdS(sCFUNCTYPE(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 CFunctionTypecseZZZZRS((t__name__t __module__t _argtypes_t _restype_t_flags_((targtypestflagstrestype(s'/usr/lib64/python2.7/ctypes/__init__.pyR&hsN( 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 CFUNCTYPENs   "(t LoadLibrary(tFUNCFLAG_STDCALLcst|jdtr%tOn|jdtrDtOn|rctd|jnytfSWnGtk rdt ffdY}|tf<|SXdS(NR$R%s!unexpected keyword argument(s) %stWinFunctionTypecseZZZZRS((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__.pyt WINFUNCTYPEws   "R:R@(tdlopen(tsizeoftbyreft addressoft alignmenttresize(t get_errnot set_errno(t _SimpleCDatacCsmddlm}|dkr(|j}nt|||}}||kritd|||fndS(Ni(R s"sizeof(%s) wrong: %d instead of %d(tstructR Rt_type_RBt SystemError(ttypttypecodeR tactualtrequired((s'/usr/lib64/python2.7/ctypes/__init__.pyt _check_sizes   t py_objectcBseZdZdZRS(tOcCs=ytt|jSWntk r8dt|jSXdS(Ns %s()(tsuperRRt__repr__R4ttypeR'(tself((s'/usr/lib64/python2.7/ctypes/__init__.pyRUs (R'R(RKRU(((s'/usr/lib64/python2.7/ctypes/__init__.pyRRstPtc_shortcBseZdZRS(th(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRYstc_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__.pyRbstc_uintcBseZdZRS(tI(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRcstc_floatcBseZdZRS(tf(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRestc_doublecBseZdZRS(td(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRgst c_longdoublecBseZdZRS(tg(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRistqt c_longlongcBseZdZRS(Rk(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRlst c_ulonglongcBseZdZRS(tQ(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRmstc_ubytecBseZdZRS(tB(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRostc_bytecBseZdZRS(tb(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRqsRcBseZdZRS(tc(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRstc_char_pcBs2eZdZejdkr'dZn dZRS(tzR cCsLtjj|ds,d|jj|jfSd|jjt|tjfS(Nis%s(%r)s%s(%s)(twindlltkernel32tIsBadStringPtrAt __class__R'Rtcasttc_void_p(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRUscCs d|jjt|tjfS(Ns%s(%s)(RyR'RzR{R(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRUs(R'R(RKt_ostnameRU(((s'/usr/lib64/python2.7/ctypes/__init__.pyRts 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_cachecCsbtjtjtjdkr0tjntjtt _t jtt _t td character array create_unicode_buffer(anInteger) -> character array create_unicode_buffer(aString, anInteger) -> character array iN( RRRRRRRRRR(RRR R!((s'/usr/lib64/python2.7/ctypes/__init__.pytcreate_unicode_buffer$s      cCsptj|ddk r'tdnt|tkrHtdn|j||t|.qsort -> callable object ['qsort'] -> callable object Calling the functions releases the Python GIL during the call and reacquires it afterwards. cs|_j|r%tOn|r8tOndtffdY}|_|dkrtj|_n |_dS(Nt_FuncPtrcseZZjZRS((R'R(R+t_func_restype_R*((R-RW(s'/usr/lib64/python2.7/ctypes/__init__.pyRbs( t_namet _func_flags_R2R3R8RRt_dlopent_handle(RWR}tmodethandleR$R%R((R-RWs'/usr/lib64/python2.7/ctypes/__init__.pyt__init__Xs      cCsDd|jj|j|jtjdd@t|tjdd@fS(Ns<%s '%s', handle %x at %x>ii(RyR'RRt_systmaxintR(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRUlscCsP|jdr-|jdr-t|n|j|}t||||S(Nt__(t startswithtendswithtAttributeErrort __getitem__tsetattr(RWR}tfunc((s'/usr/lib64/python2.7/ctypes/__init__.pyt __getattr__rs cCs:|j||f}t|ttfs6||_n|S(N(RRRRR'(RWtname_or_ordinalR((s'/usr/lib64/python2.7/ctypes/__init__.pyRys N(R'R(t__doc__R/RRbRt DEFAULT_MODERR1RRURR(((s'/usr/lib64/python2.7/ctypes/__init__.pyRGs    tPyDLLcBseZdZeeBZRS(sThis class represents the Python library itself. It allows to access Python API functions. The GIL is not released, and Python exceptions are handled correctly. (R'R(RR/t_FUNCFLAG_PYTHONAPIR(((s'/usr/lib64/python2.7/ctypes/__init__.pyRstWinDLLcBseZdZeZRS(snThis class represents a dll exporting functions using the Windows stdcall calling convention. (R'R(RR>R(((s'/usr/lib64/python2.7/ctypes/__init__.pyRs(t_check_HRESULTRItHRESULTcBseZdZeZRS(R^(R'R(RKRt_check_retval_(((s'/usr/lib64/python2.7/ctypes/__init__.pyRs tOleDLLcBseZdZeZeZRS(sThis 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(RR>RRR(((s'/usr/lib64/python2.7/ctypes/__init__.pyRst LibraryLoadercBs,eZdZdZdZdZRS(cCs ||_dS(N(t_dlltype(RWtdlltype((s'/usr/lib64/python2.7/ctypes/__init__.pyRscCsB|ddkrt|n|j|}t||||S(Nit_(RRR(RWR}tdll((s'/usr/lib64/python2.7/ctypes/__init__.pyRs cCs t||S(N(tgetattr(RWR}((s'/usr/lib64/python2.7/ctypes/__init__.pyRscCs |j|S(N(R(RWR}((s'/usr/lib64/python2.7/ctypes/__init__.pyR;s(R'R(RRRR;(((s'/usr/lib64/python2.7/ctypes/__init__.pyRs   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__.pytWinErrors    (t _memmove_addrt _memset_addrt_string_at_addrt _cast_addrcs#dtffdY}|S(NR&cseZZZeeBZRS((R'R(R)R*R/RR+((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 PYFUNCTYPEscCst|||S(N(t_cast(tobjRM((s'/usr/lib64/python2.7/ctypes/__init__.pyRzscCs 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_ats(t_wstring_at_addrcCs t||S(sFwstring_at(addr[, size]) -> string Return the string at addr.(t _wstring_at(RR((s'/usr/lib64/python2.7/ctypes/__init__.pyt wstring_atscCsNy"tdttdg}Wntk r6dSX|j|||SdS(Nscomtypes.server.inprocservert*i(t __import__tglobalstlocalst ImportErrortDllGetClassObject(trclsidtriidtppvtccom((s'/usr/lib64/python2.7/ctypes/__init__.pyRs " cCsAy"tdttdg}Wntk r6dSX|jS(Nscomtypes.server.inprocserverRi(RRRRtDllCanUnloadNow(R((s'/usr/lib64/python2.7/ctypes/__init__.pyRs " (tBigEndianStructuretLittleEndianStructurei(sntsce(sntsce(sntsce(sntsce(sntsce(sntsce(sntsce(RtosR|tsysRRt_ctypesRRRRRR8t_ctypes_versionRRRRJR t _calcsizet ExceptionR}R RtplatformRtunametsplitRR/RRRR2RR3RR"R#R6R:R;RR<R>R?R@treplaceRARBRCRDRERFRGRHRIRQRRRYR[R]R_RbRcReRgRiRlRmRot __ctype_le__t __ctype_be__RqRRtR{tc_voidpR~RRRRRRRRRRRtobjectRRRRRRRtcdlltpydllt dllhandlet pythonapit version_infoRvtoledllRwRtcoredllRRRtc_size_tt c_ssize_tRRRRtmemmovetmemsetRRRzRRRRRRRtctypes._endianRRtc_int8tc_uint8tkindtc_int16tc_int32tc_int64tc_uint16tc_uint32tc_uint64(((s'/usr/lib64/python2.7/ctypes/__init__.pytsJ ) "   !   (                         8           "             PK!K94""util.pyonu[ pfc@sddlZddlZejdkrEdZdZdZnejdkr`dZnejdkrejd krdd lmZ d Znejdkrddl Z ddl Z ddl Z d Z ejd krdZn dZejjds0ejjds0ejjdrEdZdZqejd krldZedZqdZdZndZedkrendS(iNtntcCsd}tjj|}|dkr(dS|t|}tj|jdd\}}t|d d}t|dd!d }|dkrd }n|dkr||Sd S( sReturn 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.iit iiiig$@iN(tsystversiontfindtlentsplittinttNone(tprefixtitstrestt majorVersiont minorVersion((s#/usr/lib64/python2.7/ctypes/util.pyt_get_build_version s    cCswt}|dkrdS|dkr.d}nd|d}ddl}|jdddkro|d 7}n|d S( s%Return the name of the VC runtime dllitmsvcrtsmsvcr%di iNis_d.pydtds.dll(RRtimpt get_suffixes(RtclibnameR((s#/usr/lib64/python2.7/ctypes/util.pyt find_msvcrt s      cCs|dkrtSxtjdjtjD]l}tjj||}tjj|r^|S|jj dryq-n|d}tjj|r-|Sq-WdS(NtctmtPATHs.dll(RR( RtostenvironRtpathseptpathtjointisfiletlowertendswithR(tnamet directorytfname((s#/usr/lib64/python2.7/ctypes/util.pyt find_library1s   tcecCs|S(N((R!((s#/usr/lib64/python2.7/ctypes/util.pyR$Gstposixtdarwin(t dyld_findcCs[d|d|d||fg}x3|D]+}yt|SWq(tk rRq(q(Xq(WdS(Ns lib%s.dylibs%s.dylibs%s.framework/%s(t _dyld_findt ValueErrorR(R!tpossible((s#/usr/lib64/python2.7/ctypes/util.pyR$Ls   c Csdtj|}tj\}}tj|d|d|}z3tj|}z|j}Wd|j}XWdytj|Wn+t k r}|j t j krqnXX|dkrt dntj ||} | sdS| jdS(Ns[^\(\)\s]*lib%s\.[^\(\)\s]*srif type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;$CC -Wl,-t -o s 2>&1 -li sgcc or cc command not foundi(tretescapettempfiletmkstempRtclosetpopentreadtunlinktOSErrorterrnotENOENTtsearchRtgroup( R!texprtfdouttccouttcmdtfttracetrvtetres((s#/usr/lib64/python2.7/ctypes/util.pyt _findLib_gcc[s(    tsunos5cCsj|s dSd|}tj|}z|j}Wd|jXtjd|}|s]dS|jdS(Ns#/usr/ccs/bin/dump -Lpv 2>/dev/null s\[.*\]\sSONAME\s+([^\s]+)i(RRR1R2R0R,R7R8(R=R<tdataRA((s#/usr/lib64/python2.7/ctypes/util.pyt _get_sonamews  cCs|s dSd|}tj|}|j}|j}|dkrWtjj|Stj|}z|j}Wd|jXtjd|}|sdS|j dS(NsWif ! type objdump >/dev/null 2>&1; then exit 10; fi;objdump -p -j .dynamic 2>/dev/null i s\sSONAME\s+([^\s]+)i( RRR1R2R0RtbasenameR,R7R8(R=R<tdumpR?RDRA((s#/usr/lib64/python2.7/ctypes/util.pyREs"    tfreebsdtopenbsdt dragonflycCsf|jd}g}y-x&|r@|jdt|jqWWntk rUnX|petjgS(Nt.i(RtinsertRtpopR*Rtmaxint(tlibnametpartstnums((s#/usr/lib64/python2.7/ctypes/util.pyt _num_versions $ cCstj|}d||f}tjd}z|j}Wd|jXtj||}|sttt|S|j dd|dS(Ns:-l%s\.\S+ => \S*/(lib%s\.\S+)s/sbin/ldconfig -r 2>/dev/nulltcmpcSstt|t|S(N(RSRR(txty((s#/usr/lib64/python2.7/ctypes/util.pytsi( R,R-RR1R2R0tfindallRERBtsort(R!tenameR9R=RDRA((s#/usr/lib64/python2.7/ctypes/util.pyR$s cCstjjdsdS|r%d}nd}xKtj|jD]4}|j}|jdrA|jd}qAqAW|sdSxF|jdD]5}tjj |d|}tjj|r|SqWdS(Ns /usr/bin/crles*env LC_ALL=C /usr/bin/crle -64 2>/dev/nulls&env LC_ALL=C /usr/bin/crle 2>/dev/nullsDefault Library Path (ELF):it:slib%s.so( RRtexistsRR1t readlineststript startswithRR(R!tis64R<tlinetpathstdirtlibfile((s#/usr/lib64/python2.7/ctypes/util.pyt _findLib_crles   cCstt||pt|S(N(RERdRB(R!R_((s#/usr/lib64/python2.7/ctypes/util.pyR$sc Csddl}|jddkr8tjdd}ntjdd}idd6dd 6dd 6dd 6d d 6}|j|d}dtj||f}tjd}z|j}Wd|j Xtj ||}|sdS|j dS(Nitlis-32s-64s libc6,x86-64s x86_64-64s libc6,64bitsppc64-64s sparc64-64ss390x-64s libc6,IA-64sia64-64tlibc6s\s+(lib%s\.[^\s]+)\s+\(%ss/sbin/ldconfig -p 2>/dev/nulli( tstructtcalcsizeRtunametgetR,R-R1R2R0R7RR8( R!Rgtmachinetmach_maptabi_typeR9R=RDRA((s#/usr/lib64/python2.7/ctypes/util.pyt_findSoname_ldconfigs(   cCst|ptt|S(N(RnRERB(R!((s#/usr/lib64/python2.7/ctypes/util.pyR$scCsddlm}tjdkrC|jGH|jdGHtdGHntjdkrtdGHtdGHtdGHtjd kr|j d GH|j d GH|j d GH|j d GHq|j dGH|j dGHtdGHndS(Ni(tcdllRRR&RRtbz2R's libm.dylibslibcrypto.dylibslibSystem.dylibsSystem.framework/Systemslibm.sos libcrypt.sotcrypt( tctypesRoRR!RtloadR$Rtplatformt LoadLibrary(Ro((s#/usr/lib64/python2.7/ctypes/util.pyttests"   t__main__(RRR!RRR$Rttctypes.macholib.dyldR(R)R,R.R5RBRER^RRRdtFalseRnRvt__name__(((s#/usr/lib64/python2.7/ctypes/util.pyts8     $         PK!FpCC wintypes.pyonu[ pfcZ@sddlTeZeZeZeZe Z e Z e ZeZeZeZddlmZdefdYZeZeZeZeZeZZeZZ e!Z"Z#Z$e!Z%Z&e'Z(Z)e*Z+Z,e-ee-e*kreZ.eZ/n'e-ee-e*kreZ.eZ/neZ0eZ1eZ2eZ3eZ4eZ5e*Z6e6Z7e6Z8e6Z9e6Z:e6Z;e6Z<e6Z=e6Z>e6Z?e6Z@e6ZAe6ZBe6ZCe6ZDe6ZEe6ZFe6ZGe6ZHe6ZIe6ZJe6ZKe6ZLe6ZMe6ZNe6ZOe6ZPe6ZQe6ZRe6ZSe6ZTe6ZUdeVfdYZWeWZXZYZZdeVfdYZ[e[Z\d eVfd YZ]d eVfd YZ^e^Z_Z`Zad eVfdYZbebZcZddZedeVfdYZfefZgdeVfdYZhehZidZjdeVfdYZkdeVfdYZlddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOddPd dQddRdSdTdUdVd dWdXdYdZd[d\dd]ddd^d_d d`dadbdcddddedfdgdhgZZmdiS(ji(t*(t _SimpleCDatat VARIANT_BOOLcBseZdZdZRS(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 ds   t _SMALL_RECTcBs2eZdefdefdefdefgZRS(tLefttToptRighttBottom(RR tc_shortR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRks   t_COORDcBs eZdefdefgZRS(tXtY(RR RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRrs tPOINTcBs eZdefdefgZRS(txty(RR RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRvs tSIZEcBs eZdefdefgZRS(tcxtcy(RR RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR{s cCs||d>|d>S(Nii((tredtgreentblue((s'/usr/lib64/python2.7/ctypes/wintypes.pytRGBstFILETIMEcBs 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 nFileSizeLowt dwReserved0t dwReserved1t cFileNametcAlternateFileNamei(RR R(R%tc_chartMAX_PATHR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR4s         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.pyRAs         tATOMtBOOLtBOOLEANtBYTEtCOLORREFtDOUBLER(tFLOATtHACCELtHANDLEtHBITMAPtHBRUSHt HCOLORSPACEtHDCtHDESKtHDWPt HENHMETAFILEtHFONTtHGDIOBJtHGLOBALtHHOOKtHICONt HINSTANCEtHKEYtHKLtHLOCALtHMENUt HMETAFILEtHMODULEtHMONITORtHPALETTEtHPENtHRGNtHRSRCtHSTRtHTASKtHWINSTAR0tINTtLANGIDt LARGE_INTEGERtLCIDtLCTYPEtLGRPIDtLONGR3t LPCOLESTRtLPCSTRtLPCVOIDtLPCWSTRtLPOLESTRtLPSTRtLPVOIDtLPWSTRR@tOLESTRtPOINTLtRECTLR$t SC_HANDLEtSERVICE_STATUS_HANDLEtSHORTtSIZELt SMALL_RECTtUINTtULARGE_INTEGERtULONGtUSHORTtWCHARtWORDR2t _FILETIMEt_LARGE_INTEGERt_POINTLt_RECTLt_ULARGE_INTEGERttagMSGttagPOINTttagRECTttagSIZEN(ntctypestc_byteRFtc_ushortRtc_ulongR(RBRR1R~tc_intRgtc_doubleRHtc_floatRIRERRDRRRRmRRR{t c_longlongRRit c_ulonglongRRt c_wchar_pRnRrRvRqRutc_char_pRoRstc_void_pRpRttsizeofR2R3RCRhRGRlRkRjRKRJRLRMRNRORPRQRRRSRTRURVRWRXRYRZR[R\R]R^R_R`RaRbRcRdReRfR0RyRzt StructureR RRRxRR}RRRRRwRRR|R$R%RR)RR@R4RAt__all__(((s'/usr/lib64/python2.7/ctypes/wintypes.pyts             PK! [#[#util.py.binutils-no-depnu[###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### import sys, os # 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): expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp() os.close(fdout) cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;' \ '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: f = os.popen(cmd) try: trace = f.read() finally: rv = f.close() finally: try: os.unlink(ccout) except OSError, e: if e.errno != errno.ENOENT: raise if rv == 10: raise OSError, 'gcc or cc command not found' 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 cmd = "/usr/ccs/bin/dump -Lpv 2>/dev/null " + f f = os.popen(cmd) try: data = f.read() finally: f.close() res = re.search(r'\[.*\]\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 10; fi;' \ "objdump -p -j .dynamic 2>/dev/null " + f f = os.popen(cmd) dump = f.read() rv = f.close() if rv == 10: raise OSError, 'objdump command not found' f = os.popen(cmd) try: data = f.read() finally: f.close() res = re.search(r'\sSONAME\s+([^\s]+)', data) 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(".") 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) f = os.popen('/sbin/ldconfig -r 2>/dev/null') try: data = f.read() finally: f.close() res = re.findall(expr, data) if not res: return _get_soname(_findLib_gcc(name)) res.sort(cmp= lambda x,y: cmp(_num_version(x), _num_version(y))) return res[-1] elif sys.platform == "sunos5": def _findLib_crle(name, is64): if not os.path.exists('/usr/bin/crle'): return None if is64: cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null' else: cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null' for line in os.popen(cmd).readlines(): line = line.strip() if line.startswith('Default Library Path (ELF):'): paths = 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()[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) f = os.popen('/sbin/ldconfig -p 2>/dev/null') try: data = f.read() finally: f.close() 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() PK!Vd  _endian.pycnu[ pfc@sddlZddlTeeZdZdeefdYZejdkr{dZ eZ defd YZ n@ejd krd Z eZ d efd YZ n e ddS(iN(t*cCsft|trt|tSt|tr?t|j|jSt|t rR|St d|dS(sReturn 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.pyR s t _swapped_metacBseZdZRS(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.pyR1stbigt __ctype_le__tLittleEndianStructurecBseZdZeZdZRS(s'Structure with little endian byte orderN(RRRR RR R!(((s&/usr/lib64/python2.7/ctypes/_endian.pyR$:ssInvalid byteorder( tsystctypesttypetArrayRRR R t byteorderRR$Rt RuntimeError(((s&/usr/lib64/python2.7/ctypes/_endian.pyts    PK!٨%NN __init__.pyonu[ pfc@sQ dZddlZddlZdZddlmZmZm Z ddlm Z ddlm Z ddlmZ ddlmZmZdd lmZdd lmZee kred ee nejdukrddlmZneZejdkrBejdkrBeejdjdddkrBeZqBnddlmZmZm Z!m"Z#ddZ%ddZ&iZ'dZ(ejdvkrddlm)Z*ddlm+Z,ejd kreZ,niZ-dZ.e.jr*e(jj/dde._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@d0e8fd1YZ?e9e?d2e8fd3YZ@e9e@d4e8fd5YZAe9eAd6e8fd7YZBe9eBd8e8fd9YZCe1eCe1eBkreBZCned/ed:kr,e=ZDe>ZEn@d;e8fd<YZDe9eDd=e8fd>YZEe9eEd?e8fd@YZFeFeF_GeF_He9eFdAe8fdBYZIeIeI_GeI_He9eIdCe8fdDYZJeJeJ_GeJ_He9eJdEe8fdFYZKe9eKd%dGe8fdHYZLeLZMe9eLdIe8fdJYZNddKlmOZOmPZPmQZQdLZRyddMlmSZSWneTk rneXejdwkreSdNdOn eSdPdQdRe8fdSYZUdTe8fdUYZVddVZWdWZXdXZYdYeZfdZYZ[d[e[fd\YZ\ejdxkrd]e[fd^YZ]dd_lm^Z^m8Z8d`e8fdaYZ_dbe[fdcYZ`nddeZfdeYZaeae[Zbeae\Zcejdykr e\dfdejdZen5ejdgkr2e\dhejfd Zen e\dZeejdzkreae]Zgeae`Zhejd kregjijjZjn egjkjjZjddilmlZlmmZmdddjZnne1e@e1eLkre@Zoe?ZpnNe1e>e1eLkre>Zoe=Zpn'e1eEe1eLkr,eEZoeDZpnddklmqZqmrZrmsZsmtZte(eLeLeLeoeqZue(eLeLe?eoerZvdlZwewe:eLe:e:etZxdmZyewe:eLe?esZzddnZ{yddolm|Z|WneTk rn%Xewe:eLe?e|Z}ddpZ~ejd{krE dqZdrZnddslmZmZeIZeFZxke;e?e=eDgD]WZe1edkr eZqz e1edtkr eZqz e1edkrz eZqz qz Wxke<e@e>eEgD]WZe1edkr eZq e1edtkr$ eZq e1edkr eZq q W[eRdS(|s,create and manipulate C data types in PythoniNs1.1.0(tUniont StructuretArray(t_Pointer(tCFuncPtr(t __version__(t RTLD_LOCALt RTLD_GLOBAL(t ArgumentError(tcalcsizesVersion number mismatchtnttce(t FormatErrortposixtdarwinit.ii(tFUNCFLAG_CDECLtFUNCFLAG_PYTHONAPItFUNCFLAG_USE_ERRNOtFUNCFLAG_USE_LASTERRORcCst|ttfrT|dkr4t|d}nt|}|}||_|St|ttfrt|}|}|St |dS(screate_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_buffer4s      cCs t||S(N(R"(RR((s'/usr/lib64/python2.7/ctypes/__init__.pytc_bufferFscst|jdtr%tOn|jdtrDtOn|rctd|jnytfSWnGtk rdt ffdY}|tf<|SXdS(sCFUNCTYPE(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 CFunctionTypecseZZZZRS((t__name__t __module__t _argtypes_t _restype_t_flags_((targtypestflagstrestype(s'/usr/lib64/python2.7/ctypes/__init__.pyR&hsN( 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 CFUNCTYPENs   "(t LoadLibrary(tFUNCFLAG_STDCALLcst|jdtr%tOn|jdtrDtOn|rctd|jnytfSWnGtk rdt ffdY}|tf<|SXdS(NR$R%s!unexpected keyword argument(s) %stWinFunctionTypecseZZZZRS((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__.pyt WINFUNCTYPEws   "R:R@(tdlopen(tsizeoftbyreft addressoft alignmenttresize(t get_errnot set_errno(t _SimpleCDatacCsmddlm}|dkr(|j}nt|||}}||kritd|||fndS(Ni(R s"sizeof(%s) wrong: %d instead of %d(tstructR Rt_type_RBt SystemError(ttypttypecodeR tactualtrequired((s'/usr/lib64/python2.7/ctypes/__init__.pyt _check_sizes   t py_objectcBseZdZdZRS(tOcCs=ytt|jSWntk r8dt|jSXdS(Ns %s()(tsuperRRt__repr__R4ttypeR'(tself((s'/usr/lib64/python2.7/ctypes/__init__.pyRUs (R'R(RKRU(((s'/usr/lib64/python2.7/ctypes/__init__.pyRRstPtc_shortcBseZdZRS(th(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRYstc_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__.pyRbstc_uintcBseZdZRS(tI(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRcstc_floatcBseZdZRS(tf(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRestc_doublecBseZdZRS(td(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRgst c_longdoublecBseZdZRS(tg(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRistqt c_longlongcBseZdZRS(Rk(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRlst c_ulonglongcBseZdZRS(tQ(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRmstc_ubytecBseZdZRS(tB(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRostc_bytecBseZdZRS(tb(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRqsRcBseZdZRS(tc(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRstc_char_pcBs2eZdZejdkr'dZn dZRS(tzR cCsLtjj|ds,d|jj|jfSd|jjt|tjfS(Nis%s(%r)s%s(%s)(twindlltkernel32tIsBadStringPtrAt __class__R'Rtcasttc_void_p(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRUscCs d|jjt|tjfS(Ns%s(%s)(RyR'RzR{R(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRUs(R'R(RKt_ostnameRU(((s'/usr/lib64/python2.7/ctypes/__init__.pyRts 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_cachecCsbtjtjtjdkr0tjntjtt _t jtt _t td character array create_unicode_buffer(anInteger) -> character array create_unicode_buffer(aString, anInteger) -> character array iN( RRRRRRRRRR(RRR R!((s'/usr/lib64/python2.7/ctypes/__init__.pytcreate_unicode_buffer$s      cCsptj|ddk r'tdnt|tkrHtdn|j||t|.qsort -> callable object ['qsort'] -> callable object Calling the functions releases the Python GIL during the call and reacquires it afterwards. cs|_j|r%tOn|r8tOndtffdY}|_|dkrtj|_n |_dS(Nt_FuncPtrcseZZjZRS((R'R(R+t_func_restype_R*((R-RW(s'/usr/lib64/python2.7/ctypes/__init__.pyRbs( t_namet _func_flags_R2R3R8RRt_dlopent_handle(RWR}tmodethandleR$R%R((R-RWs'/usr/lib64/python2.7/ctypes/__init__.pyt__init__Xs      cCsDd|jj|j|jtjdd@t|tjdd@fS(Ns<%s '%s', handle %x at %x>ii(RyR'RRt_systmaxintR(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRUlscCsP|jdr-|jdr-t|n|j|}t||||S(Nt__(t startswithtendswithtAttributeErrort __getitem__tsetattr(RWR}tfunc((s'/usr/lib64/python2.7/ctypes/__init__.pyt __getattr__rs cCs:|j||f}t|ttfs6||_n|S(N(RRRRR'(RWtname_or_ordinalR((s'/usr/lib64/python2.7/ctypes/__init__.pyRys N(R'R(t__doc__R/RRbRt DEFAULT_MODERR1RRURR(((s'/usr/lib64/python2.7/ctypes/__init__.pyRGs    tPyDLLcBseZdZeeBZRS(sThis class represents the Python library itself. It allows to access Python API functions. The GIL is not released, and Python exceptions are handled correctly. (R'R(RR/t_FUNCFLAG_PYTHONAPIR(((s'/usr/lib64/python2.7/ctypes/__init__.pyRstWinDLLcBseZdZeZRS(snThis class represents a dll exporting functions using the Windows stdcall calling convention. (R'R(RR>R(((s'/usr/lib64/python2.7/ctypes/__init__.pyRs(t_check_HRESULTRItHRESULTcBseZdZeZRS(R^(R'R(RKRt_check_retval_(((s'/usr/lib64/python2.7/ctypes/__init__.pyRs tOleDLLcBseZdZeZeZRS(sThis 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(RR>RRR(((s'/usr/lib64/python2.7/ctypes/__init__.pyRst LibraryLoadercBs,eZdZdZdZdZRS(cCs ||_dS(N(t_dlltype(RWtdlltype((s'/usr/lib64/python2.7/ctypes/__init__.pyRscCsB|ddkrt|n|j|}t||||S(Nit_(RRR(RWR}tdll((s'/usr/lib64/python2.7/ctypes/__init__.pyRs cCs t||S(N(tgetattr(RWR}((s'/usr/lib64/python2.7/ctypes/__init__.pyRscCs |j|S(N(R(RWR}((s'/usr/lib64/python2.7/ctypes/__init__.pyR;s(R'R(RRRR;(((s'/usr/lib64/python2.7/ctypes/__init__.pyRs   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__.pytWinErrors    (t _memmove_addrt _memset_addrt_string_at_addrt _cast_addrcs#dtffdY}|S(NR&cseZZZeeBZRS((R'R(R)R*R/RR+((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 PYFUNCTYPEscCst|||S(N(t_cast(tobjRM((s'/usr/lib64/python2.7/ctypes/__init__.pyRzscCs 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_ats(t_wstring_at_addrcCs t||S(sFwstring_at(addr[, size]) -> string Return the string at addr.(t _wstring_at(RR((s'/usr/lib64/python2.7/ctypes/__init__.pyt wstring_atscCsNy"tdttdg}Wntk r6dSX|j|||SdS(Nscomtypes.server.inprocservert*i(t __import__tglobalstlocalst ImportErrortDllGetClassObject(trclsidtriidtppvtccom((s'/usr/lib64/python2.7/ctypes/__init__.pyRs " cCsAy"tdttdg}Wntk r6dSX|jS(Nscomtypes.server.inprocserverRi(RRRRtDllCanUnloadNow(R((s'/usr/lib64/python2.7/ctypes/__init__.pyRs " (tBigEndianStructuretLittleEndianStructurei(sntsce(sntsce(sntsce(sntsce(sntsce(sntsce(sntsce(RtosR|tsysRRt_ctypesRRRRRR8t_ctypes_versionRRRRJR t _calcsizet ExceptionR}R RtplatformRtunametsplitRR/RRRR2RR3RR"R#R6R:R;RR<R>R?R@treplaceRARBRCRDRERFRGRHRIRQRRRYR[R]R_RbRcReRgRiRlRmRot __ctype_le__t __ctype_be__RqRRtR{tc_voidpR~RRRRRRRRRRRtobjectRRRRRRRtcdlltpydllt dllhandlet pythonapit version_infoRvtoledllRwRtcoredllRRRtc_size_tt c_ssize_tRRRRtmemmovetmemsetRRRzRRRRRRRtctypes._endianRRtc_int8tc_uint8tkindtc_int16tc_int32tc_int64tc_uint16tc_uint32tc_uint64(((s'/usr/lib64/python2.7/ctypes/__init__.pytsJ ) "   !   (                         8           "             PK!M3roomacholib/__init__.pynu[###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """ 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' PK!Xn n macholib/framework.pynu[###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """ Generic framework path manipulation """ import re __all__ = ['framework_info'] STRICT_FRAMEWORK_RE = re.compile(r"""(?x) (?P^.*)(?:^|/) (?P (?P\w+).framework/ (?:Versions/(?P[^/]+)/)? (?P=shortname) (?:_(?P[^_]+))? )$ """) 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() PK!~macholib/dyld.pyonu[ pfc@sIdZddlZddlmZddlmZddlTdddd gZejj d d d d gZ ejj ddddgZ dZ dZ ddZddZddZddZddZddZddZddZddZdddZdddZdZed krEendS(!s dyld emulation iN(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|tr|jdS|S(sCNot all of PyObjC and Python understand unicode paths very well yettutf8(t isinstancetunicodetencode(ts((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyt ensure_utf8"s cCsD|dkrtj}n|j|}|dkr7gS|jdS(Nt:(tNonetostenvirontgettsplit(tenvtvartrval((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_env(s    cCs%|dkrtj}n|jdS(NtDYLD_IMAGE_SUFFIX(R R RR(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_image_suffix0s  cCs t|dS(NtDYLD_FRAMEWORK_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_framework_path5scCs t|dS(NtDYLD_LIBRARY_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_library_path8scCs t|dS(NtDYLD_FALLBACK_FRAMEWORK_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_fallback_framework_path;scCs t|dS(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]>}|jdr7|td |dVn ||V|VqWdS(Ns.dylib(tendswithtlen(titeratortsuffixtpath((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyt_injectFs   N(RR (R!RR"R$((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_image_suffix_searchAs   ccst|}|dk rJx/t|D]}tjj||dVq%Wnx4t|D]&}tjj|tjj|VqWWdS(Ntname(RR RR R#tjoinRtbasename(R&Rt frameworkR#((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_override_searchOs   ccs@|jdr<|dk r<tjj||tdVndS(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||dVq0Wnt|}x.|D]&}tjj|tjj|VqhW|dk r| rx)tD]}tjj||dVqWn|s x1t D]&}tjj|tjj|VqWndS(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_searchgs      $  cCst|}t|}xTttt||t||t|||D]}tjj|rO|SqOWt d|fdS(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.pyR}s      cCsyt|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 .frameworkiN(RR5trfindR R R#R'R((tfnR,Rtet fmwk_index((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyRs    % cCs i}dS(N((R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyttest_dyld_findst__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.pyts<                  PK!il<<macholib/__init__.pycnu[ pfc@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 sPK!Ymacholib/dylib.pyonu[ pfc@sVdZddlZdgZejdZdZdZedkrRendS(s! Generic dylib path manipulation iNt dylib_infos(?x) (?P^.*)(?:^|/) (?P (?P\w+?) (?:\.(?P[^._]+))? (?:_(?P[^._]+))? \.dylib$ ) cCs#tj|}|sdS|jS(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(Nc Ss%td|d|d|d|d|S(Ntlocationtnamet shortnametversiontsuffix(tdict(RRR R R ((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pytd1s (R(R ((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pyttest_dylib_info0st__main__(t__doc__tret__all__tcompileRRRt__name__(((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pyts      PK!A((macholib/README.ctypesnu[Files in this directory from 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/PK!macholib/dylib.pynu[###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """ Generic dylib path manipulation """ import re __all__ = ['dylib_info'] DYLIB_RE = re.compile(r"""(?x) (?P^.*)(?:^|/) (?P (?P\w+?) (?:\.(?P[^._]+))? (?:_(?P[^._]+))? \.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() PK!il<<macholib/__init__.pyonu[ pfc@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 sPK!^jmacholib/dyld.pynu[###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """ dyld emulation """ import os from framework import framework_info from 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 ensure_utf8(s): """Not all of PyObjC and Python understand unicode paths very well yet""" if isinstance(s, unicode): return s.encode('utf8') return s 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 """ name = ensure_utf8(name) executable_path = ensure_utf8(executable_path) 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 """ try: return dyld_find(fn, executable_path=executable_path, env=env) except ValueError, e: pass 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 e 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() PK!macholib/dyld.pycnu[ pfc@sIdZddlZddlmZddlmZddlTdddd gZejj d d d d gZ ejj ddddgZ dZ dZ ddZddZddZddZddZddZddZddZddZdddZdddZdZed krEendS(!s dyld emulation iN(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|tr|jdS|S(sCNot all of PyObjC and Python understand unicode paths very well yettutf8(t isinstancetunicodetencode(ts((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyt ensure_utf8"s cCsD|dkrtj}n|j|}|dkr7gS|jdS(Nt:(tNonetostenvirontgettsplit(tenvtvartrval((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_env(s    cCs%|dkrtj}n|jdS(NtDYLD_IMAGE_SUFFIX(R R RR(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_image_suffix0s  cCs t|dS(NtDYLD_FRAMEWORK_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_framework_path5scCs t|dS(NtDYLD_LIBRARY_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_library_path8scCs t|dS(NtDYLD_FALLBACK_FRAMEWORK_PATH(R(R((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_fallback_framework_path;scCs t|dS(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]>}|jdr7|td |dVn ||V|VqWdS(Ns.dylib(tendswithtlen(titeratortsuffixtpath((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyt_injectFs   N(RR (R!RR"R$((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_image_suffix_searchAs   ccst|}|dk rJx/t|D]}tjj||dVq%Wnx4t|D]&}tjj|tjj|VqWWdS(Ntname(RR RR R#tjoinRtbasename(R&Rt frameworkR#((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pytdyld_override_searchOs   ccs@|jdr<|dk r<tjj||tdVndS(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||dVq0Wnt|}x.|D]&}tjj|tjj|VqhW|dk r| rx)tD]}tjj||dVqWn|s x1t D]&}tjj|tjj|VqWndS(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_searchgs      $  cCst|}t|}xTttt||t||t|||D]}tjj|rO|SqOWt d|fdS(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.pyR}s      cCsyt|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 .frameworkiN(RR5trfindR R R#R'R((tfnR,Rtet fmwk_index((s,/usr/lib64/python2.7/ctypes/macholib/dyld.pyRs    % cCs:i}tddksttddks6tdS(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_findst__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.pyts<                  PK!UrA A macholib/framework.pycnu[ pfc@sVdZddlZdgZejdZdZdZedkrRendS(s% Generic framework path manipulation iNtframework_infos(?x) (?P^.*)(?:^|/) (?P (?P\w+).framework/ (?:Versions/(?P[^/]+)/)? (?P=shortname) (?:_(?P[^_]+))? )$ cCs#tj|}|sdS|jS(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}tddks0ttddksHttddks`ttddksxttd|ddd ksttd |dd d d d ksttddksttddksttd|ddd dksttd|ddd dd ksGtdS(Nc Ss%td|d|d|d|d|S(Ntlocationtnamet shortnametversiontsuffix(tdict(RRR R R ((s1/usr/lib64/python2.7/ctypes/macholib/framework.pytd0s scompletely/invalidscompletely/invalid/_debugs P/F.frameworksP/F.framework/_debugsP/F.framework/FtPs F.framework/FtFsP/F.framework/F_debugsF.framework/F_debugR tdebugsP/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.pyts      PK!K CTTmacholib/fetch_macholibnuȯ#!/bin/sh svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ . PK![D macholib/dylib.pycnu[ pfc@sVdZddlZdgZejdZdZdZedkrRendS(s! Generic dylib path manipulation iNt dylib_infos(?x) (?P^.*)(?:^|/) (?P (?P\w+?) (?:\.(?P[^._]+))? (?:_(?P[^._]+))? \.dylib$ ) cCs#tj|}|sdS|jS(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}tddks0ttddksHttd|dddkslttd|dd dd d ksttd |dd ddksttd|ddddksttd|ddddd kstdS(Nc Ss%td|d|d|d|d|S(Ntlocationtnamet shortnametversiontsuffix(tdict(RRR R R ((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pytd1s scompletely/invalidscompletely/invalide_debugs P/Foo.dylibtPs Foo.dylibtFoosP/Foo_debug.dylibsFoo_debug.dylibR tdebugs P/Foo.A.dylibs Foo.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_info0s$*''t__main__(t__doc__tret__all__tcompileRRRt__name__(((s-/usr/lib64/python2.7/ctypes/macholib/dylib.pyts      PK!yDSSmacholib/framework.pyonu[ pfc@sVdZddlZdgZejdZdZdZedkrRendS(s% Generic framework path manipulation iNtframework_infos(?x) (?P^.*)(?:^|/) (?P (?P\w+).framework/ (?:Versions/(?P[^/]+)/)? (?P=shortname) (?:_(?P[^_]+))? )$ cCs#tj|}|sdS|jS(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(Nc Ss%td|d|d|d|d|S(Ntlocationtnamet shortnametversiontsuffix(tdict(RRR R R ((s1/usr/lib64/python2.7/ctypes/macholib/framework.pytd0s (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.pyts      PK!Vd  _endian.pyonu[ pfc@sddlZddlTeeZdZdeefdYZejdkr{dZ eZ defd YZ n@ejd krd Z eZ d efd YZ n e ddS(iN(t*cCsft|trt|tSt|tr?t|j|jSt|t rR|St d|dS(sReturn 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.pyR s t _swapped_metacBseZdZRS(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.pyR1stbigt __ctype_le__tLittleEndianStructurecBseZdZeZdZRS(s'Structure with little endian byte orderN(RRRR RR R!(((s&/usr/lib64/python2.7/ctypes/_endian.pyR$:ssInvalid byteorder( tsystctypesttypetArrayRRR R t byteorderRR$Rt RuntimeError(((s&/usr/lib64/python2.7/ctypes/_endian.pyts    PK!Vl$##util.pynu[###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### import sys, os # 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): expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp() os.close(fdout) cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;' \ '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: f = os.popen(cmd) try: trace = f.read() finally: rv = f.close() finally: try: os.unlink(ccout) except OSError, e: if e.errno != errno.ENOENT: raise if rv == 10: raise OSError, 'gcc or cc command not found' 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 cmd = "/usr/ccs/bin/dump -Lpv 2>/dev/null " + f f = os.popen(cmd) try: data = f.read() finally: f.close() res = re.search(r'\[.*\]\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 10; fi;' \ "objdump -p -j .dynamic 2>/dev/null " + f f = os.popen(cmd) dump = f.read() rv = f.close() if rv == 10: return os.path.basename(f) # This is good for GLibc, I think, # and a dep on binutils is big (for # live CDs). f = os.popen(cmd) try: data = f.read() finally: f.close() res = re.search(r'\sSONAME\s+([^\s]+)', data) 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(".") 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) f = os.popen('/sbin/ldconfig -r 2>/dev/null') try: data = f.read() finally: f.close() res = re.findall(expr, data) if not res: return _get_soname(_findLib_gcc(name)) res.sort(cmp= lambda x,y: cmp(_num_version(x), _num_version(y))) return res[-1] elif sys.platform == "sunos5": def _findLib_crle(name, is64): if not os.path.exists('/usr/bin/crle'): return None if is64: cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null' else: cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null' for line in os.popen(cmd).readlines(): line = line.strip() if line.startswith('Default Library Path (ELF):'): paths = 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()[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) f = os.popen('/sbin/ldconfig -p 2>/dev/null') try: data = f.read() finally: f.close() 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() PK!nk wintypes.pynu[###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### # The most useful windows datatypes from ctypes import * BYTE = c_byte WORD = c_ushort DWORD = c_ulong WCHAR = c_wchar UINT = c_uint INT = c_int DOUBLE = c_double FLOAT = c_float BOOLEAN = BYTE BOOL = c_long from ctypes import _SimpleCData class VARIANT_BOOL(_SimpleCData): _type_ = "v" def __repr__(self): return "%s(%r)" % (self.__class__.__name__, self.value) ULONG = c_ulong LONG = c_long USHORT = c_ushort SHORT = c_short # in the windows header files, these are structures. _LARGE_INTEGER = LARGE_INTEGER = c_longlong _ULARGE_INTEGER = ULARGE_INTEGER = c_ulonglong LPCOLESTR = LPOLESTR = OLESTR = c_wchar_p LPCWSTR = LPWSTR = c_wchar_p LPCSTR = LPSTR = c_char_p LPCVOID = LPVOID = c_void_p # WPARAM is defined as UINT_PTR (unsigned type) # LPARAM is defined as LONG_PTR (signed type) if sizeof(c_long) == sizeof(c_void_p): WPARAM = c_ulong LPARAM = c_long elif sizeof(c_longlong) == sizeof(c_void_p): WPARAM = c_ulonglong LPARAM = c_longlong ATOM = WORD LANGID = WORD COLORREF = DWORD LGRPID = DWORD LCTYPE = DWORD LCID = DWORD ################################################################ # HANDLE types HANDLE = 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(Structure): _fields_ = [("left", c_long), ("top", c_long), ("right", c_long), ("bottom", c_long)] tagRECT = _RECTL = RECTL = RECT class _SMALL_RECT(Structure): _fields_ = [('Left', c_short), ('Top', c_short), ('Right', c_short), ('Bottom', c_short)] SMALL_RECT = _SMALL_RECT class _COORD(Structure): _fields_ = [('X', c_short), ('Y', c_short)] class POINT(Structure): _fields_ = [("x", c_long), ("y", c_long)] tagPOINT = _POINTL = POINTL = POINT class SIZE(Structure): _fields_ = [("cx", c_long), ("cy", c_long)] tagSIZE = SIZEL = SIZE def RGB(red, green, blue): return red + (green << 8) + (blue << 16) class FILETIME(Structure): _fields_ = [("dwLowDateTime", DWORD), ("dwHighDateTime", DWORD)] _FILETIME = FILETIME class MSG(Structure): _fields_ = [("hWnd", HWND), ("message", c_uint), ("wParam", WPARAM), ("lParam", LPARAM), ("time", DWORD), ("pt", POINT)] tagMSG = MSG MAX_PATH = 260 class WIN32_FIND_DATAA(Structure): _fields_ = [("dwFileAttributes", DWORD), ("ftCreationTime", FILETIME), ("ftLastAccessTime", FILETIME), ("ftLastWriteTime", FILETIME), ("nFileSizeHigh", DWORD), ("nFileSizeLow", DWORD), ("dwReserved0", DWORD), ("dwReserved1", DWORD), ("cFileName", c_char * MAX_PATH), ("cAlternateFileName", c_char * 14)] class WIN32_FIND_DATAW(Structure): _fields_ = [("dwFileAttributes", DWORD), ("ftCreationTime", FILETIME), ("ftLastAccessTime", FILETIME), ("ftLastWriteTime", FILETIME), ("nFileSizeHigh", DWORD), ("nFileSizeLow", DWORD), ("dwReserved0", DWORD), ("dwReserved1", DWORD), ("cFileName", c_wchar * MAX_PATH), ("cAlternateFileName", c_wchar * 14)] __all__ = ['ATOM', 'BOOL', 'BOOLEAN', 'BYTE', 'COLORREF', 'DOUBLE', 'DWORD', 'FILETIME', 'FLOAT', 'HACCEL', 'HANDLE', 'HBITMAP', 'HBRUSH', 'HCOLORSPACE', 'HDC', 'HDESK', 'HDWP', 'HENHMETAFILE', 'HFONT', 'HGDIOBJ', 'HGLOBAL', 'HHOOK', 'HICON', 'HINSTANCE', 'HKEY', 'HKL', 'HLOCAL', 'HMENU', 'HMETAFILE', 'HMODULE', 'HMONITOR', 'HPALETTE', 'HPEN', 'HRGN', 'HRSRC', 'HSTR', 'HTASK', 'HWINSTA', 'HWND', 'INT', 'LANGID', 'LARGE_INTEGER', 'LCID', 'LCTYPE', 'LGRPID', 'LONG', 'LPARAM', 'LPCOLESTR', 'LPCSTR', 'LPCVOID', 'LPCWSTR', 'LPOLESTR', 'LPSTR', 'LPVOID', 'LPWSTR', 'MAX_PATH', 'MSG', 'OLESTR', 'POINT', 'POINTL', 'RECT', 'RECTL', 'RGB', 'SC_HANDLE', 'SERVICE_STATUS_HANDLE', 'SHORT', 'SIZE', 'SIZEL', 'SMALL_RECT', 'UINT', 'ULARGE_INTEGER', 'ULONG', 'USHORT', 'VARIANT_BOOL', 'WCHAR', 'WIN32_FIND_DATAA', 'WIN32_FIND_DATAW', 'WORD', 'WPARAM', '_COORD', '_FILETIME', '_LARGE_INTEGER', '_POINTL', '_RECTL', '_SMALL_RECT', '_ULARGE_INTEGER', 'tagMSG', 'tagPOINT', 'tagRECT', 'tagSIZE'] PK!FpCC wintypes.pycnu[ pfcZ@sddlTeZeZeZeZe Z e Z e ZeZeZeZddlmZdefdYZeZeZeZeZeZZeZZ e!Z"Z#Z$e!Z%Z&e'Z(Z)e*Z+Z,e-ee-e*kreZ.eZ/n'e-ee-e*kreZ.eZ/neZ0eZ1eZ2eZ3eZ4eZ5e*Z6e6Z7e6Z8e6Z9e6Z:e6Z;e6Z<e6Z=e6Z>e6Z?e6Z@e6ZAe6ZBe6ZCe6ZDe6ZEe6ZFe6ZGe6ZHe6ZIe6ZJe6ZKe6ZLe6ZMe6ZNe6ZOe6ZPe6ZQe6ZRe6ZSe6ZTe6ZUdeVfdYZWeWZXZYZZdeVfdYZ[e[Z\d eVfd YZ]d eVfd YZ^e^Z_Z`Zad eVfdYZbebZcZddZedeVfdYZfefZgdeVfdYZhehZidZjdeVfdYZkdeVfdYZlddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOddPd dQddRdSdTdUdVd dWdXdYdZd[d\dd]ddd^d_d d`dadbdcddddedfdgdhgZZmdiS(ji(t*(t _SimpleCDatat VARIANT_BOOLcBseZdZdZRS(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 ds   t _SMALL_RECTcBs2eZdefdefdefdefgZRS(tLefttToptRighttBottom(RR tc_shortR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRks   t_COORDcBs eZdefdefgZRS(tXtY(RR RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRrs tPOINTcBs eZdefdefgZRS(txty(RR RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyRvs tSIZEcBs eZdefdefgZRS(tcxtcy(RR RR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR{s cCs||d>|d>S(Nii((tredtgreentblue((s'/usr/lib64/python2.7/ctypes/wintypes.pytRGBstFILETIMEcBs 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 nFileSizeLowt dwReserved0t dwReserved1t cFileNametcAlternateFileNamei(RR R(R%tc_chartMAX_PATHR(((s'/usr/lib64/python2.7/ctypes/wintypes.pyR4s         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.pyRAs         tATOMtBOOLtBOOLEANtBYTEtCOLORREFtDOUBLER(tFLOATtHACCELtHANDLEtHBITMAPtHBRUSHt HCOLORSPACEtHDCtHDESKtHDWPt HENHMETAFILEtHFONTtHGDIOBJtHGLOBALtHHOOKtHICONt HINSTANCEtHKEYtHKLtHLOCALtHMENUt HMETAFILEtHMODULEtHMONITORtHPALETTEtHPENtHRGNtHRSRCtHSTRtHTASKtHWINSTAR0tINTtLANGIDt LARGE_INTEGERtLCIDtLCTYPEtLGRPIDtLONGR3t LPCOLESTRtLPCSTRtLPCVOIDtLPCWSTRtLPOLESTRtLPSTRtLPVOIDtLPWSTRR@tOLESTRtPOINTLtRECTLR$t SC_HANDLEtSERVICE_STATUS_HANDLEtSHORTtSIZELt SMALL_RECTtUINTtULARGE_INTEGERtULONGtUSHORTtWCHARtWORDR2t _FILETIMEt_LARGE_INTEGERt_POINTLt_RECTLt_ULARGE_INTEGERttagMSGttagPOINTttagRECTttagSIZEN(ntctypestc_byteRFtc_ushortRtc_ulongR(RBRR1R~tc_intRgtc_doubleRHtc_floatRIRERRDRRRRmRRR{t c_longlongRRit c_ulonglongRRt c_wchar_pRnRrRvRqRutc_char_pRoRstc_void_pRpRttsizeofR2R3RCRhRGRlRkRjRKRJRLRMRNRORPRQRRRSRTRURVRWRXRYRZR[R\R]R^R_R`RaRbRcRdReRfR0RyRzt StructureR RRRxRR}RRRRRwRRR|R$R%RR)RR@R4RAt__all__(((s'/usr/lib64/python2.7/ctypes/wintypes.pyts             PK!K94""util.pycnu[ pfc@sddlZddlZejdkrEdZdZdZnejdkr`dZnejdkrejd krdd lmZ d Znejdkrddl Z ddl Z ddl Z d Z ejd krdZn dZejjds0ejjds0ejjdrEdZdZqejd krldZedZqdZdZndZedkrendS(iNtntcCsd}tjj|}|dkr(dS|t|}tj|jdd\}}t|d d}t|dd!d }|dkrd }n|dkr||Sd S( sReturn 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.iit iiiig$@iN(tsystversiontfindtlentsplittinttNone(tprefixtitstrestt majorVersiont minorVersion((s#/usr/lib64/python2.7/ctypes/util.pyt_get_build_version s    cCswt}|dkrdS|dkr.d}nd|d}ddl}|jdddkro|d 7}n|d S( s%Return the name of the VC runtime dllitmsvcrtsmsvcr%di iNis_d.pydtds.dll(RRtimpt get_suffixes(RtclibnameR((s#/usr/lib64/python2.7/ctypes/util.pyt find_msvcrt s      cCs|dkrtSxtjdjtjD]l}tjj||}tjj|r^|S|jj dryq-n|d}tjj|r-|Sq-WdS(NtctmtPATHs.dll(RR( RtostenvironRtpathseptpathtjointisfiletlowertendswithR(tnamet directorytfname((s#/usr/lib64/python2.7/ctypes/util.pyt find_library1s   tcecCs|S(N((R!((s#/usr/lib64/python2.7/ctypes/util.pyR$Gstposixtdarwin(t dyld_findcCs[d|d|d||fg}x3|D]+}yt|SWq(tk rRq(q(Xq(WdS(Ns lib%s.dylibs%s.dylibs%s.framework/%s(t _dyld_findt ValueErrorR(R!tpossible((s#/usr/lib64/python2.7/ctypes/util.pyR$Ls   c Csdtj|}tj\}}tj|d|d|}z3tj|}z|j}Wd|j}XWdytj|Wn+t k r}|j t j krqnXX|dkrt dntj ||} | sdS| jdS(Ns[^\(\)\s]*lib%s\.[^\(\)\s]*srif type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;$CC -Wl,-t -o s 2>&1 -li sgcc or cc command not foundi(tretescapettempfiletmkstempRtclosetpopentreadtunlinktOSErrorterrnotENOENTtsearchRtgroup( R!texprtfdouttccouttcmdtfttracetrvtetres((s#/usr/lib64/python2.7/ctypes/util.pyt _findLib_gcc[s(    tsunos5cCsj|s dSd|}tj|}z|j}Wd|jXtjd|}|s]dS|jdS(Ns#/usr/ccs/bin/dump -Lpv 2>/dev/null s\[.*\]\sSONAME\s+([^\s]+)i(RRR1R2R0R,R7R8(R=R<tdataRA((s#/usr/lib64/python2.7/ctypes/util.pyt _get_sonamews  cCs|s dSd|}tj|}|j}|j}|dkrWtjj|Stj|}z|j}Wd|jXtjd|}|sdS|j dS(NsWif ! type objdump >/dev/null 2>&1; then exit 10; fi;objdump -p -j .dynamic 2>/dev/null i s\sSONAME\s+([^\s]+)i( RRR1R2R0RtbasenameR,R7R8(R=R<tdumpR?RDRA((s#/usr/lib64/python2.7/ctypes/util.pyREs"    tfreebsdtopenbsdt dragonflycCsf|jd}g}y-x&|r@|jdt|jqWWntk rUnX|petjgS(Nt.i(RtinsertRtpopR*Rtmaxint(tlibnametpartstnums((s#/usr/lib64/python2.7/ctypes/util.pyt _num_versions $ cCstj|}d||f}tjd}z|j}Wd|jXtj||}|sttt|S|j dd|dS(Ns:-l%s\.\S+ => \S*/(lib%s\.\S+)s/sbin/ldconfig -r 2>/dev/nulltcmpcSstt|t|S(N(RSRR(txty((s#/usr/lib64/python2.7/ctypes/util.pytsi( R,R-RR1R2R0tfindallRERBtsort(R!tenameR9R=RDRA((s#/usr/lib64/python2.7/ctypes/util.pyR$s cCstjjdsdS|r%d}nd}xKtj|jD]4}|j}|jdrA|jd}qAqAW|sdSxF|jdD]5}tjj |d|}tjj|r|SqWdS(Ns /usr/bin/crles*env LC_ALL=C /usr/bin/crle -64 2>/dev/nulls&env LC_ALL=C /usr/bin/crle 2>/dev/nullsDefault Library Path (ELF):it:slib%s.so( RRtexistsRR1t readlineststript startswithRR(R!tis64R<tlinetpathstdirtlibfile((s#/usr/lib64/python2.7/ctypes/util.pyt _findLib_crles   cCstt||pt|S(N(RERdRB(R!R_((s#/usr/lib64/python2.7/ctypes/util.pyR$sc Csddl}|jddkr8tjdd}ntjdd}idd6dd 6dd 6dd 6d d 6}|j|d}dtj||f}tjd}z|j}Wd|j Xtj ||}|sdS|j dS(Nitlis-32s-64s libc6,x86-64s x86_64-64s libc6,64bitsppc64-64s sparc64-64ss390x-64s libc6,IA-64sia64-64tlibc6s\s+(lib%s\.[^\s]+)\s+\(%ss/sbin/ldconfig -p 2>/dev/nulli( tstructtcalcsizeRtunametgetR,R-R1R2R0R7RR8( R!Rgtmachinetmach_maptabi_typeR9R=RDRA((s#/usr/lib64/python2.7/ctypes/util.pyt_findSoname_ldconfigs(   cCst|ptt|S(N(RnRERB(R!((s#/usr/lib64/python2.7/ctypes/util.pyR$scCsddlm}tjdkrC|jGH|jdGHtdGHntjdkrtdGHtdGHtdGHtjd kr|j d GH|j d GH|j d GH|j d GHq|j dGH|j dGHtdGHndS(Ni(tcdllRRR&RRtbz2R's libm.dylibslibcrypto.dylibslibSystem.dylibsSystem.framework/Systemslibm.sos libcrypt.sotcrypt( tctypesRoRR!RtloadR$Rtplatformt LoadLibrary(Ro((s#/usr/lib64/python2.7/ctypes/util.pyttests"   t__main__(RRR!RRR$Rttctypes.macholib.dyldR(R)R,R.R5RBRER^RRRdtFalseRnRvt__name__(((s#/usr/lib64/python2.7/ctypes/util.pyts8     $         PK!KkCkC __init__.pynu[PK!\ϙ C_endian.pynu[PK!٨%NN L__init__.pycnu[PK!K94""util.pyonu[PK!FpCC ܺwintypes.pyonu[PK! [#[#[util.py.binutils-no-depnu[PK!Vd  _endian.pycnu[PK!٨%NN ;__init__.pyonu[PK!M3roo9Nmacholib/__init__.pynu[PK!Xn n Omacholib/framework.pynu[PK!~Ymacholib/dyld.pyonu[PK!il<<omacholib/__init__.pycnu[PK!Y.qmacholib/dylib.pyonu[PK!A((5xmacholib/README.ctypesnu[PK!ymacholib/dylib.pynu[PK!il<<݁macholib/__init__.pyonu[PK!^j^macholib/dyld.pynu[PK!{macholib/dyld.pycnu[PK!UrA A Wmacholib/framework.pycnu[PK!K CTT޹macholib/fetch_macholibnuȯPK![D ymacholib/dylib.pycnu[PK!yDSSmacholib/framework.pyonu[PK!Vd  __endian.pyonu[PK!Vl$##util.pynu[PK!nk wintypes.pynu[PK!FpCC  wintypes.pycnu[PK!K94""i%util.pycnu[PKgD