pazpar2  1.14.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
 

Macros

#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))
 

Typedefs

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

Functions

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

◆ EVENT_EXCEPT

#define EVENT_EXCEPT   0x04

Definition at line 37 of file eventl.h.

◆ EVENT_INPUT

#define EVENT_INPUT   0x01

Definition at line 35 of file eventl.h.

◆ EVENT_OUTPUT

#define EVENT_OUTPUT   0x02

Definition at line 36 of file eventl.h.

◆ EVENT_TIMEOUT

#define EVENT_TIMEOUT   0x08

Definition at line 38 of file eventl.h.

◆ iochan_activity

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

Definition at line 69 of file eventl.h.

◆ iochan_clearflag

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

Definition at line 66 of file eventl.h.

◆ iochan_getdata

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

Definition at line 62 of file eventl.h.

◆ iochan_getfd

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

Definition at line 60 of file eventl.h.

◆ 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)

Definition at line 63 of file eventl.h.

◆ iochan_setfd

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

Definition at line 61 of file eventl.h.

◆ iochan_setflag

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

Definition at line 65 of file eventl.h.

◆ iochan_setflags

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

Definition at line 64 of file eventl.h.

◆ iochan_settimeout

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

Definition at line 68 of file eventl.h.

Typedef Documentation

◆ IOC_CALLBACK

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

Definition at line 27 of file eventl.h.

◆ IOCHAN

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,
IOC_CALLBACK  cb,
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)