22 #ifndef LELY_IO2_SIGSET_H_ 23 #define LELY_IO2_SIGSET_H_ 31 #if _WIN32 && !defined(SIGHUP) 35 #ifndef LELY_IO_SIGSET_INLINE 36 #define LELY_IO_SIGSET_INLINE static inline 54 #define IO_SIGSET_WAIT_INIT(exec, func) \ 56 EV_TASK_INIT(exec, func), 0 \ 64 io_dev_t *(*get_dev)(
const io_sigset_t *sigset);
65 int (*clear)(io_sigset_t *sigset);
66 int (*insert)(io_sigset_t *sigset,
int signo);
67 int (*
remove)(io_sigset_t *sigset,
int signo);
68 void (*submit_wait)(io_sigset_t *sigset,
struct io_sigset_wait *wait);
201 return (*sigset)->get_dev(sigset);
207 return (*sigset)->clear(sigset);
213 return (*sigset)->insert(sigset, signo);
219 return (*sigset)->remove(sigset, signo);
225 (*sigset)->submit_wait(sigset, wait);
244 #endif // !LELY_IO2_SIGSET_H_ const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
struct ev_task task
The task (to be) submitted upon completion (or cancellation) of the wait operation.
static size_t io_sigset_abort(io_sigset_t *sigset, struct ev_task *task)
ev_future_t * io_sigset_async_wait(io_sigset_t *sigset, ev_exec_t *exec, struct io_sigset_wait **pwait)
Submits an asynchronous wait operation to a signal handler and creates a future which becomes ready o...
const struct io_sigset_vtbl *const io_sigset_t
An abstract signal handler.
static ev_exec_t * io_sigset_get_exec(const io_sigset_t *sigset)
ev_exec_t * io_dev_get_exec(const io_dev_t *dev)
Returns a pointer to the executor used by the I/O device to execute asynchronous tasks.
static size_t io_sigset_abort_wait(io_sigset_t *sigset, struct io_sigset_wait *wait)
Aborts the specified signal wait operation if it is pending.
int signo
The signal number, or 0 if the wait operation was canceled.
A wait operation suitable for use with a signal handler.
size_t io_dev_cancel(io_dev_t *dev, struct ev_task *task)
Cancels the asynchronous operation submitted to *dev, if its task has not yet been submitted to its e...
int io_sigset_insert(io_sigset_t *sigset, int signo)
Insert the specified signal number into the set of signals being monitored by a signal handler...
static size_t io_sigset_cancel_wait(io_sigset_t *sigset, struct io_sigset_wait *wait)
Cancels the specified signal wait operation if it is pending.
void io_sigset_submit_wait(io_sigset_t *sigset, struct io_sigset_wait *wait)
Submits a wait operation to a signal handler.
static io_ctx_t * io_sigset_get_ctx(const io_sigset_t *sigset)
io_dev_t * io_sigset_get_dev(const io_sigset_t *sigset)
Returns a pointer to the abstract I/O device representing the signal handler.
This header file is part of the event library; it contains the futures and promises declarations...
size_t io_dev_abort(io_dev_t *dev, struct ev_task *task)
Aborts the asynchronous operation submitted to *dev, if its task has not yet been submitted to its ex...
io_ctx_t * io_dev_get_ctx(const io_dev_t *dev)
Returns a pointer to the I/O context with which the I/O device is registered.
This header file is part of the event library; it contains the task declarations. ...
int io_sigset_remove(io_sigset_t *sigset, int signo)
Removes the specified signal number from the set of signals being monitored by a signal handler...
static size_t io_sigset_cancel(io_sigset_t *sigset, struct ev_task *task)
int io_sigset_clear(io_sigset_t *sigset)
Clears the set of signals being monitored by a signal handler.
const struct io_dev_vtbl *const io_dev_t
An abstract I/O device.
This header file is part of the I/O library; it contains the abstract I/O device interface.
struct io_sigset_wait * io_sigset_wait_from_task(struct ev_task *task)
Obtains a pointer to a signal wait operation from a pointer to its completion task.