Your IP : 216.73.216.213


Current Path : /opt/alt/python27/lib64/python2.7/site-packages/cffi/
Upload File :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyc

�
.�Wc@s*ddlZddlZddlZddlZddlmZejdfkr[eZne	Z
eZe
Zd�Zdefd��YZdefd	��YZd
efd��YZdefd
��YZdefd��YZdefd��YZdefd��YZdefd��YZdS(i����Ni(tmodelicCs
t|g�S(N(tbytes(tnum((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt<lambda>
tt
CTypesTypecBseZRS((t__name__t
__module__(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRst
CTypesDatacBsdeZeZdgZdZd�Zed��Zed��Z	ed��Z
ed��Zed��Zedd	��Z
ed
��Zd�Zd�Zdd
�Zd�Zed��Zd�Zed��Zd�Zed��Zd�Zd�Zed�Zed�Zed�Zed�Zed�Zed�Z d�Z!d�Z"RS(t__weakref__s<cdata>cGstd|jf��dS(Nscannot instantiate %r(t	TypeErrort	__class__(tselftargs((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__init__scCstd|j�f��dS(Ns+expected a pointer or array ctype, got '%s'(R
t_get_c_name(tclstinit((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt_newpscCs
t�dS(N(R
(tvalue((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
_to_ctypesscGs}y
|j}Wn$tk
r3td|f��nX|rm|j|�}t||�sy|j|�}qyn|j�}|S(Nscannot create an instance of %r(t_ctypetAttributeErrorR
Rt
isinstance(RRtctypetres((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt_arg_to_ctypes s

cCs'|dkr|j�S|j|�SdS(N(tNoneR(RR((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt_create_ctype_obj.s
cCs
t�dS(N(R
(tctypes_value((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt_from_ctypes5sRcCs|jjd|�S(Ns &(t_reftypenametreplace(Rtreplace_with((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR9scCs9d|j�f|_d|j�f|_d|_dS(Ns	CData<%s>tffi(RRt__qualname__R(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
_fix_class=scCs
t�dS(N(tNotImplementedError(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
_get_own_reprCscCsI|dkrdS|dkr=|ddtjtj�>7}nd|SdS(NitNULLiis0x%x(tctypestsizeoftc_void_p(Rtaddress((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
_addr_reprFs
!cCs&|j�}d|p|j�|fS(Ns
<cdata %r %s>(R&R(Rtc_nametown((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__repr__NscCsN|dkr(td|j�f��n"td|j�|j�f��dS(Nscannot convert %r to an addressscannot convert %r to %r(RR
R(RtBClass((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt_convert_to_addressRs
cCstj|j�S(N(R(R)R(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt	_get_sizeZscCstj|j�S(N(R(R)R(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt_get_size_of_instance^scCstd|j�f��dS(Nscannot cast to %r(R
R(Rtsource((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
_cast_fromascCs
|jd�S(N(R1R(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt_cast_to_integerescCstj|j�S(N(R(t	alignmentR(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
_alignmenthscCstd|j���dS(Ns#cdata %r does not support iteration(R
R(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__iter__lscs+tt|���fd�}||_|S(Ncs6t|t�r.�|jd�|jd��StSdS(N(RRR1RtNotImplemented(Rtother(tcmpfunc(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytcmprs(tgetattrtoperatort	func_name(tnameR=((R<sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt	_make_cmpps	t__eq__t__ne__t__lt__t__le__t__gt__t__ge__cCs#tt|��t|jd��AS(N(thashttypeR1R(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__hash__�scCstd|f��dS(Nsstring(): %r(R
(Rtmaxlen((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
_to_string�sN(#RRRt
__metaclass__t	__slots__RtclassmethodRtstaticmethodRRRRRR$R&R,RR/R1R2R3R5R6R8R9RBRCRDRERFRGRHRKRM(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRs>										tCTypesGenericPrimitivecBs2eZgZd�Zd�Zd�Zd�ZRS(cCs
||kS(N((RR;((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRC�scCs
||k	S(N((RR;((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRD�scCs
tj|�S(N(tobjectRK(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRK�scCst|j|j��S(N(treprRt_value(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR&�s(RRRORCRDRKR&(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRR�s
			tCTypesGenericArraycBs/eZgZed��Zd�Zd�ZRS(cCs
||�S(N((RR((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�sccs*x#tt|��D]}||VqWdS(N(txrangetlen(Rti((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR9�scCs|jtj|j��S(N(R,R(t	addressoft_blob(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR&�s(RRRORPRR9R&(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRV�s	tCTypesGenericPtrcBs�eZddgZeZdZed��Zed��Zed��Z	d�Z
d�Zd�ZeZ
ed	��Zed
��Zed��Zd�ZRS(
t_addresst
_as_ctype_ptrtpointercCs
||�S(N((RR((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�scCs}|dkrd}n[t|t�r3|j�}n=t|ttf�rQ|}ntd|t|�jf��|j	|�S(Nisbad type for cast to %r: %r(
RRRR6tinttlongR
RJRt_new_pointer_at(RR4R+((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR5�s		cCs4|j|�}||_tj||j�|_|S(N(t__new__R]R(tcastRR^(RR+R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRb�s	cCs-y|j|j�SWntk
r(dSXdS(Ns???(R,R]R(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR&�s
cCs|jS(N(R](R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR6�scCs
t|j�S(N(tboolR](R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__nonzero__�scCsMt|t�s+tdt|�j��n|j|�}tj||j�S(Nsunexpected %s object(	RRR
RJRR1R(RdR(RRR+((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�scCs+tj|tj�jpd}|j|�S(Ni(R(RdR*RRb(Rt
ctypes_ptrR+((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�scCs"|r|j|�j|_ndS(N(Rtcontents(RRgR((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt_initialize�scCsB||jdfks'|js'|jr.|jStj||�SdS(N(RRt_automatic_castsR]RR1(RR0((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR1�s	(RRROtFalseRjtkindRPRR5RbR&R6Rft__bool__RRRiR1(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR\�s
			tCTypesBaseStructOrUnioncBskeZdgZed��Zd�Zed��Zd�Zed��Zed��Z	dd�ZRS(	R[cCstd|f��dS(Ns!cannot instantiate opaque type %s(R
(RR((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�scCs|jtj|j��S(N(R,R(RZR[(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR&�scCst|j|�jS(N(R>Rtoffset(Rt	fieldname((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt	_offsetof�scCs?t|dd�|jkr+tj|j�Stj||�SdS(Nt_BItem(R>RRR(RZR[RR1(RR0((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR1�scCs|j|�}||_|S(N(RcR[(Rtctypes_struct_or_unionR((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRs	cCs|jS(N(R[(RR((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRscCstj||p|jd��S(Ns &(RR/R(RR-((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR/
sN(RRRORPRR&RqR1RRRR/(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRn�s			t
CTypesBackendcBs�eZiejd6ejd6ejd6ejd6ejd6ejd6ej	d6ej
d6ejd6ejd	6ej
d
6ejd6ejd6ejd
6Zx�d
d	dddgD]�Zejee�Zeeedde<eejej�kreeed<neejej�kr�eeed<q�q�Wx�dddddgD]�Zejee�Zeeedde<eejej�kr�eeed<eeed<neejej�krIeeed<qIqIWd�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�Zd�Zd �Z d!�Z!d"d"dd#�Z"d$�Z#d%�Z$d&�Z%d'�Z&d"d(�Z'd"d)�Z(d*�Zd+�Z)d,�Z*d-�Z+d.�Z,d3Z.d/�Z/e0Z1d0�Z2dd1�Z3d3d2�Z4RS(4tchartshortR`Ras	long longssigned chars
unsigned charsunsigned shortsunsigned ints
unsigned longsunsigned long longtfloattdoublet_Boolsuint%d_tit	uintptr_ttsize_tsint%d_ttintptr_tt	ptrdiff_ttssize_tcCs.d|_d|_tj|_tj|_dS(Ni(t	RTLD_LAZYtRTLD_NOWR(tRTLD_GLOBALt
RTLD_LOCAL(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR4s		cCs
||_dS(N(R"(RR"((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytset_ffi:scCs
ttfS(N(RR(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
_get_types=sicCstj||�}t||�S(N(R(tCDLLt
CTypesLibrary(Rtpathtflagstcdll((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytload_library@scCs$dtfd��Y}|j�|S(Nt
CTypesVoidcBs2eZgZdZed��Zed��ZRS(svoid &cSsdS(N(R(tnovalue((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRHscSs/|dk	r+tdt|�jf��ndS(NsNone expected, got %s object(RR
RJR(R�((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRKs(RRRORRQRR(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�Es(RR$(RR�((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
new_void_typeDs
cs��dkrt���n|j���dkr=d}nZ�dkrRd}nE�dkrgd}n�dkr|d	}nd
}�d�jdk��fd��|�d
tf������fd��Y��j��S(Ntwchar_tRuRwRxssigned chars
unsigned chartbyteRyReR`i����cs�t|tttf�r't|�}npt|t�rE|j�}nRt|t�rct|�}n4|dkrxd}nt	d�t
|�jf��|S(Nisbad type for cast to %r: %r(RR`RaRwRR6RtordRR
RJR(R4(tCTypesPrimitive(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt_cast_source_to_intes	R�cseZdgZ�Zd�Z�Zd�Ze��fd��Zedks^edkr�e	��fd��Z
d�Znedkr�e	�fd	��Z
d
�Znedkr�e	�fd��Z
d
�Znedkre	��fd��Z
d�Zd�ZneZ
edks?edks?edkr]e���fd��Znedkr�e�fd��Zd�Zn	d�ZeZedkr�e�fd��Zned��Ze�fd��Zedkr�d�Znedkrd�ZnRS(RUs%s &cSs
||_dS(N(RU(RR((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRzscs&|dkr��S��j|��S(N(RR(R(R�R(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR}sR`R�cs%�|�}�|�j}||�S(N(R(RR4(R�R(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR5�scSs|jS(N(RU(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__int__�sRecs7t|tttf�s'�|�}n|t|��S(N(RR`RaRwRe(RR4(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR5�scSs|jS(N(RU(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR��sRucs&�|�}t|d@�}||�S(Ni�(tbytechr(RR4(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR5�scSs
t|j�S(N(R�RU(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR��sRwcsst|t�rnHt|t�rNt|d�r?t|�}qZt|�}n�|�}�|�j}||�S(Nt	__float__(RRwRRthasattrR`R(RR4(R�R(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR5�scSs
t|j�S(N(R`RU(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR��scSs|jS(N(RU(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR��scs�t|ttf�sOt|t�r3t|�}qOtdt|�j��n�|�j|kr��r�|dkr�td���q�td���n|S(Nsinteger expected, got %sis%s: negative integers%s: integer out of bounds(	RR`RaRR
RJRRt
OverflowError(tx(Rt	is_signedRA(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�s
csXt|t�r%t|�dkr%|St|��r;|jStdt|�j��dS(Nischaracter expected, got %s(RRRXRUR
RJR(R�(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�s!cSst|j�dkS(Ni(R�RU(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRf�scSs
|jdkS(Ni(RU(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRf�scsDt|ttttf�s7tdt|�j��n�|�jS(Nsfloat expected, got %s(	RR`RaRwRR
RJRR(R�(R(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�scSst|d|�S(NR(R>(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�scs�j|�|_dS(N(RR(tblobR(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRi�scSs|jS(N(RU(RRL((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRM�scSst|jd@�S(Ni�(tchrRU(RRL((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRM�s(RRRORRRlRRQRRPR5R�R�R6RRfRmRRiRM((R�R�RR�tkind1RA(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�tsF	
	
	$	(RwRx(ssigned chars
unsigned char(R%tPRIMITIVE_TYPESRRRR$(RRARl((R�R�RR�R�RAsF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytnew_primitive_typeTs$
				+w
cs|jj}�|tjd��kr0d�n]�|tjd��|tjd��fkrid�n$�|tj�kr�d�nd�dtf���fd	��Y��|jjtj�ks��|jjtjd��kr�t�_n�j��S(
NRutcharpssigned chars
unsigned chartbyteptvoidptgenerict	CTypesPtrcsGeZdgZ�dkr+edg7Zn�Ze�d�rgej�j�Zej�j�Z	n	ej
Ze�e�r��j
d�Zn�j
d�Z��fd�Zd�Zd�Z�fd	�Z�fd
�Z�dks��dkre�fd��Zn�dks*�d
kr6d�Zn�fd�ZRS(t_ownR�t__as_strbufRs(* &)s * &cs��j|�}�dkrRtj|jd�|_tj|j|j�|_ntj|�|_tj|jtj	�j|_
t|_dS(NR�s(
RR(tcreate_string_bufferRt_CTypesPtr__as_strbufRdRR^R_R*R]tTrueR�(RRtctypeobj(tBItemRl(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR	scSs8t|ttf�r0|j|j||j�StSdS(N(RR`RaRbR]t_bitem_sizeR:(RR;((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__add__scSset|ttf�r0|j|j||j�St|�t|�kr]|j|j|jStSdS(N(RR`RaRbR]R�RJR:(RR;((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__sub__scs;t|dt�r'|dkr't�n�j|j|�S(NR�i(R>Rkt
IndexErrorRR^(Rtindex(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__getitem__&s	cs�j|�|j|<dS(N(RR^(RR�R(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__setitem__+sR�csD|r*t|dt�r*tj|d�St�|�j|�SdS(Ni(RRR(tc_char_ptsuperR(RR(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR/sR�cSs�|dkrtj}ntj|jtjtj��}d}x*||krk||dkrk|d7}qBWdjgt|�D]}||^q�S(NisiR(	tsystmaxsizeR(RdR^tPOINTERtc_chartjointrange(RRLtptnRY((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRM7scs?t|dt�r,dtj|jj�fSt�|�j�S(NR�sowning %d bytes(R>RkR(R)R^RhR�R&(R(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR&As(RRRORrR�R(R�RR)R�R*t
issubclassRVRRRR�R�R�R�RPRRMR&((R�R�Rl(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR��s*		
			
(	R"t_get_cached_btypeRt
PrimitiveTypet	void_typeR\R�RjR$(RR�tgetbtype((R�R�RlsF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytnew_pointer_type�s			"M!
cs��dkrd�n
d���j�|jj}�|tjd��krXd�n?�|tjd��|tjd��fkr�d�nd�dtf������fd	��Y��j��S(
Ns &[]s &[%d]Russigned chars
unsigned charR�R�tCTypesArraycs6eZddgZ�dk	r.�j�Zn
ejd��j��Z�Z�Z	���fd�Z
e�fd��Zd�Z
�fd�Z�fd�Z�dks��d	kr�d
�Zn�fd�Z�fd�Ze�fd
��Ze�fd��Z��fd�Zed��ZRS(R[R�Rcs��dkr�t|ttf�r0|}d}nF�dkr^t|t�r^t|�d}nt|�}t|�}�j||_n|j�|_t	|_
|dk	r�|j|j|�ndS(NRui(RRR`RaRRXttupleRR[R�R�Ri(RRtlen1(R�Rltlength(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRgs		cs�t|t�rBgtt|��D]}|||d!^q"}nt|�}t|�t|�krutd��ntj|tj�j	}tj
�j�}tj�j�}xGt
|�D]9\}}tj||||�}�j|j|�q�WdS(Nistoo many initializers(RRR�RXR�R�R(RdR*RR�RR)t	enumerateRiRh(R�RRYtaddrtPTRtitemsizeRR�(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRiws3cSs
t|j�S(N(RXR[(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__len__�scsBd|ko t|j�kns.t�n�j|j|�S(Ni(RXR[R�R(RR�(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR��s%	csHd|ko t|j�kns.t�n�j|�|j|<dS(Ni(RXR[R�R(RR�R(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR��s%	RuR�cSs�|dkrt|j�}ntj|jtjtj��}d}x*||krq||dkrq|d7}qHWdjgt|�D]}||^q��S(NisiR(RXR[R(RdR�R�R�R�(RRLR�R�RY((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRM�scs<t|dt�r)dtj|j�fSt�|�j�S(NR�sowning %d bytes(R>RkR(R)R[R�R&(R(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR&�scs?|�dfks|jr+tj|j�Stj||�SdS(N(RRjR(RZR[RR1(RR0(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR1�scs�j��}||_|S(N(RcR[(tctypes_arrayR(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�s	cs
�j|�S(N(R(R(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�scsJt|ttf�rB�jtj|j�|tj�j��St	SdS(N(
RR`RaRbR(RZR[R)RR:(RR;(R�R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR��s
cSstd|j�f��dS(Ns
casting to %r(R%R(RR4((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR5�sN(RRRORRtappendRRt_declared_lengtht_CTPtrRRQRiR�R�R�RMR&R1RRR�RPR5((R�R�R�tbracketsRlR�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�]s(
	
(RRrR"R�RR�RVR$(RR�R�R�((R�R�R�R�RlR�sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytnew_array_typeNs	
			+c
cs_d|fd��Y�d|�f�_|�dtf���fd��Y}|j�|S(Ntstruct_or_unioncBseZRS((RR(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR��ss%s_%stCTypesStructOrUnioncs.eZdgZ�Zd�fZ�ZZRS(R[s%s &(RRRORRt_kindRl((R�RAR�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR��s	
(RRnR$(RRlRAtbase_ctypes_classR�((R�RAR�sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt_new_struct_or_union�s"
cCs|jd|tj�S(Ntstruct(R�R(t	Structure(RRA((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytnew_struct_type�scCs|jd|tj�S(Ntunion(R�R(tUnion(RRA((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytnew_union_type�si����csL|dks|dkr'td��n�j�g|D]\}}}	|^q7�g|D]\}}}	|^qY}
g|D]\}}}	|	^q{}i}g}
xi|D]a\}}}	|	dkr�|
j||jf�|||<q�|
j||j|	f�t||<q�W|d@r$d�_n|
�_|�_t��fd��}|�_����fd���j	dk�t
t�t|
|����x*|D]"\}}}	|dkr�td	��nt�|�r�t
d
|��n|	dkr�||�j|�tj|j�d�}||d�}t|t�r�d}|jdkr�||j�j|�tj|j�d
�}q�q�n||d�}||d�}t�|t||��q�W|jjtj|��}xa�D]Y}t||�rt
d
|��n|d�}|d�}t||t||��q�WdS(Nis�the ctypes backend of CFFI does not support structures completed by verify(); please compile and install the _cffi_backend module.iics)��}|dk	r%�||�n|S(N(R(Rtresult(t
initializeR�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�s	c
sa�r7t|�dkr7tdt|�f��q7nt|t�s�t|ttf�rjtd��nt|�}t|�t��kr�td�j���ntt	�|��}nt
j|�}x�|j�D]~\}}�|\}}|dkst
d���j|�}t
j|j�}t
j|||�}	|j|	j|�q�WdS(NisPunion initializer: %d items given, but only one supported (use a dict if needed)sunion initializer: got a strs"too many values for %s initializeris,not implemented: initializer with bit fields(RXt
ValueErrorRtdictRtunicodeR
R�RtzipR(RZtitemstAssertionErrorRqR�RRdRiRh(
R�RR�tfnameRtBFieldtbitsizeRoR�R�(R�tfnamestis_uniontname2fieldtype(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR��s*	R�Rsnested anonymous structs/unionss1the field name %r conflicts in the ctypes backendcSs8tj|j�}tj|||�}|j|j�S(N(R(RZR[RdRRh(RR�R�RoR�R�R�((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytgetterscSs t|j||j|��dS(N(tsetattrR[R(RRR�R�((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytsetter!scSs5tj|j�}tj|||�}|j|�S(N(R(RZR[RdR(RR�t	BFieldPtrRoR�R�R�((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�'scSs|jt|j|��S(N(RR>R[(RR�R�((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�/scSsr|j|�}t|j|�}t|j||�|t|j|�krnt|j||�td��ndS(Nsvalue too large for bitfield(RR>R[R�R�(RRR�R�toldvalue((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�1scSst|d|�S(Ni(R>(RR�((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�@scSst|d||�dS(Ni(R�(RRR�((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�Bs(R%RR�tEllipsist_pack_t_fields_t
_bfield_typesRQRR�R�R�R�R�RqR(R�R�RVRR�R�R�tpropertyR"R�RtPointerType(RR�tfieldsttpt	totalsizettotalalignmenttsflagsR�R�R�tbtypest	bitfieldstbfield_typestcfieldsRR�R�R�((R�R�R�R�R�R�sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytcomplete_struct_or_union�sf	"""

			
	!

cszg�D]}|j�^q��r5�jd�ndj���dtf�����fd��Y��j��S(Ns...s, tCTypesFunctionPtrcs�eZddgZeje�dd
�deg�D]Zej	^q4�Z	�j
d�f�Zd
����fd�Ze
d��Zd�Z�fd�Z���fd	�ZRS(t
_own_callbackt_nameRt	use_errnos	(* &)(%s)cs�ddl��std��t�dd�dk	rR�j�j����nd������fd�}t�t�r�tj	tj
dtg�D]}|j^q��}n	�j}||�|_
tj|j
tj
�j|_�|_dS(Ni����s#varargs not supported for callbacksRcs�g}x3t|��D]"\}}|j|j|��qWy�|�}�j|�}Wn�j��}nXt�t�r�|r�tj|tj	�j
}q�d}n|S(N(R�R�RRt	print_excR�R\R(RdR*RR(R
targs2targtBArgtres2(tBArgstBResultterrorRt	traceback(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytcallback\s

	R(RR�R>RRRR�R\R(t	CFUNCTYPER*R�RR^RdRR]R(RRR
RRtcallback_ctype(RR	R�thas_varargs(R
RRsF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRSs 	%	cSs|rtd��ndS(NsActypes backend: not supported: initializers for function pointers(R%(RgR((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRi|scSsvt|dd�}|rf|jjd�}|j|ddkrNd|}n|jjd|�}ntj||�S(NRs(* &)is )*t (R>RRR�R RR/(RR-RY((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR/�s
cs9t|dd�dk	r&d|jfSt�|�j�S(NRs
calling %r(R>RRR�R&(R(R�(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR&�scs`�rGt|�t��ks$t�|t��}|t�� }nt|�t��kset�g}x3t|��D]"\}}|j|j|��q{W�rDx�t|�D]�\}}|dkr�|jtjd��q�nt	|t
�s'tddt��|t|�j
f��n|j|j|��q�Wn|j|�}�j|�S(NisKargument %d passed in the variadic part needs to be a cdata object (got %s)i(RXR�R�R�RR�RR(R*RRR
RJRR^R(RR
t	extraargstctypes_argsRRRYR�(RR	R(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt__call__�s(*N(RRROR(R
R>RR�RRRRRRQRiR/R&R((RR	R�Rtnameargs(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�Ls")		(RR�R�R\R$(RRR	RR((RR	R�RRsF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytnew_function_typeFs(\
csct�t�st�ttt|�t|����d|f��fd��Y}|j�|S(Nt
CTypesEnumcs6eZgZd�Z�fd�Z�fd�ZRS(s%s &cs>|j}yd|�|fSWntk
r9t|�SXdS(Ns%d: %s(RUtKeyErrortstr(RR(treverse_mapping(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR&�s
	
cs4|j}y�|SWntk
r/t|�SXdS(N(RURR(RRLR(R(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRM�s
	
(RRRORR&RM((RAR(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�s
(RRR�R�R�treversedR$(RRAtenumeratorst
enumvaluest	CTypesIntR((RARsF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
new_enum_type�s
cCs
tj�S(N(R(t	get_errno(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�scCstj|�dS(N(R(t	set_errno(RR((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR �scCs
|j|�S(N(RM(RtbRL((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytstring�scCstd��dS(Nsbuffer() with ctypes backend(R%(Rtbptrtsize((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytbuffer�scCs<t|t�r|j�St|t�s.t�|j�SdS(N(RRR3R�R�R2(Rtcdata_or_BType((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR)�s
cCst|t�st�|j�S(N(R�RR�R8(RtBType((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytalignof�scCs%t|t�st�n|j|�S(N(R�RR
R(RR'R4((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytnewp�s	cCs
|j|�S(N(R5(RR'R4((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRd�scCs|dkst�|||�S(N(RR�(RR'R4R
tonerror((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�scs�|jdkrFddl}d|jfd��Y}i|f|_n|j\�}|dkr�y�||�=Wntk
r�td��nXdS�fd�}|j|j|�|�}||k	s�t�||f�|||�<|S(Ni����tMyRefcBs#eZd�Zd�Zd�ZRS(cSs.|�}||kp-|dk	o-||�kS(N(R(RR;tmyref((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRC�s	cSs||kS(N((RR;((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRD�scSs9y|jSWn'tk
r4t|��|_|jSXdS(N(t_hashRRI(R((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRK�s

(RRRCRDRK(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR+�s		sFCan remove destructor only on a object previously returned by ffi.gc()cs5�j|d�\}}|dk	r1||�ndS(N(NN(tpopR(tktcdatat
destructor(t
weak_cache(sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytremoves(	t_weakref_cache_refRtweakreftrefRR
RdttypeofR�(RR0R1R5R+R3t	new_cdata((R2sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytgcp�s 

cCs
|j|�S(N(R(RR'R!((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytgetcnamescCs.t|t�r�|dkr6t|t�r6|j}nt|t�sTtd��n|j|}|tkr|td��n||j	|�fSt|t
tf�rt|t�r�|j
}nt|t�s�td��n|j}|j�|}|tjkrt�n||fStt|���dS(Nis expected a struct or union ctypesnot supported for bitfieldssexpected an array or ptr ctype(RRR�R\RrRnR
R�R�RqR`RaRVR�R2R�R�R�RJ(RR'RpRR�R�Ro((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyttypeoffsetofs(
		
cCst|t�r0tjt|�j|��}n�t|t�r�|dksdtt|�j	t�rst
d��nt|�j|�}n3t|t�r�t|�j|�}nt
d��|r�tjtj
tj|tj
�j|�t|��}n|j|�S(Nsunexpected cdata types$expected a <cdata 'struct-or-union'>(RRnR(R_RJRR\RR�RrR
RVRdR*RR(RtBTypePtrR0Rotptr((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytrawaddressof+s !
N(5RRR(R�tc_shorttc_inttc_longt
c_longlongtc_bytetc_ubytetc_ushorttc_uinttc_ulongtc_ulonglongtc_floattc_doubletc_boolR�RR)t_sizeR*tc_size_tRR�R�R�R�R�R�R�R�R�R�R�RRRR R"R%R(R)RdRRR4R9RJR7R:R;R>(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRtsx













						�	`	u			l	e									%	R�cBs,eZd�Zd�Zd�Zd�ZRS(cCs||_||_dS(N(tbackendR�(RRNR�((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyRAs	cCs.t|j|�}|j|�}||_|S(N(R>R�RR(RR'RAtc_functfuncobj((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
load_functionEs	cCsKy|jj|j|�}Wntk
r=}t|��nX|j|�S(N(Rtin_dllR�RR%R(RR'RAt
ctypes_objte((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt
read_variableKs
cCs\|j|�}|jj|j|�}tjtj|�tj|�tj|j��dS(N(RRRRR�R(tmemmoveRZR)(RR'RARtnew_ctypes_objRS((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pytwrite_variableRs
(RRRRQRURX(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyR�?s			(R(tctypes.utilR?R�RRtversion_infoR�R�RR�R`RaR�RWRJRRSRRRRVR\RnRtR�(((sF/opt/alt/python27/lib64/python2.7/site-packages/cffi/backend_ctypes.pyt<module>s$0		zC#���4