Viewing File: /opt/alt/python38/lib64/python3.8/site-packages/cffi/__pycache__/api.cpython-38.pyc
U
ل=^P @ s d dl Z d dlZddlmZ ddlmZ ddlmZ ze W n( e k
rd d dl
mZ dd ZY nX ze W n e k
r e
ZY nX e ZG d d
d
eZdd Zd
d Zdd ZdS ) N )
allocate_lock) CDefError)model)Callablec C s
t | tS N)
isinstancer )x r
/api.py<lambda> r c @ s e Zd ZdZdjddZdkddZdldd Zdmd
dZdnd
dZdd Z dd Z
doddZdd Zdd Z
dd Zdd ZdpddZdqd d!Zd"d# Zdrd%d&Zd'd( Zedfd)d*Zd+d, Zdsd-d.Zdtd0d1Zdud2d3Zd4d5 Zdvd6d7Zd8d9 Zd:d; Zeeedd<Z dwd=d>Z!d?d@ Z"dAdB Z#dCdD Z$dEdF Z%dGdH Z&dIdJ Z'dKdL Z(dMdN Z)dOdP Z*dQdR Z+dxdTdUZ,dydVdWZ-dzdYdZZ.d[d\ Z/d]d^ Z0d{d`daZ1dbdc Z2ddde Z3dfdg Z4dhdi Z5dS )|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|drJtd|t|j|jf ntd|t|jf ddlm} || _t | _ |
| _i | _t
d j| _t
d
j| _g | _g | _g | _g | _d| _i | _d| _d| _t|| _t|dr|| t|jD ] }|drt | |t!|| q| j " | "tj#| _$| "tj%| _&W 5 Q R X t'|t
jrtt(d
s| )| j$dt(_*|+ \t(_,t(_-n | )| j$d| _*|+ \| _,| _-|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__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.)cparserZparsed_typesZ new_typesset_ffiZRTLD_NULL)/Z
_cffi_backend r hasattr Exceptionr r _backendr _lockZParser_parser_cached_btypestypes
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
startswithsetattrgetattr_get_cached_btypeZ
voidp_typeBVoidPZchar_array_typeBCharAr r castr Z
_get_typesCDataZCTypebuffer)selfbackendr r namer
r
r __init__) s^
zFFI.__init__Fc C s | j ||||d dS )a[ Parse 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.
Alternatively, 'pack' can be a small integer, and requests for
alignment greater than that are ignored (pack=1 is equivalent to
packed=True).
)overridepackedpackN)_cdef)r1 csourcer5 r6 r7 r
r
r cdefe s zFFI.cdefc C s&