lf8NddlZddlZddlmZddlmZGddeZdZdS)N)modelVerificationErrorceZdZdZdZdZdZdZdZd;dZ d Z d Z d Z dd3Zd4Z?d5Z@d6ZAeZBeZCeZDeZEd7ZFd8ZGeZHeZId9ZJd:ZKd S)?VCPythonEnginexTcH||_|j|_i|_i|_dSN)verifierffi_struct_pending_verification_types_of_builtin_functions)selfr s r/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/cffi/vengine_cpy.py__init__zVCPythonEngine.__init__ s(  <,.)+-(((cdSr )rkwdss rpatch_extension_kwdsz#VCPythonEngine.patch_extension_kwds rc tj||\}}}n#t$rYdSwxYw|||d|vrdS|SNr)imp find_module ImportErrorclose)r module_namepath so_suffixesffilenamedescrs rrzVCPythonEngine.find_modulesp !$d!C!C Ax   44  = GGIII 8; & &4s  **c>i|_|ddS)N collecttype) _typesdict _generate)rs r collect_typeszVCPythonEngine.collect_types$s! }%%%%%rc@|j|dzdS)N )_fwrite)rwhats r_prntzVCPythonEngine._prnt(s   dTk"""""rc|j|Sr )r')rtypes r _gettypenumzVCPythonEngine._gettypenum+st$$rct|tjr |jdkr+||jvr t |j}||j|<dSdSdS)N long double) isinstancer PrimitiveTypenamer'len)rtpnums r_do_collect_typezVCPythonEngine._do_collect_type/sbB 344 &=((do--do&&C"%DOB   .-)(rc|ddg|_|j}|t|||jj||d|||d|d|d|d|d||j}|jd}|d ||d |d |d |z|d |d|d|d|d||d|d|z|d|d|d|d|d|d|d|d|d|d|d|d||d||d|d|z|d|d|d |z|d|d!|d|d"|d!|d#|d||d$dS)%Nz ((void)lib,0)declz&static PyMethodDef _cffi_methods[] = {methodz3 {"_cffi_setup", _cffi_setup, METH_VARARGS, NULL},z) {NULL, NULL, 0, NULL} /* Sentinel */z};Fz#if PY_MAJOR_VERSION >= 3z.static struct PyModuleDef _cffi_module_def = {z PyModuleDef_HEAD_INIT,z "%s",z NULL,z -1,z _cffi_methods,z NULL, NULL, NULL, NULLPyMODINIT_FUNCzPyInit_%s(void){z PyObject *lib;z+ lib = PyModule_Create(&_cffi_module_def);z if (lib == NULL) return NULL; if (z < 0 || _cffi_init() < 0) {z Py_DECREF(lib); }z return lib;}z#elsez init%s(void)z+ lib = Py_InitModule("%s", _cffi_methods);z return;z < 0 || _cffi_init() < 0)z return;z#endif) r)_chained_list_constantsr0cffimod_headerr preambler(_generate_setup_customget_module_name)rprntmodname constantss rwrite_source_to_fz VCPythonEngine.write_source_to_f6s ")8'I$z ^  T] #$$$  v ##%%%   5666 x     BCCC  8999 T  -//1107   ()))   =>>>  '((( Y !!! Y W        '((( T       ())) S        :;;;  !"""      iii ABBB  "###      U  _ S   W     ^g %&&& S        :W DEEE  !""" ] III ?@@@ ] [ S   XrNc( tj ttdrtj} ttdr|tj|tjjjj  n3#t$r&}djj d|}t|d}~wwxYw ttdrtj|n/#ttdrtj|wwxYwtj n#tj wxYw dtdjD fdt#t% D}t't)jj|}G fdd t.} |t|r3d dl}|d jz d | j _j _|S)Ngetdlopenflagssetdlopenflagsz importing z: loadingcg|] \}}||f Srr).0keyvalues r z/VCPythonEngine.load_library..s6HHH+U"3<HHHrc g|] }| Srr)rTi revmappings rrWz/VCPythonEngine.load_library..s===z!}===rc0eZdZZjZgZfdZdS)/VCPythonEngine.load_library..FFILibraryc<jt|jzSr ) _cffi_dirlist__dict__)r FFILibrarys r__dir__z7VCPythonEngine.load_library..FFILibrary.__dir__s!+d4=.A.AAArN)__name__ __module__ __qualname___cffi_python_moduler _cffi_ffir^rb)ramodulersrrar\sG"( II B B B B B B Brrarz0reimporting %r might overwrite older definitionsloaded)library)r acquire_lockhasattrsysrPrQ load_dynamicr rJmodulefilenamerr release_lock_loaddictr'itemsranger9r_mapr _get_cached_btypeobject _cffi_setupwarningswarn_cffi_original_ffir_cffi_types_of_builtin_funcs) rflagsprevious_flagseerrorlstrjryrarhrZs ` @@@r load_libraryzVCPythonEngine.load_librarys  s,-- 6!$!3!5!5 73 011.e6G&u---)$-*G*G*I*I*.-*FHH / / / /.2m.J.J.JAAN'... / 3 0117&~6663 0117&~66667      C      69%%%HH/3/D/D/F/FHHHII ====eC OO&<&<===3tx137788 B B B B B B B B B B B B *,,   c#4g > > ? OOO MML!]::<<> ? ? ? 68W 555$(H!.2.N+sB(EA!B$#D$ C.!CCD*E,D..EEcd|jjjD}||S)Nc"g|] \}\}}||f Srr)rTrUr:quals rrWz4VCPythonEngine._get_declarations..s7HHH.c:BRyHHHr)r _parser _declarationsrssort)rrs r_get_declarationsz VCPythonEngine._get_declarationssKHH $ 0 > D D F FHHH   rcF|D]\}}|dd\}} t|d|d|}n #t$rt d|zwxYw |||d#t $r}t j||d}~wwxYwdS)N r_generate_cpy__znot implemented in verify(): %r)rsplitgetattrAttributeErrorr Exceptionrattach_exception_info)r step_namer8r:kindrealnamer?rs rr(zVCPythonEngine._generates..00  HD"!ZZQ//ND( > @I (KLL! > > >'5<>>> > r8$$$$   +At444   s#A  A(, A99 BBBc |D]h\}}|dd\}}t|d|d|} ||||fi|A#t$r} t j| |d} ~ wwxYwdS)Nrrr_cpy_)rrrrrr) rrhrrr8r:rrr?rs rrqzVCPythonEngine._loads..00  HD"!ZZQ//ND(TT999dd#CDDF r8V44t4444   +At444    s A A; A66A;cdSr rrr:r8s r_generate_nothingz VCPythonEngine._generate_nothingrrc dSr rrr:r8rhrs r _loaded_noopzVCPythonEngine._loaded_nooprrc d}t|tjrc|r|jdkr d}d|jz}n4d|dd|jdd}d }nt|tjr|||||dSt|tj tj frH| d || ||fz| d |zdSt|tj r3d |dz}d | |z}d}nt|| d|d|d||d| d|d|dd|d| d |zdS)Nr*_Bool_cffi_to_c_intz, %s(z )_cffi_to_c_rrz-1z6 if (_cffi_to_c((char *)&%s, _cffi_type(%d), %s) < 0)z %s;z(%s)_cffi_to_c_pointerz, _cffi_type(%d)NULL z = );rCz == ()z && PyErr_Occurred()))r6rr7is_integer_typer8 get_c_namereplace PointerType"_convert_funcarg_to_c_ptr_or_array StructOrUnionEnumTyper0r3FunctionPtrTypeNotImplementedError)rr:fromvartovarerrcodeextraarg convertererrvalues r_convert_funcarg_to_cz$VCPythonEngine._convert_funcarg_to_cs b%- . . *!!## N7(:(:, !BG+35==3D3D3D3D357??33L3L3LN HH E- . . *  3 3B497 D D D F U0%.A B B * JJO 0 0 4 4g>? @ @ @ JJy7* + + + F E1 2 2 *02==3D3DDI)D,<,A B B B #&*&6&6r&:&:GU%KL M M M ABBB ;())) 5rct|tjrt|r|jdkrd|d|jdS|jdkr"d|jddd |dSd |||fzSt|tjtjfrd |||fzSt|tj r1d ||tj|j fzSt|tj rI|j (td |d |dd|||fzSt|tjrd |||fzSt!|)Nrz_cffi_from_c_int(, rr5 _cffi_from_c_rrrz/_cffi_from_c_deref((char *)&%s, _cffi_type(%d))z0_cffi_from_c_pointer((char *)%s, _cffi_type(%d))'z ' is used as z, but is opaquez0_cffi_from_c_struct((char *)&%s, _cffi_type(%d)))r6rr7rr8rr3rr ArrayTypeitemrfldnames TypeError _get_c_namerr)rr:varcontexts r_convert_expr_from_cz#VCPythonEngine._convert_expr_from_c*s b%- . . *!!## /7(:(:(:58SS"'''BBM)))02S0I0I0I0I333OOH))"--L/// U.0EF G G *ET%%b))I++ + EO , , *ET%%e&7&@&@AAICC C E/ 0 0 *{"iNN$$$$ggg!/000ET%%b))I++ + EN + + *DT%%b))H++ +&b)) )rct|tjsJ|jr||dS|jD]}||||jdSr )r6rrellipsisr<argsresult)rr:r8r2s r"_generate_cpy_function_collecttypez1VCPythonEngine._generate_cpy_function_collecttypeQs"e344444 ; -  ! !" % % % % % , ,%%d++++  ! !") , , , , ,rc<t|tjsJ|jr|d||dS|j}t |j}|dkrd}n |dkrd}nd}|d|d|d |d |d d |z}t|jD]*\}}|d | d|z|z+t} t} |jD]}| || | t| D]} |d| dt|j tjs:d} d|z}|d |j d|z|dnd} t |jdkr~tt |j} | D]}|d|z||dd|zd|ddd| Dd|d|t|jD]-\}}||d|zd |zd!|.|d"|d#|d$| |d%dd&tt |jDd'|d(|d)||d*|dkr |d+| rG|d,||j d-d.z| D]}|d|z|d/n)| D]}|d|z|d0|d1|d2|dS)3NFrnoargrarg0rstatic PyObject *_cffi_f_z(PyObject *self, PyObject *rrAzargument of %s %s;z x%dr;z result = z result of %sz resultz PyObject *pyresult;r*z PyObject *arg%d;z if (!PyArg_ParseTuple(args, "O:", rcg|]}d|zS)z&arg%drrTrYs rrWz>VCPythonEngine._generate_cpy_function_decl..s/J/J/J1 /J/J/Jrz))rBzarg%dx%dz return NULLz Py_BEGIN_ALLOW_THREADSz _cffi_restore_errno(); { rcg|]}d|zS)rrrs rrWz>VCPythonEngine._generate_cpy_function_decl..s>>>Quqy>>>rz); }z _cffi_save_errno();z Py_END_ALLOW_THREADS (void)self; /* unused */ (void)noarg; /* unused */z pyresult = %s;rz result typez return pyresult;z Py_INCREF(Py_None);z return Py_None;rE)r6rrr_generate_cpy_constr0r9r enumeratersetrsortedrVoidTypertjoinrr)rr:r8rKnumargsargnamerrYr2rrr> result_coderngfreelines r_generate_cpy_function_declz*VCPythonEngine._generate_cpy_function_decl\s"e344444 ;   $ $UD" 5 5 5 Fzbg,, a<<GG \\GGG  !!! 444 IJJJ S "T) )) A AGAt D4??6A:w??? @ @ @ @EE EE G D DD  ' 'i C C C C9%% $ $D DDDDD" # # # #")U^44 %K$t+G D29// 7CCC D D D D( ) ) ) )K rw<>%BG *=*=>>> ? ? ? ?A B B B  $%%%  %&&&   )*** a<< D. / / /  & D#**29h NNO P P P% & &TH_%%%% D% & & & &% & &TH_%%%% D( ) ) ) D$ % % % S  rc |jrdSt|j}|dkrd}n |dkrd}nd}|d|d|d|d dS) Nr METH_NOARGSrMETH_O METH_VARARGS {"z ", _cffi_f_rz, NULL},)rr9rr0)rr:r8rmeths r_generate_cpy_function_methodz,VCPythonEngine._generate_cpy_function_methodsp ;  Fbg,, a<< DD \\DD!D dddDDDIJJJJJrcn|jrdSt||}t|||||j|<dSr )rrsetattrr)rr:r8rhrjfuncs r_loaded_cpy_functionz#VCPythonEngine._loaded_cpy_functionsE ;  Fvt$$t$$$13(...rcN||jksJ||d|dSNstructr8_generate_struct_or_union_declrs r_generate_cpy_struct_declz(VCPythonEngine._generate_cpy_struct_decls/rw ++B$?????rc4||d|dSr _generate_struct_or_union_methodrs r_generate_cpy_struct_methodz*VCPythonEngine._generate_cpy_struct_methods  --b(DAAAAArc6||d||dSr_loading_struct_or_unionrr:r8rhs r_loading_cpy_structz"VCPythonEngine._loading_cpy_structs" %%b(D&AAAAArc 0||dSr _loaded_struct_or_unionrs r_loaded_cpy_structz!VCPythonEngine._loaded_cpy_struct $$R(((((rcN||jksJ||d|dSNunionrrs r_generate_cpy_union_declz'VCPythonEngine._generate_cpy_union_decls/rw ++B>>>>>rc4||d|dSr rrs r_generate_cpy_union_methodz)VCPythonEngine._generate_cpy_union_methods  --b'4@@@@@rc6||d||dSr rrs r_loading_cpy_unionz!VCPythonEngine._loading_cpy_unions" %%b'4@@@@@rc 0||dSr rrs r_loaded_cpy_unionz VCPythonEngine._loaded_cpy_unionrrc |jdSd|d|}d|d|}|d|}|j}|d|d|d|d|d |d |D]\}} } } t | t jr| s| d kr|d |zJ |d | dd|z| d|dw#t$r%} |dt| zYd} ~ d} ~ wwxYw|d|d||d|d|d|z|d|d|z|d|D]t\}} } } | d kr|d|d|dt | t j r(| j !|d| zb|d|d |du|d!|d"|d#|d$|d%|d&|d'|d(|d|dS))N _cffi_check_r _cffi_layout_rz static void rz *p)rAz8 /* only to generate compile-time warnings or errors */z (void)p;rz (void)((p->%s) << 1);rz*tmpzfield %r)qualsz = &p->z; (void)tmp; }z /* %s */rErz!(PyObject *self, PyObject *noarg)z, struct _cffi_aligncheck { char x; %s y; };z static Py_ssize_t nums[] = {z sizeof(%s),z) offsetof(struct _cffi_aligncheck, y),z offsetof(rz),z 0, /* %s */z sizeof(((z *)0)->z -1z };rrz' return _cffi_get_struct_layout(nums);z3 /* the next line is not executed, but compiled */rz(0);)rstripr0 enumfieldsr6rr7rrrstrrlengthr) rr:prefixr8 checkfuncnamelayoutfuncnamecnamerKfnameftypefbitsizefqualrs rrz-VCPythonEngine._generate_struct_or_union_decls~ ;  F /5vvtt< 17>"FFDD)0022z  uuu =>>> S   GHHH \-/]]__ 0 0 )E5(E5%"566 0))++ 008A .677770DD((E1A(OOOO    )000DA.////////0 S   !!! nnn FGGG S   ;e CDDD  -...   &'''  8999-/]]__ D D )E5(E1}} DDEEE5559 : : :%11 Del6J'%*;*;*=*==>>>>UUUEEEBCCCC X V   )***  *+++  6777  BCCC === *+++ S  s +C88 D'D""D'c`|jdSd|d|}|d|d|ddS)Nrrrrz, METH_NOARGS, NULL},)rr0)rr:rr8rs rrz/VCPythonEngine._generate_struct_or_union_method s^ ;  F 17> 9GI J J J J Jrc|jdSd|d|}t||}|}t|tjr|jr|d}|d} |ddd} |ddd} |t| t| cxkrt|jksnJ| | || f|_dS|d| } || f|j |<dS)Nrrrrr) rrr6rrpartial force_flattenr9 fixedlayoutrr) rr:rr8rhrfunctionlayout totalsizetotalalignmentfieldofs fieldsizers rrz'VCPythonEngine._loading_struct_or_unions$ ;  F 17>6>22 b%- . . B2: Bq I#AYNadd|Hqt!t I      x==C NNFFFFc"+6F6FFFFFFF%y)^KBNNN &-4466E4:EMD -b 1 1 1rc|jdS|j|||jvrAd}|j}||}|j|\}}||d||d||d||dd}|D]\}} } } | dkr||||||d|||dzdkrA|| } |||dz|| d||dz }|t|ksJdSdS) Nc<||krtd|||fzdS)Nz'%s (we have %d, but C compiler says %d)r) realvalue expectedvaluemsgs rcheckz5VCPythonEngine._loaded_struct_or_union..check0s9 --+A y9:;;;.-rrzwrong total sizerzwrong total alignmentr%zwrong offset for field zwrong size for field ) rr rvrpopsizeofalignofroffsetofr9) rr:r5r BStructr+rrYrr r!r"BFields rrz&VCPythonEngine._loaded_struct_or_union)s ;  F ""2&&& 2 2 2 ; ; ; (C++B//G =AA"EEMFE E&)SZZ002D E E E E&)S[[113J K K KA13  -uhq==fQigu!=!=!=5:U<>>>!A#;!## 22599FE&1+szz&'9'9'97@@@QF ####/ 3 2.$#rct|tjr|||ddS||d|dSNr*)r6rr_generate_cpy_enum_declrrs r_generate_cpy_anonymous_declz+VCPythonEngine._generate_cpy_anonymous_declMsR b%. ) ) >  ( (T2 6 6 6 6 6  / /B = = = = =rclt|tjs||d|dSdSr=)r6rrrrs r_generate_cpy_anonymous_methodz-VCPythonEngine._generate_cpy_anonymous_methodSsA"en-- @  1 1"b$ ? ? ? ? ? @ @rct|tjr||||dS||d||dSr=)r6rr_loading_cpy_enumrrs r_loading_cpy_anonymousz%VCPythonEngine._loading_cpy_anonymousWsU b%. ) ) @  " "2tV 4 4 4 4 4  ) )"b$ ? ? ? ? ?rc t|tjr|j|||fi|dS||dSr )r6rr_loaded_cpy_enumrrs r_loaded_cpy_anonymousz$VCPythonEngine._loaded_cpy_anonymous]sU b%. ) ) - !D !"dF ; ;d ; ; ; ; ;  ( ( , , , , ,rconstFc b|j} d|d|} | d| z| d| d| d|s%| d|p|d|zn|d ksJ|||||sF|d krd |z} n|} | d | d | d||ddd|sJn| d|z| d| d|rQ| d| d| d|d| d| d| d| d| d|z| d| d| d| d |j|z| d!z|j|<| d"| dS)#N_cffi_rstatic int %s(PyObject *lib)rAz PyObject *o;z int res;rz irHr&z i = (rz o = rYz variable typerz! o = _cffi_from_c_int_const(%s);z if (o == NULL) return -1;z {z PyObject *o1 = o;z3 o = Py_BuildValue("On", o1, (Py_ssize_t)sizeof(z));z Py_DECREF(o1);z if (o == NULL)z return -1;rDz- res = PyObject_SetAttrString(lib, "%s", o);z Py_DECREF(o);z if (res < 0) return %s;(lib)rE)r0r_check_int_constant_valuerrF) ris_intr8r:categoryvartpdelayedsize_too check_valuerKfuncnamerealexprs rrz"VCPythonEngine._generate_cpy_constfsz$,HHdd3  +h 6777 S    \ ' DEKR33D$??? @ @ @ @w&&&&  "  * *4 = = = =5  : DD(((, - - - DD 9 9"c:I!K!K!K!KM N N NNN7N D4t; < < <          DKKK D( ) ) ) DDDD    D% & & & D% & & & D# $ $ $ DKKK  0 || (long)(%s) != %dL) {z1 if ((%s) <= 0 || (unsigned long)(%s) != %dUL) {z char buf[64];z if ((%s) <= 0)z. snprintf(buf, 63, "%%ld", (long)(%s));z elsez7 snprintf(buf, 63, "%%lu", (unsigned long)(%s));z) PyErr_Format(_cffi_VerificationError,z6 "%s%s has the real value %s, not %s",z( "%s", "%s", buf, "%d");rMrD)r0)rr8rV err_prefixrKs rrPz(VCPythonEngine._check_int_constant_valuesBz A:: D9dE=## $ $ $ $ DDdEH## $ $ $  !!!  !D ()))  = DEEE Z  F      8999  EFFF  7 e;%% & & &   U rc>|dd}d|d|S)N$___D__cffi_e_r)r)rrr8s r_enum_funcnamezVCPythonEngine._enum_funcnames(||C))"(&&$$//renumc|jr$|jD]}|d|ddS|||}|j}|d|z|dt |j|jD]\}}|||d|z |d|jdz|dz|jd<|d |dS) NTF)rTrKrAz enum %s: rNrOrE) r' enumeratorsrrdr0zip enumvaluesrPrF)rr:r8r enumeratorrWrK enumvalues rr>z&VCPythonEngine._generate_cpy_enum_decls :  n J J ((z5(IIII F&&vt44z  +h 6777 S %(%G%G ? ? !J  * *:y+6+= ? ? ? ? ^d:4@ @AAA-5-?$T* S  rcv|jr0fd|jD}t||_d|_dSdS)Nc0g|]}t|Sr)r)rTrjrhs rrWz4VCPythonEngine._loading_cpy_enum..s3<<<("&*55<<.getters q6Mrc|d<dSrr)rjrVr|s rsetterz3VCPythonEngine._loaded_cpy_variable..setter sCFFFr)rr6rrrxrnr rvrdivmodr7rresolve_lengthrcastrdelattrr2propertyr^append)rr:r8rhrjrVsize BItemTyperrestBArrayr}rr|s @r_loaded_cpy_variablez#VCPythonEngine._loaded_cpy_variables&& b%/ * * ##%% /!%///// %  H66rw?? %dDHOOI,F,FGG 199++rww()))&&v..y$33B77 fe44u--- F          W tXff%=%=>>> W &&t,,,,,rc|j}|d|d|d|jdz|ddS)Nz,static int _cffi_setup_custom(PyObject *lib)rArNTrE)r0rF)rrKs rrIz%VCPythonEngine._generate_setup_custom'sUz  ;<<< S  ^d:4@ @AAA S r)r*r )NrHNTFN)re)Lrcrdre _class_key_gen_python_modulerrrr)r0r3r<rNrrr(rqrrrrrr!_generate_cpy_typedef_collecttype_generate_cpy_typedef_decl_generate_cpy_typedef_method_loading_cpy_typedef_loaded_cpy_typedefrrr_loading_cpy_functionr _generate_cpy_struct_collecttyperrrr_generate_cpy_union_collecttyper rrrrrrr#_generate_cpy_anonymous_collecttyper?rArDrGrr[r]_generate_cpy_constant_method_loading_cpy_constant_loaded_cpy_constantrPrdr>_generate_cpy_enum_collecttype_generate_cpy_enum_methodrCrFrr_generate_cpy_macro_collecttype_generate_cpy_macro_method_loading_cpy_macro_loaded_cpy_macrorvry_generate_cpy_variable_method_loading_cpy_variablerrIrrrrr sJ...       &&&####%%%&&&YYYv8888t         "("("(HKKK   ***<):%#4#4 #/#/ - - -NNN` K K K)444(9$@@@BBBBBB)))'8#???AAAAAA)))111fJJJBBB*$$$D+<'>>> @@@@@@ ---CJ?D(,....`&&& 333%6!(( *000 $&7" 1'''444FFF'8#!2%% &&&JJJ%6!(---Drra( #include #include /* this block of #ifs should be kept exactly identical between c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py and cffi/_cffi_include.h */ #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 */ # ifndef __cplusplus typedef unsigned char _Bool; # endif # endif #else # include # if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux) # 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_from_c__Bool PyBool_FromLong #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); } union _cffi_union_alignment_u { unsigned char m_char; unsigned short m_short; unsigned int m_int; unsigned long m_long; unsigned long long m_longlong; float m_float; double m_double; long double m_longdouble; }; struct _cffi_freeme_s { struct _cffi_freeme_s *next; union _cffi_union_alignment_u alignment; }; #ifdef __GNUC__ __attribute__((unused)) #endif static int _cffi_convert_array_argument(CTypeDescrObject *ctptr, PyObject *arg, char **output_data, Py_ssize_t datasize, struct _cffi_freeme_s **freeme) { char *p; if (datasize < 0) return -1; p = *output_data; if (p == NULL) { struct _cffi_freeme_s *fp = (struct _cffi_freeme_s *)PyObject_Malloc( offsetof(struct _cffi_freeme_s, alignment) + (size_t)datasize); if (fp == NULL) return -1; fp->next = *freeme; *freeme = fp; p = *output_data = (char *)&fp->alignment; } memset((void *)p, 0, (size_t)datasize); return _cffi_convert_array_from_object(p, ctptr, arg); } #ifdef __GNUC__ __attribute__((unused)) #endif static void _cffi_free_array_arguments(struct _cffi_freeme_s *freeme) { do { void *p = (void *)freeme; freeme = freeme->next; PyObject_Free(p); } while (freeme != NULL); } 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)) /**********/ ) rmrr*rrrrwrrGrrrrs{$$$$$$c c c c c Vc c c JFr