§
    Æ‡tj„  ã                   óÚ  — 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                     d¬¦  «        Ze                     dd¬¦  «        Ze                     ddd¬¦  «         e                     d ej        dd¬¦  «        d¬¦  «         e                     dd ¬¦  «         e                     d!d"¬¦  «        Ze                     d#d$¬¦  «         e                     d% ej        dd¬¦  «        d&¬¦  «         e                     d' ej        dd¬¦  «        d(¬¦  «         e                     dd ¬¦  «         d*d)„ZdS )+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                 óL   — t          | |d¬¦  «        }t          |||¦  «         d S )NÚexec)ÚsourceÚfilenameÚmode)Úcompiler   )Úpysrcr   ÚglobsÚcompileds       úP/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/cffi/_cffi_gen_src.pyÚ	_execfiler   3   s.   € Ý˜e¨h¸VÐDÑDÔD€HÝˆ�5˜%Ñ Ô Ð Ð Ð ó    c                 óL  — t           j                             |¦  «        }d|dœ}t          j        dd…         }t          j                             dt           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   s1  € õ Œw�Š˜xÑ(Ô(€HØ'°XÐ>Ð>€EÝŒx˜˜˜Œ{€HÝ„H‡O‚O�A•r”w—’ xÑ0Ô0Ñ1Ô1Ð1ðÝ�%˜ 5Ñ)Ô)Ð)Ø˜ÐÐÝ�)à+1¨6¨6ð4ñô ð ð �FŒmˆÝ˜#�sÑ#Ô#ð 	­°©¬ð 	à�#‘%”%ˆCÝ˜#�sÑ#Ô#ð 	Ý�)à.4¨f¨fð7ñô ð ð à�Œ���‰ˆø�h�Œ���‰ÐÐÐÐs   Á7BD ÄD#c                 óx   — t          ¦   «         }|                     |¦  «         |                     | |¦  «         |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(   _   s9   € å‘”€JØ‡O‚O�DÑÔÐØ×Ò˜* dÑ+Ô+Ð+ØÐr   c                 óz   — t          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                             |¦  «         d S t          | dd¬¦  «        5 }|                     |¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )Nú-Úwúutf-8©Úencoding)r   ÚstdoutÚwriteÚopen)r.   Ú	generatedÚfs      r   Úwrite_c_sourcer;   n   s®   € Ø�‚}€}ÝŒ
×Ò˜Ñ#Ô#Ð#ØˆÝ	ˆf�c GÐ	,Ñ	,Ô	,ð °Ø	�Š�	ÑÔÐðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s   ºAÁA!Á$A!c                 ó†   — | |u rdS 	 t           j                             | j        |j        ¦  «        S # t          $ r Y dS w xY w)NTF)r   r   ÚsamefileÚnameÚOSError)Úfile1Úfile2s     r   Úsame_input_filerB   v   sS   € Ø�€~€~ØˆtðÝŒw×Ò ¤
¨E¬JÑ7Ô7Ð7øÝð ð ð Øˆuˆuðøøøs   ˆ)2 ²
A ¿A c                 óÈ   — |5  t          |                     ¦   «         |j        |¦  «        }d d d ¦  «         n# 1 swxY w Y   t          |¦  «        }t	          | |¦  «         d S ©N)r!   Úreadr>   r/   r;   )r.   ÚpyfileÚffi_varr    r9   s        r   Úexec_pythonrH      s¬   € Ø	ð Mð MÝ'¨¯ª©¬°v´{ÀGÑLÔLˆðMð Mð Mñ Mô Mð Mð Mð Mð Mð Mð Møøøð Mð Mð Mð Må! #Ñ&Ô&€IÝ�6˜9Ñ%Ô%Ð%Ð%Ð%s   ƒ)8¸<¿<c                 ó  — |5  |5  |                      ¦   «         }|                      ¦   «         }d d d ¦  «         n# 1 swxY w Y   d d d ¦  «         n# 1 swxY w Y   t          |||¦  «        }t          |¦  «        }t          | |¦  «         d S rD   )rE   r(   r/   r;   )r.   Úmodule_nameÚ
cdef_inputÚ
csrc_inputr&   r#   r    r9   s           r   Úread_sourcesrM   †   s  € Ø	ð !ð !�Zð !ð !Ø�ŠÑ Ô ˆØ�ŠÑ Ô ˆð!ð !ð !ñ !ô !ð !ð !ð !ð !ð !ð !øøøð !ð !ð !ð !ð !ð !ð !ñ !ô !ð !ð !ð !ð !ð !ð !øøøð !ð !ð !ð !õ   ¨T°4Ñ
8Ô
8€CÝ! #Ñ&Ô&€IÝ�6˜9Ñ%Ô%Ð%Ð%Ð%s.   ƒA†);¯A»?	¿AÁ?	ÁAÁAÁAc                  ó®   — t           j        r/t          j                             t           j        d         ¦  «        nd} |                      d¦  «        rdS dS )Nr   Ú zcffi-gen-srczpython -m cffi.gen_src)r   Úargvr   r   ÚbasenameÚ
startswith)Úargv0s    r   Ú_progrT   �   sL   € õ .1¬XÐ=�BŒG×Ò�Sœ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        dk    r"t          | j        | j        | j        ¬¦  «         n�| j        dk    r\t          | j        | j	        ¦  «        rt            
                    d¦  «         t          | j        | j        | j        | j	        ¬¦  «         nt            
                    d¦  «         t                                d¦  «         d S )	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�MÒ!Ð!Ý˜4œ;¨t¬{ÀDÄLÐQÑQÔQÐQÐQØ	Œ�nÒ	$Ð	$Ý˜4œ9 d¤iÑ0Ô0ð 	NÝ�LŠLÐLÑMÔMÐMÝØ”;ØÔ(Ø”yØ”yð		
ñ 	
ô 	
ð 	
ð 	
õ 	�ŠÐLÑMÔMÐMÝ
‡K‚K��N„N€N€N€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Ñ	1Ô	1Ø	$ð  ñ ô ð ð
 × Ò ØØ	'ð  ñ ô ð ð
 !×+Ò+ØØ	Ið ,ñ ô Ð ð ×  Ò  ØØ	@ð !ñ ô ð ð ×  Ò  Ø
Ø	ˆÔ	˜3¨Ð	1Ñ	1Ô	1Ø	(ð !ñ ô ð ð
 ×  Ò  Ø
Ø	ˆÔ	˜3¨Ð	1Ñ	1Ô	1Ø	+ð !ñ ô ð ð
 ×  Ò  ØØ	'ð !ñ ô ð ðð ð ð ð ð r   