YAZ
5.34.0
|
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 iochan * | IOCHAN |
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) |
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.
#define iochan_settimeout | ( | i, | |
t | |||
) | ((i)->max_idle = (t), (i)->last_event = time(0)) |
IOCHAN iochan_create | ( | int | fd, |
IOC_CALLBACK | cb, | ||
int | flags, | ||
int | port | ||
) |
Definition at line 42 of file eventl.c.
References iochan::chan_id, iochan::destroyed, iochan::fd, iochan::flags, iochan::force_event, iochan::fun, iochan::last_event, log_level, log_level_initialized, iochan::max_idle, iochan::next, xmalloc, and yaz_log_module_level().
Referenced by add_listener(), inetd_connection(), and new_session().
int iochan_event_loop | ( | IOCHAN * | iochans, |
int * | watch_sig | ||
) |
Definition at line 81 of file eventl.c.
References iochan::destroyed, EVENT_EXCEPT, EVENT_INPUT, EVENT_OUTPUT, EVENT_TIMEOUT, iochan::fd, yaz_poll_fd::fd, iochan::flags, iochan::force_event, iochan::fun, yaz_poll_fd::input_mask, iochan::last_event, log_level, iochan::max_idle, iochan::next, yaz_poll_fd::output_mask, statserv_remove(), xfree, xmalloc, yaz_errno(), yaz_log(), yaz_poll(), yaz_poll_add, yaz_poll_except, yaz_poll_none, yaz_poll_read, yaz_poll_write, YLOG_ERRNO, and YLOG_WARN.
Referenced by daemon_handler(), and new_session().
int iochan_is_alive | ( | IOCHAN | chan | ) |
Definition at line 66 of file eventl.c.
References EVENT_INPUT, iochan::fd, yaz_poll_fd::fd, yaz_poll_fd::input_mask, ir_read(), yaz_poll(), and yaz_poll_read.
Referenced by bend_assoc_is_alive().
void statserv_remove | ( | IOCHAN | pIOChannel | ) |
Definition at line 928 of file statserv.c.
Referenced by iochan_event_loop().