+
    icb"  c                   s    ^ RI t ^ RIHt ^ RIHtHt ^ RIHt ^ RIH	t	 ^ RI
t
]
P                  ! RR4       ^ RIHt ] P                  ! ]4      tR	R
.tR tR R lt ! R R]4      t ! R R	]4      t ! R R
]	4      tR# )i    N)DBUS_FLAG_NONE)VariantUnpackingget_variant)
GLibClient)
GLibServerGioz2.0)r   GLibClientUnixGLibServerUnixc                s   a V f   R# . oV3R lp\         P                  W4      pS'       g   V R3# V\        P                  P	                  S4      3# )a  Acquire Unix file descriptors contained in a variant.

Return a variant with indexes into a list of Unix file descriptors
and the list of Unix file descriptors.

If the variant is None, or the variant doesn't contain any Unix
file descriptors, return None instead of the list.

:param variant: a variant with Unix file descriptors
:return: a variant with indexes and a list of Unix file descriptors
Nc                 sJ   < SP                  V 4       \        S4      ^,
          # )   )ZappendZlen)Zfdfd_list   &0/usr/lib/python3.14/site-packages/dasbus/unix.py_get_idxZacquire_fds.<locals>._get_idx9   s    r7|a    )NN)
UnixFDSwapapplyr   
UnixFDListZnew_from_array)variantr   Zvariant_without_fdsr	   s   &  @r   acquire_fdsr   (   sT     G  %**7=} = =g FFFr   c                s8    V ^8  d   QhR\         P                  /# )i   r	   )r   r   )Zformats   "r   __annotate__r   E   s     . .#.. .r   c                s   a V f   R# Sf   V # SP                  4       oS'       g   V # V3R lp\        P                  W4      # )a  Restore Unix file descriptors in a variant.

If the variant is None, return None. Otherwise, return
a variant with Unix file descriptors.

:param variant: a variant with indexes into fd_list
:param fd_list: a list of Unix file descriptors
:return: a variant with Unix file descriptors
Nc                 s>   <  SV ,          #   \          d    Ru # i ; i)r   i)Z
IndexError)Zindexr	   r
   r   _get_fdZrestore_fds.<locals>._get_fdZ   s&    	5>! 	I	s    )Z	steal_fdsr   r   )r   r	   r   s   &f r   restore_fdsr   E   sE     !G G--r   c                   sd   a  ] tR t^ct o Rt]R 4       t]R 4       t]R 4       t]R 4       t	Rt
V tR# )r   z-Class for swapping values of the UnixFD type.c                s$    V P                  W4      # )a	  Swap unix file descriptors with indices.

The provided function should swap a unix file
descriptor with an index into an array of unix
file descriptors or vice versa.

:param variant: a variant to modify
:param swap: a swapping function
:return: a modified variant
)_recreate_variant)clsr   swaps   &&&r   r   ZUnixFDSwap.applyf   s     $$W33r   c                sF    V P                   ! VP                  4       .VO5!  # )zHandle a variant.)r   r   )r   r   extrass   &&*r   _handle_variantZUnixFDSwap._handle_variantt   s#     $$W%8%8%:DVDDr   c                s    VP                  4       pVR8X  d   VvrEV! VP                  4       4      # VP                  4       # )zHandle a basic value.h)get_type_stringZ
get_handleZunpack)r   r   r   type_stringr   Z_s   &&*   r   _handle_valueZUnixFDSwap._handle_valuey   sD     --/ #HD**,--~~r   c                s    VP                  4       pRV9  d
   RV9  d   V# V P                  ! V.VO5!  p\        W44      # )z%Create a variant with swapped values.r   Zv)r   Z_process_variantr   )r   r   r   r   Zvalues   &&*  r   r   ZUnixFDSwap._recreate_variant   sL     --/ k!c&<N $$W6v6 ;..r    N)__name__
__module____qualname____firstlineno____doc__classmethodr   r   r   r   __static_attributes____classdictcell__Z__classdict__   @r   r   r   c   sX     74 4 E E     / /r   r   c                   s   a  ] tR t^t o Rt]]]P                  3R l4       t	]R]]P                  3R l4       t
]R 4       tRtV tR# )r   z0The low-level DBus client library based on GLib.c
                sb    \        V4      w  rjVP                  VVVVVVVV	V
R4
      p\        V!  # )zFSynchronously call a DBus method.

:return: a result of the DBus call
N)r   Zcall_with_unix_fd_list_syncr   )r   
connectionservice_nameobject_pathinterface_namemethod_name
parameters
reply_typeflagstimeoutr	   results   &&&&&&&&&&  r   	sync_callZGLibClientUnix.sync_call   sN     **5
 77
 F##r   c                sn    \        V4      w  rlVP                  VVVVVVV
VVV P                  W3R7       R# )z"Asynchronously call a DBus method.)callback	user_dataN)r   Zcall_with_unix_fd_list_async_call_finish)r   r*   r+   r,   r-   r.   r/   r0   r5   callback_argsr1   r2   r	   s   &&&&&&&&&&&& r   
async_callZGLibClientUnix.async_call   sP     **5
 	))++/ 	* 	
r   c                s4   aa Vw  rEVV3R lpV! V.VO5!   R# )z(Finish an asynchronous DBus method call.c                  s8   < SP                  S4      p \        V !  # N)Zcall_with_unix_fd_list_finishr   )r3   result_objectsource_objects    r   _finish_callZ7GLibClientUnix._async_call_finish.<locals>._finish_call   s#    "@@F ''r   Nr   )r   r<   r;   r6   r5   r8   r=   s   &ff&   r   r7   Z!GLibClientUnix._async_call_finish   s!     #,	( 	..r   r   N)r    r!   r"   r#   r$   r%   r    r   ZDBUS_TIMEOUT_NONEr4   r9   r7   r&   r'   r(   r)   r   r   r      s^     :=K$66$ $6  "$>%77
 
. / /r   c                   sX   a  ] tR t^t o Rt]RR l4       t]R 4       t]R 4       tRt	V t
R# )r   zTThe low-level DBus server library based on GLib.

Adds Unix FD Support to base classNc                s    \        V4      w  rWV'       d   \        P                  R4       VP                  VVVVV4       R# )zEmit a DBus signal.

GLib doesn't seem to support Unix file descriptors in signals.
Swap Unix file descriptors with indexes into a list of Unix file
descriptors, but emit just the indexes. Log a warning to inform
users about the limited support.
z1Unix file descriptors in signals are unsupported.N)r   logZwarningemit_signal)r   r*   r,   r-   Zsignal_namer/   Zdestinationr	   s   &&&&&&& r   r?   ZGLibServerUnix.emit_signal   s@     **5
KKKL 		
r   c                s^    V P                  W#4      p\        V4      pVP                  ! V!   R# )zSet the reply of the DBus call.N)Z_get_reply_valuer   Zreturn_value_with_unix_fd_list)r   
invocationZout_typeZ	out_valueZreply_valueZ
reply_argss   &&&&  r   set_call_replyZGLibServerUnix.set_call_reply   s.     **8? -
 	11:>r   c	                sz    Vw  rVP                  4       P                  4       p\        Wk4      pV	! VVVV.V
O5!   R# )z'A method call closure of a DBus object.N)Zget_messageZget_unix_fd_listr   )r   r*   Zsenderr,   r-   r.   r/   r@   r6   r5   r8   r	   s   &&&&&&&&&   r   _object_callbackZGLibServerUnix._object_callback  sO     #, ((*;;= 5
 			

 	
r   r   r:   )r    r!   r"   r#   r$   r%   r?   rA   rB   r&   r'   r(   r)   r   r   r      sF     * 
 
0 ? ? 
 
r   )ZloggingZdasbus.constantsr    Zdasbus.typingr   r   Zdasbus.client.handlerr   Zdasbus.server.handlerr   ZgiZrequire_versionZgi.repositoryr   Z	getLoggerr    r>   Z__all__r   r   r   r   r   r   r   r   <module>rC      s   *  + 7 , , 	   5%   ! G:.<1/! 1/hF/Z F/R;
Z ;
r   