ELinks 0.16.1.1
select.c File Reference
#include <errno.h>
#include <signal.h>
#include <string.h>
#include <sys/types.h>
#include "elinks.h"
#include "intl/libintl.h"
#include "main/main.h"
#include "main/select.h"
#include "main/timer.h"
#include "osdep/osdep.h"
#include "osdep/signals.h"
#include "terminal/terminal.h"
#include "util/error.h"
#include "util/memory.h"
#include "util/time.h"
Include dependency graph for select.c:

Data Structures

struct  thread
struct  bottom_half

Macros

#define EINTRLOOPX(ret_, call_, x_)
#define EINTRLOOP(ret_, call_)
#define FD_SETSIZE   1024

Functions

const char * get_libevent_version (void)
int get_file_handles_count (void)
int register_bottom_half_do (select_handler_T fn, void *data)
void check_bottom_halves (void)
select_handler_T get_handler (int fd, enum select_handler_type tp)
void * get_handler_data (int fd)
void set_handlers (int fd, select_handler_T read_func, select_handler_T write_func, select_handler_T error_func, void *data)
void select_loop (void(*init)(void))
static int can_read_or_write (int fd, int write)
int can_read (int fd)
int can_write (int fd)
void terminate_select (void)

Variables

static int n_threads = 0
static struct threadthreads = NULL
static fd_set w_read
static fd_set w_write
static fd_set w_error
static fd_set x_read
static fd_set x_write
static fd_set x_error
static int w_max
static struct bottom_half list bottom_halves = { D_LIST_HEAD(bottom_halves) }

Macro Definition Documentation

◆ EINTRLOOP

#define EINTRLOOP ( ret_,
call_ )
Value:
EINTRLOOPX(ret_, call_, -1)
#define EINTRLOOPX(ret_, call_, x_)
Definition select.c:53

◆ EINTRLOOPX

#define EINTRLOOPX ( ret_,
call_,
x_ )
Value:
do { \
(ret_) = (call_); \
} while ((ret_) == (x_) && errno == EINTR)
int errno

◆ FD_SETSIZE

#define FD_SETSIZE   1024

Function Documentation

◆ can_read()

int can_read ( int fd)

◆ can_read_or_write()

int can_read_or_write ( int fd,
int write )
static

◆ can_write()

int can_write ( int fd)

◆ check_bottom_halves()

void check_bottom_halves ( void )

◆ get_file_handles_count()

int get_file_handles_count ( void )

◆ get_handler()

select_handler_T get_handler ( int fd,
enum select_handler_type tp )

◆ get_handler_data()

void * get_handler_data ( int fd)

◆ get_libevent_version()

const char * get_libevent_version ( void )

◆ register_bottom_half_do()

int register_bottom_half_do ( select_handler_T fn,
void * data )

◆ select_loop()

void select_loop ( void(* init )(void))

◆ set_handlers()

void set_handlers ( int fd,
select_handler_T read_func,
select_handler_T write_func,
select_handler_T error_func,
void * data )

◆ terminate_select()

void terminate_select ( void )

Variable Documentation

◆ bottom_halves

struct bottom_half list bottom_halves = { D_LIST_HEAD(bottom_halves) }
static

◆ n_threads

int n_threads = 0
static

◆ threads

struct thread* threads = NULL
static

◆ w_error

fd_set w_error
static

◆ w_max

int w_max
static

◆ w_read

fd_set w_read
static

◆ w_write

fd_set w_write
static

◆ x_error

fd_set x_error
static

◆ x_read

fd_set x_read
static

◆ x_write

fd_set x_write
static