
C]c           @@ 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   Z d   Z 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(
   i    (   t   absolute_importt   print_function(   t   c_void_pt   c_char_pt   c_boolt   POINTERi   (   t   ffi(   t   _encode_stringc         C@ s   t  j j t |    S(   s{   
    Get the in-process address of symbol named *name*.
    An integer is returned, or None if the symbol isn't found.
    (   R   t   libt   LLVMPY_SearchAddressOfSymbolR   (   t   name(    (    s5   lib/python2.7/site-packages/llvmlite/binding/dylib.pyt   address_of_symbol   s    c         C@ s#   t  j j t |   t |   d S(   s   
    Register the *address* of global symbol *name*.  This will make
    it usable (e.g. callable) from LLVM-compiled functions.
    N(   R   R   t   LLVMPY_AddSymbolR   R   (   R
   t   address(    (    s5   lib/python2.7/site-packages/llvmlite/binding/dylib.pyt
   add_symbol   s    c         C@ sI   t  j   7 } t  j j t |   |  r? t t |    n  Wd QXd S(   s"   
    Load an external library
    N(   R   t   OutputStringR   t   LLVMPY_LoadLibraryPermanentlyR   t   RuntimeErrort   str(   t   filenamet   outerr(    (    s5   lib/python2.7/site-packages/llvmlite/binding/dylib.pyt   load_library_permanently   s    	N(   t
   __future__R    R   t   ctypesR   R   R   R   t    R   t   commonR   R   R   R   R   R   t   argtypesR	   t   restypeR   (    (    (    s5   lib/python2.7/site-packages/llvmlite/binding/dylib.pyt   <module>   s   "			