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Zeejdzkr·eae]ƒZgeae`ƒZhejd krƒegjijjZjn egjkjjZjddilmlZlmmZmdddj„Znne1e@ƒe1eLƒkrÞe@Zoe?ZpnNe1e>ƒe1eLƒkre>Zoe=Zpn'e1eEƒe1eLƒkr,eEZoeDZpnddklmqZqmrZrmsZsmtZte(eLeLeLeoƒeqƒZue(eLeLe?eoƒerƒZvdl„Zwewe:eLe:e:ƒetƒZxdm„Zyewe:eLe?ƒesƒZzddn„Z{yddolm|Z|WneTk rün%Xewe:eLe?ƒe|ƒZ}ddp„Z~ejd{krE dq„Zdr„Z€nddsl�m‚Z‚mƒZƒeIZ„eFZ…xke;e?e=eDgD]WZ†e1e†ƒdkr› e†Z‡qz e1e†ƒdtkr¶ e†Zˆqz e1e†ƒdkrz e†Z‰qz qz Wxke<e@e>eEgD]WZ†e1e†ƒdkr e†ZŠqè e1e†ƒdtkr$ e†Z‹qè e1e†ƒdkrè e†ZŒqè qè W[†eRƒdS(|s,create and manipulate C data types in PythoniÿÿÿÿNs1.1.0(tUniont StructuretArray(t_Pointer(tCFuncPtr(t __version__(t RTLD_LOCALt RTLD_GLOBAL(t ArgumentError(tcalcsizesVersion number mismatchtnttce(t FormatErrortposixtdarwinit.ii(tFUNCFLAG_CDECLtFUNCFLAG_PYTHONAPItFUNCFLAG_USE_ERRNOtFUNCFLAG_USE_LASTERRORcCs�t|ttfƒrT|dkr4t|ƒd}nt|}|ƒ}||_|St|ttfƒr€t|}|ƒ}|St |ƒ‚dS(s¬create_string_buffer(aString) -> character array create_string_buffer(anInteger) -> character array create_string_buffer(aString, anInteger) -> character array iN( t isinstancetstrtunicodetNonetlentc_chartvaluetinttlongt TypeError(tinittsizetbuftypetbuf((s'/usr/lib64/python2.7/ctypes/__init__.pytcreate_string_buffer1s      cCs t||ƒS(N(R"(RR((s'/usr/lib64/python2.7/ctypes/__init__.pytc_bufferCscsÆt‰|jdtƒr%ˆtO‰n|jdtƒrDˆtO‰n|rctd|jƒƒ‚nytˆˆˆfSWnGtk rÁdt f‡‡‡fd†ƒY}|tˆˆˆf<|SXdS(sÉCFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) -> function prototype. restype: the result type argtypes: a sequence specifying the argument types The function prototype can be called in different ways to create a callable object: prototype(integer address) -> foreign function prototype(callable) -> create and return a C callable function from callable prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal prototype((function name, dll object)[, paramflags]) -> foreign function exported by name t use_errnotuse_last_errors!unexpected keyword argument(s) %st CFunctionTypecseZˆZˆZˆZRS((t__name__t __module__t _argtypes_t _restype_t_flags_((targtypestflagstrestype(s'/usr/lib64/python2.7/ctypes/__init__.pyR&esN( t_FUNCFLAG_CDECLtpoptFalset_FUNCFLAG_USE_ERRNOt_FUNCFLAG_USE_LASTERRORt ValueErrortkeyst_c_functype_cachetKeyErrort _CFuncPtr(R.R,tkwR&((R,R-R.s'/usr/lib64/python2.7/ctypes/__init__.pyt CFUNCTYPEKs   "(t LoadLibrary(tFUNCFLAG_STDCALLcsÆt‰|jdtƒr%ˆtO‰n|jdtƒrDˆtO‰n|rctd|jƒƒ‚nytˆˆˆfSWnGtk rÁdt f‡‡‡fd†ƒY}|tˆˆˆf<|SXdS(NR$R%s!unexpected keyword argument(s) %stWinFunctionTypecseZˆZˆZˆZRS((R'R(R)R*R+((R,R-R.(s'/usr/lib64/python2.7/ctypes/__init__.pyR=€s( t_FUNCFLAG_STDCALLR0R1R2R3R4R5t_win_functype_cacheR7R8(R.R,R9R=((R,R-R.s'/usr/lib64/python2.7/ctypes/__init__.pyt WINFUNCTYPEts   "R:R@(tdlopen(tsizeoftbyreft addressoft alignmenttresize(t get_errnot set_errno(t _SimpleCDatacCsmddlm}|dkr(|j}nt|ƒ||ƒ}}||kritd|||fƒ‚ndS(Niÿÿÿÿ(R s"sizeof(%s) wrong: %d instead of %d(tstructR Rt_type_RBt SystemError(ttypttypecodeR tactualtrequired((s'/usr/lib64/python2.7/ctypes/__init__.pyt _check_size�s   t py_objectcBseZdZd„ZRS(tOcCs=ytt|ƒjƒSWntk r8dt|ƒjSXdS(Ns %s()(tsuperRRt__repr__R4ttypeR'(tself((s'/usr/lib64/python2.7/ctypes/__init__.pyRUžs (R'R(RKRU(((s'/usr/lib64/python2.7/ctypes/__init__.pyRRœstPtc_shortcBseZdZRS(th(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRY¥stc_ushortcBseZdZRS(tH(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR[©stc_longcBseZdZRS(tl(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR]­stc_ulongcBseZdZRS(tL(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR_±stiR^tc_intcBseZdZRS(Ra(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRbºstc_uintcBseZdZRS(tI(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRc¾stc_floatcBseZdZRS(tf(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyReÂstc_doublecBseZdZRS(td(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRgÆst c_longdoublecBseZdZRS(tg(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRiÊstqt c_longlongcBseZdZRS(Rk(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRlÔst c_ulonglongcBseZdZRS(tQ(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRmØstc_ubytecBseZdZRS(tB(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRoßstc_bytecBseZdZRS(tb(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRqæsRcBseZdZRS(tc(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyRëstc_char_pcBs2eZdZejdkr'd„Zn d„ZRS(tzR cCsLtjj|dƒs,d|jj|jfSd|jjt|tƒjfS(Niÿÿÿÿs%s(%r)s%s(%s)(twindlltkernel32tIsBadStringPtrAt __class__R'Rtcasttc_void_p(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRUóscCs d|jjt|tƒjfS(Ns%s(%s)(RyR'RzR{R(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRUøs(R'R(RKt_ostnameRU(((s'/usr/lib64/python2.7/ctypes/__init__.pyRtðs R{cBseZdZRS(RX(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR{üstc_boolcBseZdZRS(t?(R'R(RK(((s'/usr/lib64/python2.7/ctypes/__init__.pyR~s(tPOINTERtpointert_pointer_type_cachecCsbtjƒtjƒtjdkr0tjƒntjtt ƒ_t jtt ƒ_t td character array create_unicode_buffer(anInteger) -> character array create_unicode_buffer(aString, anInteger) -> character array iN( RRRRRR†RRRR(RRR R!((s'/usr/lib64/python2.7/ctypes/__init__.pytcreate_unicode_buffer!s      cCsptj|dƒdk r'tdƒ‚nt|ƒtkrHtdƒ‚n|j|ƒ|t|stCDLLcBs\eZdZeZeZdZdZdZ e de e d„Z d„Zd„Zd„ZRS(sÆAn instance of this class represents a loaded dll/shared library, exporting functions using the standard C calling convention (named 'cdecl' on Windows). The exported functions can be accessed as attributes, or by indexing with the function name. Examples: .qsort -> callable object ['qsort'] -> callable object Calling the functions releases the Python GIL during the call and reacquires it afterwards. sics‘|ˆ_ˆj‰|r%ˆtO‰n|r8ˆtO‰ndtf‡‡fd†ƒY}|ˆ_|dkr„tˆj|ƒˆ_n |ˆ_dS(Nt_FuncPtrcseZˆZˆjZRS((R'R(R+t_func_restype_R*((R-RW(s'/usr/lib64/python2.7/ctypes/__init__.pyR˜cs( t_namet _func_flags_R2R3R8R˜Rt_dlopent_handle(RWR}tmodethandleR$R%R˜((R-RWs'/usr/lib64/python2.7/ctypes/__init__.pyt__init__Ys      cCsDd|jj|j|jtjdd@t|ƒtjdd@fS(Ns<%s '%s', handle %x at %x>ii(RyR'RšR�t_systmaxintR’(RW((s'/usr/lib64/python2.7/ctypes/__init__.pyRUmscCsP|jdƒr-|jdƒr-t|ƒ‚n|j|ƒ}t|||ƒ|S(Nt__(t startswithtendswithtAttributeErrort __getitem__tsetattr(RWR}tfunc((s'/usr/lib64/python2.7/ctypes/__init__.pyt __getattr__ss cCs:|j||fƒ}t|ttfƒs6||_n|S(N(R˜RRRR'(RWtname_or_ordinalR©((s'/usr/lib64/python2.7/ctypes/__init__.pyR§zs N(R'R(t__doc__R/R›RbR™RšR�RR˜t DEFAULT_MODER1R RURªR§(((s'/usr/lib64/python2.7/ctypes/__init__.pyR—Ds    tPyDLLcBseZdZeeBZRS(s¯This class represents the Python library itself. It allows accessing Python API functions. The GIL is not released, and Python exceptions are handled correctly. (R'R(R¬R/t_FUNCFLAG_PYTHONAPIR›(((s'/usr/lib64/python2.7/ctypes/__init__.pyR®€stWinDLLcBseZdZeZRS(snThis class represents a dll exporting functions using the Windows stdcall calling convention. (R'R(R¬R>R›(((s'/usr/lib64/python2.7/ctypes/__init__.pyR°‰s(t_check_HRESULTRItHRESULTcBseZdZeZRS(R^(R'R(RKR±t_check_retval_(((s'/usr/lib64/python2.7/ctypes/__init__.pyR²’s tOleDLLcBseZdZeZeZRS(sßThis class represents a dll exporting functions using the Windows stdcall calling convention, and returning HRESULT. HRESULT error values are automatically raised as WindowsError exceptions. (R'R(R¬R>R›R²R™(((s'/usr/lib64/python2.7/ctypes/__init__.pyR´Ÿst LibraryLoadercBs,eZd„Zd„Zd„Zd„ZRS(cCs ||_dS(N(t_dlltype(RWtdlltype((s'/usr/lib64/python2.7/ctypes/__init__.pyR ©scCsB|ddkrt|ƒ‚n|j|ƒ}t|||ƒ|S(Nit_(R¦R¶R¨(RWR}tdll((s'/usr/lib64/python2.7/ctypes/__init__.pyRª¬s cCs t||ƒS(N(tgetattr(RWR}((s'/usr/lib64/python2.7/ctypes/__init__.pyR§³scCs |j|ƒS(N(R¶(RWR}((s'/usr/lib64/python2.7/ctypes/__init__.pyR;¶s(R'R(R RªR§R;(((s'/usr/lib64/python2.7/ctypes/__init__.pyRµ¨s   s python dlltcygwinslibpython%d.%d.dll(tget_last_errortset_last_errorcCsF|dkrtƒ}n|dkr9t|ƒjƒ}nt||ƒS(N(Rt GetLastErrorR tstript WindowsError(tcodetdescr((s'/usr/lib64/python2.7/ctypes/__init__.pytWinErrorÎs    (t _memmove_addrt _memset_addrt_string_at_addrt _cast_addrcs#dtf‡‡fd†ƒY}|S(NR&cseZˆZˆZeeBZRS((R'R(R)R*R/R¯R+((R,R.(s'/usr/lib64/python2.7/ctypes/__init__.pyR&ês(R8(R.R,R&((R,R.s'/usr/lib64/python2.7/ctypes/__init__.pyt PYFUNCTYPEéscCst|||ƒS(N(t_cast(tobjRM((s'/usr/lib64/python2.7/ctypes/__init__.pyRzñscCs t||ƒS(sAstring_at(addr[, size]) -> string Return the string at addr.(t _string_at(tptrR((s'/usr/lib64/python2.7/ctypes/__init__.pyt string_atõs(t_wstring_at_addrcCs t||ƒS(sFwstring_at(addr[, size]) -> string Return the string at addr.(t _wstring_at(RÌR((s'/usr/lib64/python2.7/ctypes/__init__.pyt wstring_atscCsNy"tdtƒtƒdgƒ}Wntk r6dSX|j|||ƒSdS(Nscomtypes.server.inprocservert*i€(t __import__tglobalstlocalst ImportErrortDllGetClassObject(trclsidtriidtppvtccom((s'/usr/lib64/python2.7/ctypes/__init__.pyRÖ s " cCsAy"tdtƒtƒdgƒ}Wntk r6dSX|jƒS(Nscomtypes.server.inprocserverRÑi(RÒRÓRÔRÕtDllCanUnloadNow(RÚ((s'/usr/lib64/python2.7/ctypes/__init__.pyRÛs " (tBigEndianStructuretLittleEndianStructurei(R R (R R (R R (R R (R R (R R (R R (�R¬tosR|tsysR¡Rt_ctypesRRRRRR8t_ctypes_versionRRRRJR t _calcsizet ExceptionR}R R­tplatformRtunametsplitRR/RR¯RR2RR3RR"R#R6R:R;RœR<R>R?R@treplaceRARBRCRDRERFRGRHRIRQRRRYR[R]R_RbRcReRgRiRlRmRot __ctype_le__t __ctype_be__RqRRtR{tc_voidpR~R€R�R‚R‡RˆRÕR„R†R�R•R–tobjectR—R®R°R±R²R´Rµtcdlltpydllt dllhandlet pythonapit version_infoRvtoledllRwR¾tcoredllR¼R½RÃtc_size_tt c_ssize_tRÄRÅRÆRÇtmemmovetmemsetRÈRÉRzRËRÍRÎRÏRÐRÖRÛtctypes._endianRÜRÝtc_int8tc_uint8tkindtc_int16tc_int32tc_int64tc_uint16tc_uint32tc_uint64(((s'/usr/lib64/python2.7/ctypes/__init__.pytsJ ) "   !   (                         <           "