+
     h+  c                   s>   ^ RI t ^ RIt^ RIt^ RIt^ RIt^RIHt ^RIHt ^RIH	t	 ] P                  R8  d	   ^ RItR tM^ RItR t] P                  R8  d   ]P                  tM ! R R]P"                  4      t ! R	 R
]4      tRtR tRsR tR tRR ltR tR tR# )    N)__version_verifier_modules__)ffiplatform)VerificationErrorc                  sD    \         P                  P                  R ,          # ):NNN)	importlibZ	machineryZEXTENSION_SUFFIXES     4/usr/lib64/python3.14/site-packages/cffi/verifier.py_extension_suffixesr      s    ""55a88r   c                  s    \         P                  ! 4        U UUu. uF  w  rpV\         P                  8X  g   K  V NK!  	  uppp # u uppp i N)impZget_suffixesZC_EXTENSION)suffix_Ztypes      r   r   r      sB    .1.>.>.@ ,.@?6d3??* .@ , 	, ,s
   AAc                   s2   a a ] tR t^t oV 3R ltRtVtV ;t# )NativeIOc                s|   < \        V\        4      '       d   VP                  R 4      p\        \        V `  V4       R# )ZasciiN)
isinstanceZunicodeencodeZsuperr   write)selfZs	__class__s   &&r   r   ZNativeIO.write   s-    !W%%HHW%(D'*r   r   )__name__
__module____qualname____firstlineno__r   __static_attributes____classdictcell__Z__classcell__)r   __classdict__s   @@r   r   r      s     	+ 	+r   r   c                   sz   a  ] tR t^t o RR ltRR ltR tR tR tR t	R t
R	 tR
 tR tRR ltR tR tRtV tR# )VerifierNc                sV   VP                   P                  '       d$   \        R VP                   P                  : 24      hWn        W n        V'       g   \
        P                  ! V4      p\        W4      pV! V 4      V n        V P                  P                  V4       Wn
        V P                  W4      V n        V'       d   V'       d   \        R4      hEM*RP                  R\        P                   R,          ,          \"        VX.VP$                  ,           4      p\        P                   R8  d   VP'                  R4      p\)        \*        P,                  ! VR,          4      R,          4      pVP/                  R4      P1                  R	4      p\)        \*        P,                  ! VR
,          4      R,          4      pVP/                  R4      P1                  R	4      pRV: RV P                  P2                  : V: V: 2p\5        4       ^ ,          pT;'       g    \7        4       V n        \:        P<                  P                  V P8                  WH,           4      V n        \:        P<                  P                  V P8                  VV,           4      V n         WPn!        RV n"        RV n#        R# )zIfeature not supported with ffi.verify(), but only with ffi.set_source(): z)can't specify both 'modulename' and 'tag'Z z%d.%d:N   Nzutf-8:r    Nr   l    Z0xZL:i   Nr   Z0_cffi_r   FN   )$Z_parserZ_uses_new_featurer   ffipreambler   Zflatten_locate_engine_class_vengineZpatch_extension_kwdsflagsmake_relative_tokwds	TypeErrorjoinsysversion_infor   Z_cdefsourcesr   ZhexbinasciiZcrc32ZlstripZrstripZ
_class_key_get_so_suffixes_caller_dir_pycachetmpdirospathsourcefilenamemodulefilenameext_package_has_source_has_module)r   r   r    r-   Z
modulenamer2   Ztagforce_generic_engineZsource_extensionr#   relative_tor%   Zflattened_kwdsZvengine_classkeyZk1Zk2r   s   &&&&&&&&&&&,      r   __init__ZVerifier.__init__    s    ;;(((#/2{{/L/LOP P  (006N,SG%d+**40
))$<	 KLL  ++w)9)9")==;'9 "../ 0C 4'jj)X^^CI.;<B4'',BX^^CI.;<B3&&s+B.14==3K3K.0"6J!#A&55 3 5 ggll4;;
8UV ggll4;;
V8KL&  r   c                s    V P                   P                  ;_uu_ 4        V P                  '       d   Vf   \        R4      hV P	                  V4       RRR4       R#   + '       g   i     R# ; i)zcWrite the C source code.  It is produced in 'self.sourcefilename',
which can be tweaked beforehand.Nzsource code already written)r   _lockr3   r   _write_sourcer   file   &&r   write_sourceZVerifier.write_sourceI   sK     XX^^^DL'13 3t$	 ^^^s   3AA-	c                s   V P                   P                  ;_uu_ 4        V P                  '       d   \        R4      hV P                  '       g   V P                  4        V P                  4        RRR4       R#   + '       g   i     R# ; i)z|Write the C source code (if not done already) and compile it.
This produces a dynamic link library in 'self.modulefilename'.zmodule already compiledN)r   r9   r4   r   r3   r:   _compile_moduler      &r   compile_moduleZVerifier.compile_moduleR   sY     XX^^^'(ABB###""$  " ^^^s   /A9 A99B
	c                sh   V P                   P                  ;_uu_ 4        V P                  '       gU   V P                  4        V P                  '       g3   V P                  '       g   V P                  4        V P                  4        V P                  4       uuRRR4       #   + '       g   i     R# ; i)zGet a C module from this Verifier instance.
Returns an instance of a FFILibrary class that behaves like the
objects returned by ffi.dlopen(), but that delegates all
operations to the C module.  If necessary, the C code is written
and compiled first.
N)r   r9   r4   _locate_moduler3   r:   r?   _load_libraryr@   rA   r   load_libraryZVerifier.load_library\   sq     XX^^^#####%'''+++**,((*%%' ^^^s   4B B &/B  B1	c                s    \         P                  P                  V P                  4      pVP	                  R ^4      ^ ,          pVP                  R4      '       d   \        \        R4      '       d   VRR pV# )Z.Z_dZgettotalrefcountNi)r.   r/   basenamer1   ZsplitendswithZhasattrr(   )r   rF      & r   get_module_nameZVerifier.get_module_namel   sc    77##D$7$78 >>#q)!, T""ws4F'G'G}Hr   c                s   V P                   '       gJ   V P                  P                  ;_uu_ 4        V P                   '       g   V P                  4        R R R 4       \        P
                  ! V P                  4      pV P                  4       p\        P                  ! W3/ V P                  B #   + '       g   i     La; ir	   )
r3   r   r9   r:   r   Zmaybe_relative_pathr0   rI   get_extensionr%   )r   Z
sourcenameZmodnames   &  r   rJ   ZVerifier.get_extensionw   s    '''&&(   !44T5H5HI
&&(((J		JJ  s   #B--B=	c                s.    V P                   P                  # r	   )r"   Z_gen_python_moduler@   rA   r   generates_python_moduleZ Verifier.generates_python_module   s    }}///r   c                s   V'       d   \         P                  P                  V4      '       d   \         P                  P                  V4      pVP                  4       p\        P
                   Fq  pWA9   g   K  W,          p\        V\        \        34      '       g   \        R V: R24      hV Uu. uF"  p\         P                  P                  W64      NK$  	  ppWQV&   Ks  	  V# u upi )z	keyword 'z' should be a list or tuple)r.   r/   dirnameZcopyr   ZLIST_OF_FILE_NAMESr   ZlistZtupler&   r'   )r   r%   r6   rL   r7   Zlstfns   &&&    r   r$   ZVerifier.make_relative_to   s    277??;77ggook2G99;D"55;)C%cD%=99'+.)1 2 2?BCs277<<4sCC #I 6  Ds   0(C$c                s   \         P                  P                  V P                  4      '       g{   V P                  '       d(    \        V P                  R R R.4      pTP                  pMR pV P                  P                  V P                  4       V\        4       4      pVf   R # W0n        V P                  P                  4        RV n        R #   \         d     R # i ; i)NZ__doc__T)r.   r/   Zisfiler1   r2   Z
__import__ImportErrorZ__path__r"   Zfind_modulerI   r+   Zcollect_typesr4   )r   Zpkgr/   filename   &   r   rC   ZVerifier._locate_module   s    ww~~d1122$T%5%5tTI;OC ||}}001E1E1G1A1CEH"*##% # s   C CCc                s    WP                   n         V P                   P                  4        V P                   =R #   T P                   =i ; ir	   )r"   Z_fZwrite_source_to_fr;   r=   r   _write_source_toZVerifier._write_source_to   s6    	!MM++-  s	   : Ac                sh   Ve   V P                  V4       R # \        4       pV P                  V4       VP                  4       p\        P                  P                  V P                  4      '       d=   \        V P                  R4      ;_uu_ 4       pVP                  4       V8X  * pR R R 4       MRpX'       dN   \        V P                  4       \        V P                  R4      ;_uu_ 4       pVP                  V4       R R R 4       RV n        R #   + '       g   i     Ln; i  + '       g   i     L,; i)NZrTZw)rQ   r   Zgetvaluer.   r/   Zexistsr0   ZopenZread_ensure_dirr   r3   )r   r<   ZfZsource_dataZfpZneeds_writtens   &&    r   r:   ZVerifier._write_source   s    !!$' 
A!!!$**,K ww~~d1122$--s33r)+k$BM 43 !% D//0$--s33rHH[) 4  $D 43 43s   D+D!D	!D1	c                s   \         P                  P                  V P                  4      p\        P
                  ! WP                  4       4      p \        P                  ! W P                  4      pV'       g6   \        V P                  4       \        P                  ! W P                  4       RV n        R#   \         d    R p LUi ; i)FTN)r.   r/   rL   r0   r   ZcompilerJ   Zsamefiler1   OSErrorrR   shutilZmover4   )r   r-   ZoutputfilenameZsamerP   r   r?   ZVerifier._compile_module   s    !4!45$,,V5G5G5IJ	''8K8KLD ++,KK(;(;<  	D	s    B5 5CCc                s    V P                   e&   V P                  P                  V P                   4      # V P                  P                  4       # r	   )r#   r"   rE   r@   rA   r   rD   ZVerifier._load_library   s8    ::!==--djj99==--//r   )r4   r3   r"   r2   r   r#   r%   r1   r    r0   r-   )NNN F.cNNr	   )r   r   r   r   r8   r>   rB   rE   rI   rJ   rK   r$   rC   rQ   r:   r?   rD   r   r   )r   s   @r   r   r      sM     '!R%#( 	K0  &!$2 0 0r   r   Fc                 s
   \         '       d   R pV'       g0   R\        P                  9   d   R pM ^ RIpV P
                  VJd   R pV'       d   ^RIHp VP                  # ^RIH	p VP                  #   \         d    Rp LMi ; i)TZ__pypy__NZ?)vengine_gen)vengine_cpy)_FORCE_GENERIC_ENGINEr(   Zbuiltin_module_names_cffi_backendrN   Z_backendrU   rW   ZVGenericEnginerX   ZVCPythonEngine)r   r5   rZ   rW   rX   s   &&   r   r!   r!      sx    #111#' $$ ||=0'+$!)))!)))  $ #$s   A2 2BBc                  s   \         '       d   \         # \        P                  P                  R 4      p V '       d   V # \        P
                  ! ^4      P                  P                  p\        P                  P                  \        P                  P                  \        P                  P                  V4      R4      4      # )ZCFFI_TMPDIRZ__pycache__)_TMPDIRr.   ZenvironZgetr(   Z	_getframeZf_codeZco_filenamer/   Zabspathr'   rL   )ZresultrO   s     r   r,   r,      sv    wZZ^^M*F}}Q&&22H77??277<<(A(* + +r   c                s
    V s R# )z:Set the temporary directory to use instead of __pycache__.N)r[   )rL   rA   r   
set_tmpdirr\      s	     Gr   c                s   T ;'       g    \        4       p  \        P                  ! V 4      pT'       d   RpM\	        4       ^ ,          P                  4       pT F  pTP                  4       P                  R4      '       g   K*  TP                  4       P                  T4      '       g(   TP                  4       P                  R4      '       g   Kv   \        P                  ! \        P                  P                  Y4      4       K  	  \        P                  P                  T R4      .pT F  p \        P                  ! T4       Fp  p\        P                  P                  Yd4      p\        P                  P                  T4      '       d   TP                  T4       KZ  \        P                  ! T4       Kr  	  K  	  R#   \         d     R# i ; i  \         d     EK  i ; i  \         d     K  i ; i)zyClean up the temporary directory by removing all files in it
called `_cffi_*.{c,so}` as well as the `build` subdirectory.NrV   r   Zbuild)r,   r.   ZlistdirrS   r+   ZlowerZ
startswithrG   Zunlinkr/   r'   isdirZappend)r-   Zkeep_soZfilelistr   rM   Z	clean_dirZdirs   &&     r   cleanup_tmpdirr^     sf    ,,*,F::f% !#A&,,.88:  **
##F++rxxz/B/B4/H/H		"'',,v23	  fg./I	jjoWW\\#*77==$$$$R(IIbM &       		s6   F= 3G-B
G"=GGGG"G10G1c                  sd    \        4       p V '       g   \        P                  R 8X  d   R.p V # R.p V # )Zwin32z.pydz.so)r   r(   Zplatform)Zsuffixess    r   r+   r+   $  s5    "$H<<7"xH O wHOr   c                 s    \         P                  P                  V 4      pV'       d@   \         P                  P                  V4      '       g   \         P                  ! V4       R # R # R # r	   )r.   r/   rL   r]   Zmakedirs)rO   rL   rH   r   rR   rR   /  s<    ggooh'Grww}}W--
G .wr   )r   r   r   )NF)r(   r.   r*   rT   ZiorU   r   r   Zerrorr   r)   Zimportlib.machineryr   r   r
   ZStringIOr   ZBytesIOZobjectr   rY   r!   r[   r,   r\   r^   r+   rR   r   r   r   <module>r_      s    % $ $ *  $v9 ,
 t{{H+2:: +z0v z0|  *, +
>	r   