|
myMPD
Internal API documentation
|
Event handling. More...
#include "compile_time.h"#include "src/lib/event.h"#include "src/lib/log.h"#include <errno.h>#include <string.h>#include <unistd.h>
Functions | |
| void | event_pfd_init (struct mympd_pfds *pfds) |
| bool | event_pfd_add_fd (struct mympd_pfds *pfds, int fd, enum pfd_type type, struct t_partition_state *partition_state) |
| int | event_eventfd_create (void) |
| int | event_eventfd_create_simple (void) |
| bool | event_eventfd_write (int fd) |
| bool | event_eventfd_read (int fd) |
| eventfd_t | event_eventfd_read_number (int fd) |
| void | event_fd_close (int fd) |
| const char * | lookup_pfd_type (enum pfd_type type) |
| const char * | lookup_pfd_revents (short revent) |
Event handling.
| int event_eventfd_create | ( | void | ) |
Creates an eventfd with semaphore semantics
| int event_eventfd_create_simple | ( | void | ) |
Creates an eventfd
| bool event_eventfd_read | ( | int | fd | ) |
Reads from an eventfd
| fd | read from this fd |
| eventfd_t event_eventfd_read_number | ( | int | fd | ) |
Reads from an eventfd and returns the number read. Sets errno to 0 on success, else sets errno to the error code.
| fd | read from this fd |
| bool event_eventfd_write | ( | int | fd | ) |
Increments the eventfd by one
| fd | fd to write |
| void event_fd_close | ( | int | fd | ) |
Closes the fd
| fd | fd to close |
| bool event_pfd_add_fd | ( | struct mympd_pfds * | pfds, |
| int | fd, | ||
| enum pfd_type | type, | ||
| struct t_partition_state * | partition_state ) |
Adds an fd to poll
| pfds | struct to add the fd |
| fd | fd to add |
| type | fd type to add |
| partition_state | pointer to partition_state or NULL |
| void event_pfd_init | ( | struct mympd_pfds * | pfds | ) |
Initializes the mympd_pfds struct to zero
| pfds | struct to initialize |
| const char * lookup_pfd_revents | ( | short | revent | ) |
Lookups the name for poll revents
| revent | poll return event |