#include <sys/poll.h>
Include dependency graph for io.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | AST_IO_IN POLLIN |
#define | AST_IO_OUT POLLOUT |
#define | AST_IO_PRI POLLPRI |
#define | AST_IO_ERR POLLERR |
#define | AST_IO_HUP POLLHUP |
#define | AST_IO_NVAL POLLNVAL |
#define | AST_IO_CB(a) ((ast_io_cb)(a)) |
Typedefs | |
typedef int(* | ast_io_cb )(int *id, int fd, short events, void *cbdata) |
Functions | |
io_context * | io_context_create (void) |
Creates a context. | |
void | io_context_destroy (struct io_context *ioc) |
Destroys a context. | |
int * | ast_io_add (struct io_context *ioc, int fd, ast_io_cb callback, short events, void *data) |
Adds an IO context. | |
int * | ast_io_change (struct io_context *ioc, int *id, int fd, ast_io_cb callback, short events, void *data) |
Changes an IO handler. | |
int | ast_io_remove (struct io_context *ioc, int *id) |
Removes an IO context. | |
int | ast_io_wait (struct io_context *ioc, int howlong) |
Waits for IO. | |
void | ast_io_dump (struct io_context *ioc) |
Dumps the IO array. | |
int | ast_hide_password (int fd) |
Set fd into non-echoing mode (if fd is a tty). | |
int | ast_restore_tty (int fd, int oldstatus) |
Restores TTY mode. | |
int | ast_get_termcols (int fd) |
|
|
|
Error condition (errno or getsockopt) |
|
Hangup |
|
Input ready Definition at line 28 of file io.h. Referenced by ast_rtp_new(). |
|
Invalid fd |
|
Output ready |
|
Priority input ready |
|
Definition at line 66 of file io.h. Referenced by ast_io_add(). |
|
Definition at line 341 of file io.c.
|
|
Set fd into non-echoing mode (if fd is a tty).
Definition at line 305 of file io.c.
|
|
Adds an IO context.
Definition at line 139 of file io.c. References ast_io_cb, ast_log(), io_rec::callback, io_rec::data, DEBUG, pollfd::events, pollfd::fd, io_context::fdcnt, io_context::fds, io_rec::id, io_context::ior, LOG_DEBUG, malloc, and io_context::maxfdcnt. Referenced by ast_rtp_new().
|
|
Changes an IO handler.
Definition at line 176 of file io.c. References io_rec::callback, io_rec::data, pollfd::events, pollfd::fd, io_context::fdcnt, io_context::fds, and io_context::ior.
|
|
Dumps the IO array.
Definition at line 281 of file io.c. References ast_log(), io_rec::callback, io_rec::data, pollfd::events, pollfd::fd, io_context::fdcnt, io_context::fds, io_rec::id, io_context::ior, LOG_DEBUG, and io_context::maxfdcnt.
|
|
Removes an IO context.
Definition at line 218 of file io.c. References ast_log(), io_context::current_ioc, pollfd::events, io_context::fdcnt, io_context::fds, free, io_rec::id, io_context::ior, LOG_NOTICE, LOG_WARNING, io_context::needshrink, and pollfd::revents. Referenced by ast_io_wait(), and ast_rtp_destroy().
|
|
Waits for IO.
Definition at line 243 of file io.c. References ast_io_remove(), ast_log(), io_rec::callback, io_context::current_ioc, io_rec::data, DEBUG, pollfd::fd, io_context::fdcnt, io_context::fds, io_rec::id, io_context::ior, LOG_DEBUG, io_context::needshrink, poll(), and pollfd::revents.
|
|
Restores TTY mode.
Definition at line 324 of file io.c.
|
|
Creates a context. Create a context for I/O operations Basically mallocs an IO structure and sets up some default values. Returns an allocated io_context structure Definition at line 65 of file io.c. References free, GROW_SHRINK_SIZE, and malloc.
|
|
Destroys a context.
Definition at line 93 of file io.c. References io_context::fds, free, and io_context::ior.
|