|
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 <sys/eventfd.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) |
| bool | event_eventfd_write (int fd) |
| bool | event_eventfd_read (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
| bool event_eventfd_read | ( | int | fd | ) |
Reads from an eventfd
| 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 |
| const char * lookup_pfd_type | ( | enum pfd_type | type | ) |
Lookups the name for a pfd_type
| type | pfd_type |