|
Asterisk - The Open Source Telephony Project GIT-master-27fb039
|
#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. | |
| void | ast_alertpipe_close (int alert_pipe[2]) |
| Close an alert pipe. | |
| ast_alert_status_t | ast_alertpipe_flush (int alert_pipe[2]) |
| Consume all alerts written to the alert pipe. | |
| int | ast_alertpipe_init (int alert_pipe[2]) |
| Initialize an alert pipe. | |
| ast_alert_status_t | ast_alertpipe_read (int alert_pipe[2]) |
| Read an event from an alert pipe. | |
| int attribute_pure | ast_alertpipe_readable (int alert_pipe[2]) |
| Determine if the alert pipe is readable. | |
| int attribute_pure | ast_alertpipe_readfd (int alert_pipe[2]) |
| Get the alert pipe's read file descriptor. | |
| void | ast_alertpipe_swap (int alert_pipe_1[2], int alert_pipe_2[2]) |
| Swap the file descriptors from two alert pipes. | |
| int attribute_pure | ast_alertpipe_writable (int alert_pipe[2]) |
| Determine if the alert pipe is writable. | |
| ssize_t | ast_alertpipe_write (int alert_pipe[2]) |
| Write an event to an alert pipe. | |
| 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.
| alert_pipe | a two-element array containing the alert pipe's file descriptors |
Definition at line 98 of file alertpipe.h.
References alert_pipe.
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.
| alert_pipe | a two-element containing the alert pipe's file descriptors |
Definition at line 79 of file alertpipe.c.
References alert_pipe, and ast_alertpipe_clear().
Referenced by ast_alertpipe_init(), ast_channel_internal_alertpipe_close(), bridge_channel_destroy(), dealloc_signal(), and really_quit().
| ast_alert_status_t ast_alertpipe_flush | ( | int | alert_pipe[2] | ) |
Consume all alerts written to the alert pipe.
| alert_pipe | 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 alert_pipe, AST_ALERT_NOT_READABLE, AST_ALERT_READ_FAIL, AST_ALERT_READ_SUCCESS, ast_alertpipe_readable(), ast_log, errno, and LOG_WARNING.
Referenced by ast_channel_internal_alert_flush().
| int ast_alertpipe_init | ( | int | alert_pipe[2] | ) |
Initialize an alert pipe.
| alert_pipe | a two-element array to hold the alert pipe's file descriptors |
| non-zero | if a failure occurred. |
| zero | otherwise. |
Definition at line 38 of file alertpipe.c.
References alert_pipe, ast_alertpipe_clear(), ast_alertpipe_close(), ast_fd_set_flags, ast_log, errno, and LOG_WARNING.
Referenced by alloc_signal(), 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.
| alert_pipe | 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 alert_pipe, AST_ALERT_NOT_READABLE, AST_ALERT_READ_FAIL, AST_ALERT_READ_SUCCESS, ast_alertpipe_readable(), ast_log, errno, and LOG_WARNING.
Referenced by ast_channel_internal_alert_read(), bridge_channel_handle_write(), monitor_sig_flags(), and wait_for_signal_or_hangup().
|
inline |
Determine if the alert pipe is readable.
| alert_pipe | a two-element array containing the alert pipe's file descriptors |
| non-zero | if the alert pipe is readable. |
| zero | otherwise. |
Definition at line 114 of file alertpipe.h.
References alert_pipe.
Referenced by ast_alertpipe_flush(), ast_alertpipe_read(), and ast_channel_internal_alert_readable().
|
inline |
Get the alert pipe's read file descriptor.
| alert_pipe | a two-element array containing the alert pipe's file descriptors |
| -1 | if the file descriptor is not initialized. |
| non-negative | otherwise. |
Definition at line 146 of file alertpipe.h.
References SWAP.
Referenced by ast_channel_internal_alert_readfd().
|
inline |
Swap the file descriptors from two alert pipes.
| alert_pipe_1 | a two-element array containing an alert pipe's file descriptors |
| alert_pipe_2 | a two-element array containing an alert pipe's file descriptors |
Definition at line 161 of file alertpipe.h.
Referenced by ast_channel_internal_alertpipe_swap().
|
inline |
Determine if the alert pipe is writable.
| alert_pipe | a two-element array containing the alert pipe's file descriptors |
| non-zero | if the alert pipe is writable. |
| zero | otherwise. |
Definition at line 130 of file alertpipe.h.
References alert_pipe.
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.
| alert_pipe | a two-element array containing the alert pipe's file descriptors |
| 0 | Success |
| 1 | Failure |
Definition at line 120 of file alertpipe.c.
References alert_pipe, ast_alertpipe_writable(), and errno.
Referenced by __quit_handler(), _hup_handler(), ast_bridge_channel_queue_frame(), ast_channel_alert_write(), send_signal(), and wait_for_signal_or_hangup().