U
    O8Úc%  ã                   @   s   d dl Z dd„ ZdS )é    Nc              	   C   sR  t tj |dd¡ƒ>}g }|D ]}| ¡  d¡r2q| |¡ q|  d |¡¡ W 5 Q R X t tj |dd¡ƒÜ}g }d}d}|D ]´}|rš| ¡  d¡r~d}q~| ¡  d	¡r¬d
}| ¡  d¡r¼q~| ¡  d¡rÜ|| d¡7 }q~n(|dkr|| d¡7 }|| d¡8 }q~| 	dd¡}| 	dd¡}| 	dd¡}| |¡ q~|  d |¡¡ W 5 Q R X dS )zÎ
    Parse distributions.h located in inc_dir for CFFI, filling in the ffi.cdef

    Read the function declarations without the "#define ..." macros that will
    be filled in when loading the library.
    Úrandomzbitgen.hú#Ú
zdistributions.hr   Fz#endifz#ifdef __cplusplusTzstatic NPY_INLINEÚ{Ú}ZDECLDIRÚ Z
NPY_INLINEZRAND_INT_TYPEZint64_tN)
ÚopenÚosÚpathÚjoinÚstripÚ
startswithÚappendZcdefÚcountÚreplace)ÚffiÚinc_dirZfidÚsÚlineZin_skipZignoring© r   úE/tmp/pip-unpacked-wheel-fd_gsd75/numpy/random/_examples/cffi/parse.pyÚparse_distributions_h   s@    
r   )r	   r   r   r   r   r   Ú<module>   s   