YAZ  5.34.0
Data Structures | Macros | Typedefs | Functions
eventl.h File Reference

Definitions for event loop handling for GFS. More...

#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_destroy(i)   (void)((i)->destroyed = 1)
 
#define iochan_getfd(i)   ((i)->fd)
 
#define iochan_setfd(i, f)   ((i)->fd = (f))
 
#define iochan_getdata(i)   ((i)->data)
 
#define iochan_setdata(i, d)   ((i)->data = d)
 
#define iochan_getflags(i)   ((i)->flags)
 
#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_getfun(i)   ((i)->fun)
 
#define iochan_setfun(i, d)   ((i)->fun = d)
 
#define iochan_setevent(i, e)   ((i)->force_event = (e))
 
#define iochan_getnext(i)   ((i)->next)
 
#define iochan_settimeout(i, t)   ((i)->max_idle = (t), (i)->last_event = time(0))
 

Typedefs

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

Functions

IOCHAN iochan_create (int fd, IOC_CALLBACK cb, int flags, int port)
 
int iochan_is_alive (IOCHAN chan)
 
int iochan_event_loop (IOCHAN *iochans, int *watch_sig)
 
void statserv_remove (IOCHAN pIOChannel)
 

Detailed Description

Definitions for event loop handling for GFS.

This "private" header defines various functions for the main event loop in GFS.

Definition in file eventl.h.

Macro Definition Documentation

◆ EVENT_EXCEPT

#define EVENT_EXCEPT   0x04

Definition at line 51 of file eventl.h.

◆ EVENT_INPUT

#define EVENT_INPUT   0x01

Definition at line 49 of file eventl.h.

◆ EVENT_OUTPUT

#define EVENT_OUTPUT   0x02

Definition at line 50 of file eventl.h.

◆ EVENT_TIMEOUT

#define EVENT_TIMEOUT   0x08

Definition at line 52 of file eventl.h.

◆ iochan_clearflag

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

Definition at line 72 of file eventl.h.

◆ iochan_destroy

#define iochan_destroy (   i)    (void)((i)->destroyed = 1)

Definition at line 64 of file eventl.h.

◆ iochan_getdata

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

Definition at line 67 of file eventl.h.

◆ iochan_getfd

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

Definition at line 65 of file eventl.h.

◆ iochan_getflag

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

Definition at line 73 of file eventl.h.

◆ iochan_getflags

#define iochan_getflags (   i)    ((i)->flags)

Definition at line 69 of file eventl.h.

◆ iochan_getfun

#define iochan_getfun (   i)    ((i)->fun)

Definition at line 74 of file eventl.h.

◆ iochan_getnext

#define iochan_getnext (   i)    ((i)->next)

Definition at line 77 of file eventl.h.

◆ iochan_setdata

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

Definition at line 68 of file eventl.h.

◆ iochan_setevent

#define iochan_setevent (   i,
 
)    ((i)->force_event = (e))

Definition at line 76 of file eventl.h.

◆ iochan_setfd

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

Definition at line 66 of file eventl.h.

◆ iochan_setflag

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

Definition at line 71 of file eventl.h.

◆ iochan_setflags

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

Definition at line 70 of file eventl.h.

◆ iochan_setfun

#define iochan_setfun (   i,
 
)    ((i)->fun = d)

Definition at line 75 of file eventl.h.

◆ iochan_settimeout

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

Definition at line 78 of file eventl.h.

Typedef Documentation

◆ IOC_CALLBACK

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

Definition at line 43 of file eventl.h.

◆ IOCHAN

typedef struct iochan * IOCHAN

Function Documentation

◆ iochan_create()

IOCHAN iochan_create ( int  fd,
IOC_CALLBACK  cb,
int  flags,
int  port 
)

◆ iochan_event_loop()

int iochan_event_loop ( IOCHAN iochans,
int *  watch_sig 
)

◆ iochan_is_alive()

int iochan_is_alive ( IOCHAN  chan)

◆ statserv_remove()

void statserv_remove ( IOCHAN  pIOChannel)

Definition at line 928 of file statserv.c.

Referenced by iochan_event_loop().