![]() |
GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A simple epoll wrapper. More...
Go to the source code of this file.
Data Structures | |
| struct | gp_poll |
| An epoll instance. More... | |
| struct | gp_fd |
| An epoll file descriptor. More... | |
Typedefs | |
| typedef struct gp_poll | gp_poll |
| An epoll instance. | |
Enumerations | |
| enum | gp_poll_events { GP_POLLIN = 0x01 , GP_POLLPRI = 0x02 , GP_POLLOUT = 0x04 , GP_POLLERR = 0x08 , GP_POLLHUP = 0x10 } |
| A gp_epoll flags. More... | |
| enum | gp_poll_event_ret { GP_POLL_RET_OK = 0 , GP_POLL_RET_REM = 1 } |
| A return value from the event() callback. More... | |
Functions | |
| void | gp_poll_clear (gp_poll *self) |
| Removes all file descriptors from the poll. | |
| int | gp_poll_add (gp_poll *self, gp_fd *fd) |
| Adds a file descriptor. | |
| int | gp_poll_rem (gp_poll *self, gp_fd *fd) |
| Removes a file descriptor. | |
| gp_fd * | gp_poll_rem_by_fd (gp_poll *self, int fd) |
| Looks up and removes a gp_fd by a fd. | |
| int | gp_poll_wait (gp_poll *self, int timeout_ms) |
| A wrapper around the poll(). | |
| static size_t | gp_poll_fds (gp_poll *self) |
| Returns a number of fds in the poll instance. | |
A simple epoll wrapper.
Definition in file gp_poll.h.
| enum gp_poll_event_ret |
| enum gp_poll_events |
Adds a file descriptor.
Referenced by gp_backend_poll_add().
| void gp_poll_clear | ( | gp_poll * | self | ) |
Removes all file descriptors from the poll.
| self | The gp_poll struct. |
|
inlinestatic |
Returns a number of fds in the poll instance.
| self | The fds struct. |
Definition at line 152 of file gp_poll.h.
References gp_dlist::cnt, and gp_poll::fds.
Removes a file descriptor.
| self | The poll struct. |
| fd | File descriptor to be removed. |
Referenced by gp_backend_poll_rem().
Looks up and removes a gp_fd by a fd.
| self | The poll struct. |
| fd | A file descriptor for the lookup. |
Referenced by gp_backend_poll_rem_by_fd().
| int gp_poll_wait | ( | gp_poll * | self, |
| int | timeout_ms ) |
A wrapper around the poll().
Polls for file descriptors added by the gp_fds_add() function, calls event() callback for each fd if events are returned.
| self | The fds struct. |
| timeout_ms | Timeout passed to poll(). |