Current File : //usr/lib64/python2.7/site-packages/cffi/model.pyc
�
9�Wc@sZddlZddlZddlZddlmZdZdZdZd�Zde	fd��YZ
d	e
fd
��YZdefd��YZe�Z
d
efd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZee
�Zd�Zee
�Zdefd��YZd efd!��YZeed"�d�Zd#e
fd$��YZd%efd&��YZd'efd(��YZd)efd*��YZ d+efd,��YZ!dd-�Z"dd.�Z#e�Z$d/�Z%d0�Z&d1�Z'dS(2i����Ni(t
allocate_lockiicCs[|t@rd|j�}n|t@r:d|j�}n|t@rWd|j�}n|S(Ns const s
 volatile s __restrict (tQ_CONSTtlstript
Q_VOLATILEt
Q_RESTRICT(tqualstreplace_with((s0/usr/lib64/python2.7/site-packages/cffi/model.pytqualifys


tBaseTypeByIdentitycBs_eZeZeZdddd�Zd�Zd�Zd�Zed�Z	d�Z
d	�ZRS(
tsa C fileicCs�|j}|jd�dks$t�|j�}|r~|jd�r^d|kr^d|}q~|ddkr~d|}q~nt||�}|jd|�}d	|kr�dd
lm}|d|j	�|f��n|S(Nt&it*s&[s(%s)is[(t t$(tVerificationErrors-cannot generate '%s' in %s: unknown type name(
tc_name_with_markertcounttAssertionErrortstript
startswithRtreplacetffiplatformRt_get_c_name(tselfRtcontextRtresultR((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt
get_c_names 	
cCs|jjdd�S(NR
R	(RR(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR0scCsd|j�kS(NR
(R(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt
has_c_name3scCstS(N(tFalse(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pytis_integer_type6scCsby|j|}WnJtk
r]|j||�}|jj||�}||ks^t�nX|S(N(t_cached_btypestKeyErrortbuild_backend_typet
setdefaultR(Rtffit
finishlistt	can_delaytBTypetBType2((s0/usr/lib64/python2.7/site-packages/cffi/model.pytget_cached_btype9s
cCsd|j�fS(Ns<%s>(R(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt__repr__BscCs)g|jD]}|t||�f^q
S(N(t_attrs_tgetattr(Rtname((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt
_get_itemsEs(t__name__t
__module__Rt
is_array_typetis_raw_functionRRRRR'R(R,(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyRs					tBaseTypecBs#eZd�Zd�Zd�ZRS(cCs(|j|jko'|j�|j�kS(N(t	__class__R,(Rtother((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt__eq__KscCs||kS(N((RR3((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt__ne__OscCst|jt|j��f�S(N(thashR2ttupleR,(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt__hash__Rs(R-R.R4R5R8(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR1Is		tVoidTypecBs eZdZd�Zd�ZRS(cCs
d|_dS(Nsvoid&(R(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt__init__YscCst||d�S(Nt
new_void_type(tglobal_cache(RR"R#((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR \s((R-R.R)R:R (((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR9Vs	tBasePrimitiveTypecBseZRS((R-R.(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR=bst
PrimitiveTypecBs�eZd8Zi/dd6dd6dd6dd6dd6dd6dd	6dd
6dd6dd6dd
6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd 6dd!6dd"6dd#6dd$6dd%6dd&6dd'6dd(6dd)6dd*6dd+6dd,6dd-6dd.6dd/6dd06dd16dd26Zd3�Zd4�Zd5�Zd6�Zd7�ZRS(9R+tctchartitshorttinttlongs	long longssigned chars
unsigned charsunsigned shortsunsigned ints
unsigned longsunsigned long longtftfloattdoubleslong doublet_Booltwchar_ttint8_ttuint8_ttint16_ttuint16_ttint32_ttuint32_ttint64_ttuint64_ttint_least8_tt
uint_least8_tt
int_least16_ttuint_least16_tt
int_least32_ttuint_least32_tt
int_least64_ttuint_least64_ttint_fast8_ttuint_fast8_ttint_fast16_tt
uint_fast16_ttint_fast32_tt
uint_fast32_ttint_fast64_tt
uint_fast64_ttintptr_tt	uintptr_ttintmax_tt	uintmax_tt	ptrdiff_ttsize_ttssize_tcCs/||jkst�||_|d|_dS(NR
(tALL_PRIMITIVE_TYPESRR+R(RR+((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR:�s	cCs|j|jdkS(NR?(RiR+(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pytis_char_type�scCs|j|jdkS(NRA(RiR+(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR�scCs|j|jdkS(NRE(RiR+(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt
is_float_type�scCst||d|j�S(Ntnew_primitive_type(R<R+(RR"R#((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR �s(sname(	R-R.R)RiR:RjRRkR (((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR>fsl
				tUnknownIntegerTypecBs)eZdZd�Zd�Zd�ZRS(R+cCs||_|d|_dS(NR
(R+R(RR+((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR:�s	cCstS(N(tTrue(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR�scCstd|j��dS(Ns4integer type '%s' can only be used after compilation(tNotImplementedErrorR+(RR"R#((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR �s(sname(R-R.R)R:RR (((s0/usr/lib64/python2.7/site-packages/cffi/model.pyRm�s		tUnknownFloatTypecBs eZdZd�Zd�ZRS(R+cCs||_|d|_dS(NR
(R+R(RR+((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR:�s	cCstd|j��dS(Ns2float type '%s' can only be used after compilation(RoR+(RR"R#((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR �s(sname(R-R.R)R:R (((s0/usr/lib64/python2.7/site-packages/cffi/model.pyRp�s	tBaseFunctionTypecBseZdZdd�ZRS(targsRtellipsistabicCs�||_||_||_||_g|jD]}|j�^q.}|jr_|jd�n|pkdg}|jdj|�f}|dk	r�|d |d|d}n|jj	j
d|�|_	dS(Ns...tvoids, iRR
(RrRRsRtRtappendt
_base_patterntjointNoneRR(RRrRRsRttargtreprargsR((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR:�s				"	(sargssresultsellipsissabiN(R-R.R)RyR:(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyRq�stRawFunctionTypecBs&eZdZeZd�Zd�ZRS(s(&)(%s)cCs*ddlm}|jd|f��dS(Ni(tapisPcannot render the type %r: it is a function type, not a pointer-to-function type(R	R}t	CDefError(RR"R#R}((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR �s	cCst|j|j|j|j�S(N(tFunctionPtrTypeRrRRsRt(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pytas_function_pointer�s(R-R.RwRnR0R R�(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR|�s	RcBs eZdZd�Zd�ZRS(s(*&)(%s)cCs�|jj||�}g}x*|jD]}|j|j||��q%Wd}|jdkr�|js�y|jjf}Wq�tk
r�q�Xq�nt	||dt
|�||j|�S(Nt	__stdcalltnew_function_type((RR'RrRvRtRst_backendtFFI_STDCALLtAttributeErrorR<R7(RR"R#RRrttptabi_args((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR �s	

cCst|j|j|j|j�S(N(R|RrRRsRt(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pytas_raw_function�s(R-R.RwR R�(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR�s	tPointerTypecBs#eZdZdd�Zd�ZRS(ttotypeRicCs\||_||_t|d�}|jr@d|j�f}n|jjd|�|_dS(Ns *&s(%s)R
(R�RRR/RRR(RR�Rtextra((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR:s			cCs.|jj||dt�}t||d|�S(NR$tnew_pointer_type(R�R'RnR<(RR"R#tBItem((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR s(stotypesquals(R-R.R)R:R (((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR�scCs
t|t�S(N(R�R(R�((s0/usr/lib64/python2.7/site-packages/cffi/model.pytConstPointerTypestNamedPointerTypecBseZdZdd�ZRS(R�R+icCs-tj|||�||_|d|_dS(NR
(R�R:R+R(RR�R+R((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR:s	(stotypesname(R-R.R)R:(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR�st	ArrayTypecBs/eZdZeZd�Zd�Zd�ZRS(titemtlengthcCse||_||_|dkr'd}n|dkr<d}n
d|}|jjjd|�|_dS(Ns&[]s...s
&[/*...*/]s&[%s]R
(R�R�RyRR(RR�R�tbrackets((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR:$s				
cCst|j|�S(N(R�R�(Rt	newlength((s0/usr/lib64/python2.7/site-packages/cffi/model.pytresolve_length1scCs|jdkr8ddlm}|jd|f��n|jj||�t|j�j||�}t||d||j�S(Ns...i(R}s)cannot render the type %r: unknown lengthtnew_array_type(R�R	R}R~R�R'R�R<(RR"R#R}tBPtrItem((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR 4s	(sitemslength(R-R.R)RnR/R:R�R (((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR� s
	
	R@tStructOrUnionOrEnumcBs/eZdZdZd�Zd�Zd�ZRS(R+cCs0|jpd|j|jf}|d|_dS(Ns%s %sR
(t	forcenametkindR+R(RR+((s0/usr/lib64/python2.7/site-packages/cffi/model.pytbuild_c_name_with_markerDscCs||_|j�dS(N(R�R�(RR�((s0/usr/lib64/python2.7/site-packages/cffi/model.pytforce_the_nameHs	cCs#|jjd�st�|jd S(NR
i����(RtendswithR(R((s0/usr/lib64/python2.7/site-packages/cffi/model.pytget_official_nameLs(snameN(R-R.R)RyR�R�R�R�(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR�@s
		t
StructOrUnioncBsweZd
ZdZeZeZd
d�Zd�Z	d�Z
d�Zed�Zd�Z
d�Zd�Zd	�ZRS(icCs;||_||_||_||_||_|j�dS(N(R+tfldnamestfldtypest
fldbitsizetfldqualsR�(RR+R�R�R�R�((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR:Ws					cCs\|jdkrtSxBt|j|j�D]+\}}|dkr)t|t�r)tSq)WtS(NR	(R�RyRtzipR�t
isinstanceR�Rn(RR+ttype((s0/usr/lib64/python2.7/site-packages/cffi/model.pythas_anonymous_struct_fields_s"ccs�|j}|dkr+dt|j�}nx}t|j|j|j|�D]]\}}}}|dkr�t|t�r�x-|j	�D]}|Vq�WqJ||||fVqJWdS(NiR	(i(
R�RytlenR�R�R�R�R�R�t
enumfields(RR�R+R�tbitsizeRR((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR�gs	c	Cs�g}g}g}g}xT|j�D]F\}}}}|j|�|j|�|j|�|j|�q%Wt|�|_t|�|_t|�|_t|�|_dS(N(R�RvR7R�R�R�R�(	RtnamesttypestbitsizesR�R+R�R�R((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt
force_flattents


cCs5tj||||�}|s1|j||�n|S(N(R�R'tfinish_backend_type(RR"R#R$R%((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR'�s
	cCs�|jr5|jdkr1td|jf��ndS|j|}d|_|jdkr]nz|jdkr�g|jD]}|j||�^qv}tt	|j
||j��}d}|jr�d}n|j
j|||dd|�n�g}|j\}}	}
}x�tt|j
��D]y}|	|}
|j|}t|t�r�|jdkr�|jj||�}t|
|j|��\}}|dkr�|jd|j|j
|p�d	f�n|j|�}|j| |f|j|d|_n|j||�}t|t�r>|jdkr>|
dks�t�nK|j|�}||
kr�|jd
|j|j
|pxd	||
f�n|j|�qWtt	|j
||j|��}|j
j||||
|�d|_dS(Nis(recursive structure declaration for '%s'iiii����s...sfield '%s.%s' has a bogus size?s{}s=field '%s.%s' is declared as %d bytes, but is really %d bytes(t	completedRoR+RR�RytfixedlayoutR'tlistR�R�R�tpackedR�tcomplete_struct_or_uniontrangeR�R�R�R�R�tdivmodtsizeoft_verification_errorR�RRv(RR"R#R%R�R�tlsttsflagstfieldofst	fieldsizet	totalsizettotalalignmentRAtfsizetftypet	BItemTypetnlentnrestt
BFieldTypet	bitemsize((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR��s`	
	%		

!!
cCs ddlm}||��dS(Ni(R(RR(RtmsgR((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR��scCsD|jr@|jdkr@ddlm}|j|j���ndS(Ni(R(tpartialR�RyR	RtVerificationMissingR(RR((s0/usr/lib64/python2.7/site-packages/cffi/model.pytcheck_not_partial�scCs=|j�|j|�t||d|j|j�d|�S(Nsnew_%s_typetkey(R�RvR<R�R�(RR"R#((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR �s

N(R-R.RyR�R�RR�R�R:R�R�R�R'R�R�R�R (((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR�Qs		
		<		t
StructTypecBseZdZRS(tstruct(R-R.R�(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR��st	UnionTypecBseZdZRS(tunion(R-R.R�(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR��stEnumTypecBsJeZdZeZeZdd�Zd�Zd�Z	d�Z
d�ZRS(tenumcCs2||_||_||_||_|j�dS(N(R+tenumeratorst
enumvaluestbaseinttypeR�(RR+R�R�R�((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR:�s
				cCsKtj||�|jdkrG|j�}d|jdd�|_ndS(NR
Rt_(R�R�R�RyR�R(RR�R+((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR��scCs?|jr;|jr;ddlm}|j|j���ndS(Ni(R(R�tpartial_resolvedR	RR�R(RR((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR��sc
CsJ|j�|j||�}t||d|j�|j|j|d|�S(Nt
new_enum_typeR�(R�tbuild_baseinttypeR<R�R�R�(RR"R#t
base_btype((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR �s
	cCs�|jdk	r"|jj||�Sddlm}|jr\t|j�}t|j�}n-ddl}|j	d|j
��d}}|dkr�d}td�}td�}	nd}td�}td	�}	|j||�}
|	j||�}|j|
�}|j|�}
|dd
|d>krJ|dd
||>krJ|
S|dd
|
d>kr~|dd
|
|>kr~|S|j
d|j
���dS(Ni(R}i����s�%r has no values explicitly defined; next version will refuse to guess which integer type it is meant to be (unsigned/signed, int/long)iRCRDsunsigned ints
unsigned longis=%s values don't all fit into either 'long' or 'unsigned long'(R�RyR'R	R}R�tmintmaxtwarningstwarnRR>R�R~(RR"R#R}tsmallest_valuet
largest_valueR�tsignt
candidate1t
candidate2tbtype1tbtype2tsize1tsize2((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR�s:		
	N(R-R.R�RR�R�RyR:R�R�R R�(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR��s			cCsH|dkrd|}nt|ddd�}|j|�d|_|S(Ns$%stunknown_type(RyR�R�torigin(R+t
structnameR�((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR�%s

	cCs;|dkrd|}nt|ddd�}t||�S(Ns$$%s(RyR�R�(R+R�R�((s0/usr/lib64/python2.7/site-packages/cffi/model.pytunknown_ptr_type-s
c
Os2|jd||f�}|s%t�y|jj|SWnctk
rJnStk
r�t|jtj�r�t	j
�|j_q�t	j
�t|j�_nXyt|j|�|�}Wn,t
k
r�}t
d|||f��nX|jj}t�2|j|�}	|	dkr$|||<|S|	SWdQXdS(NR�s
%s: %r: %s(tpopRR�t__typecacheRR�R�R�t
ModuleTypetweakreftWeakValueDictionaryR�R*Rotglobal_locktgetRy(
tsrctypeR"tfuncnameRrtkwdsR�trestetcachetres1((s0/usr/lib64/python2.7/site-packages/cffi/model.pyR<6s*



cCstd|d|�S(Nt?R�(R<(R"R%((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt
pointer_cacheUscCsQ|jrMt|jd�tkrMd||jdff|jd|_ndS(Nis%s: %si(RrR�tstr(R�R+((s0/usr/lib64/python2.7/site-packages/cffi/model.pytattach_exception_infoXs"((R�tsysR�tlockRRRRRtobjectRR1R9t	void_typeR=R>RmRpRqR|RR�t
voidp_typeR�tconst_voidp_typeR�R�Rytchar_array_typeR�R�R�R�R�R�R�R�R<R�R�(((s0/usr/lib64/python2.7/site-packages/cffi/model.pyt<module>sF	
0
		F		�C