+
    Dfj                        R t ^ RIt^ RIt^ RIHtHt ^ RIHt  ! R R]4      t	R R lt
R R	 ltR
 R ltR R lt]P                  P                  R4      t]'       g	   ]! R4      h]P$                  P'                  ]4      t]! ]4       R# )z
Very low-level ctypes-based interface to Linux inotify(7).

ctypes and a version of libc which supports inotify system calls are
required.
N)Anycast)FilePathc                       ] tR t^tRtRtR# )INotifyErrorzJ
Unify all the possible exceptions that can be raised by the INotify API.
 N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       9/usr/lib/python3/dist-packages/twisted/python/_inotify.pyr   r      s    r   r   c                $    V ^8  d   QhR\         /# )   returnint)formats   "r   __annotate__r      s      c r   c                 n    \        \        \        P                  4       4      p V ^ 8  d   \	        R4      hV # )zG
Create an inotify instance and return the associated file descriptor.
zINotify initialization error.)r   r   libcinotify_initr   )fds    r   initr      s1     
c4$$&	'B	Av:;;Ir   c                ^    V ^8  d   QhR\         R\        \        ,          R\         R\         /# )r   r   pathmaskr   )r   r   r   )r   s   "r   r   r   #   s,      C x} C C r   c                    \        \        \        P                  WP	                  4       P
                  V4      4      pV^ 8  d   \        RV: RV: R24      hV# )a  
Add a watch for the given path to the inotify file descriptor, and return
the watch descriptor.

@param fd: The file descriptor returned by C{libc.inotify_init}.
@param path: The path to watch via inotify.
@param mask: Bitmask specifying the events that inotify should monitor.
zFailed to add watch on 'z' - ())r   r   r   inotify_add_watchasBytesModer   r   )r   r   r   wds   &&& r   addr$   #   sS     
c4))".>.>.@.E.EtL	MB	Av5dXU2&JKKIr   c                4    V ^8  d   QhR\         R\         RR/# )r   r   r#   r   Nr   )r   s   "r   r   r   2   s!     " "s " " "r   c                0    \         P                  W4       R# )zE
Remove the given watch descriptor from the inotify file descriptor.
N)r   inotify_rm_watch)r   r#   s   &&r   remover(   2   s    0 	"!r   c                <    V ^8  d   QhR\         P                  RR/# )r   r   r   N)ctypesCDLL)r   s   "r   r   r   M   s     2 26;; 24 2r   c                    R F  p\        WR4      e   K  \        R4      h	  . V P                  n        \        P
                  V P                  n        \        P
                  \        P
                  .V P                  n        \        P
                  V P                  n        \        P
                  \        P                  \        P                  .V P                  n        \        P
                  V P                  n        R# )z
Initialize the module, checking if the expected APIs exist and setting the
argtypes and restype for C{inotify_init}, C{inotify_add_watch}, and
C{inotify_rm_watch}.
Nzlibc6 2.4 or higher needed)r!   r   r'   )getattrImportErrorr   argtypesr*   c_intrestyper'   c_char_pc_uint32r!   )r   functions   & r   initializeModuler5   M   s     N44(0:;; N "$D &D&,llFLL%AD"$*LLD!'-||V__foo&VD#%+\\D"r   czCan't find C library.)r   r*   ctypes.utiltypingr   r   twisted.python.filepathr   	Exceptionr   r   r$   r(   r5   utilfind_librarynamer.   cdllLoadLibraryr   r   r   r   <module>r@      sy   
    ,9 "62& {{$
-
..{{t$  r   