Hacked By AnonymousFox
3
'+e� � @ s� d dl Z d dlZddlmZ ddlmZ ddlmZ ye W n( e k
rd d dl
mZ dd� ZY nX ye W n e k
r� e
ZY nX G d d
� d
e�Zdd� Zd
d� Zdd� ZdS )� N� )�
allocate_lock)� CDefError)�model)�Callablec C s
t | t�S )N)�
isinstancer )�x� r �/usr/lib64/python3.6/api.py�<lambda> s r c @ s� e Zd ZdZdfdd�Zdgdd�Zdhdd �Zdid
d�Zdjd
d�Zdd� Z dd� Z
dkdd�Zdd� Zdd� Z
dd� Zdd� Zdldd�Zdmd d!�Zd"d#� Zdod%d&�Zd'd(� Zdpd)d*�Zd+d,� Zdqd-d.�Zdrd0d1�Zdsd2d3�Zd4d5� Zdtd6d7�Zd8d9� Zd:d;� Zeeedd<�Zdvd=d>�Z d?d@� Z!dAdB� Z"dCdD� Z#dEdF� Z$dGdH� Z%dIdJ� Z&dKdL� Z'dMdN� Z(dOdP� Z)dwdRdS�Z*dxdUdV�Z+dWdX� Z,dYdZ� Z-dyd\d]�Z.d^d_� Z/d`da� Z0dbdc� Z1ddde� Z2dS )z�FFIa�
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
C s� |dkr^ddl }ddlm} |j|kr^t|d�rJtd|t|j|jf ��ntd|t|jf ��ddlm} || _t� | _ |j
� | _i | _t
jd �j| _t
jd
�j| _g | _g | _g | _g | _d| _i | _d| _d| _tj|�| _t|d�r�|j| � x2t|j�D ]$}|jd��r t | |t!||�� �q W | j �" | j"tj#�| _$| j"tj%�| _&W dQ R X t'|t
j��r�tt(d
��s�| j)| j$d�t(_*|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.
Nr r )�__version__�__file__z�Version 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.z�Version 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.)�cparserZparsed_typesZ new_types�set_ffiZRTLD_�NULL)/Z
_cffi_backend� r
�hasattr� Exceptionr r �_backendr �_lockZParser�_parser�_cached_btypes�types�
ModuleType�__dict__�
_parsed_typesZ
_new_types�_function_caches�
_libraries�_cdefsources�_included_ffis�_windows_unicode�_init_once_cache�
_cdef_version�
_embeddingr Z
get_typecacheZ
_typecacher �list�
startswith�setattr�getattr�_get_cached_btypeZ
voidp_type�BVoidPZchar_array_type�BCharAr r �castr Z
_get_types�CDataZCType�buffer)�self�backendr
r �namer r r
�__init__'