Ë
    °Œj„  ã                   ó’  — d Z ddlZddlZddlZddlZddlmZ d„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Z ej                    e«       d¬«      Zej%                  d¬«      Zej)                  dd¬«      Zej-                  ddd¬«       ej-                  d ej.                  dd¬«      d¬«       ej-                  dd ¬«       ej)                  d!d"¬«      Zej-                  d#d$¬«       ej-                  d% ej.                  dd¬«      d&¬«       ej-                  d' ej.                  dd¬«      d(¬«       ej-                  dd ¬«       d*d)„Zy)+aê  Implementation of the ``cffi-gen-src`` command-line tool.

This module is private; the command line is the only supported
interface. Two subcommands:

``exec-python``
    Execute a Python script that constructs a :class:`cffi.FFI`
    (the same kind of script that the CFFI docs' "Main mode of usage"
    describes) and emit the generated C source.

``read-sources``
    Create the :class:`cffi.FFI` from a separate ``cdef`` file and C
    source prelude, then emit the generated C source.
é    Né   )ÚFFIc                 ó:   — t        | |d¬«      }t        |||«       y )NÚexec)ÚsourceÚfilenameÚmode)Úcompiler   )Úpysrcr   ÚglobsÚcompileds       ú\/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/cffi/_cffi_gen_src.pyÚ	_execfiler   3   s   € Ü˜e¨h¸VÔD€HÜˆ�5˜%Õ ó    c                 ó  — t         j                  j                  |«      }d|dœ}t        j                  dd }t        j                  j	                  dt         j                  j                  |«      «       	 t        | ||«       ||vrt        d|›d�«      ‚||   }t        |t        «      st        |«      r |«       }t        |t        «      st        d|›d�«      ‚||t        j                  dd S # |t        j                  dd w xY w)	a
  Execute ``pysrc`` and return the :class:`FFI` object it defines.

    The script is executed with ``__name__`` set to ``"cffi.gen_src"``,
    so a trailing ``if __name__ == "__main__": ffibuilder.compile()``
    block in the script is skipped.

    ``ffivar`` is the name bound by the script to the :class:`FFI`
    object, or to a callable that returns one.

    Raises :class:`NameError` if the name is not bound by the script,
    or :class:`TypeError` if the name does not resolve to an
    :class:`FFI` instance.
    zcffi.gen_src)Ú__name__Ú__file__Nr   z.Expected to find the FFI object with the name z, but it was not found.zFound an object with the name z+ but it was not an instance of cffi.api.FFI)ÚosÚpathÚabspathÚsysÚinsertÚdirnamer   Ú	NameErrorÚ
isinstancer   ÚcallableÚ	TypeError)r   r   Úffivarr   Úold_pathÚffis         r   Úfind_ffi_in_python_scriptr!   8   sÛ   € ô �w‰w�‰˜xÓ(€HØ'°XÑ>€EÜ�x‰x™ˆ{€HÜ‡H�H‡O�O�A”r—w‘w—‘ xÓ0Ô1ðÜ�%˜ 5Ô)Ø˜ÑÝâ+1ð4óð ð �F‰mˆÜ˜#œsÔ#¬°¬á“%ˆCÜ˜#œsÔ#Ýâ.4ð7óð ð àŒ�‰‘‰ø�hŒ�‰‘‰ús   Á6A'C1 Ã1Dc                 ó`   — t        «       }|j                  |«       |j                  | |«       |S )zACreate an :class:`FFI` from ``cdef`` text and a C source prelude.)r   ÚcdefÚ
set_source)Ú
modulenamer#   ÚcsrcÚ
ffibuilders       r   Úmake_ffi_from_sourcesr(   _   s+   € ä“€JØ‡O�O�DÔØ×Ñ˜* dÔ+ØÐr   c                 ól   — t        j                  «       }| j                  |«       |j                  «       S )z=Return the C source that :meth:`FFI.emit_c_code` would write.)ÚioÚStringIOÚemit_c_codeÚgetvalue)r    Úoutputs     r   Úgenerate_c_sourcer/   g   s&   € ä�[‰[‹]€FØ‡O�O�FÔØ�?‰?ÓÐr   c                 ó¶   — | dk(  r t         j                  j                  |«       y t        | dd¬«      5 }|j                  |«       d d d «       y # 1 sw Y   y xY w)NÚ-Úwúutf-8©Úencoding)r   ÚstdoutÚwriteÚopen)r.   Ú	generatedÚfs      r   Úwrite_c_sourcer;   n   sD   € Ø�‚}Ü�
‰
×Ñ˜Ô#ØÜ	ˆf�c GÕ	,°Ø	�‰�	Ô÷ 
-×	,Ñ	,ús   ´AÁAc                 ó”   — | |u ry	 t         j                  j                  | j                  |j                  «      S # t        $ r Y yw xY w)NTF)r   r   ÚsamefileÚnameÚOSError)Úfile1Úfile2s     r   Úsame_input_filerB   v   sB   € Ø��~ØðÜ�w‰w×Ñ §
¡
¨E¯J©JÓ7Ð7øÜò Ùðús   ‡3; »	AÁAc                 óª   — |5  t        |j                  «       |j                  |«      }d d d «       t        «      }t	        | |«       y # 1 sw Y   Œ!xY w©N)r!   Úreadr>   r/   r;   )r.   ÚpyfileÚffi_varr    r9   s        r   Úexec_pythonrH      s>   € Ú	Ü'¨¯©«°v·{±{ÀGÓLˆ÷ 
ä! #Ó&€IÜ�6˜9Õ%÷ 
ˆús   ƒ&A	Á	Ac                 óè   — |5  |5  |j                  «       }|j                  «       }d d d «       d d d «       t        |«      }t        |«      }t        | |«       y # 1 sw Y   Œ6xY w# 1 sw Y   Œ:xY wrD   )rE   r(   r/   r;   )r.   Úmodule_nameÚ
cdef_inputÚ
csrc_inputr&   r#   r    r9   s           r   Úread_sourcesrM   †   sW   € Ú	’ZØ�‰Ó ˆØ�‰Ó ˆ÷  �ô   ¨T°4Ó
8€CÜ! #Ó&€IÜ�6˜9Õ%÷  �Zú�ˆús!   ƒA(†!A§A(ÁA%	Á!A(Á(A1c                  ó¬   — t         j                  r0t        j                  j	                  t         j                  d   «      nd} | j                  d«      ryy)Nr   Ú zcffi-gen-srczpython -m cffi.gen_src)r   Úargvr   r   ÚbasenameÚ
startswith)Úargv0s    r   Ú_progrT   �   s<   € ô .1¯XªXŒB�G‰G×ÑœSŸX™X a™[Ô)¸2€EØ×Ñ˜Ô'ØØ#r   z-Generate CFFI C source for extension modules.)ÚprogÚdescriptionr	   )Údestúexec-pythonz2Execute a Python script that defines an FFI object)Úhelpz	--ffi-varr'   zFName of the FFI object in the Python script; defaults to 'ffibuilder'.)ÚdefaultrY   rF   Úrr3   r4   zPath to the Python script)ÚtyperY   r.   zOutput path for the C sourceúread-sourcesz>Read cdef and C source prelude files that define an FFI objectrJ   z5Full name of the generated module, including packagesr#   zFile containing C definitionsr&   z File containing C source preludec                 óô  — t         j                  | ¬«      } | j                  dk(  r-t        | j                  | j
                  | j                  ¬«       n‘| j                  dk(  rmt        | j                  | j                  «      rt         j                  d«       t        | j                  | j                  | j                  | j                  ¬«       nt         j                  d«       t         j                  d«       y )	N©ÚargsrX   )r.   rF   rG   r]   z1cdef and csrc are the same file and should not be)r.   rJ   rK   rL   z5a subcommand is required: exec-python or read-sourcesr   )ÚparserÚ
parse_argsr	   rH   r.   rF   rG   rB   r#   r&   ÚerrorrM   rJ   Úexitr_   s    r   Úrunre   É   s¤   € Ü×Ñ $ÐÓ'€DØ‡y�y�MÒ!Ü˜4Ÿ;™;¨t¯{©{ÀDÇLÁLÖQØ	�‰�nÒ	$Ü˜4Ÿ9™9 d§i¡iÔ0Ü�L‰LÐLÔMÜØ—;‘;Ø×(Ñ(Ø—y‘yØ—y‘yö		
ô 	�‰ÐLÔMÜ
‡K�K�…Nr   rD   )Ú__doc__Úargparser*   r   r   Úapir   r   r!   r(   r/   r;   rB   rH   rM   rT   ÚArgumentParserra   Úadd_subparsersÚ
subparsersÚ
add_parserÚexec_python_parserÚadd_argumentÚFileTypeÚread_sources_parserre   © r   r   Ú<module>rr      s¯  ðñ8ó Û 	Û 	Û 
å ò!ò
$òNòòòò&ò&ò$ð 
!ˆ×	 Ñ	 Ù	‹Ø?ô
€ð ×"Ñ"¨Ð"Ó/€
à×*Ñ*ØØ	=ð +ó Ð ð × Ñ ØØØ	Qð  ô ð
 × Ñ ØØ	ˆ×	Ñ	˜3¨Ô	1Ø	$ð  ô ð
 × Ñ ØØ	'ð  ô ð
 !×+Ñ+ØØ	Ið ,ó Ð ð ×  Ñ  ØØ	@ð !ô ð ×  Ñ  Ø
Ø	ˆ×	Ñ	˜3¨Ô	1Ø	(ð !ô ð
 ×  Ñ  Ø
Ø	ˆ×	Ñ	˜3¨Ô	1Ø	+ð !ô ð
 ×  Ñ  ØØ	'ð !ô ôr   