|
Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk/utils.h"

Go to the source code of this file.
Enumerations | |
| enum | ast_alert_status_t { AST_ALERT_READ_SUCCESS = 0, AST_ALERT_NOT_READABLE, AST_ALERT_READ_FAIL, AST_ALERT_READ_FATAL } |
Functions | |
| void | ast_alertpipe_clear (int alert_pipe[2]) |
| Sets the alert pipe file descriptors to default values. More... | |
| void | ast_alertpipe_close (int alert_pipe[2]) |
| Close an alert pipe. More... | |
| ast_alert_status_t | ast_alertpipe_flush (int alert_pipe[2]) |
| Consume all alerts written to the alert pipe. More... | |
| int | ast_alertpipe_init (int alert_pipe[2]) |
| Initialize an alert pipe. More... | |
| ast_alert_status_t | ast_alertpipe_read (int alert_pipe[2]) |
| Read an event from an alert pipe. More... | |
| int | ast_alertpipe_readable (int alert_pipe[2]) |
| Determine if the alert pipe is readable. More... | |
| int | ast_alertpipe_readfd (int alert_pipe[2]) |
| Get the alert pipe's read file descriptor. More... | |
| void | ast_alertpipe_swap (int alert_pipe_1[2], int alert_pipe_2[2]) |
| Swap the file descriptors from two alert pipes. More... | |
| int | ast_alertpipe_writable (int alert_pipe[2]) |
| Determine if the alert pipe is writable. More... | |
| ssize_t | ast_alertpipe_write (int alert_pipe[2]) |
| Write an event to an alert pipe. More... | |
| enum ast_alert_status_t |
| Enumerator | |
|---|---|
| AST_ALERT_READ_SUCCESS | |
| AST_ALERT_NOT_READABLE | |
| AST_ALERT_READ_FAIL | |
| AST_ALERT_READ_FATAL | |
Definition at line 24 of file alertpipe.h.
|
inline |
Sets the alert pipe file descriptors to default values.
| p | a two-element array containing the alert pipe's file descriptors |
Definition at line 97 of file alertpipe.h.
Referenced by ast_alertpipe_close(), ast_alertpipe_init(), and ast_channel_internal_alertpipe_clear().
| void ast_alertpipe_close | ( | int | alert_pipe[2] | ) |
Close an alert pipe.
| p | a two-element containing the alert pipe's file descriptors |
Definition at line 79 of file alertpipe.c.
References ast_alertpipe_clear().
Referenced by ast_alertpipe_init(), ast_channel_internal_alertpipe_close(), bridge_channel_destroy(), and really_quit().
| ast_alert_status_t ast_alertpipe_flush | ( | int | alert_pipe[2] | ) |
Consume all alerts written to the alert pipe.
| p | a two-element array containing the alert pipe's file descriptors |
| AST_ALERT_READ_SUCCESS | on success |
| AST_ALERT_NOT_READABLE | if the alert pipe is not readable |
| AST_ALERT_READ_FATAL | if the alert pipe's file descriptors are in blocking mode, or a read error occurs. |
Definition at line 134 of file alertpipe.c.
References AST_ALERT_NOT_READABLE, AST_ALERT_READ_FAIL, AST_ALERT_READ_SUCCESS, ast_alertpipe_readable(), ast_log, errno, LOG_WARNING, and tmp().
Referenced by ast_channel_internal_alert_flush().
| int ast_alertpipe_init | ( | int | alert_pipe[2] | ) |
Initialize an alert pipe.
| p | a two-element array to hold the alert pipe's file descriptors |
Definition at line 38 of file alertpipe.c.
References ast_alertpipe_clear(), ast_alertpipe_close(), ast_fd_set_flags, ast_log, errno, and LOG_WARNING.
Referenced by ast_channel_internal_alertpipe_init(), asterisk_daemon(), and bridge_channel_internal_alloc().
| ast_alert_status_t ast_alertpipe_read | ( | int | alert_pipe[2] | ) |
Read an event from an alert pipe.
| p | a two-element array containing the alert pipe's file descriptors |
| AST_ALERT_READ_SUCCESS | on success |
| AST_ALERT_NOT_READABLE | if the alert pipe is not readable |
| AST_ALERT_READ_FATAL | if the alert pipe's file descriptors are in blocking mode, or a read error occurs. |
Definition at line 102 of file alertpipe.c.
References AST_ALERT_NOT_READABLE, AST_ALERT_READ_FAIL, AST_ALERT_READ_SUCCESS, ast_alertpipe_readable(), ast_log, errno, LOG_WARNING, and tmp().
Referenced by ast_channel_internal_alert_read(), bridge_channel_handle_write(), and monitor_sig_flags().
|
inline |
Determine if the alert pipe is readable.
| p | a two-element array containing the alert pipe's file descriptors |
Definition at line 112 of file alertpipe.h.
Referenced by ast_alertpipe_flush(), ast_alertpipe_read(), and ast_channel_internal_alert_readable().
|
inline |
Get the alert pipe's read file descriptor.
| p | a two-element array containing the alert pipe's file descriptors |
Definition at line 143 of file alertpipe.h.
References SWAP.
Referenced by ast_channel_internal_alert_readfd().
|
inline |
Swap the file descriptors from two alert pipes.
| p1 | a two-element array containing an alert pipe's file descriptors |
| p2 | a two-element array containing an alert pipe's file descriptors |
Definition at line 158 of file alertpipe.h.
Referenced by ast_channel_internal_alertpipe_swap().
|
inline |
Determine if the alert pipe is writable.
| p | a two-element array containing the alert pipe's file descriptors |
Definition at line 127 of file alertpipe.h.
Referenced by ast_alertpipe_write(), and ast_channel_alert_writable().
| ssize_t ast_alertpipe_write | ( | int | alert_pipe[2] | ) |
Write an event to an alert pipe.
| p | a two-element array containing the alert pipe's file descriptors |
| 0 | Success |
| 1 | Failure |
Definition at line 120 of file alertpipe.c.
References ast_alertpipe_writable(), errno, and tmp().
Referenced by __quit_handler(), _hup_handler(), ast_bridge_channel_queue_frame(), and ast_channel_alert_write().
1.8.13