Event loop - empty template (basic structure, but no OS specific operations). More...
#include "includes.h"
#include "common.h"
#include "eloop.h"
Go to the source code of this file.
Data Structures | |
struct | eloop_sock |
struct | eloop_timeout |
struct | eloop_signal |
struct | eloop_data |
Functions | |
int | eloop_init (void *user_data) |
Initialize global event loop data. | |
int | eloop_register_read_sock (int sock, void(*handler)(int sock, void *eloop_ctx, void *sock_ctx), void *eloop_data, void *user_data) |
void | eloop_unregister_read_sock (int sock) |
Unregister handler for read events. | |
int | eloop_register_timeout (unsigned int secs, unsigned int usecs, void(*handler)(void *eloop_ctx, void *timeout_ctx), void *eloop_data, void *user_data) |
int | eloop_cancel_timeout (void(*handler)(void *eloop_ctx, void *sock_ctx), void *eloop_data, void *user_data) |
int | eloop_is_timeout_registered (void(*handler)(void *eloop_ctx, void *timeout_ctx), void *eloop_data, void *user_data) |
int | eloop_register_signal (int sig, void(*handler)(int sig, void *eloop_ctx, void *signal_ctx), void *user_data) |
int | eloop_register_signal_terminate (void(*handler)(int sig, void *eloop_ctx, void *signal_ctx), void *user_data) |
int | eloop_register_signal_reconfig (void(*handler)(int sig, void *eloop_ctx, void *signal_ctx), void *user_data) |
void | eloop_run (void) |
Start the event loop. | |
void | eloop_terminate (void) |
Terminate event loop. | |
void | eloop_destroy (void) |
Free any resources allocated for the event loop. | |
int | eloop_terminated (void) |
Check whether event loop has been terminated. | |
void | eloop_wait_for_read_sock (int sock) |
Wait for a single reader. | |
void * | eloop_get_user_data (void) |
Get global user data. |
Event loop - empty template (basic structure, but no OS specific operations).
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
Definition in file eloop_none.c.
void eloop_destroy | ( | void | ) |
Free any resources allocated for the event loop.
After calling eloop_destroy(), other eloop_* functions must not be called before re-running eloop_init().
Definition at line 378 of file eloop_none.c.
void* eloop_get_user_data | ( | void | ) |
Get global user data.
Definition at line 408 of file eloop_none.c.
int eloop_init | ( | void * | user_data | ) |
Initialize global event loop data.
user_data | Pointer to global data passed as eloop_ctx to signal handlers |
This function must be called before any other eloop_* function. user_data can be used to configure a global (to the process) pointer that will be passed as eloop_ctx parameter to signal handlers.
Definition at line 64 of file eloop_none.c.
void eloop_run | ( | void | ) |
Start the event loop.
Start the event loop and continue running as long as there are any registered event handlers. This function is run after event loop has been initialized with event_init() and one or more events have been registered.
Definition at line 315 of file eloop_none.c.
void eloop_terminate | ( | void | ) |
Terminate event loop.
Terminate event loop even if there are registered events. This can be used to request the program to be terminated cleanly.
Definition at line 372 of file eloop_none.c.
int eloop_terminated | ( | void | ) |
Check whether event loop has been terminated.
This function can be used to check whether eloop_terminate() has been called to request termination of the event loop. This is normally used to abort operations that may still be queued to be run when eloop_terminate() was called.
Definition at line 393 of file eloop_none.c.
void eloop_unregister_read_sock | ( | int | sock | ) |
Unregister handler for read events.
sock | File descriptor number for the socket |
Unregister a read socket notifier that was previously registered with eloop_register_read_sock().
Definition at line 99 of file eloop_none.c.
void eloop_wait_for_read_sock | ( | int | sock | ) |
Wait for a single reader.
sock | File descriptor number for the socket |
Do a blocking wait for a single read socket.
Definition at line 399 of file eloop_none.c.