Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
api.cpython-313.pyc348 linesDownload Raw Back to __pycache__
1�

2��j������SSKrSSKrSSKJr SSKJr SSKJr \ \ \"5r"SS	\5rS3rSrSrg!\	a SSK4Jr SrN0f=f!\	a \
rN;f=f)
�N�)�
allocate_lock)�	CDefError)�model)�Callablec�"�[U[5$�N)�5isinstancer)�xs �ND:\code\apps\devtools\python\user_packages\Python313\site-packages\cffi/api.py�<lambda>r
s���A�x�0�c��\rSrSrSrS6SjrS7SjrS8SjrS9SjrS:S	jr	S6r7SrS9SjrS
r
SrSrSrS6SjrS;SjrSrS<SjrSr\S4SjrSrS=SjrS>SjrS:SjrSrS?SjrSrSr\ "\\SS5r!S<S jr"S!r#S"r$S#r%S$r&S%r'S&r(S'r)S(r*S)r+S*r,S@S+jr-S@S,jr.SAS-jr/S.r0S/r1SBS0jr2S1r3S2r4S3r5S4r6S5r7g)C�FFI�af8The main top-level class that you instantiate once, or once per module.9 10Example usage:11 12    ffi = FFI()13    ffi.cdef("""14        int printf(const char *, ...);15    """)16 17    C = ffi.dlopen(None)   # standard library18    -or-19    C = ffi.verify()  # use a C compiler: verify the decl above is right20 21    C.printf("hello, %s!\n", ffi.new("char[]", "world"))22Nc�23�Uc�SSKnSSKJn URU:wak[US5(a4[	SU<S[24<SUR<SUR25<S	3	5e[	SU<S[26<S27UR<S	35eSSKJn Xl[5Ul	UR5Ul0Ul[R"S5RUl[R"S
5RUl/Ul/Ul/Ul/UlSUl0UlSUlSUl[4R6"U5Ul[US5(aUR;U5 [=UR5H0nUR?S5(dMX[CX55 M2 UR URE[4RF5Ul$URE[4RJ5Ul&SSS5 [OU[R5(a`[[PS5(dJURSURHS5[Pl*URW5u[Pl,[Pl-O>URSURHS5Ul*URW5uUl,Ul-UR\Ul.g!,(df   N�=f)zkCreate an FFI instance.  The 'backend' argument is used to28select a non-default backend, mostly for tests.29Nrr)�__version__�__file__z5Version mismatch: this is the 'cffi' package version z
, located in zQ.  When we import the top-level '_cffi_backend' extension module, we get version z=.  The two versions should be equal; check your installation.zS.  This interpreter comes with a built-in '_cffi_backend' module, which is version )�cparser�parsed_types�	new_types�set_ffi�RTLD_�NULL)/�
_cffi_backend�r�hasattr�	Exceptionrr�_backendr�_lock�Parser�_parser�_cached_btypes�types�30ModuleType�__dict__�
_parsed_types�31_new_types�_function_caches�32_libraries�_cdefsources�_included_ffis�_windows_unicode�_init_once_cache�
_cdef_version�33_embeddingr�
get_typecache�34_typecacher�list�35startswith�setattr�getattr�_get_cached_btype�36voidp_type�BVoidP�char_array_type�BCharAr37r�castr�38_get_types�CData�CType�buffer)�self�backendrr�names     r�__init__�FFI.__init__)s@���?�
,�%��"�"�k�1��7�J�/�/�#�#�X��+�+�W�-=�-=�%?�@�@�39$�#�X�w�/B�/B�%D�E�E�	��
�"�_��40��~�~�'��� ���"�-�-�n�=�F�F����*�*�;�7�@�@��� "��������� ��� $��� "���!�������-�-�g�6����7�I�&�&��O�O�D�!���)�)�*�D����w�'�'���G�G�$:�;�+��Z�Z��0�0��1A�1A�B�D�K��0�0��1F�1F�G�D�K���g�u�/�/�0�0��3��'�'��9�9�T�[�[�!�4���'.�'9�'9�';�$��	�3�9���	�	�$�+�+�q�1�D�I�%,�%7�%7�%9�"�D�J��41��n�n����Z�s
�A	K4�442LFc�$�URXX4S9 g)aParse the given C source.  This registers all declared functions,43types, and global variables.  The functions and global variables can44then be accessed via either 'ffi.dlopen()' or 'ffi.verify()'.45The types can be used in 'ffi.new()' and other functions.46If 'packed' is specified as True, all structs declared inside this47cdef are packed, i.e. laid out without any field alignment at all.48Alternatively, 'pack' can be a small integer, and requests for49alignment greater than that are ignored (pack=1 is equivalent to50packed=True).51)�override�packed�packN)�_cdef)rA�csourcerGrHrIs     r�cdef�FFI.cdefes��	
�52�53�7�f�54�Hrc�P�URXUSS9 URcSUlgg)NT)rHrI�	dllexportr)rJr0)rArKrHrIs    r�
embedding_api�FFI.embedding_apirs*���55�56�7���57�E��?�?�"� �D�O�#rc�R�[U[5(d1[U[5(d[S5eUR	S5nUR58 [
5UlURR"U4SU0UD6 URRU5 U(a#URHnUR5 M URRnU(a+/URlUHnURX5 M SSS5 g!,(df   g=f)Nz cdef() argument must be a string�asciirG)r59�str�60basestring�	TypeError�encoder �objectr/r"�parser+�appendr)�clear�_recomplete�finish_backend_type)rArKrG�options�cache�61finishlist�tps       rrJ�	FFI._cdefws����'�3�'�'��g�z�2�2�� B�C�C��n�n�W�-�G�
�Z�Z�!'��D���L�L���w�E��E�W�E����$�$�W�-��!�2�2�E��K�K�M�3����1�1�J��+-����(�$�B��*�*�4�<�%��Z�Z�s
�B<D�62D&c�V�[U[5(d(Ub%[XR5(d[S5eUR [XU5up4URRU5 URRU5 SSS5 U$!,(df   W$=f)a Load and return a dynamic library identified by 'name'.63The standard C library can be loaded by passing None.64Note that functions and types declared by 'ffi.cdef()' are not65linked to a particular library, just like C headers; in the66library we only look for the actual (untyped) symbols.67NzRdlopen(name): name must be a file name, None, or an already-opened 'void *' handle)	r68rUr>rVr �_make_ffi_libraryr)rZr*)rArC�flags�lib�function_caches     r�dlopen�69FFI.dlopen�s����4��,�,����4���,�,��C�D�
D�
�Z�Z�"3�D��"F��C��!�!�(�(��8��O�O�"�"�3�'���70�	�Z��71�s
�72AB�73B(c�8�[U5RU5 g)z�Close a library obtained with ffi.dlopen().  After this call,74access to functions or variables from the library will fail75(possibly with a segmentation fault).76N)�type�__cffi_close__)rArfs  r�dlclose�FFI.dlclose�s��77	
�S�	� � ��%rc�R�UnX R;aURU$[U[5(dURS5nURRU5nURnU(aUR5nURU5nXT4nX`RU'U$)NrS)	r'r78rTrWr"�79parse_type�is_raw_function�as_function_pointerr7)rA�cdecl�keyrk�really_a_function_type�btype�results       r�_typeof_locked�FFI._typeof_locked�s������$�$�$��%�%�c�*�*��%��%�%��L�L��)�E��|�|�&�&�u�-��!%�!5�!5��!��+�+�-�D��&�&�t�,���.��"(���3���
rc���URUnWupEU(aU(d[	SU<S35eU$![a< UR URU5nSSS5 MW!,(df   Nf=ff=f)Nz	the type z3 is a function type, not a pointer-to-function type)r'�KeyErrorr rxr)rArs�consider_function_as_funcptrrwrvrus      r�_typeof�FFI._typeof�sx��	4��'�'��.�F�80)/�%��!�*F��:?�B�C�
C�����	4�����,�,�U�3�������	4�s'�5�A;�A(�A;�(81A7	�2A;�7A;c�"�[U[5(aURU5$[XR5(aURRU5$[U[R5(a[U5nUbU$[U[R5(aB[US5(a1UR URUR5sSSS5 $[[U55e!,(df   N"=f)z�Parse the C type given as a string and return the82corresponding <ctype> object.83It can also be used on 'cdata' instance to get its C type.84N�_cffi_base_type)r85rUr}r>r�typeofr$�BuiltinFunctionType�_builtin_function_type�FunctionTyperr r7r�rVrk)rArs�ress   rr��86FFI.typeof�s���87�e�Z�(�(��<�<��&�&��e�Z�Z�(�(��=�=�'�'��.�.��e�U�6�6�7�7�(��/�C����88��u�e�0�0�1�1��E�#4�5�5�����-�-�e�.C�.C�D�����U��$�$���s�D�89Dc��[U[5(a,URU5nURR	U5$URR	U5$)zfReturn the size in bytes of the argument.  It can be a90string naming a C type, or a 'cdata' instance.91)r92rUr}r�sizeof)rArs�BTypes   rr��93FFI.sizeof�sI���e�Z�(�(��L�L��'�E��=�=�'�'��.�.��=�=�'�'��.�.rc��[U[5(aURU5nURR	U5$)zLReturn the natural alignment size in bytes of the C type94given as a string.95)r96rUr}r�alignof)rArss  rr��FFI.alignof�s4���e�Z�(�(��L�L��'�E��}�}�$�$�U�+�+rc�z�[U[5(aURU5nUR"U/UQ76S$)aReturn the offset of the named field inside the given97structure or array, which must be given as a C type name.98You can give several field names in case of nested structures.99You can also give numeric values which correspond to array100items, in case of an array type.101r)r102rUr}�
_typeoffsetof)rArs�fields_or_indexess   r�offsetof�FFI.offsetof�s;���e�Z�(�(��L�L��'�E��!�!�%�<�*;�<�Q�?�?rc��[U[5(aURU5nURR	X5$)aAllocate an instance according to the specified C type and103return a pointer to it.  The specified C type must be either a104pointer or an array: ``new('X *')`` allocates an X and returns105a pointer to it, whereas ``new('X[n]')`` allocates an array of106n X'es and returns an array referencing it (which works107mostly like a pointer, like in C).  You can also use108``new('X[]', n)`` to allocate an array of a non-constant109length n.110 111The memory is initialized following the rules of declaring a112global variable in C: by default it is zero-initialized, but113an explicit initializer can be given which can be used to114fill all or part of the memory.115 116When the returned <cdata> object goes out of scope, the memory117is freed.  In other words the returned <cdata> object has118ownership of the value of type 'cdecl' that it points to.  This119means that the raw data can be used as long as this object is120kept alive, but must not be used for a longer time.  Be careful121about that when copying the pointer to the memory somewhere122else, e.g. into another structure.123)r124rUr}r�newp)rArs�inits   r�new�FFI.new�s4��.�e�Z�(�(��L�L��'�E��}�}�!�!�%�.�.rc�t^^�TRR5nURXU5mSUU4SjjnU$)awReturn a new allocator, i.e. a function that behaves like ffi.new()125but uses the provided low-level 'alloc' and 'free' functions.126 127'alloc' is called with the size as argument.  If it returns NULL, a128MemoryError is raised.  'free' is called with the result of 'alloc'129as argument.  Both can be either Python function or directly C130functions.  If 'free' is None, then no free function is called.131If both 'alloc' and 'free' are None, the default is used.132 133If 'should_clear_after_alloc' is set to False, then the memory134returned by 'alloc' is assumed to be already cleared (or you are135fine with garbage); otherwise CFFI will clear it.136c�`>�[U[5(aTRU5nT"X5$r	�r137rUr})rsr��	allocatorrAs  ��r�allocate�#FFI.new_allocator.<locals>.allocates)����%��,�,����U�+���U�)�)rr	)rr�
new_allocator)rA�alloc�free�should_clear_after_alloc�compiled_ffir�r�s`     @rr��FFI.new_allocator
s>����}�}�(�(�*�� �.�.�u�/G�I�	�	*�	*��rc��[U[5(aURU5nURR	X5$)z�Similar to a C cast: returns an instance of the named C138type initialized with the given 'source'.  The source is139casted between integers or pointers of any type.140)r141rUr}rr<)rArs�sources   rr<�FFI.cast%s4��142�e�Z�(�(��L�L��'�E��}�}�!�!�%�0�0rc�8�URRX5$)akReturn a Python string (or unicode string) from the 'cdata'.143If 'cdata' is a pointer or array of characters or bytes, returns144the null-terminated string.  The returned string extends until145the first null character, or at most 'maxlen' characters.  If146'cdata' is an array then 'maxlen' defaults to its length.147 148If 'cdata' is a pointer or array of wchar_t, returns a unicode149string following the same rules.150 151If 'cdata' is a single character or byte or a wchar_t, returns152it as a string or unicode string.153 154If 'cdata' is an enum, returns the value of the enumerator as a155string, or 'NUMBER' if the value is out of range.156)r�string)rA�cdata�maxlens   rr��157FFI.string.s�� �}�}�#�#�E�2�2rc�8�URRX5$)a�Unpack an array of C data of the given length,158returning a Python string/unicode/list.159 160If 'cdata' is a pointer to 'char', returns a byte string.161It does not stop at the first null.  This is equivalent to:162ffi.buffer(cdata, length)[:]163 164If 'cdata' is a pointer to 'wchar_t', returns a unicode string.165'length' is measured in wchar_t's; it is not the size in bytes.166 167If 'cdata' is a pointer to anything else, returns a list of168'length' items.  This is a faster equivalent to:169[cdata[i] for i in range(length)]170)r�unpack)rAr��lengths   rr��171FFI.unpack@s���}�}�#�#�E�2�2rc��U[LaURUp!O&[U[5(aUR	U5nUR172R
XU5$)a�Return a cdata of the given type pointing to the data of the173given Python object, which must support the buffer interface.174Note that this is not meant to be used on the built-in types175str or unicode (you can build 'char[]' arrays explicitly)176but only on objects containing large quantities of raw data177in some other format, like 'array.array' or numpy arrays.178 179The first argument is optional and default to 'char[]'.180)�_unspecifiedr;r181rUr}r�from_buffer)rArs�
python_buffer�require_writables    rr��FFI.from_buffer^sN���L�(�#'�;�;��=�
��z�
*�
*��L�L��'�E��}�}�(�(��)9�;�	;rc�:�URRXU5$)affi.memmove(dest, src, n) copies n bytes of memory from src to dest.182 183Like the C function memmove(), the memory areas may overlap;184apart from that it behaves like the C function memcpy().185 186'src' can be any cdata ptr or array, or any Python buffer object.187'dest' can be any cdata ptr or array, or a writable Python buffer188object.  The size to copy, 'n', is always measured in bytes.189 190Unlike other methods, this one supports all Python buffer including191byte strings and bytearrays---but it still does not support192non-contiguous buffers.193)r�memmove)rA�dest�src�ns    rr��FFI.memmoveps���}�}�$�$�T��2�2rc�^^^^�UUUU4Sjn[T[5(aTRTSS9mUcU$U"U5$)a_Return a callback object or a decorator making such a194callback object.  'cdecl' must name a C function pointer type.195The callback invokes the specified 'python_callable' (which may196be provided either directly or via a decorator).  Important: the197callback object must be manually kept alive for as long as the198callback may be invoked from the C level.199c�v>�[U5(d[S5eTRRTUTT5$)Nz.the 'python_callable' argument is not callable)�callablerVr�callback)�python_callablers�error�onerrorrAs ����r�callback_decorator_wrap�-FFI.callback.<locals>.callback_decorator_wrap�s@����O�,�,��!2�3�3��=�=�)�)�%��*/��:�
:rT)r|r�)rArsr�r�r�r�s`` `` rr��FFI.callback�sE���	:�	:��e�Z�(�(��L�L��T�L�J�E��"�*�*�*�?�;�;rc�F�[U[5(aURU5nUR5nUR	S5(a&SUR200R
US5;aSU-nOU(aUSS;aSU-nUR201R
X5$)aReturn a string giving the C type 'cdecl', which may be itself202a string or a <ctype> object.  If 'replace_with' is given, it gives203extra text to append (or insert for more complicated C types), like204a variable name, or '*' to get actually the C type 'pointer-to-cdecl'.205�*z&[�&z(%s)rz[(� )r206rUr}�stripr4r�getcname)rArs�replace_withs   r�getctype�FFI.getctype�s����e�Z�(�(��L�L��'�E�#�)�)�+���#�#�C�(�(��D�M�M�2�2�5�#�>�>�!�L�0�L�
�,�q�/�T�"9���-�L��}�}�%�%�e�:�:rc�:�URRXU5$)a�Return a new cdata object that points to the same207data.  Later, when this new cdata object is garbage-collected,208'destructor(old_cdata_object)' will be called.209 210The optional 'size' gives an estimate of the size, used to211trigger the garbage collection more eagerly.  So far only used212on PyPy.  It tells the GC that the returned object keeps alive213roughly 'size' bytes of external memory.214)r�gcp)rAr��215destructor�sizes    r�gc�FFI.gc�s���}�}� � ��D�9�9rc���URRS5SLdeURUnU$![a1 /nUR	X5nUHnURX5 M U$f=f)NF)r �acquirer#r{�get_cached_btyper])rArkr�r`s    rr7�FFI._get_cached_btype�s~���z�z�!�!�%�(�E�1�1�1�	;��'�'��-�E�����	;��J��)�)�$�;�E�"���(�(��:�#���	;�s�3�7A.�-A.c��SSKJnJn UR(aUR	U5 U=(d U"5nU"XU40UD6UlURR5nURRU5 U$)a�Verify that the current ffi signatures compile on this216machine, and return a dynamic library object.  The dynamic217library can be used to call functions and access global218variables declared in this 'ffi'.  The library is compiled219by the C compiler: it gives you C-level API compatibility220(including calling macros).  This is unlike 'ffi.dlopen()',221which requires binary compatibility in the signatures.222r)�Verifier�_caller_dir_pycache)�verifierr�r�r-�_apply_windows_unicode�load_libraryr*rZ)rAr��tmpdir�kwargsr�r�rfs       r�verify�223FFI.verify�sp��	<�� � ��'�'��/�224�0�.�0��!��v�@��@��
��m�m�(�(�*��	
�����s�#��225rc�6�URR5$r	)r�	get_errno)rAs r�226_get_errno�FFI._get_errno�s���}�}�&�&�(�(rc�:�URRU5 gr	)r�	set_errno)rA�errnos  r�227_set_errno�FFI._set_errno�s���
�
����&rz(the value of 'errno' from/to the C callsc�8�URRU5$r	)r�getwinerror)rA�codes  rr��FFI.getwinerror�s���}�}�(�(��.�.rc�|�UR [R"X5sSSS5 $!,(df   g=fr	)r r�
pointer_cache)rA�ctypes  r�_pointer_to�FFI._pointer_to�s!��
�Z�Z��&�&�t�3��Z�Z�s�-�228;c��URRU5nU(aUR"U/UQ76up4OURS:Xa[S5eSnURU5nURRXQU5$![a9 S[U5R;a[U5R229"U/UQ76s$ef=f)z�Return the address of a <cdata 'struct-or-union'>.230If 'fields_or_indexes' are given, returns the address of that231field or array item in the structure or array, recursively in232case of nested structures.233�
__addressof__�pointerzaddressof(pointer)r)234rr�rVrkr&r�r��kindr��rawaddressof)rAr�r�r��offset�ctypeptrs      r�	addressof�
FFI.addressof�s���	��M�M�(�(��/�E�235� �.�.�u�I�7H�I�M�E�6��z�z�Y�&�� 4�5�5��F��#�#�E�*���}�}�)�)�(�6�B�B���	��$�u�+�"6�"6�6��E�{�0�0��K�9J�K�K��	�s�B�?C�Cc��URRX5upUH%nURRXS5upXF-
nM' X4$)Nr)r�typeoffsetof)rAr��field_or_indexr�r��field1�offset1s       rr��FFI._typeoffsetof�sL���
�
�2�2�5�I�
��'�F�!�]�]�7�7��q�I�N�E���F�(��}�rc�^�[U[5(d"[S[U5R<35eXLa[S5eUR UR URRUR5 URRS5 URRUR5 URRS5 URRU5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)a�Includes the typedefs, structs, unions and enums defined236in another FFI instance.  Usage is similar to a #include in C,237where a part of the program might include types defined in238another part for its own usage.  Note that the include()239method has no effect on functions, constants and global240variables, which must anyway be accessed directly from the241lib object returned by the original FFI instance.242zEffi.include() expects an argument that is also of type cffi.FFI, not zself.include(self)�[�]N)
r243rrVrk�__name__�244ValueErrorr r"�includer+rZ�extendr,)rA�ffi_to_includes  rr	�FFI.includes����.�#�.�.�� $�^� 4� =� =�@�A�
A��!��1�2�2�
�
!�
!�������$�$�^�%;�%;�<��!�!�(�(��-��!�!�(�(��)D�)D�E��!�!�(�(��-��#�#�*�*�>�:��"�
!����"�
!�s%�
D� BD
�<D�
245D	�D�246D,c�N�URRURU5$r	)r�newp_handler9�rArs  r�247new_handle�FFI.new_handles���}�}�(�(����a�8�8rc�8�URRU5$r	)r�from_handlers  rr�FFI.from_handles���}�}�(�(��+�+rc�:�URRU5 gr	)r�releasers  rr�FFI.release"s���
�
���a� rc��URb[S5e[U5nU(aURS5 OURS5 Xlg)a;Windows: if 'enabled_flag' is True, enable the UNICODE and248_UNICODE defines in C, and declare the types like TCHAR and LPTCSTR249to be (pointers to) wchar_t.  If 'enabled_flag' is False,250declare these types to be (pointers to) plain 8-bit characters.251This is mostly for backward compatibility; you usually want True.252Nz%set_unicode() can only be called oncez�typedef 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;z�typedef 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-r�boolrL)rA�enabled_flags  r�set_unicode�FFI.set_unicode%sU��� � �,��D�E�E��L�)����I�I�/�
0�
�I�I�/�
0�!-�rc��URSS5n[U[[45(d[	S5e[U5SS/-nX!S'g)N�
define_macros�z''define_macros' must be a list or tuple)�UNICODE�1)�_UNICODEr!)�getr253r3�tuplerV)rA�kwds�	defmacross   rr��FFI._apply_windows_unicodeCsP���H�H�_�b�1�	��)�d�E�]�3�3��E�F�F���O�'7�'8�':�:�	� )�_�rc�j^�U4SjnS[R;Ga%SSKn[RS:XafSR	[R2545n[
[S5(a1U"SURR[RS55 O_[R255S	:aS256nOSn[
[S5(a1U"SURR[RS55 [
[S5(a2U"SURR[RS
S55 O�[RS:XaSn[
[S5(aUS-
nO0SSK257nSnURS5(aXVRS5-
nU[RS-	[RS-	S-4-n[
[S5(aU[R-
nU"SU5 [RS:Xa258U"SS5 gg![a	 SSKJ259n N�f=f)Nc�X>�TRU/5nX;aURU5 ggr	)�260setdefaultrZ)rt�value�lstr%s   �r�ensure�(FFI._apply_embedding_fix.<locals>.ensureMs*����/�/�#�r�*�C����261�262�5�!� r�__pypy__r�win32zpython{0[0]}{0[1]}�prefix�library_dirs�libs��zpypy-czpypy3-c�bin�pypy�goalz263python%d%d�gettotalrefcount�_d)�	sysconfigzpython%d.%d�	DEBUG_EXT�����abiflags�	libraries�extra_link_argsz	/MANIFEST)�sys�builtin_module_names�os�platform�format�version_infor�path�joinr1r;�ImportError�cffi._shimmed_dist_utils�get_config_var�264hexversionr@)rAr%r-rE�	pythonlib�templater;s `     r�_apply_embedding_fix�FFI._apply_embedding_fixKs����	"�265��1�1�1���|�|�w�&�1�7�7��8H�8H�I�	��3��)�)��>�2�7�7�<�<��266�267�F�+K�L��268�#�#�d�*� (�I� )�I��3��)�)��>�2�7�7�<�<��269�270�E�+J�K��s�H�%�%��~�r�w�w�|�|�C�J�J���'O�P���|�|�w�&�'���3� 2�3�3���$�H��C�$�)���+�+�K�8�8�� 8� 8�� E�E�H�!��^�^�r�)�C�N�N�b�,@�D�+H�I�J�I��s�J�'�'��S�\�\�)�	��{�I�&��<�<�7�"��$�k�2�#��#�C�B�C�s�4H�H2�1H2c�"�SSKn[US5(a[S5e[U[5(d[S5eURU;d!UR(aURU;a[S5e[U5UX44Ul	g)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)271rErrr272rUrV�sep�altseprTrT)rA�module_namer��source_extensionr%rEs      r�273set_source�FFI.set_source}s�����4�+�,�,��.�/�
/��+�z�2�2��<�=�=�
�6�6�[� �R�Y�Y�2�9�9��3K��H�I�
I�!$�[�!1�6�!1�!9��rc��SSKJn [U[5(d[	S5eURU5nUR
XW5 UR"XU40UD6 g)Nr)�	pkgconfigz;the pkgconfig_libs argument must be a list of package names)rr\r274r3rV�flags_from_pkgconfig�merge_flagsrY)rArW�pkgconfig_libsr�rXr%r\�kwds2s        r�set_source_pkgconfig�FFI.set_source_pkgconfig�sV����.�$�/�/��/�0�
0��.�.�~�>�����d�*�����-=�F��Frc���SSKJn SSKJn [	US5(d6[	US5(aUR275R
5$[S5eURupVpxUc[S5eU"U5 U"XU4XUS	S276.UD6up�U(akU277(a3[RRSU	RS<S35 U	$[RRS
U	RS<S35 U	$)Nr)�mkpathr��	recompilerTr�z8set_source() must be called before distutils_extension()zadistutils_extension() is only for C extension modules, not for dlopen()-style pure Python modulesF)r��extradirrX�call_c_compilerz
regenerated: �278znot modified: )rLrd�279recompilerrfrr��
get_extensionrrTrVrC�stderr�write�sources)rAr��verboserdrfrWr�rXr%�ext�updateds           r�distutils_extension�FFI.distutils_extension�s���3�)��t�/�0�0��t�Z�(�(��}�}�2�2�4�4��6�7�
7�6:�6K�6K�3��-��>��&�'�
'�	�v�� ��!'�@�06�2B�16�@�;?�@������280�281� � ����A��!H�I��282��283�284� � ����Q��!I�J��285rc��SSKJn [US5(d[S5eURup4pVUc[S5eU"XU4USSS.UD6 g)NrrerT�0set_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_filerh�uses_ffiplatform�rjrfrrrTrV�rA�filenamerfrWr�rXr%s       r�emit_c_code�FFI.emit_c_code�sk��)��t�/�0�0��O�P�P�6:�6K�6K�3��-��>��I�J�
J��$�V�	2�!�5�#(�	2�,0�	2rc��SSKJn [US5(d[S5eURup4pVUb[S5eU"XU4USSS.UD6 g)NrrerTruz^emit_python_code() is only for dlopen()-style pure Python modules, not for C extension modulesFrvryrzs       r�emit_python_code�FFI.emit_python_code�sl��)��t�/�0�0��O�P�P�6:�6K�6K�3��-����O�P�
P��$�V�	2�!�5�#(�	2�,0�	2rc	��SSKJn [US5(d[S5eURupgp�U"XU4UX8X$S.U	D6$)a�The 'target' argument gives the final file name of the286compiled DLL.  Use '*' to force distutils' choice, suitable for287regular CPython C API modules.  Use a file name ending in '.*'288to ask for the system's default extension for dynamic libraries289(.so/.dll/.dylib).290 291The default is '*' when building a non-embedded C API extension,292and (module_name + '.*') when building an embedded library.293rrerTz,set_source() must be called before compile())r��targetrX�compiler_verbose�debug)rjrfrrrT)294rAr�ror�r�rfrWr�rXr%s295          r�compile�FFI.compile�s\��	*��t�/�0�0��K�L�L�6:�6K�6K�3��-���F�H�6� &�*1�H�BF�H�	Hrc�n�URUnUS(aUS$US URUnUS(aUSsSSS5 $U"5nSU4URU'SSS5 U$![a) URRUS[545nN�f=f!,(df   W$=f)NFrrT)r.r{r*r)rA�func�tagrrws     r�	init_once�
FFI.init_once�s���	P��%�%�c�*�A�
�Q�4��Q�4�K�
�q�T��%�%�c�*�A���t���t�	�T��V�F�*.���D�!�!�#�&���
���	P��%�%�0�0��u�m�o�6N�O�A�	P���T��
�s"�A/�B%�
B%�/0B"�!B"�%296B4c��UR(a[S5eSSKnURSU5nU(aXR	5SnUR5=(d S/nURSUS5R
5n[S[U55HSnXFnUR5(dMURU5(aM6USSnURU5(dMMU [U5nUVs/sH297owUSS-PM nnSRU5n[US	S2985 Xlgs snf)Nz-embedding_init_code() can only be called oncerz\s*\nrz\s*r�����ri�	cffi_init�exec)
r0r�re�match�end�299splitlines�group�range�len�rstripr4rJr�)rA�pysourcer�r��linesr1�i�lines        r�embedding_init_code�FFI.embedding_init_code�s���?�?��L�M�M�300	�����8�,����	�	���-�H��#�#�%�-�"������&�%��(�+�1�1�3���q�#�e�*�%�A��8�D��{�{�}�}��/�/�&�1�1�#�C�R�[�F��/�/�&�1�1�&�301
��K��+0�1�5�4�a�b��$��5��1��7�7�5�>����+�v�.�"���2s�D<c��[S5e)Nz:ffi.def_extern() is only available on API-mode FFI objects)r)rA�argsr%s   r�302def_extern�FFI.def_extern
s���#�$�	$rc��/n/n/nURRH�nURS5(aURUSS5 M/URS5(aURUSS5 M[URS5(dMsURUSS5 M� UR	5 UR	5 UR	5 XU4$)z�Returns the user type names known to this FFI instance.303This returns a tuple containing three lists of names:304(typedef_names, names_of_structs, names_of_unions)305ztypedef �Nzstruct �zunion �)r"�
_declarationsr4rZ�sort)rA�typedefs�structs�unionsrts     r�306list_types�FFI.list_typess���307�������<�<�-�-�C��~�~�j�)�)�����A�B��(����	�*�*����s�1�2�w�'�����)�)��
�
�c�!�"�g�&�
.�	�
�
���������
��6�*�*r)r;r9r>r?rrTrr#r/r+r0r)r,r.r*r r(r'r"r2r-r@r�r	)FFN)FN)F)r)NNT)r�)NNN)r)rN)z.c)�buildT)�.rNN)8r�308__module__�__qualname__�__firstlineno__�__doc__rDrLrPrJrhrmrxr}r�r�r�r�r�r�r<r�r�r�r�r�r�r�r�r7r�r�r��propertyr�r�r�r�r�r	rrrrr�rQrYrarrr|rr�r�r�r�r��__static_attributes__rrrrrs"���":%�xI�!�309=�$�$&��$�%�&/�,�	@�/�6.2�/3��01�3�$3�<0<�%*�;�$3� <�*;� 310:�311��<)�'��Z��T�?�
A�E�/�4�C�*�;�.9�,�!�-�<*�03�d9�/3�G��42�2�H�&�0#�4$�+rrc�,�SSKn[U[5(d*[RS:wdUbURX5$SnSnSU;dSU;dURU;aURX5$SSKnURRU5nUcVUS:Xa3[RS:Xa[RS:�a[S5eSU<3nUb	U<S	U<3n[U5eURXr5$![anUnSnAN�SnAff=f)312Nrr0�cr��/r4zXdlopen(None) cannot work on Windows for Python 3 (see http://bugs.python.org/issue23606)zEctypes.util.find_library() did not manage to locate a library called z.  Additionally, )rEr313rUrCrFr�rU�OSError�ctypes.util�util�find_libraryrH)	rBrCrerE�first_error�e�ctypesrI�msgs	         r�_load_backend_libr�&s��
��d�J�'�'��<�<�7�"�d�&6��'�'��4�4����K�314�d�{�c�T�k�R�V�V�t�^�	��'�'��4�4���;�;�#�#�D�)�D��|��3�;�3�<�<�7�2�s�7G�7G�4�7O��D�E�
E��37�9���"�-8�#�>�C��c�l������,�,���	��K��	�s�#C=�=315D�D�Dc316��^^^^^^^	^317^^^
^^^�TRn[X1U5m
U
UU4SjmUU
U4SjmUU
U4SjmSmUU4Sjm0m	S/m3180mUUUUU	U319UU4SjmUU	UUU4Sjm"UU	UU
UUUU4S	jS320[5m[U[5(a1[U[3215(dUR
S5nSU-TlT"5mTTR4$![a N!f=f)
Nc�>�SU-nTRRUup#TRU5nTRX@5nUTRU'g)Nz	function )r"r�r7�
load_functionr&)	rCrtra�_r�r+�322backendlib�ffi�librarys	      ���r�accessor_function�,_make_ffi_library.<locals>.accessor_functionDsS����D� �����)�)�#�.����%�%�b�)���(�(��5��!&�����rc323��>^^^^�ST-nT	RRUup#T	RU5mTRmTRm[TT[
UUU4SjUUU4Sj55 g)N�	variable c�>�T"TT5$r	r)rAr�rC�
read_variables ���rr
�>_make_ffi_library.<locals>.accessor_variable.<locals>.<lambda>Rs����u�d�3rc�>�T"TTU5$r	r)rAr+r�rC�write_variables  ���rr
r�Ss����u�d�E� Br)r"r�r7r�r�r5r�)324rCrtrar�r�r�r��325FFILibraryr�r�s326`   @@@���r�accessor_variable�,_make_ffi_library.<locals>.accessor_variableKsd����D� �����)�)�#�.����%�%�b�)��"�0�0�
�#�2�2���327�D�(�3�B�#D�	Erc�p>�TU$![a� TR UT;anSU-nTRRUup#TR	U5nUR328S:wa[R"TU5nTRX@5nUTU'SSS5 O!,(df   O=fTUs$f=f)Nr��array)	r{r r"r�r7r�rr�r�)	rCrtrar�r��p�addr_variablesr�r�s	      ���r�
addressof_var�(_make_ffi_library.<locals>.addressof_varUs����	(�!�$�'�'���329	(�����~�-�%��,�C��K�K�5�5�c�:�E�B��1�1�"�5�E��z�z�W�,� %� 3� 3�C�� ?��"�0�0��=�A�+,�N�4�(�����"�$�'�'�330	(�s'��B5�A5B�	B5�331B*	�&B5�4B5c�"�[SU<S35e)Nznon-integer constant 'z,' cannot be accessed from a dlopen() library)�NotImplementedError)rCs r�accessor_constant�,_make_ffi_library.<locals>.accessor_constantds��!�HL�#O�P�	Prc�R>�TRRUTRU'gr	)r"�_int_constantsr&)rCr�r�s ��r�accessor_int_constant�0_make_ffi_library.<locals>.accessor_int_constanths"���!$���!;�!;�D�!A�����rFc�>�T
STRLagTRRR5H�unup[	U[332R5(d=URSS5up4US:XaT	TU'MHUS:XaTTU'MUUS:XaTTU'MbMd[UR5HupVX4U4SjjnUTU'M M� TRRHnTRUT3335 M TRT
S'g)Nrr�r�function�variable�constantc�^>�UR5 URUTRU'gr	)�check_not_partial�334enumvaluesr&)rCrar�r�s   �r�
accessor_enum�B_make_ffi_library.<locals>.update_accessors.<locals>.accessor_enum~s(����,�,�.�13���q�1A��(�(��.r)r/r"r��itemsr335r�EnumType�split�	enumerate�enumeratorsr�r*)rtrar�r�rCr��enumnamer�r�r�r�r��	accessors�accessors_versionr�r�s        ��������r�update_accessors�+_make_ffi_library.<locals>.update_accessorsos�����Q��3�#4�#4�4���K�K�5�5�;�;�=�L�C��"��b�%�.�.�1�1��I�I�c�1�-�	���*�$�&7�I�d�O��J�&�&7�I�d�O��J�&�&7�I�d�O�'�$-�R�^�^�#<�K�A�/1�B�+8�I�h�'�	$=�>��K�K�.�.�D�� � ��'<�=�/�"�0�0��!�rc��>�TR UTR;dUTR;a336SSS5 gUT;aT"5 UT;a[U5eTU"U5 SSS5 g!,(df   g=fr	)r r&�AttributeError)rCr�r�r�r�r�s �����r�
make_accessor�(_make_ffi_library.<locals>.make_accessor�sh���
�Y�Y��w�'�'�'�4�:�3F�3F�+F���Y��9�$� �"��y�(�(��.�.��d�O�D�!��Y�Y�s�"A+�)A+�+337A9c�\>�\rSrSrU4SjrU4SjrUUU4SjrUUUU4SjrU4SjrSr	g)	�%_make_ffi_library.<locals>.FFILibraryi�c�*>�T"U5 [X5$r	)r6)rArCr�s  �r�__getattr__�1_make_ffi_library.<locals>.FFILibrary.__getattr__�s����$���4�&�&rc�>�[URU5nURX5 g![a T"U5 [	XU5 gf=fr	)r6�	__class__�__set__r�r5)rArCr+r�r�s    �r�__setattr__�1_make_ffi_library.<locals>.FFILibrary.__setattr__�sK���
.�"�4�>�>�4�8��338� � ��-��	"�
+��d�#���E�*�
+�s�+�A�Ac�>�TR T"5 TR5sSSS5 $!,(df   g=fr	)r �keys)rAr�r�r�s ���r�__dir__�-_make_ffi_library.<locals>.FFILibrary.__dir__�s$������ �"� �~�~�'����s�/�339=c�>�UTR;aTRU$UTR;aT"U5$T"U5 UTR;aTRU$UTR;aT"U5$[SU<S35e)Nz7cffi library has no function or global variable named '�')r&r�)rArCr�r�r�r�s  ����rr��3_make_ffi_library.<locals>.FFILibrary.__addressof__�s�����w�'�'�'��'�'��-�-��z�*�*�*�$�T�*�*��$���w�'�'�'��'�'��-�-��z�*�*�*�$�T�*�*� �AE�"H�I�
Irc�Z>�TR5 URR5 gr	)�	close_libr&r[)rAr�s �rrl�4_make_ffi_library.<locals>.FFILibrary.__cffi_close__�s���� � �"��M�M���!rrN)340rr�r�r�r�rrr�rlr�)r�r�r�r�r�r�r�r�s��������rr�r��s(���	'�	.�	(�	I�	I�	"�	"rr�zutf-8z
FFILibrary_%s)341rr�rXr342rUrTrWr�UnicodeErrorr&)r��libnamererBr�r�r�r�r�r�r�r�r�r�r�r�r�s`   @@@@@@@@@@@@@rrdrd@s������l�l�G�"�7�U�;�J�'�E�
(�P�B��I�����N�1�1�."�"�"�"�V�"�@�'�:�&�&�	��g�s�+�+�!�.�.��1��"1�G�";�J���l�G��G�$�$�$�$���	��	�s�0C�343C(�'C(c��SSKnURURnURnURnX@nUR344 UR
U5sSSS5 $!,(df   g=f![[[4a gf=f)Nr)345rC�modulesr��_cffi_original_ffi�_cffi_types_of_builtin_funcsr r7r{r�rV)r�rC�moduler��types_of_builtin_funcsras      rr�r��sx���	-����T�_�_�-���'�'��!'�!D�!D��
#�
)���Y�Y��(�(��,��Y�Y��
�n�i�0����s�5A3�A"�"346A0�3B�347B)rCr$�lockrr�rrrr��	NameError�collectionsrrUrTrXr�rr�rdr�rrr�<module>rsy������1����348�x��L+�&�L+�^-�4x%�t
-��e�1�$�0�H�1�����J��s �=�A�A�A�A�A
codekingpro/portable-devtools · Team Ai