Viewing File: /usr/lib64/python2.7/site-packages/cffi/recompiler.pyo


pWc@srddlZddlZddlZddlmZmZddlTdZdZdfdYZ	d	fd
YZ
dfdYZd
fdYZdfdYZ
dfdYZejdfkrejZndejfdYZdZedZedZdZdZdZdZdZdeededed Zd!ZdS("iNi(tffiplatformtmodel(t*t0x2601t0x2701t
GlobalExprcBs)eZdddZdZdZRS(icCs1||_||_||_||_||_dS(N(tnametaddressttype_optsizetcheck_value(tselfRRRR	R
((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt__init__
s
				cCs&d|j|j|jj|jfS(Ns'  { "%s", (void *)%s, %s, (void *)%s },(RRRt	as_c_exprR	(R((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR
scCs d|jj|j|jfS(Ns
b'%s%s',%d(Rtas_python_bytesRR
(R((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pytas_python_exprs(t__name__t
__module__RR
R(((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR	s	t	FieldExprcBs,eZdZdZdZdZRS(cCs1||_||_||_||_||_dS(N(Rtfield_offsett
field_sizetfbitsizet
field_type_op(RRRRRR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRs
				cCsOdt|j}d|j|jfd||jfd||jjfS(Nt s  { "%s", %s,
s     %s   %s,
s     %s   %s },(tlenRRRRR
(Rtspaces((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR
!s$cCs
tdS(N(tNotImplementedError(R((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR'scCsb|jjtkrd}n*|jjtkr?t|j}ntd|jj||jfS(Nts	b'%s%s%s'(	RtoptOP_NOOPtOP_BITFIELDtformat_four_bytesRRRR(Rt	size_expr((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pytas_field_python_expr*s	(RRRR
RR!(((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRs			tStructUnionExprcBs#eZdZdZdZRS(c		CsL||_||_||_||_||_||_||_||_dS(N(Rt
type_indextflagsR	t	alignmenttcommenttfirst_field_indextc_fields(	RRR#R$R	R%R&R'R(((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR6s							cCsfd|j|j|jfd|j|jfd|jt|jf|jr]d|jnddS(Ns  { "%s", %d, %s,s

    %s, %s, s%d, %d s	/* %s */ Rs},(	RR#R$R	R%R'RR(R&(R((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR
AscCsct|jt}g|jD]}|j^q}dt|jt||jdj|fS(Ns(b'%s%s%s',%s)t,(	tevalR$tG_FLAGSR(R!RR#Rtjoin(RR$tc_fieldtfields_expr((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRHs	(RRRR
R(((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR"5s		tEnumExprcBs#eZdZdZdZRS(cCs1||_||_||_||_||_dS(N(RR#R	tsignedtallenums(RRR#R	R0R1((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRSs
				cCs&d|j|j|j|j|jfS(Ns1  { "%s", %d, _cffi_prim_int(%s, %s),
    "%s" },(RR#R	R0R1(R((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR
ZscCswitd6td6td	6td
6td6td6td
6td6|j|j	f}dt
|jt
||j|j
fS(Niiiiisb'%s%s%s\x00%s'(ii(ii(ii(ii(ii(ii(ii(ii(t
PRIM_UINT8t	PRIM_INT8tPRIM_UINT16t
PRIM_INT16tPRIM_UINT32t
PRIM_INT32tPRIM_UINT64t
PRIM_INT64R	R0RR#RR1(Rt
prim_index((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR_s	(RRRR
R(((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR/Rs		tTypenameExprcBs#eZdZdZdZRS(cCs||_||_dS(N(RR#(RRR#((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRks	cCsd|j|jfS(Ns  { "%s", %d },(RR#(R((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR
oscCsdt|j|jfS(Nsb'%s%s'(RR#R(R((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRrs(RRRR
R(((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR;js		t
RecompilercBseZdZedZdZdZdZddddd	gZd
Z	ddZ
d
ZdZdZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd ZdKd!Z d"Z!d#Z"e"Z#d$Z$d%Z%e%Z&d&Z'e'Z(d'Z)d(Z*d)Z+dKd*dKd+Z,d,Z-d-Z.d.Z/d/Z0dKd0Z1d1Z2d2Z3d3Z4d4Z5d5Z6d6Z7d7Z8d8Z9d9Z:d:Z;e;Z<Z=d;Z>d<Z?d=Z@d>ZAd?ZBeBZCZDd@ZEdAZFdBZGdCZHdDZIdEZJdFZKeKZLeKZMdGZNdHZOdIZPePZQdJZRRS(LicCs||_||_||_dS(N(tffitmodule_namettarget_is_python(RR=R>R?((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR|s		cCsi|_|jdt|jdt}g|_x|D]}|jr;t|j|j|<|jj|xM|jD]B}|j|dkrt|j|j|<n|jj|qzW|jjdq;q;Wx|D]w}|jr|j|dkrt|j|j|<|jj||j
rU|jdk	rU|jjdqUqqWi|_i|_
xR|D]J}t|tjrd|j|<qrt|tjrrd|j
|<qrqrWx9tt|jddD]\}}||j|<qWx9tt|j
ddD]\}}||j
|<qWx;|D]3}t|d|jj}|||j|q?Wx|jD]}qWt|j|_dS(NtcollecttypetkeytENDtLENcSs|jS(N(R(ttp((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt<lambda>scSs|jS(N(R(RD((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyREst_emit_bytecode_(t
_typesdictt	_generatetsortedtstrt
cffi_typestis_raw_functionRtappendtargstNonet
is_array_typetlengtht_struct_unionst_enumst
isinstanceRt
StructOrUniontEnumTypet	enumeratetgetattrt	__class__Rttuple(Rt	all_declsRDttp1titmethodR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pytcollect_type_tablesL	
	
	
		

cCs6t|tjsFt|trBx|D]}|j|q(WndS||jkr2d|j|<t|tjr|j|jq2t|tj	r|j
dk	r/||jjj
kr/x?|jD].\}}}}|j|j|||qWq/q2x*|jD]\}}|j|qWndS(N(RTRtBaseTypeByIdentityRZt_do_collect_typeRGROtFunctionPtrTypetas_raw_functionRUtfldtypesR=t_parsert_included_declarationst
enumfieldst_field_typet
_get_items(RRDtxtname1R\t_((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRas 

&c
Cs|jjjj}xt|D]\}\}}|jdd\}}yt|d||f}Wn$tk
rtj	d|nXy||_
|||Wq"tk
r}	tj
|	|q"Xq"WdS(NRis_generate_cpy_%s_%ss"not implemented in recompile(): %r(R=Ret
_declarationstitemsRItsplitRXtAttributeErrorRtVerificationErrort_current_qualst	ExceptionRtattach_exception_info(
Rt	step_nametlstRRDtqualstkindtrealnameR^te((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRHs
	tglobaltfieldtstruct_uniontenumttypenamecCsi|_x|jD]}g|j|<qWt|_|jd|jxS|jD]H}|j|}|dkr|jddnt||j|<qWW|jd}x|jj	D]\}}qW|jd}x|j
j	D]\}}qWdS(NtctxR|RAcSs|jS(N(R(tentry((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyREsR}R~(t_lstst	ALL_STEPStsett_seen_struct_unionsRHt_add_missing_struct_unionstsortRZRRRnRS(RRuRvRDR]((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pytcollect_step_tabless$	




RcCs|jj|ddS(Ns
(t_ftwrite(Rtwhat((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_prntscCs-|jr|j|n|j||dS(N(R?twrite_py_source_to_ftwrite_c_source_to_f(Rtftpreamble((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pytwrite_source_to_fs	cCsDttjjtjjt|d}|j}|j|S(Ntr(topentostpathR,tdirnamet__file__t	readlinestclose(Rtfilenametgtlines((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_rel_readlines
s*
cCs>||_|j}|jd}|jd}|jd|||d+|dj||jjdd}|jjdk	r?|d|jf|d	|j
|jjf|d
|d|f|d|d
|f|d|d|f|d|jd}|dj|t}nt}|d|||||d||dt
g|jjD]\}}||f^q}	xct|jD]R\}}
d}||	krd|	|j}n|d||
j|fqW|js2|dn|d|t|_|jdi}x|jD]|}
|j|
}t|||
<||
dkrl|d|
|
fx|D]}||jqW|d|qlqlW|jjr|dx|jjD]|}y|jd \}}Wn-tk
r[tjd|j|fnX|dkrztjdn|d|fqW|d |d|n|d!|d"x@|jD]5}
||
dkr|d#|
q|d$|
qWx8|jD]-}
|
d%kr|d&||
|
fqqW|jjrX|d'n
|d(|d)t|jfd}|jr|dO}n|d*||d||d
|d+|d,|f|d-|jr|d.|d/|d0n|d1||d2|d3|d4|d5|d6|d7|f|d8|d9|f|d:|d:|d|d+|d;|f|d-|d<|j|f|d3|d|d+|d=|f|d-|d>|j|f|d3|ddS(?Ns_cffi_include.hs#include "parse_c_type.h"
sparse_c_type.hiRt.is#define _CFFI_MODULE_NAME  "%s"s%#define _CFFI_PYTHON_STARTUP_CODE  %ss#ifdef PYPY_VERSIONs5# define _CFFI_PYTHON_STARTUP_FUNC  _cffi_pypyinit_%ss#elif PY_MAJOR_VERSION >= 3s-# define _CFFI_PYTHON_STARTUP_FUNC  PyInit_%ss#elses*# define _CFFI_PYTHON_STARTUP_FUNC  init%ss#endifs_embedding.hs>/************************************************************/sstatic void *_cffi_types[] = {s // s/* %2d */ %s,%ss  0s};tdeclis.static const struct _cffi_%s_s _cffi_%ss[] = {s.static const char * const _cffi_includes[] = {isQffi object %r includes %r, but the latter has not been prepared with set_source()sMnot implemented yet: ffi.include() of a Python-based ffi inside a C-based ffis  "%s",s  NULLs?static const struct _cffi_type_context_s _cffi_type_context = {s  _cffi_types,s  _cffi_%ss,s  NULL,  /* no %ss */R|s  %d,  /* num_%ss */s  _cffi_includes,s  NULL,  /* no includes */s  %d,  /* num_types */s  %d,  /* flags */tPyMODINIT_FUNCs"_cffi_pypyinit_%s(const void *p[])t{s%    if (((intptr_t)p[0]) >= 0x0A03) {sQ        _cffi_call_python_org = (void(*)(struct _cffi_externpy_s *, char *))p[1];s    }s    p[0] = (const void *)%s;s    p[1] = &_cffi_type_context;t}s#  ifdef _MSC_VERs     PyMODINIT_FUNCs#  if PY_MAJOR_VERSION >= 3s%     PyInit_%s(void) { return NULL; }s#  elses     init%s(void) { }s#  endifsPyInit_%s(void)s3  return _cffi_init("%s", %s, &_cffi_type_context);sinit%s(void)s,  _cffi_init("%s", %s, &_cffi_type_context);( RRRtindexR,R>RoR=t
_embeddingROt_string_literaltVERSION_EMBEDDEDtVERSIONtdictRGRnRWRKt_get_c_nameR
Rt_seen_constantsRHRRRt_included_ffist_assigned_sourceRpRRqt
_num_externpy(RRRtprntRR]tbase_module_nametversionRDttypeindex2typeRR&tnumsRuRvRtffi_to_includetincluded_module_nametincluded_sourceR$((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRs		



	



4!	














	




	


















cCst|trd|fSt|ttfrg|D]}|j|^q6}t|dkrs|jdnddj|fS|jS(Nsb'%s'iRs(%s)R)(	RTRJtlistRZt_to_pyRRMR,R(RRjtitemtrep((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRs"cCsH||_|j}|d|dt|jjp8d}xt|D]}|jj|}y|jd \}}Wn-tk
rtj	d|j|fnX|dk	rtj	dn|d||fqKW||d|jf|dtft
|j|_g|jD]}|j^q&}	|d	|jd
j|	ftg|jjD]\}
}||
f^qt}x\|jD]Q}|j|}
t|
dkr|dkr|d
||j|
fqqW|dkr:|ddjgt|D]}d|^qfn|ddS(Ns# auto-generated filesimport _cffi_backendisQffi object %r includes %r, but the latter has not been prepared with set_source()sMnot implemented yet: ffi.include() of a C-based ffi inside a Python-based ffisfrom %s import ffi as _ffi%dsffi = _cffi_backend.FFI('%s',s    _version = %s,s    _types = %s,RiR|s    _%ss = %s,s    _includes = (%s,),s, s_ffi%dt)((RRRR=RtrangeRRpRRqROR>RRZRKRRR,RRGRnRR(RRRtnum_includesR]RRRRt	types_lstRDRRuRv((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRs@		


"#4
$4cCs|j|S(N(RG(Rttype((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_gettypenumscCsd}t|tjr|jrI|jdkrId}d|j}nSt|tjrtd|jdf}n(d|jd|jjddf}d	}nt|tjr|j	||||dSt|tj
tjfr$|jd
||j
||f|jd|dSt|tjred|jd}d
|j
|}d}nt||jd||||f|jd||jd|f|jd|dS(NRt_Boolt_cffi_to_c_ints, %ss(%s)_cffi_to_c_doubles(%s)_cffi_to_c_%sRRls-1s6  if (_cffi_to_c((char *)&%s, _cffi_type(%d), %s) < 0)s    %s;s(%s)_cffi_to_c_pointers, _cffi_type(%d)tNULLs  %s = %s(%s%s);s'  if (%s == (%s)%s && PyErr_Occurred())(RTRtBasePrimitiveTypetis_integer_typeRtUnknownFloatTypet
get_c_nametreplacetPointerTypet"_convert_funcarg_to_c_ptr_or_arrayRURVRRRbR(RRDtfromvarttovarterrcodetextraargt	converterterrvalue((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_convert_funcarg_to_cs8	
			cCs&t|tjr"|jdndS(NsPy_ssize_t datasize(RTRRtadd(RRDt	localvars((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_extra_local_variablesscCs|jd|jd|j|||f|jd|jd|jd||jd||jdf|jd|f|jd	||j||f|jd||jd
dS(Ns1  datasize = _cffi_prepare_pointer_call_argument(s(      _cffi_type(%d), %s, (char **)&%s);s  if (datasize != 0) {s    if (datasize < 0)s	      %s;s&    %s = (%s)alloca((size_t)datasize);Rs,    memset((void *)%s, 0, (size_t)datasize);sL    if (_cffi_convert_array_from_object((char *)%s, _cffi_type(%d), %s) < 0)s  }(RRR(RRDRRR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRs
	

		cCst|tjr|jr/d||jfSt|tjrLd|fS|jdkrxd|jjdd|fSd||j|fSnt|tjtj	frd||j|fSt|tj
rd||jtj|jfSt|tjrP|j
dkr9td	|j|fnd
||j|fSt|tjryd||j|fSt|dS(Ns_cffi_from_c_int(%s, %s)s_cffi_from_c_double(%s)slong doubles_cffi_from_c_%s(%s)RRls/_cffi_from_c_deref((char *)&%s, _cffi_type(%d))s0_cffi_from_c_pointer((char *)%s, _cffi_type(%d))s!'%s' is used as %s, but is opaques0_cffi_from_c_struct((char *)&%s, _cffi_type(%d))(RTRRRRRRRRRbt	ArrayTypeRt
StructTypetfldnamesROt	TypeErrorRRVR(RRDtvartcontext((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_convert_expr_from_c,s2 cCs|j|dS(N(Ra(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt!_generate_cpy_typedef_collecttypeLscCsdS(N((RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_typedef_declOscCs.|j|}|jdjt||dS(NR(RGRRMR;(RRDRR#((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_typedef_ctxRs
cCs|j||t|dddkrD|j||jddn=t|tjr|j|j|jjd|jd|ndS(Ntorigintunknown_typet
approxnamet	named_ptr(	RRXROt_struct_ctxRRTRtNamedPointerTypettotype(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_typedef_ctxVs!cCs:|j|j|jr6|jr6|j|ndS(N(RaRctellipsisR?(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt"_generate_cpy_function_collecttypeascCs|jr|j||dS|j}t|j}|dkrJd}n|dkr_d}nd}g}g}d|}xKt|jD]:\}	}
|j|
jd|	||jd|	qWd	j|}|pd
}|j	r|j	d}nd}d
|||f}
|d|j
j|
f|dd	j|}d}t|j
tj
rpd}n|d|||f|d|d|d|d||f|dd|}xAt|jD]0\}	}
|
jd|	|}|d|qWt}x!|jD]}
|j|
|q$Wx|D]}|d|fqEWt|j
tj
sd}d|}d|j
jd|}||nd}d}t|jdkrgtt|j}x|D]}	|d|	qW|d||dt||f|d|dx%|D]}	|d|	|	fqFWn|xBt|jD]1\}	}
|j|
d |	d|	d!|q~W|d"|d#gtt|jD]}	d|	^q}d	j|}|d$|||f|d%|d&||d'|dkrW|d(n|r|d)|j|j
d*d+n|d,|d-|d|d.t}g}g}d|}xt|jD]s\}	}
d}t|
tjrd/}t}n|
jd0||	f|}|j||jd1||	fqW|j
}t|tjrd|}|jd2|}|jd|tj}d}d3}t}n|rad	j|}|pd
}d4|||f}
|d|j|
f|d|r||nd	j|}|d$|||f|rT|d5n|dn|d6||f|d7|dS(8Nitnoargitarg0RNsargument of %ss x%dsx%ds, tvoidRRs%s_cffi_d_%s(%s)s	static %sRsreturn s  %s%s(%s);Rs#ifndef PYPY_VERSIONsstatic PyObject *s(_cffi_f_%s(PyObject *self, PyObject *%s)s  %s;s	result = sresult of %ss results  PyObject *arg%d;s  PyObject **aa;s)  aa = _cffi_unpack_args(args, %d, "%s");s  if (aa == NULL)s    return NULL;s  arg%d = aa[%d];sarg%dsreturn NULLs  Py_BEGIN_ALLOW_THREADSs  _cffi_restore_errno();s  { %s%s(%s); }s  _cffi_save_errno();s  Py_END_ALLOW_THREADSs  (void)self; /* unused */s  (void)noarg; /* unused */s  return %s;tresultsresult types  Py_INCREF(Py_None);s  return Py_None;s#elseRs %sx%ds%sx%ds *results
*result = s%s_cffi_f_%s(%s)s  return result;s#  define _cffi_f_%s _cffi_d_%ss#endif(Rt_generate_cpy_constant_declRRRNRWRMRR,tabiRRTRtVoidTypeRRRORRRtFalseRUtTruetinsertt	void_type(RRDRRtnumargstargnamet	argumentstcall_argumentsRR]Rtrepr_argumentsRtname_and_argumentstresult_codetargRRtresult_decltrngt
differencetindirectiont	tp_result((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_function_declfs				
	
	




	









,








	
	
			





c	Cs|jr'|jr'|j||dS|j|j}t|j}|jr[t}n0|dkrpt}n|dkrt	}nt
}|jdjt
|d|t||dd|dS(NiiR{s
_cffi_f_%sR	s
_cffi_d_%s(RR?t_generate_cpy_constant_ctxRGRcRRNtOP_DLOPEN_FUNCtOP_CPYTHON_BLTN_NtOP_CPYTHON_BLTN_OtOP_CPYTHON_BLTN_VRRMRtCffiOp(RRDRR#Rt	meth_kind((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_function_ctxs 				

cCs~t|tjrz|j}|dkrI|jd}d||f}n|j|d||j}tj||}n|S(Ns...Rs_cffi_array_len(((%s)0)->%s)s%s[0](RTRRRQRRhR(Rt	tp_structt
field_namettp_fieldt
actual_lengthtptr_struct_namettp_item((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRhs	cCs|j|dS(N(Ra(RRD((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_struct_collecttype scCs|jdkrdS|j}d|f}|d|d||f|d|d|dx|jD]\}}}}	y|js|dkr|d|||fwrnxGt|tjr|jdks|jd	kr|j	}|d
}qW|d|j
dd
|d|	|fWqrtjk
r]}
|dt
|
qrXqrW|d|d||f|dS(Ns_cffi_checkfld_%st_CFFI_UNUSED_FNsstatic void %s(%s *p)Rs8  /* only to generate compile-time warnings or errors */s
  (void)p;is?  (void)((p->%s) << 1);  /* check that '%s.%s' is an integer */s...s[0]s  { %s = &p->%s; (void)tmp; }s*tmpsfield %rRws
  /* %s */Rs(struct _cffi_align_%s { char x; %s y; };(RdRORRgRRTRRRQRRRRqRJ(RRDtcnameRRt
checkfuncnametfnametftypeRtfqualRz((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_struct_decl#s6	




	
cCsi|j|}d}g}t|tjr;|jdn|jdkr`|jdd}n||jjj	kr|dks||jjj	kr|jdkrn%|j
s|jrn
|jd|jr|jdqn|jdd}dj
|pd	}g}|dkrt|j}	xC|	D];\}
}}}
|j||
|}t}|d
krt}d|}nd|dkst|tjr|jdkrd}n.d
|dkr|jdn|j|
f}|dks|d
kr
d}n;|dk	r/d|j|
f}nd|jd|
f}|jt|
|||t||j|q<Wt|jd}|jdj||dkrd}d}d}q#|dk	rd|jf}d}nd|f}d|f}d}nd}d}d}|}|jdjt|j||||||||jj|dS(Nt
_CFFI_F_UNIONt_CFFI_F_OPAQUEtopaquet_CFFI_F_CHECK_FIELDSt_CFFI_F_PACKEDt_CFFI_F_EXTERNALtexternalt|t0is
%d /* bits */s
(size_t)-1ssizeof(((%s)0)->%s)Rs"((char *)&((%s)0)->%s) - (char *)0soffsetof(%s, %s)RR|s
(size_t)-2itunnamedssizeof(*(%s)0)s-1 /* unknown alignment */s
sizeof(%s)s"offsetof(struct _cffi_align_%s, y)iR}(RGRORTRt	UnionTypeRMRdR=ReRftpartialthas_anonymous_struct_fieldstpackedR,RRgRhRRRRQRRRRRRtextendR"RR(RRDRRRR#treason_for_not_expandingR$R(RgtfldnametfldtypeRRRR	toffsetR'talignR&((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRDs

	
	

	
			

	

cCst|jj}|jddx|D]\}}||jkr/|jritd|fn|jjdr|jdj	r|jd}nJ|jdkr|j
dkrd}|j|dntd|f|j|d|q/q/WdS(	NRAcSs|dS(Ni((ttp_order((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyREssDinternal inconsistency: %r is partial but was not seen at this pointt$it_IO_FILEtFILEsinternal inconsistency: %r(RRRRnRRR"RRt
startswithtisdigitt	forcenameRRRO(RRvRDtorderR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRs	%
cCs|j|dS(N(R(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt _generate_cpy_struct_collecttypescCsC|jd}d|kr1||jddfS|d|fSdS(NRRRl(RR(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt
_struct_namesscCs|j||j|dS(N(RR4(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_struct_declscCs|j||j|dS(N(RR4(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_struct_ctxscCs6t|tjr%|j||n
|j|dS(N(RTRRVt_generate_cpy_enum_collecttypeR(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt#_generate_cpy_anonymous_collecttypescCs=t|tjr"|j|n|j||d|dS(Nttypedef_(RTRRVt_generate_cpy_enum_declR(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_anonymous_declscCs@t|tjr%|j||n|j||d|dS(NR9(RTRRVt	_enum_ctxR(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_anonymous_ctxstconstcCsJ||f|jkr1tjd||fn|jj||f|j}d||f}|r|d||d|d|f|d||f|dk	r|dkrd|f}n|d	|f|d
n|d|dn?|d
||d|d|jd|f|d|dS(Ns duplicate declaration of %s '%s's_cffi_%s_%ss$static int %s(unsigned long long *o)Rs  int n = (%s) <= 0;sJ  *o = (unsigned long long)((%s) << 0);  /* check that %s is an integer */is%dUs"  if (!_cffi_check_int(*o, n, %s))s    n |= 2;s  return n;Rsstatic void %s(char *o)s  *(%s)o = %s;R(RRRqRRROR(Rtis_intRRDtcategoryR
Rtfuncname((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_consts0	





cCs0|j}|s|jr,|j|ndS(N(RR?Ra(RRDRR?((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt"_generate_cpy_constant_collecttypescCs#|j}|j|||dS(N(RRB(RRDRR?((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRscCs|jr(|jr(ttd}n4|jr:t}nt}|j|}t||}|jdjt	|d||dS(NiR{s_cffi_const_%s(
R?RRtOP_CONSTANT_INTtOP_DLOPEN_CONSTtOP_CONSTANTRGRRMR(RRDRRt
const_kindR#((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRs		

cCs|j|dS(N(Ra(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR7scCs(x!|jD]}|jt|q
WdS(N(tenumeratorsRBR(RRDRt
enumerator((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR:sc	CsH|j|}ttd}|jr2|jnxMt|j|jD]6\}}|jdj	t
|d||d|qHW|dk	rd|kr|jrd|}d|}nN|j|j
g}	|j
j|	}tt|j
j|	ddk}d	j|j}
|jd
j	t|j||||
dS(NiR{s_cffi_const_%sR
R,s
sizeof(%s)s
((%s)-1) <= 0iR)R~(RGRtOP_ENUMR?tcheck_not_partialtzipRHt
enumvaluesRRMRROtbuild_baseinttypeR=tsizeoftinttcastR,R/R(RRDRR#RRIt	enumvalueR	R0tbasetpR1((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR<s"
	
"
"

'
cCs|j||jdS(N(R<R(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_enum_ctx(scCsdS(N((RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_macro_collecttype.scCs5|dkrd}n|}|jt|d|dS(Ns...R
(RORBR(RRDRR
((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_macro_decl1s	cCsz|dkr7|jr.tjd|fnd}n|}ttd}|jdjt|d||d|dS(Ns...sGcannot use the syntax '...' in '#define %s ...' when using the ABI modeiR{s_cffi_const_%sR
(	R?RRqRORRDRRMR(RRDRR
R((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_macro_ctx8s		
cCsit|tjre|j}|dkr7d|f}n|j|jd|}tj||}n|S(Ns...s_cffi_array_len(%s)s%s[0](RTRRRQt_global_typeR(RRDtglobal_nameRR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRXIs	cCs|j|j||dS(N(RaRX(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt"_generate_cpy_variable_collecttypeRscCs|j}|j||}t|tjrN|jdkrN|j}d}nd}d|f}|d|j|d|j	|d|d||f|d|dS(	NRt&s*_cffi_var_%s(void)sstatic RwRs  return %s(%s);R(
RRXRTRRRQRORRRr(RRDRRt	ampersandR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_variable_declUs	!			
 

cCsh|j||}|j|}|jr1t}nt}|jdjt|d|t||dS(NR{s_cffi_var_%s(	RXRGR?t
OP_GLOBAL_VARtOP_GLOBAL_VAR_FRRMRR(RRDRR#R((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_variable_ctxls
		
cCs|j|dS(N(Ra(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt'_generate_cpy_extern_python_collecttypeyscCs|j}t|jtjr'd}n&d|}d|jjd|f}|d||d||f|g}d|}x@t|jD]/\}}	|	jd||}
|j|
qWd	j	|}|pd
}d||f}|j
dkrd
|}nd}
tt|jdd}|
|jrVt|d}nt|jtj
rd|jjd||jjd|f}n|d||jj|f|d|d||dxt|jD]t\}}	d|}
t|	tj
s"|
|	r>d|
}
tj|	}	n|d|	jd|d|
fqW|d|t|jtjs|d|jjdfn|d||jd7_dS(NRsresult of %ss(int)sizeof(%s)Rs3static struct _cffi_externpy_s _cffi_externpy__%s =s  { "%s", %s };sargument of %ss a%ds, Rs%s(%s)t	__stdcalls_cffi_stdcall cSst|tjo|jdkS(Nslong double(RTRt
PrimitiveTypeR(RD((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pytmay_need_128_bitssiis!sizeof(%s) > %d ? sizeof(%s) : %ds%s%sRs
  char a[%s];s  char *p = a;sa%dR[s  *(%s)(p + %d) = %s;Rs,  _cffi_call_python(&_cffi_externpy__%s, p);s  return *(%s)p;Ri(RRTRRRRRWRNRMR,RtmaxRRURR(RRDRt
tag_and_spaceRtsize_of_resultRRR]RRRRRdt	size_of_a((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_extern_python_declsX		


	 



( 
cCs|j||ddS(Nsstatic (Ri(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt _generate_cpy_extern_python_declscCs|j||ddS(NsCFFI_DLLEXPORT (Ri(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt#_generate_cpy_dllexport_python_declscCs|j||ddS(NR(Ri(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt'_generate_cpy_extern_python_plus_c_declscCsz|jrtjdn|jr3tdn|j|}tt|}|jdj	t
|d|||dS(Ns,cannot use 'extern "Python"' in the ABI modes$a vararg function is extern "Python"R{s&_cffi_externpy__%s(R?RRqRRRGRtOP_EXTERN_PYTHONRRMR(RRDRR#R((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_generate_cpy_extern_python_ctxs		

c	Csrd}g}xS|jtp'dgD]9}|jddjg|D]}||^qDq(Wdj|S(NcSsR|dkrd|Sd|ko+dknr4|S|dkrDdSdt|S(Ns\"?s\Rss
s\ns\%03o(tord(tc((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt
_char_reprsRs"%s"s \
(t
splitlinesRRMR,(RtsRqRtlineRp((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyRs
	7cCsttt|j|<dS(N(RtOP_PRIMITIVEt	PRIM_VOIDRK(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_emit_bytecode_VoidTypescCs't|j}tt||j|<dS(N(tPRIMITIVE_TO_INDEXRRRuRK(RRDRR:((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_emit_bytecode_PrimitiveTypes
cCs6d|j|j|jf}tt||j|<dS(Nsm_cffi_prim_int(sizeof(%s), (
           ((%s)-1) << 0 /* check that %s is an integer type */
         ) <= 0)(RRRuRK(RRDRRs((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt!_emit_bytecode_UnknownIntegerTypescCs0d|j|jf}tt||j|<dS(Nsd_cffi_prim_float(sizeof(%s) *
           (((%s)1) / 2) * 2 /* integer => 0, float => 1 */
         )(RRRuRK(RRDRRs((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_emit_bytecode_UnknownFloatTypescCstt|j|j|j|<|d7}xr|jD]g}|j|}||krt|tjrx|j	||qtt
||j|<n|d7}q4Wt|j}|j
dk	r|j
dkr|dO}qtd|j
fntt||j|<dS(NiRbisabi=%r(RtOP_FUNCTIONRGRRKRNRTRRcRyRRPRRRORtOP_FUNCTION_END(RRDRR\t	realindexR$((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_emit_bytecode_RawFunctionTypes 


cCs$tt|j|j|j|<dS(N(Rt
OP_POINTERRGRRK(RRDR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_emit_bytecode_PointerTypescCs-|j}tt|j||j|<dS(N(RcRRRGRK(RRDRtraw((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_emit_bytecode_FunctionPtrTypescCs|j|j}|jdkr8tt||j|<ns|jdkrrtjdt	|j
ddfn9tt||j|<tdt	|j|j|d<dS(Ns...sitype %s badly placed: the '...' array length can only be used on global arrays or on fields of structuress/*...*/i(RGRRQRORt
OP_OPEN_ARRAYRKRRqRJRtOP_ARRAY(RRDRt
item_index((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_emit_bytecode_ArrayTypes"cCs'|j|}tt||j|<dS(N(RRRtOP_STRUCT_UNIONRK(RRDRtstruct_index((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_emit_bytecode_StructTypes
cCs'|j|}tt||j|<dS(N(RSRRJRK(RRDRt
enum_index((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_emit_bytecode_EnumTypes
N(SRRRRRR_RaRHRRRRRRRRRRRRRRRRRRRRRhRRRORRR3t_generate_cpy_union_collecttypeR4R5t_generate_cpy_union_declR6t_generate_cpy_union_ctxR8R;R=RBRCRRR7R:R<RTRURVRWRXRZR]R`Rat*_generate_cpy_dllexport_python_collecttypet._generate_cpy_extern_python_plus_c_collecttypeRiRjRkRlRnt"_generate_cpy_dllexport_python_ctxt&_generate_cpy_extern_python_plus_c_ctxRRwRyRzR{RRt_emit_bytecode_ConstPointerTypet_emit_bytecode_NamedPointerTypeRRRt_emit_bytecode_UnionTypeR(((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR<ys	:							
	3		(			 										!N																							
	
	5				
										itNativeIOcBseZdZRS(cCs;t|tr!|jd}ntt|j|dS(Ntascii(RTtunicodetencodetsuperRR(RRs((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR(s(RRR(((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyR'sc
CsX|rd|fGHnt||d|dk}|j|jt}|j|||j}yVt|d/}|jt	|d|krt
nWdQX|rdGHntSWnt
k
rSd|tj
f}	t|	d}|j|WdQXytj|	|Wn.tk
rNtj|tj|	|nXtSXdS(Ns
generating %sR?Ris(already up-to-date)s%s.~%dtw(R<ROR_RRRtgetvalueRtreadRtIOErrorRRtgetpidRtrenametOSErrortunlinkR(
R=R>Rttarget_filetverboset
recompilerRtoutputtf1ttmp_file((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_make_c_or_py_source-s4

	


cCst|||||S(N(R(R=R>Rt
target_c_fileR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt
make_c_sourceIscCst||d||S(N(RRO(R=R>ttarget_py_fileR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pytmake_py_sourceNscCsp|jd}y$tjtjj||d Wntk
rFnX|dc|7<tjj|||fS(NRi(RoRtmakedirsRR,R(t	outputdirtmodnamet	extensiontparts((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_modname_to_fileRs$
cCs9t||}|j|||ft||||S(N(RXRMtsetattr(t	patchlisttclsRtnew_methtold((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_patch_meth`scCs4x-t|D]\}}}t|||q
WdS(N(treversedR(RRRtold_meth((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_unpatch_methsfscstjdkr8ddlm}t||ddntjdkr~ddlm}fd}t||d	|ndS(
Ntwin32i(tMSVCCompilert_remove_visual_c_refcSs|S(N((Rt
manifest_file((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyREostdarwin(t	CCompilercsSd|jkrCt|j|_|jjd}d|j|<n|||S(Ns-bundles-dynamiclib(t	linker_soRR(RRNtkwdsR](told_link_shared_object(s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pytmy_link_shared_objectts
tlink_shared_object(tsystplatformtdistutils.msvc9compilerRRtdistutils.ccompilerR(RRRR((Rs5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_patch_for_embeddingjs
	csddlm}jdrnd tjdkrEd7qntjdkrad7qnd	7nt||d
fddS(Ni(t	build_exts.*iRs.dllRs.dylibs.sotget_ext_filenamecsS(N((Rtext_name(ttarget(s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyREs(tdistutils.command.build_extRtendswithRRR(RRR((Rs5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_patch_for_target~s



Rs.cc
Kst|ts!|jd}n|jr:|j|
n|dk	r|jdk	}|rk|j|
n|dkrt|||\}}|r|g|}nt	j
j|}
n|}
|	dkr|rd|}	qd}	ntj
|
||
}t||||d|}|rg}t	j}zU|rFt|n|	dkrbt||	nt	j|tjd||}Wdt	j|t|X|S||fSnS|dkrt||d\}}nt|||d|}|r|Sd|fSdS(NRs%s.*RRRs.py(RTRJRt_windows_unicodet_apply_windows_unicodeRORt_apply_embedding_fixRRRR,Rt
get_extensionRtgetcwdRRtchdirtcompileRR(R=R>Rttmpdirtcall_c_compilertc_filetsource_extensiontextradirtcompiler_verboseRRt	embeddingRt
ext_c_filetexttupdatedRtcwdtoutputfilenameRl((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt	recompilesV		
		



	cOs.ddlm}ddl}|jdt|t|||||}|j||}xit|jD]X}	|	j	dslt
|j|	}
|
t
||	tk	rt||	|
qqlqlWd}||_
xJt|D]<}	|	j	drt|j|	rt||	tqqW|jS(Ni(tudirRRlc_s
tdS(N(R(RNR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyttypeof_disableds(ttesting.udirRtimpt
setdefaultRJRtload_dynamictdirR=R/RXtobjectRt_typeofthasattrtNotImplementedtlib(R=R>RRNRRRRtmoduleRtattrR((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt_verifys 		#( RRtioRRRtcffi_opcodeRRRRR"R/R;R<tversion_infotStringIORtBytesIORRRRRRRRRRRORR(((s5/usr/lib64/python2.7/site-packages/cffi/recompiler.pyt<module>s:$
							5
Back to Directory File Manager