
    ^hk                     ^    S r SSKJrJr  SSKJrJrJr  SSKJ	r	  SSKJ
r   " S S5      rS/rg	)
zzmq Context class    )EINVAL
IO_THREADS)InterruptedSystemCallZMQError	_check_rc   )ffi)libc                   `    \ rS rSrSrSrSrSrSS jr\	S 5       r
\	S 5       rS rS	 rS
 rSrg)Context   NTFc                    U(       a$  [         R                  " SU5      U l        SU l        O6SU l        US:  d  [	        [
        5      e[        R                  " 5       U l        U R                  [         R                  :X  a  [	        [        R                  " 5       5      eU(       d&  [        R                  " U R                  [        U5        SU l        g )Nzvoid *TFr   )r	   cast_zmq_ctx_shadowr   r   Czmq_ctx_newNULL	zmq_errnozmq_ctx_setr   _closed)self
io_threadsshadows      R/home/james-whalen/.local/lib/python3.13/site-packages/zmq/backend/cffi/context.py__init__Context.__init__   s    HHXv6DMDL DL?v&&MMODM==CHH$1;;=))MM$--Z@    c                 V    [        [        R                  " SU R                  5      5      $ )z,The address of the underlying libzmq contextsize_t)intr	   r   r   r   s    r   
underlyingContext.underlying#   s     388Hdmm455r   c                     U R                   $ )N)r   r"   s    r   closedContext.closed(   s    ||r   c                 \    [         R                  " U R                  X5      n[        U5        g)z&set a context option

see zmq_ctx_set
N)r   r   r   r   )r   optionvaluercs       r   setContext.set,   s    
 ]]4==&8"r   c                 \    [         R                  " U R                  U5      n[        USS9  U$ )z$get context option

see zmq_ctx_get
F)error_without_errno)r   zmq_ctx_getr   r   )r   r)   r+   s      r   getContext.get4   s'    
 ]]4==&1"%0	r   c                     U R                   (       a  g [        R                  " U R                  5      n [	        U5        S U l        SU l        g ! [
         a     Nf = f)NT)r&   r   zmq_ctx_destroyr   r   r   r   )r   r+   s     r   termContext.term=   sR    ;;t}}-	bM  % 	 	s   A 
AA)r   r   r   )r   N)__name__
__module____qualname____firstlineno__r   
_iothreadsr   r   r   propertyr#   r&   r,   r1   r5   __static_attributes__ r   r   r   r      sR    HJGG  6 6  r   r   N)__doc__zmq.constantsr   r   	zmq.errorr   r   r   _cffir	   r
   r   r   __all__r>   r   r   <module>rD      s-    
 - @ @  = =@ +r   