|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
Clean shutdown detection without library accessing application state. More...
Files | |
| file | shutdown.h |
| Shutdown check system for clean library/application separation. | |
Typedefs | |
| typedef bool(* | shutdown_check_fn) (void) |
| Shutdown check callback function type. | |
Functions | |
| void | shutdown_register_callback (shutdown_check_fn callback) |
| Register application's shutdown check function. | |
| bool | shutdown_is_requested (void) |
| Check if shutdown has been requested. | |
Clean shutdown detection without library accessing application state.
Provides clean separation between library and application for shutdown detection. Library code should never directly access application state.
Usage: Application (server.c/client.c): shutdown_register_callback(my_shutdown_check_fn);
Library code (logging.c, debug/lock.c, etc.): if (shutdown_is_requested()) { return; }
| typedef bool(* shutdown_check_fn) (void) |
#include <shutdown.h>
Shutdown check callback function type.
Definition at line 32 of file shutdown.h.
| bool shutdown_is_requested | ( | void | ) |
#include <shutdown.h>
Check if shutdown has been requested.
Definition at line 45 of file common.c.
Referenced by log_plain_msg(), log_plain_stderr_msg(), and log_plain_stderr_nonewline_msg().
| void shutdown_register_callback | ( | shutdown_check_fn | callback | ) |
#include <shutdown.h>
Register application's shutdown check function.
| callback | Function to call to check if shutdown has been requested |
Referenced by server_main().