pWc@sNddlZddlZddlmZmZdefdYZdZdS(iNi(tmodelt ffiplatformtVCPythonEnginecBsueZdZeZdZdZdZdZddZ dZ dZ d Z d7d Zd Zd Zd ZdZdZdZdZdZdZeZeZeZeZeZdZdZdZeZ dZ!eZ"dZ#dZ$dZ%dZ&eZ'dZ(dZ)dZ*dZ+d Z,d!Z-d"Z.d#Z/eZ0d$Z1d%Z2d&Z3d'Z4d7d(d7ee5d7d)Z6d*Z7d+Z8eZ9eZ:eZ;dd,Z<d-Z=d.d/Z>eZ?eZ@d0ZAd1ZBd2ZCeZDeZEeZFeZGd3ZHd4ZIeZJeZKd5ZLd6ZMRS(8txcCs+||_|j|_i|_i|_dS(N(tverifiertffit_struct_pending_verificationt_types_of_builtin_functions(tselfR((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt__init__ s   cCsdS(N((Rtkwds((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pytpatch_extension_kwdsscCseytj||\}}}Wntk r3dSX|dk rM|jn|d|kradS|S(Ni(timpt find_modulet ImportErrortNonetclose(Rt module_nametpatht so_suffixestftfilenametdescr((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyR s   cCsi|_|jddS(Nt collecttype(t _typesdictt _generate(R((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt collect_types#s tcCs|jj|ddS(Ns (t_ftwrite(Rtwhat((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt_prnt'scCs |j|S(N(R(Rttype((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt _gettypenum*scCsTt|tj s"|jdkrP||jkrPt|j}||j|= 3s.static struct PyModuleDef _cffi_module_def = {s PyModuleDef_HEAD_INIT,s "%s",s NULL,s -1,s _cffi_methods,s NULL, NULL, NULL, NULLtPyMODINIT_FUNCsPyInit_%s(void)t{s PyObject *lib;s+ lib = PyModule_Create(&_cffi_module_def);s if (lib == NULL)s return NULL;s# if (%s < 0 || _cffi_init() < 0) {s Py_DECREF(lib);s }s return lib;t}s#elses init%s(void)s+ lib = Py_InitModule("%s", _cffi_methods);s return;s! if (%s < 0 || _cffi_init() < 0)s return;s#endif( Rt_chained_list_constantsRtcffimod_headerRtpreambleRt_generate_setup_customtget_module_nametFalse(Rtprnttmodnamet constants((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pytwrite_source_to_f5st                                       c stjzttdr+tj}nzyPttdr\|dk r\tj|ntjjj jj Wn8t k r}djj |f}t j |nXWdttdrtj|nXWdtjXjdtgjjD]\}}||f^q}gtt|D]}||^qC} ttjj| } dtffdY} j| t j | rddl} | jdjj njd d | j_j_| S( Ntgetdlopenflagstsetdlopenflagssimporting %r: %stloadingt FFILibrarycs,eZZjZgZfdZRS(csjt|jS(N(t _cffi_dirtlistt__dict__(R(R;(s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt__dir__s(t__name__t __module__t_cffi_python_moduleRt _cffi_ffiR<R?((R;tmoduleR(s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyR;s is0reimporting %r might overwrite older definitionstloadedtlibrary( R t acquire_lockthasattrtsysR8RR9t load_dynamicRR2tmodulefilenameRRtVerificationErrort release_lockt_loadtdictRtitemstrangeR%R=tmapRt_get_cached_btypetobjectt _cffi_setuptwarningstwarnt_cffi_original_ffiRt_cffi_types_of_builtin_funcs( Rtflagstprevious_flagsteterrortkeytvaluet revmappingtitlstRFRV((R;RDRs6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt load_librarys>  .)"     cCsHg|jjjjD]\}\}}||f^q}|j|S(N(Rt_parsert _declarationsRPtsort(RR^R&tqualRb((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt_get_declarationss7 cCsx|jD]\}}|jdd\}}yt|d||f}Wn$tk rttjd|nXy|||Wq tk r}tj||q Xq WdS(Nt is_generate_cpy_%s_%ssnot implemented in verify(): %r( RhtsplittgetattrtAttributeErrorRRLt ExceptionRtattach_exception_info(Rt step_nameR$R&tkindtrealnameR*R\((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyRs  c Ksx|jD]}\}}|jdd\}}t|d||f}y|||||Wq tk r} tj| |q Xq WdS(NRiis _%s_cpy_%s(RhRjRkRmRRn( RRDRoR R$R&RpRqR*R\((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyRNscCsdS(N((RR&R$((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt_generate_nothingscKsdS(N((RR&R$RDR ((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt _loaded_noopscCsd}t|tjrz|jrI|jdkrId}d|j}n(d|jd|jjddf}d}nt|tjr|j||||dSt|tj tj fr|j d ||j ||f|j d |dSt|tj r:d |jd}d |j |}d }n t||j d||||f|j d||jd|f|j d |dS(NRt_Boolt_cffi_to_c_ints, %ss(%s)_cffi_to_c_%sRit_s-1s6 if (_cffi_to_c((char *)&%s, _cffi_type(%d), %s) < 0)s %s;s(%s)_cffi_to_c_pointers, _cffi_type(%d)tNULLs %s = %s(%s%s);s' if (%s == (%s)%s && PyErr_Occurred())(R"RR#tis_integer_typeR$t get_c_nametreplacet PointerTypet"_convert_funcarg_to_c_ptr_or_arrayt StructOrUniontEnumTypeRR!tFunctionPtrTypetNotImplementedError(RR&tfromvarttovarterrcodetextraargt converterterrvalue((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt_convert_funcarg_to_cs4       cCs&t|tjr"|jdndS(NsPy_ssize_t datasize(R"RR{tadd(RR&t localvars((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt_extra_local_variablesscCs|jd|jd|j|||f|jd|jd|jd||jd|f|jd|f|jd||j||f|jd||jd dS( Ns1 datasize = _cffi_prepare_pointer_call_argument(s( _cffi_type(%d), %s, (char **)&%s);s if (datasize != 0) {s if (datasize < 0)s %s;s" %s = alloca((size_t)datasize);s, memset((void *)%s, 0, (size_t)datasize);sL if (_cffi_convert_array_from_object((char *)%s, _cffi_type(%d), %s) < 0)s }(RR!(RR&RRR((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyR|s     cCslt|tjru|jr/d||jfS|jdkr[d|jjdd|fSd||j|fSnt|tjtjfrd||j|fSt|tj rd||jtj|j fSt|tj r3|j dkrtd|j|fnd ||j|fSt|tjr\d||j|fSt|dS( Ns_cffi_from_c_int(%s, %s)s long doubles_cffi_from_c_%s(%s)RiRvs/_cffi_from_c_deref((char *)&%s, _cffi_type(%d))s0_cffi_from_c_pointer((char *)%s, _cffi_type(%d))s!'%s' is used as %s, but is opaques0_cffi_from_c_struct((char *)&%s, _cffi_type(%d))(R"RR#RxR$RzR!R{Rt ArrayTypetitemt StructTypetfldnamesRt TypeErrort _get_c_nameR~R(RR&tvartcontext((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt_convert_expr_from_c(s.  cCsft|tjst|jr1|j|n1x|jD]}|j|q;W|j|jdS(N(R"RRtAssertionErrortellipsisR(targstresult(RR&R$R ((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt"_generate_cpy_function_collecttypeOs  c CsXt|tjst|jr8|jt||dS|j}t|j }|dkred}n|dkrzd}nd}|d|d||f|dd |}x;t |j D]*\}}|d |j d ||qWt } x!|j D]}|j || qWx| D]} |d | fq$Wt|jtjsd } d |}|d |jj d|nd} t|j dkr"tt|j } x| D]}|d|qW||dd||djg| D]}d|^qf|dn|xBt |j D]1\}}|j|d|d|d|q9W|d|d|d| |djgtt|j D]}d|^qf|d|d||d|dkr|dn| r/|d |j|jd!d"n|d#|d$|d%|dS(&Nitnoargitarg0Rsstatic PyObject *s(_cffi_f_%s(PyObject *self, PyObject *%s)R,sargument of %ss %s;s x%ds result = s result of %ss resultRs PyObject *arg%d;s+ if (!PyArg_ParseTuple(args, "%s:%s", %s))tOs, s&arg%ds return NULL;sarg%dsx%ds return NULLs Py_BEGIN_ALLOW_THREADSs _cffi_restore_errno();s { %s%s(%s); }s _cffi_save_errno();s Py_END_ALLOW_THREADSs (void)self; /* unused */s (void)noarg; /* unused */s return %s;Rs result types Py_INCREF(Py_None);s return Py_None;R-(R"RRRRt_generate_cpy_constR3RR%Rt enumerateRytsetRRtVoidTypeRQtjoinRR( RR&R$R4tnumargstargnameRRaR RR)t result_codetrng((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt_generate_cpy_function_declZst         "     5    :        cCsj|jr dSt|j}|dkr1d}n|dkrFd}nd}|jd|||fdS(Nit METH_NOARGSitMETH_Ot METH_VARARGSs {"%s", _cffi_f_%s, %s, NULL},(RR%RR(RR&R$Rtmeth((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt_generate_cpy_function_methods     cCs=|jr dSt||}t|||||j|%s) << 1);s { %s = &p->%s; (void)tmp; }s*tmpsfield %rtqualss /* %s */R-sstatic PyObject *s#%s(PyObject *self, PyObject *noarg)s, struct _cffi_aligncheck { char x; %s y; };s static Py_ssize_t nums[] = {s sizeof(%s),s) offsetof(struct _cffi_aligncheck, y),s offsetof(%s, %s),s 0, /* %s */s sizeof(((%s *)0)->%s),s -1s };s (void)self; /* unused */s (void)noarg; /* unused */s' return _cffi_get_struct_layout(nums);s3 /* the next line is not executed, but compiled */s %s(0);(RRtstripRt enumfieldsR"RR#RxRyRRLtstrRtlengthR( RR&tprefixR$t checkfuncnametlayoutfuncnametcnameR4tfnametftypetfbitsizetfqualR\((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyRsX          !       cCs>|jdkrdSd||f}|jd||fdS(Ns_cffi_layout_%s_%ss {"%s", %s, METH_NOARGS, NULL},(RRR(RR&RR$R((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyRs  c Cs|jdkrdSd||f}t||}|}t|tjr|jr|d}|d} |ddd} |ddd} |jt| t| kot|jknst | | || f|_ n)d||fj } || f|j | 0 || (long)(%s) != %dL) {s1 if ((%s) <= 0 || (unsigned long)(%s) != %dUL) {s char buf[64];s if ((%s) <= 0)s. snprintf(buf, 63, "%%ld", (long)(%s));s elses7 snprintf(buf, 63, "%%lu", (unsigned long)(%s));s) PyErr_Format(_cffi_VerificationError,s6 "%s%s has the real value %s, not %s",s( "%s", "%s", buf, "%d");s return -1;s }(R(RR$R_t err_prefixR4((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyRs$       cCs |jdd}d||fS(Nt$t___D_s _cffi_e_%s_%s(Rz(RRR$((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt_enum_funcnamestenumcCs|jr7x'|jD]}|jt|dtqWdS|j||}|j}|d||dx:t|j|jD]#\}}|j ||d|qW|d|j t|d|j t<|d|dS(NRsstatic int %s(PyObject *lib)R,s enum %s: s return %s;s(lib)R-( Rt enumeratorsRtTrueR3RRtzipt enumvaluesRR.(RR&R$Rt enumeratorRR4t enumvalue((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyRs   "  cCsM|jrIg|jD]}t||^q}t||_t|_ndS(N(RRRkttupleRRtpartial_resolved(RR&R$RDRR((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyRs  "cCs:x3t|j|jD]\}}t|||qWdS(N(RRRR(RR&R$RDRFRR((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyRs"cCs5|dkrd}n|}|jt|d|dS(Ns...R(RRR(RR&R$R((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt_generate_cpy_macro_decls  cCsGt|tjr'tj|j}ntj|}|j|dS(N(R"RRR{RR((RR&R$ttp_ptr((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt"_generate_cpy_variable_collecttypesc Cs{t|tjrOtj|j}|jt||d|d|jdkn(tj|}|jt||dddS(NRRs...RR(R"RRR{RRR3R(RR&R$R((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyt_generate_cpy_variable_decls c s{t||}t|tjr|jdkrt|tsEt|\}}|jj|j }t ||jj |\}} | dkrt j d||j fn|j|}n|jdk r |jj|} |jj| |}t|||ndS|t||fd} fd} tt||t| | t|jj|dS(Ns...is/bad size: %r does not seem to be an array of %scsdS(Ni((RF(tptr(s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pytgetterscs|d #include /* this block of #ifs should be kept exactly identical between c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py */ #if defined(_MSC_VER) # include /* for alloca() */ # if _MSC_VER < 1600 /* MSVC < 2010 */ typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; typedef __int8 int_least8_t; typedef __int16 int_least16_t; typedef __int32 int_least32_t; typedef __int64 int_least64_t; typedef unsigned __int8 uint_least8_t; typedef unsigned __int16 uint_least16_t; typedef unsigned __int32 uint_least32_t; typedef unsigned __int64 uint_least64_t; typedef __int8 int_fast8_t; typedef __int16 int_fast16_t; typedef __int32 int_fast32_t; typedef __int64 int_fast64_t; typedef unsigned __int8 uint_fast8_t; typedef unsigned __int16 uint_fast16_t; typedef unsigned __int32 uint_fast32_t; typedef unsigned __int64 uint_fast64_t; typedef __int64 intmax_t; typedef unsigned __int64 uintmax_t; # else # include # endif # if _MSC_VER < 1800 /* MSVC < 2013 */ typedef unsigned char _Bool; # endif #else # include # if (defined (__SVR4) && defined (__sun)) || defined(_AIX) # include # endif #endif #if PY_MAJOR_VERSION < 3 # undef PyCapsule_CheckExact # undef PyCapsule_GetPointer # define PyCapsule_CheckExact(capsule) (PyCObject_Check(capsule)) # define PyCapsule_GetPointer(capsule, name) \ (PyCObject_AsVoidPtr(capsule)) #endif #if PY_MAJOR_VERSION >= 3 # define PyInt_FromLong PyLong_FromLong #endif #define _cffi_from_c_double PyFloat_FromDouble #define _cffi_from_c_float PyFloat_FromDouble #define _cffi_from_c_long PyInt_FromLong #define _cffi_from_c_ulong PyLong_FromUnsignedLong #define _cffi_from_c_longlong PyLong_FromLongLong #define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong #define _cffi_to_c_double PyFloat_AsDouble #define _cffi_to_c_float PyFloat_AsDouble #define _cffi_from_c_int_const(x) \ (((x) > 0) ? \ ((unsigned long long)(x) <= (unsigned long long)LONG_MAX) ? \ PyInt_FromLong((long)(x)) : \ PyLong_FromUnsignedLongLong((unsigned long long)(x)) : \ ((long long)(x) >= (long long)LONG_MIN) ? \ PyInt_FromLong((long)(x)) : \ PyLong_FromLongLong((long long)(x))) #define _cffi_from_c_int(x, type) \ (((type)-1) > 0 ? /* unsigned */ \ (sizeof(type) < sizeof(long) ? \ PyInt_FromLong((long)x) : \ sizeof(type) == sizeof(long) ? \ PyLong_FromUnsignedLong((unsigned long)x) : \ PyLong_FromUnsignedLongLong((unsigned long long)x)) : \ (sizeof(type) <= sizeof(long) ? \ PyInt_FromLong((long)x) : \ PyLong_FromLongLong((long long)x))) #define _cffi_to_c_int(o, type) \ ((type)( \ sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \ : (type)_cffi_to_c_i8(o)) : \ sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \ : (type)_cffi_to_c_i16(o)) : \ sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \ : (type)_cffi_to_c_i32(o)) : \ sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \ : (type)_cffi_to_c_i64(o)) : \ (Py_FatalError("unsupported size for type " #type), (type)0))) #define _cffi_to_c_i8 \ ((int(*)(PyObject *))_cffi_exports[1]) #define _cffi_to_c_u8 \ ((int(*)(PyObject *))_cffi_exports[2]) #define _cffi_to_c_i16 \ ((int(*)(PyObject *))_cffi_exports[3]) #define _cffi_to_c_u16 \ ((int(*)(PyObject *))_cffi_exports[4]) #define _cffi_to_c_i32 \ ((int(*)(PyObject *))_cffi_exports[5]) #define _cffi_to_c_u32 \ ((unsigned int(*)(PyObject *))_cffi_exports[6]) #define _cffi_to_c_i64 \ ((long long(*)(PyObject *))_cffi_exports[7]) #define _cffi_to_c_u64 \ ((unsigned long long(*)(PyObject *))_cffi_exports[8]) #define _cffi_to_c_char \ ((int(*)(PyObject *))_cffi_exports[9]) #define _cffi_from_c_pointer \ ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[10]) #define _cffi_to_c_pointer \ ((char *(*)(PyObject *, CTypeDescrObject *))_cffi_exports[11]) #define _cffi_get_struct_layout \ ((PyObject *(*)(Py_ssize_t[]))_cffi_exports[12]) #define _cffi_restore_errno \ ((void(*)(void))_cffi_exports[13]) #define _cffi_save_errno \ ((void(*)(void))_cffi_exports[14]) #define _cffi_from_c_char \ ((PyObject *(*)(char))_cffi_exports[15]) #define _cffi_from_c_deref \ ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[16]) #define _cffi_to_c \ ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[17]) #define _cffi_from_c_struct \ ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[18]) #define _cffi_to_c_wchar_t \ ((wchar_t(*)(PyObject *))_cffi_exports[19]) #define _cffi_from_c_wchar_t \ ((PyObject *(*)(wchar_t))_cffi_exports[20]) #define _cffi_to_c_long_double \ ((long double(*)(PyObject *))_cffi_exports[21]) #define _cffi_to_c__Bool \ ((_Bool(*)(PyObject *))_cffi_exports[22]) #define _cffi_prepare_pointer_call_argument \ ((Py_ssize_t(*)(CTypeDescrObject *, PyObject *, char **))_cffi_exports[23]) #define _cffi_convert_array_from_object \ ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[24]) #define _CFFI_NUM_EXPORTS 25 typedef struct _ctypedescr CTypeDescrObject; static void *_cffi_exports[_CFFI_NUM_EXPORTS]; static PyObject *_cffi_types, *_cffi_VerificationError; static int _cffi_setup_custom(PyObject *lib); /* forward */ static PyObject *_cffi_setup(PyObject *self, PyObject *args) { PyObject *library; int was_alive = (_cffi_types != NULL); (void)self; /* unused */ if (!PyArg_ParseTuple(args, "OOO", &_cffi_types, &_cffi_VerificationError, &library)) return NULL; Py_INCREF(_cffi_types); Py_INCREF(_cffi_VerificationError); if (_cffi_setup_custom(library) < 0) return NULL; return PyBool_FromLong(was_alive); } static int _cffi_init(void) { PyObject *module, *c_api_object = NULL; module = PyImport_ImportModule("_cffi_backend"); if (module == NULL) goto failure; c_api_object = PyObject_GetAttrString(module, "_C_API"); if (c_api_object == NULL) goto failure; if (!PyCapsule_CheckExact(c_api_object)) { PyErr_SetNone(PyExc_ImportError); goto failure; } memcpy(_cffi_exports, PyCapsule_GetPointer(c_api_object, "cffi"), _CFFI_NUM_EXPORTS * sizeof(void *)); Py_DECREF(module); Py_DECREF(c_api_object); return 0; failure: Py_XDECREF(module); Py_XDECREF(c_api_object); return -1; } #define _cffi_type(num) ((CTypeDescrObject *)PyList_GET_ITEM(_cffi_types, num)) /**********/ (RIR RRRRTRR/(((s6/usr/lib64/python2.7/site-packages/cffi/vengine_cpy.pyts