ELinks 0.18.0
Macros | Typedefs | Enumerations | Functions | Variables
select.h File Reference
#include "main/timer.h"
Include dependency graph for select.h:

Macros

#define EINTRLOOPX(ret_, call_, x_)
 
#define EINTRLOOP(ret_, call_)   EINTRLOOPX(ret_, call_, -1)
 
#define register_bottom_half(fn, data)    register_bottom_half_do((select_handler_T) (fn), (void *) (data))
 
#define clear_handlers(fd)    set_handlers(fd, NULL, NULL, NULL, NULL)
 

Typedefs

typedef void(* select_handler_T) (void *)
 

Enumerations

enum  select_handler_type { SELECT_HANDLER_READ , SELECT_HANDLER_WRITE , SELECT_HANDLER_ERROR }
 

Functions

void select_loop (void(*init)(void))
 
int get_file_handles_count (void)
 
int register_bottom_half_do (select_handler_T work_handler, void *data)
 
void check_bottom_halves (void)
 
select_handler_T get_handler (int fd, enum select_handler_type type)
 
void * get_handler_data (int fd)
 
void set_handlers (int fd, select_handler_T read_handler, select_handler_T write_handler, select_handler_T error_handler, void *data)
 
int can_read (int fd)
 
int can_write (int fd)
 
void terminate_select (void)
 
const char * get_libevent_version (void)
 

Variables

pid_t signal_pid
 
int signal_pipe [2]
 

Macro Definition Documentation

◆ clear_handlers

#define clear_handlers (   fd)     set_handlers(fd, NULL, NULL, NULL, NULL)

◆ EINTRLOOP

#define EINTRLOOP (   ret_,
  call_ 
)    EINTRLOOPX(ret_, call_, -1)

◆ EINTRLOOPX

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

◆ register_bottom_half

#define register_bottom_half (   fn,
  data 
)     register_bottom_half_do((select_handler_T) (fn), (void *) (data))

Typedef Documentation

◆ select_handler_T

typedef void(* select_handler_T) (void *)

Enumeration Type Documentation

◆ select_handler_type

Enumerator
SELECT_HANDLER_READ 
SELECT_HANDLER_WRITE 
SELECT_HANDLER_ERROR 

Function Documentation

◆ can_read()

int can_read ( int  fd)

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

◆ 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  work_handler,
void *  data 
)

◆ select_loop()

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

◆ set_handlers()

void set_handlers ( int  fd,
select_handler_T  read_handler,
select_handler_T  write_handler,
select_handler_T  error_handler,
void *  data 
)

◆ terminate_select()

void terminate_select ( void  )

Variable Documentation

◆ signal_pid

pid_t signal_pid
extern

◆ signal_pipe

int signal_pipe[2]
extern