"Fossies" - the Fresh Open Source Software Archive

Member "minidlna-1.3.0/event.h" (24 Nov 2020, 1070 Bytes) of package /linux/privat/minidlna-1.3.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "event.h" see the Fossies "Dox" file reference documentation.

    1 #include "config.h"
    2 
    3 #include <sys/types.h>
    4 #ifdef HAVE_KQUEUE
    5 #include <sys/event.h>
    6 #endif
    7 
    8 struct event;
    9 
   10 typedef enum {
   11 #ifdef HAVE_KQUEUE
   12     EVENT_READ =    EVFILT_READ,
   13     EVENT_WRITE =   EVFILT_WRITE,
   14     EVENT_VNODE =   EVFILT_VNODE,
   15 #else
   16     EVENT_READ,
   17     EVENT_WRITE,
   18 #endif
   19 } event_t;
   20 
   21 #define EV_FLAG_CLOSING 0x00000001
   22 
   23 typedef void    event_process_t(struct event *);
   24 #ifdef HAVE_KQUEUE
   25 typedef void    event_vnode_process_t(struct event *, u_int);
   26 #endif
   27 
   28 struct event {
   29     int      fd;
   30     int      index;
   31     event_t      rdwr;
   32     union {
   33         event_process_t     *process;
   34 #ifdef HAVE_KQUEUE
   35         event_vnode_process_t   *process_vnode;
   36 #endif
   37     };
   38     void        *data;
   39 };
   40 
   41 typedef int event_module_add_t(struct event *);
   42 typedef int event_module_del_t(struct event *, int flags);
   43 typedef int event_module_init_t(void);
   44 typedef void    event_module_fini_t(void);
   45 typedef int event_module_process_t(u_long);
   46 struct event_module {
   47     event_module_add_t  *add;
   48     event_module_del_t  *del;
   49     event_module_process_t  *process;
   50     event_module_init_t *init;
   51     event_module_fini_t *fini;
   52 };
   53 
   54 extern struct event_module event_module;