pazpar2  1.13.1
Data Structures | Macros | Typedefs | Functions
eventl.h File Reference
#include <time.h>

Go to the source code of this file.

Data Structures

struct  iochan


#define EVENT_INPUT   0x01
#define EVENT_OUTPUT   0x02
#define EVENT_EXCEPT   0x04
#define EVENT_TIMEOUT   0x08
#define iochan_getfd(i)   ((i)->fd)
#define iochan_setfd(i, d)   ((i)->fd = d)
#define iochan_getdata(i)   ((i)->data)
#define iochan_setdata(i, d)   ((i)->data = d)
#define iochan_setflags(i, d)   ((i)->flags = d)
#define iochan_setflag(i, d)   ((i)->flags |= d)
#define iochan_clearflag(i, d)   ((i)->flags &= ~(d))
#define iochan_getflag(i, d)   ((i)->flags & d ? 1 : 0)
#define iochan_settimeout(i, t)   ((i)->max_idle = (t), (i)->last_event = time(0))
#define iochan_activity(i)   ((i)->last_event = time(0))


typedef void(* IOC_CALLBACK) (struct iochan *i, int event)
typedef struct iochan_man_siochan_man_t
typedef struct iochanIOCHAN


iochan_man_t iochan_man_create (int no_threads, int max_sockets)
int iochan_add (iochan_man_t man, IOCHAN chan, int slack)
void iochan_man_events (iochan_man_t man)
void iochan_man_destroy (iochan_man_t *mp)
void iochan_destroy (IOCHAN chan)
IOCHAN iochan_create (int fd, IOC_CALLBACK cb, int flags, const char *name)

Macro Definition Documentation


#define EVENT_EXCEPT   0x04

Definition at line 37 of file eventl.h.

Referenced by event_loop(), http_accept(), http_init(), and work_handler().


#define EVENT_INPUT   0x01


#define EVENT_OUTPUT   0x02

Definition at line 36 of file eventl.h.

Referenced by event_loop(), http_io(), http_proxy(), http_send_response(), proxy_io(), and work_handler().


#define EVENT_TIMEOUT   0x08

◆ iochan_activity

#define iochan_activity (   i)    ((i)->last_event = time(0))

Definition at line 69 of file eventl.h.

Referenced by locate_session().

◆ iochan_clearflag

#define iochan_clearflag (   i,
)    ((i)->flags &= ~(d))

Definition at line 66 of file eventl.h.

Referenced by http_io(), and proxy_io().

◆ iochan_getdata

#define iochan_getdata (   i)    ((i)->data)

◆ iochan_getfd

#define iochan_getfd (   i)    ((i)->fd)

Definition at line 60 of file eventl.h.

Referenced by http_accept(), http_channel_destroy(), http_io(), http_send_response(), and proxy_io().

◆ iochan_getflag

#define iochan_getflag (   i,
)    ((i)->flags & d ? 1 : 0)

Definition at line 67 of file eventl.h.

◆ iochan_setdata

#define iochan_setdata (   i,
)    ((i)->data = d)

◆ iochan_setfd

#define iochan_setfd (   i,
)    ((i)->fd = d)

Definition at line 61 of file eventl.h.

Referenced by iochan_update().

◆ iochan_setflag

#define iochan_setflag (   i,
)    ((i)->flags |= d)

Definition at line 65 of file eventl.h.

Referenced by http_proxy(), http_send_response(), and proxy_io().

◆ iochan_setflags

#define iochan_setflags (   i,
)    ((i)->flags = d)

Definition at line 64 of file eventl.h.

Referenced by iochan_update(), and proxy_io().

◆ iochan_settimeout

#define iochan_settimeout (   i,
)    ((i)->max_idle = (t), (i)->last_event = time(0))

Typedef Documentation


typedef void(* IOC_CALLBACK) (struct iochan *i, int event)

Definition at line 27 of file eventl.h.


typedef struct iochan * IOCHAN

◆ iochan_man_t

typedef struct iochan_man_s* iochan_man_t

Definition at line 29 of file eventl.h.

Function Documentation

◆ iochan_add()

int iochan_add ( iochan_man_t  man,
IOCHAN  chan,
int  slack 

◆ iochan_create()

IOCHAN iochan_create ( int  fd,
int  flags,
const char *  name 

◆ iochan_destroy()

void iochan_destroy ( IOCHAN  chan)

◆ iochan_man_create()

iochan_man_t iochan_man_create ( int  no_threads,
int  max_sockets 

◆ iochan_man_destroy()

void iochan_man_destroy ( iochan_man_t mp)

Definition at line 152 of file eventl.c.

References iochan_destroy_real(), and sel_thread_destroy().

Referenced by config_destroy(), and test_for_real_work().

◆ iochan_man_events()

void iochan_man_events ( iochan_man_t  man)