#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <termios.h>#include <string.h>#include <sys/ioctl.h>#include <asterisk/io.h>#include <asterisk/logger.h>Include dependency graph for io.c:

Go to the source code of this file.
Data Structures | |
| struct | io_rec |
| struct | io_context |
Defines | |
| #define | DEBUG(a) |
| #define | GROW_SHRINK_SIZE 512 |
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 oldstate) |
| Restores TTY mode. | |
| int | ast_get_termcols (int fd) |
|
|
Definition at line 26 of file io.c. Referenced by ast_io_add(), ast_io_wait(), ast_sched_add(), ast_sched_del(), ast_sched_runq(), and ast_sched_wait(). |
|
|
Definition at line 45 of file io.c. Referenced by io_context_create(). |
|
|
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.
|
1.3.7