B
    Ꮚ\*                 @   s   d dl mZmZ 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 )    )absolute_importprint_function)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   5lib/python3.7/site-packages/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   Zaddressr   r   r   
add_symbol   s    r   c          	   C   s6   t  $}t jt| |r(tt|W dQ R X dS )z"
    Load an external library
    N)r	   ZOutputStringr   LLVMPY_LoadLibraryPermanentlyr
   RuntimeErrorstr)filenameZouterrr   r   r   load_library_permanently   s    
r   N)Z
__future__r   r   Zctypesr   r   r   r    r	   commonr
   r   r   r   r   r   Zargtypesr   Zrestyper   r   r   r   r   <module>   s   
