ó
L]c           @   s5   d  Z  y e Wn e k
 r' e Z n Xd   Z d S(   sU   Utils for interoperability with other libraries.

Just CFFI pointer casting for now.
c         C   s   t  |  t t f  r |  Sy d d l } Wn t k
 r< n5 X| j   } t  |  | j  rq t | j d |    St d |    d S(   s^   Cast an address to a Python int
    
    This could be a Python integer or a CFFI pointer
    i˙˙˙˙Nt   size_ts   Cannot cast %r to int(	   t
   isinstancet   intt   longt   cffit   ImportErrort   FFIt   CDatat   castt
   ValueError(   t   nR   t   ffi(    (    s0   lib/python2.7/site-packages/zmq/utils/interop.pyt   cast_int_addr   s    N(   t   __doc__R   t	   NameErrorR   R   (    (    (    s0   lib/python2.7/site-packages/zmq/utils/interop.pyt   <module>   s
   
