Uname: Linux server.digisquadtech.com 4.18.0-553.100.1.el8_10.x86_64 #1 SMP Mon Feb 2 04:13:33 EST 2026 x86_64
User: 1091 (madhavfluid)
Group: 1090 (madhavfluid)
Disabled functions: NONE
Safe mode: On[ PHPinfo ]
//usr/lib64/python3.6/site-packages///cffi/__pycache__      ( Reset | Go to )
File Name: api.cpython-36.pyc
3
'+e@sddlZddlZddlmZddlmZddlmZyeWn(e    k
rdddl
m Z ddZYnXye Wne    k
re Z YnXGd    d
d
eZd d Zd dZddZdS)N) allocate_lock)    CDefError)model)CallablecCs
t|tS)N)
isinstancer)xr    /usr/lib64/python3.6/api.py<lambda> sr c@seZdZdZdfddZdgddZdhdd    Zdid
d Zdjd dZddZ    ddZ
dkddZ ddZ ddZ ddZddZdlddZdmd d!Zd"d#Zdod%d&Zd'd(Zdpd)d*Zd+d,Zdqd-d.Zdrd0d1Zdsd2d3Zd4d5Zdtd6d7Zd8d9Zd:d;Zeeedd<Zdvd=d>Z d?d@Z!dAdBZ"dCdDZ#dEdFZ$dGdHZ%dIdJZ&dKdLZ'dMdNZ(dOdPZ)dwdRdSZ*dxdUdVZ+dWdXZ,dYdZZ-dyd\d]Z.d^d_Z/d`daZ0dbdcZ1dddeZ2dS)zFFIa
    The main top-level class that you instantiate once, or once per module.

    Example usage:

        ffi = FFI()
        ffi.cdef("""
            int printf(const char *, ...);
        """)

        C = ffi.dlopen(None)   # standard library
        -or-
        C = ffi.verify()  # use a C compiler: verify the decl above is right

        C.printf("hello, %s!\n", ffi.new("char[]", "world"))
    Nc
Cs|dkr^ddl}ddlm}|j|kr^t|drJtd|t|j|jfntd|t|jfddlm}||_t|_    |j
|_ i|_ t jd    j|_t jd
j|_g|_g|_g|_g|_d|_i|_d|_d|_tj||_t|d r|j|x2t|jD]$}|jd rt ||t!||qW|j    "|j"tj#|_$|j"tj%|_&WdQRXt'|t jrtt(d s|j)|j$dt(_*|j+\t(_,t(_-n |j)|j$d|_*|j+\|_,|_-|j.|_.dS)z{Create an FFI instance.  The 'backend' argument is used to
        select a non-default backend, mostly for tests.
        Nrr) __version____file__zVersion mismatch: this is the 'cffi' package version %s, located in %r.  When we import the top-level '_cffi_backend' extension module, we get version %s, located in %r.  The two versions should be equal; check your installation.zVersion mismatch: this is the 'cffi' package version %s, located in %r.  This interpreter comes with a built-in '_cffi_backend' module, which is version %s.  The two versions should be equal; check your installation.)cparserZ parsed_typesZ    new_typesset_ffiZRTLD_NULL)/Z _cffi_backendr hasattr    Exceptionrr_backendr_lockZParser_parser_cached_btypestypes
ModuleType__dict__ _parsed_typesZ
_new_types_function_caches
_libraries _cdefsources_included_ffis_windows_unicode_init_once_cache _cdef_version
_embeddingrZ get_typecacheZ
_typecacherlist
startswithsetattrgetattr_get_cached_btypeZ
voidp_typeBVoidPZchar_array_typeBCharArr castrZ
_get_typesCDataZCTypebuffer)selfbackendr rnamer    r    r
__init__'sR 

 
 

  z FFI.__init__FcCs|j|||ddS)aParse the given C source.  This registers all declared functions,
        types, and global variables.  The functions and global variables can
        then be accessed via either 'ffi.dlopen()' or 'ffi.verify()'.
        The types can be used in 'ffi.new()' and other functions.
        If 'packed' is specified as True, all structs declared inside this
        cdef are packed, i.e. laid out without any field alignment at all.
        )overridepackedN)_cdef)r/csourcer3r4r    r    r
cdefcszFFI.cdefcCs$|j||dd|jdkr d|_dS)NT)r4Z    dllexportr)r5r$)r/r6r4r    r    r
embedding_apims
zFFI.embedding_apic Kst|ts&t|tstd|jd}|j|t|_|jj    |fd|i||j
j ||rvx|j D] }|j qfW|jj}|rg|j_x|D]}|j||qWWdQRXdS)Nz cdef() argument must be a stringasciir3)rstr
basestring    TypeErrorencoderobjectr#rparserappendrclearZ _recompletefinish_backend_type)r/r6r3Zoptionscache
finishlisttpr    r    r
r5rs 


   
z    FFI._cdefrc CsTt|ts|dkst|j.t|||\}}|jj||jj|WdQRX|S)aHLoad and return a dynamic library identified by 'name'.
        The standard C library can be loaded by passing None.
        Note that functions and types declared by 'ffi.cdef()' are not
        linked to a particular library, just like C headers; in the
        library we only look for the actual (untyped) symbols.
        N)rr;AssertionErrorr_make_ffi_libraryrr@r)r/r1flagslibZfunction_cacher    r    r
dlopens  z
FFI.dlopencCst|j|dS)zClose a library obtained with ffi.dlopen().  After this call,
        access to functions or variables from the library will fail
        (possibly with a segmentation fault).
        N)type__cffi_close__)r/rIr    r    r
dlclosesz FFI.dlclosecCsj|}||jkr|j|St|ts,|jd}|jj|}|j}|rJ|j}|j|}||f}||j|<|S)Nr9)    rrr:r=rZ
parse_typeZis_raw_functionZas_function_pointerr))r/cdeclkeyrKreally_a_function_typebtyperesultr    r    r
_typeof_lockeds



 

zFFI._typeof_lockedcCsdy|j|}Wn0tk
r>|j|j|}WdQRXYnX|\}}|r`| r`td|f|S)Nz>the type %r is a function type, not a pointer-to-function type)rKeyErrorrrSr)r/rNconsider_function_as_funcptrrRrQrPr    r    r
_typeofs

z FFI._typeofc
Cst|tr|j|St||jr,|jj|St|tjrLt|}|dk    rL|St|tj    r|t
|dr||j |j |j SQRXtt|dS)zParse the C type given as a string and return the
        corresponding <ctype> object.
        It can also be used on 'cdata' instance to get its C type.
        N_cffi_base_type)rr;rVr-rtypeofrBuiltinFunctionType_builtin_function_type FunctionTyperrr)rWr<rK)r/rNresr    r    r
rXs

    
z
FFI.typeofcCs0t|tr |j|}|jj|S|jj|SdS)zvReturn the size in bytes of the argument.  It can be a
        string naming a C type, or a 'cdata' instance.
        N)rr;rVrsizeof)r/rNBTyper    r    r
r]s

 z
FFI.sizeofcCs t|tr|j|}|jj|S)z\Return the natural alignment size in bytes of the C type
        given as a string.
        )rr;rVralignof)r/rNr    r    r
r_s

z FFI.alignofcGs(t|tr|j|}|j|f|dS)a3Return the offset of the named field inside the given
        structure or array, which must be given as a C type name.
        You can give several field names in case of nested structures.
        You can also give numeric values which correspond to array
        items, in case of an array type.
        r)rr;rV _typeoffsetof)r/rNfields_or_indexesr    r    r
offsetofs

z FFI.offsetofcCs"t|tr|j|}|jj||S)aAllocate an instance according to the specified C type and
        return a pointer to it.  The specified C type must be either a
        pointer or an array: ``new('X *')`` allocates an X and returns
        a pointer to it, whereas ``new('X[n]')`` allocates an array of
        n X'es and returns an array referencing it (which works
        mostly like a pointer, like in C).  You can also use
        ``new('X[]', n)`` to allocate an array of a non-constant
        length n.

        The memory is initialized following the rules of declaring a
        global variable in C: by default it is zero-initialized, but
        an explicit initializer can be given which can be used to
        fill all or part of the memory.

        When the returned <cdata> object goes out of scope, the memory
        is freed.  In other words the returned <cdata> object has
        ownership of the value of type 'cdecl' that it points to.  This
        means that the raw data can be used as long as this object is
        kept alive, but must not be used for a longer time.  Be careful
        about that when copying the pointer to the memory somewhere
        else, e.g. into another structure.
        )rr;rVrZnewp)r/rNinitr    r    r
news

zFFI.newTcs,jj}|j|||dfdd    }|S)aReturn a new allocator, i.e. a function that behaves like ffi.new()
        but uses the provided low-level 'alloc' and 'free' functions.

        'alloc' is called with the size as argument.  If it returns NULL, a
        MemoryError is raised.  'free' is called with the result of 'alloc'
        as argument.  Both can be either Python function or directly C
        functions.  If 'free' is None, then no free function is called.
        If both 'alloc' and 'free' are None, the default is used.

        If 'should_clear_after_alloc' is set to False, then the memory
        returned by 'alloc' is assumed to be already cleared (or you are
        fine with garbage); otherwise CFFI will clear it.
        Ncst|trj|}||S)N)rr;rV)rNrc)    allocatorr/r    r
allocates

z#FFI.new_allocator.<locals>.allocate)N)rr new_allocator)r/ZallocZfreeZshould_clear_after_allocZ compiled_ffirfr    )rer/r
rgs

zFFI.new_allocatorcCs"t|tr|j|}|jj||S)zSimilar to a C cast: returns an instance of the named C
        type initialized with the given 'source'.  The source is
        casted between integers or pointers of any type.
        )rr;rVrr,)r/rNsourcer    r    r
r,s

zFFI.castrcCs|jj||S)aReturn a Python string (or unicode string) from the 'cdata'.
        If 'cdata' is a pointer or array of characters or bytes, returns
        the null-terminated string.  The returned string extends until
        the first null character, or at most 'maxlen' characters.  If
        'cdata' is an array then 'maxlen' defaults to its length.

        If 'cdata' is a pointer or array of wchar_t, returns a unicode
        string following the same rules.

        If 'cdata' is a single character or byte or a wchar_t, returns
        it as a string or unicode string.

        If 'cdata' is an enum, returns the value of the enumerator as a
        string, or 'NUMBER' if the value is out of range.
        )rstring)r/cdatamaxlenr    r    r
ri%sz
FFI.stringcCs|jj||S)aLUnpack an array of C data of the given length,
        returning a Python string/unicode/list.

        If 'cdata' is a pointer to 'char', returns a byte string.
        It does not stop at the first null.  This is equivalent to:
        ffi.buffer(cdata, length)[:]

        If 'cdata' is a pointer to 'wchar_t', returns a unicode string.
        'length' is measured in wchar_t's; it is not the size in bytes.

        If 'cdata' is a pointer to anything else, returns a list of
        'length' items.  This is a faster equivalent to:
        [cdata[i] for i in range(length)]
        )runpack)r/rjZlengthr    r    r
rl7sz
FFI.unpackcCs|jj|j||S)aReturn a <cdata 'char[]'> that points to the data of the
        given Python object, which must support the buffer interface.
        Note that this is not meant to be used on the built-in types
        str or unicode (you can build 'char[]' arrays explicitly)
        but only on objects containing large quantities of raw data
        in some other format, like 'array.array' or numpy arrays.
        )r from_bufferr+)r/Z python_bufferZrequire_writabler    r    r
rmUs zFFI.from_buffercCs|jj|||S)a_ffi.memmove(dest, src, n) copies n bytes of memory from src to dest.

        Like the C function memmove(), the memory areas may overlap;
        apart from that it behaves like the C function memcpy().

        'src' can be any cdata ptr or array, or any Python buffer object.
        'dest' can be any cdata ptr or array, or a writable Python buffer
        object.  The size to copy, 'n', is always measured in bytes.

        Unlike other methods, this one supports all Python buffer including
        byte strings and bytearrays---but it still does not support
        non-contiguous buffers.
        )rmemmove)r/destsrcnr    r    r
rn`sz FFI.memmovecsBfdd}ttr*jdd|dkr6|S||SdS)aReturn a callback object or a decorator making such a
        callback object.  'cdecl' must name a C function pointer type.
        The callback invokes the specified 'python_callable' (which may
        be provided either directly or via a decorator).  Important: the
        callback object must be manually kept alive for as long as the
        callback may be invoked from the C level.
        cs"t|stdjj|S)Nz.the 'python_callable' argument is not callable)callabler<rcallback)python_callable)rNerroronerrorr/r    r
callback_decorator_wrapxs
z-FFI.callback.<locals>.callback_decorator_wrapT)rUN)rr;rV)r/rNrtrurvrwr    )rNrurvr/r
rsps 
z FFI.callbackrcCsht|tr|j|}|j}|jdrBd|jj|dkrBd|}n|rZ|ddkrZd|}|jj||S)a.Return a string giving the C type 'cdecl', which may be itself
        a string or a <ctype> object.  If 'replace_with' is given, it gives
        extra text to append (or insert for more complicated C types), like
        a variable name, or '*' to get actually the C type 'pointer-to-cdecl'.
        *z&[&z(%s)rz[( )rr;rVstripr&rZgetcname)r/rNZ replace_withr    r    r
getctypes



z FFI.getctypecCs|jj|||S)aReturn a new cdata object that points to the same
        data.  Later, when this new cdata object is garbage-collected,
        'destructor(old_cdata_object)' will be called.

        The optional 'size' gives an estimate of the size, used to
        trigger the garbage collection more eagerly.  So far only used
        on PyPy.  It tells the GC that the returned object keeps alive
        roughly 'size' bytes of external memory.
        )rZgcp)r/rjZ
destructorsizer    r    r
gcs
zFFI.gcc Csf|jjddksty|j|}Wn>tk
r`g}|j||}x|D]}|j||qHWYnX|S)NF)racquirerFrrTZget_cached_btyperB)r/rKr^rDr    r    r
r)s 
zFFI._get_cached_btypecKsVddlm}m}|jr |j||p(|}||||f||_|jj}|jj||S)aVerify that the current ffi signatures compile on this
        machine, and return a dynamic library object.  The dynamic
        library can be used to call functions and access global
        variables declared in this 'ffi'.  The library is compiled
        by the C compiler: it gives you C-level API compatibility
        (including calling macros).  This is unlike 'ffi.dlopen()',
        which requires binary compatibility in the signatures.
        r)Verifier_caller_dir_pycache)verifierrrr!_apply_windows_unicode load_libraryrr@)r/rhtmpdirkwargsrrrIr    r    r
verifys    


 z
FFI.verifycCs
|jjS)N)rZ    get_errno)r/r    r    r

_get_errnoszFFI._get_errnocCs|jj|dS)N)rZ    set_errno)r/errnor    r    r

_set_errnoszFFI._set_errnoz(the value of 'errno' from/to the C callscCs |jj|S)N)r getwinerror)r/coder    r    r
rszFFI.getwinerrorc
Cs|jtj||SQRXdS)N)rr pointer_cache)r/ctyper    r    r
_pointer_toszFFI._pointer_toc Gsy|jj|}Wn8tk
rHdt|jkrBt|j|f|SYnX|rd|j|f|\}}n|jdkrvtdd}|j|}|jj    |||S)zReturn the address of a <cdata 'struct-or-union'>.
        If 'fields_or_indexes' are given, returns the address of that
        field or array item in the structure or array, recursively in
        case of nested structures.
         __addressof__Zpointerzaddressof(pointer)r)
rrXr<rKrrr`kindrZ rawaddressof)r/rjraroffsetZctypeptrr    r    r
    addressofs

z FFI.addressofcGsD|jj||\}}x(|D] }|jj||d\}}||7}qW||fS)Nr)rZ typeoffsetof)r/rZfield_or_indexrarZfield1Zoffset1r    r    r
r`s

 zFFI._typeoffsetofcCst|tstdt|jf||kr.td|jX|jF|jj|j|j    j
d|j    j |j    |j    j
d|j j
|WdQRXWdQRXdS)aIncludes the typedefs, structs, unions and enums defined
        in another FFI instance.  Usage is similar to a #include in C,
        where a part of the program might include types defined in
        another part for its own usage.  Note that the include()
        method has no effect on functions, constants and global
        variables, which must anyway be accessed directly from the
        lib object returned by the original FFI instance.
        zGffi.include() expects an argument that is also of type cffi.FFI, not %rzself.include(self)[]N) rr r<rK__name__
ValueErrorrrincluderr@extendr )r/Zffi_to_includer    r    r
rs    
  z FFI.includecCs|jj|j|S)N)rZ newp_handler*)r/rr    r    r

new_handle szFFI.new_handlecCs |jj|S)N)r from_handle)r/rr    r    r
rszFFI.from_handlecCs>|jdk    rtdt|}|r*|jdn
|jd||_dS)acWindows: if 'enabled_flag' is True, enable the UNICODE and
        _UNICODE defines in C, and declare the types like TCHAR and LPTCSTR
        to be (pointers to) wchar_t.  If 'enabled_flag' is False,
        declare these types to be (pointers to) plain 8-bit characters.
        This is mostly for backward compatibility; you usually want True.
        Nz%set_unicode() can only be called onceztypedef wchar_t TBYTE;typedef wchar_t TCHAR;typedef const wchar_t *LPCTSTR;typedef const wchar_t *PCTSTR;typedef wchar_t *LPTSTR;typedef wchar_t *PTSTR;typedef TBYTE *PTBYTE;typedef TCHAR *PTCHAR;ztypedef char TBYTE;typedef char TCHAR;typedef const char *LPCTSTR;typedef const char *PCTSTR;typedef char *LPTSTR;typedef char *PTSTR;typedef TBYTE *PTBYTE;typedef TCHAR *PTCHAR;)r!rboolr7)r/Z enabled_flagr    r    r
set_unicodes
     
zFFI.set_unicodecCs>|jdf}t|ttfs"tdt|ddg}||d<dS)NZ define_macrosz''define_macros' must be a list or tupleUNICODE1_UNICODE)rr)rr)getrr%tupler<)r/kwdsZ    defmacrosr    r    r
r0s  zFFI._apply_windows_unicodec sjfdd}dtjkrddl}tjdkrNd}ttdr|d|jjtjd    n4tjdkr^d }nd }ttdr|d|jjtjd ttdr|d|jjtjddntjdkrd}ttdr|d7}nLy ddl    }Wn t
k
rddl m    }YnXd}|j dr||j d7}|tj d?tj d?d@f}ttdrF|tj7}|d|tjdkrf|dddS)Ncs"j|g}||kr|j|dS)N)
setdefaultr@)rOvalueZlst)rr    r
ensure:s z(FFI._apply_embedding_fix.<locals>.ensureZ__pypy__rwin32Zpython27prefixZ library_dirsZlibszpypy-czpypy3-cbinZpypyZgoalz
python%d%dgettotalrefcountZ_d)    sysconfigz python%d.%dZ    DEBUG_EXTabiflagsZ    librariesZextra_link_argsz    /MANIFEST)r)sysbuiltin_module_namesosplatformrpathjoinr version_infor ImportErrorZ    distutilsget_config_var
hexversionr)r/rrrZ    pythonlibtemplaterr    )rr
_apply_embedding_fix8s@ 








   

 zFFI._apply_embedding_fix.ccKsdddl}t|drtdt|ts,td|j|ksF|jrN|j|krNtdt||||f|_    dS)Nr_assigned_sourcez:set_source() cannot be called several times per ffi objectz'module_name' must be a stringzY'module_name' must not contain '/': use a dotted name to make a 'package.module' location)
rrrrr;r<sepaltsepr:r)r/ module_namerhsource_extensionrrr    r    r

set_sourcejs

zFFI.set_sourcebuildc Csddlm}ddlm}t|ds>t|dr6|jjStd|j\}}}}|dkr\t    d||||||f|||d    d
|\}    }
|r|
rt
j j d |    j dfnt
j j d |    j df|    S) Nr)mkpathr)    recompilerrz8set_source() must be called before distutils_extension()zadistutils_extension() is only for C extension modules, not for dlopen()-style pure Python modulesF)rZextradirrcall_c_compilerzregenerated: %r
znot modified: %r
)Zdistutils.dir_utilr
recompilerrrrZ get_extensionrrr<rstderrwriteZsources) r/rverboserrrrhrrZextupdatedr    r    r
distutils_extensionws&  


zFFI.distutils_extensioncCsZddlm}t|dstd|j\}}}}|dkr<td||||f|dd|dS)Nr)rrz0set_source() must be called before emit_c_code()zYemit_c_code() is only for C extension modules, not for dlopen()-style pure Python modulesF)c_filer)rrrrrr<)r/filenamerrrhrrr    r    r
emit_c_codes 

zFFI.emit_c_codecCsZddlm}t|dstd|j\}}}}|dk    r<td||||f|dd|dS)Nr)rrz0set_source() must be called before emit_c_code()z^emit_python_code() is only for dlopen()-style pure Python modules, not for C extension modulesF)rr)rrrrrr<)r/rrrrhrrr    r    r
emit_python_codes 

zFFI.emit_python_code.c
CsLddlm}t|dstd|j\}}}}    ||||f|||||d|    S)aThe 'target' argument gives the final file name of the
        compiled DLL.  Use '*' to force distutils' choice, suitable for
        regular CPython C API modules.  Use a file name ending in '.*'
        to ask for the system's default extension for dynamic libraries
        (.so/.dll/.dylib).

        The default is '*' when building a non-embedded C API extension,
        and (module_name + '.*') when building an embedded library.
        r)rrz,set_source() must be called before compile())rtargetrZcompiler_verbosedebug)rrrrr)
r/rrrrrrrhrrr    r    r
compiles

 z FFI.compilecCsy|j|}Wn(tk
r6|jj|dtf}YnX|drH|dS|d4|j|}|drl|dS|}d|f|j|<WdQRX|S)NFrrT)r"rTrr)r/functagrrRr    r    r
    init_onces

z FFI.init_oncecs|jrtdddl}|jd|}|r6||jd}|jpBdg}|jd|dj}xBtdt|D]0|}|j    rhx|j
|s|dd }q~WqhWt|fdd|D}dj |}t |d    d
||_dS) Nz-embedding_init_code() can only be called oncerz\s*\nrz\s*rcsg|]}|ddqS)N
r    ).0line)ir    r

<listcomp>sz+FFI.embedding_init_code.<locals>.<listcomp>Z    cffi_initexec) r$rrematchend
splitlinesgrouprangelenrstripr&rr)r/Zpysourcerrlinesrrr    )rr
embedding_init_codes$  
 zFFI.embedding_init_codecOs tddS)Nz:ffi.def_extern() is only available on API-mode FFI objects)r)r/argsrr    r    r

def_externszFFI.def_externcCsg}g}g}xh|jjD]\}|jdr8|j|ddq|jdrV|j|ddq|jdr|j|ddqW|j|j|j|||fS)zReturns the user type names known to this FFI instance.
        This returns a tuple containing three lists of names:
        (typedef_names, names_of_structs, names_of_unions)
        ztypedef Nzstruct zunion )r _declarationsr&r@sort)r/ZtypedefsZstructsZunionsrOr    r    r

list_typess


zFFI.list_types)N)FF)F)F)r)F)N)NNTr)r)F)NNN)r)r)rNr)r)r)rT)rrNN)3r
__module__ __qualname____doc__r2r7r8r5rJrMrSrVrXr]r_rbrdrgr,rirlrmrnrsr|r~r)rrrpropertyrrrrr`rrrrrrrrrrrrrrrr    r    r    r
r sb
<








    






2

 
r c    Csddl}|dkr*tjdkr&|jd|Sd}d}d|ksHd|ksH|j|kr|y |j||Stk
rz}z
|}WYdd}~XnXddl}|jj|}|dkr|dkrtjdkrtj    d
krtdd|f}|dk    rd    ||f}t||j||S) Nrrcr/rzXdlopen(None) cannot work on Windows for Python 3 (see http://bugs.python.org/issue23606)zGctypes.util.find_library() did not manage to locate a library called %rz%s.  Additionally, %s)r)
rrrrrOSErrorZ ctypes.utilutilZ find_libraryr)    r0r1rHrZ first_erroreZctypesrmsgr    r    r
_load_backend_libs,
    rc s
j}t|||        
fdd    
fdd    
fdddd
fd    d
id gi
fd d  
fdd G    
fdddt|dk    ry"t|ts|jd}d|_Wntk
rYnX jfS)Ncs<d|}jj|\}}j|}j||}|j|<dS)Nz    function )rrr) load_functionr)r1rOrE_r^r)
backendlibffilibraryr    r
accessor_function%s

 z,_make_ffi_library.<locals>.accessor_functioncs\d}jj|\}}j|jjttfddfdddS)Nz    variable cs
S)Nr    )r/)r^r1 read_variabler    r
r 3sz>_make_ffi_library.<locals>.accessor_variable.<locals>.<lambda>cs |S)Nr    )r/r)r^r1write_variabler    r
r 4s)rrr)rrr'r)r1rOrEr)
FFILibraryrr)r^r1rrr
accessor_variable,s
z,_make_ffi_library.<locals>.accessor_variablecsy|Stk
rjZ|krtd|}jj|\}}j|}|jdkr`tj|}j||}||<WdQRX|SXdS)Nz    variable Zarray)    rTrrrr)rrrr)r1rOrErr^p)addr_variablesrrr    r
addressof_var6s

  z(_make_ffi_library.<locals>.addressof_varcSstd|fdS)NzDnon-integer constant '%s' cannot be accessed from a dlopen() library)NotImplementedError)r1r    r    r
accessor_constantEsz,_make_ffi_library.<locals>.accessor_constantcsjj|j|<dS)N)r_int_constantsr)r1)rrr    r
accessor_int_constantIsz0_make_ffi_library.<locals>.accessor_int_constantFcsdjkrdSxjjjD]\}\}}t|tjs~|jdd\}}|dkrZ|<q|dkrl|<q|dkr|<q x0t|j    D]"\}}||ffdd    }||<qWq Wxjj
D]}j |qWjd<dS)    NrrzrZfunctionZvariableZconstantcs|j|j|j|<dS)N)Zcheck_not_partialZ
enumvaluesr)r1rEr)rr    r
accessor_enum_szB_make_ffi_library.<locals>.update_accessors.<locals>.accessor_enum) r#rritemsrrZEnumTypesplit    enumerateZ enumeratorsr r)rOrErrr1rZenumnamer)r rr r    accessorsaccessors_versionrrr    r
update_accessorsPs" 


z+_make_ffi_library.<locals>.update_accessorsc    sXjH|jks|jkr dS|kr>|kr>t|||WdQRXdS)N)rrAttributeError)r1)rrrrrr    r
make_accessorgsz(_make_ffi_library.<locals>.make_accessorcsReZdZfddZfddZfddZfddZfd    d
Zd S) z%_make_ffi_library.<locals>.FFILibrarycs|t||S)N)r()r/r1)rr    r
__getattr__rsz1_make_ffi_library.<locals>.FFILibrary.__getattr__c sJyt|j|}Wn(tk
r8|t|||YnX|j||dS)N)r(    __class__rr'__set__)r/r1rr)rr    r
__setattr__us z1_make_ffi_library.<locals>.FFILibrary.__setattr__c    s jjSQRXdS)N)rkeys)r/)rrrr    r
__dir__}sz-_make_ffi_library.<locals>.FFILibrary.__dir__csf|jkrj|S|jkr&|S||jkrBj|S|jkrT|Std|fdS)Nz:cffi library has no function or global variable named '%s')rr)r/r1)rr    rrr    r
rs





z3_make_ffi_library.<locals>.FFILibrary.__addressof__csj|jjdS)N)Z    close_librrA)r/)rr    r
rLsz4_make_ffi_library.<locals>.FFILibrary.__cffi_close__N)rrrrrrrrLr    )rrr    rrrrrr    r
rqs
   rzutf-8z FFILibrary_%s)    rrr>rr:r=r UnicodeErrorr)rZlibnamerHr0r    )rr rr rrrrr    rrrrrr
rG!s, 

" 

rGcCsdddl}y$|j|j}|j}|j}||}Wntttfk
rFdSX|j |j    |SQRXdS)Nr)
rmodulesrZ_cffi_original_ffiZ_cffi_types_of_builtin_funcsrTrr<rr))rrmodulerZtypes_of_builtin_funcsrEr    r    r
rZs  rZ)rrlockrrurrrrr    NameError collectionsrr;r:r>r rrGrZr    r    r    r
<module>s*    
wz

All system for education purposes only. For more tools: Telegram @jackleet

Mr.X Private Shell

Logo
-
New File | New Folder
Command
SQL