U
    +d                     @   s   d dl mZmZmZmZ d dlmZ d dlmZ dd Z	dd Z
dd	 Zeegejj_egejj_eejj_eeegejj_eejj_d
S )    )c_void_pc_char_pc_boolPOINTER)ffi)_encode_stringc                 C   s   t jt| S )z{
    Get the in-process address of symbol named *name*.
    An integer is returned, or None if the symbol isn't found.
    )r   libLLVMPY_SearchAddressOfSymbolr   )name r   :/tmp/pip-unpacked-wheel-stw2luzp/llvmlite/binding/dylib.pyaddress_of_symbol   s    r   c                 C   s   t jt| t| dS )z
    Register the *address* of global symbol *name*.  This will make
    it usable (e.g. callable) from LLVM-compiled functions.
    N)r   r   LLVMPY_AddSymbolr   r   )r
   addressr   r   r   
add_symbol   s    r   c              	   C   s6   t  $}t jt| |r(tt|W 5 Q R X dS )z"
    Load an external library
    N)r   OutputStringr   LLVMPY_LoadLibraryPermanentlyr   RuntimeErrorstr)filenameZouterrr   r   r   load_library_permanently   s    
 r   N)ctypesr   r   r   r   Zllvmlite.bindingr   Zllvmlite.binding.commonr   r   r   r   r   r   argtypesr	   restyper   r   r   r   r   <module>   s   

