|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
Files | |
| file | query.h |
| Runtime variable query tool API for debug builds. | |
Functions | |
| int | query_init (int preferred_port) |
| Initialize the query tool by spawning the controller process. | |
| void | query_shutdown (void) |
| Shutdown the query tool and terminate the controller process. | |
| bool | query_is_active (void) |
| Check if the query tool controller is currently active. | |
| int | query_get_port (void) |
| Get the port number of the active query server. | |
Convenience Macros | |
These macros provide a convenient interface that compiles out completely in release builds. Use these instead of calling the functions directly. | |
| #define | QUERY_INIT(port) query_init(port) |
| Initialize query tool (debug builds only) | |
| #define | QUERY_SHUTDOWN() query_shutdown() |
| Shutdown query tool (debug builds only) | |
| #define | QUERY_ACTIVE() query_is_active() |
| Check if query tool is active (debug builds only) | |
| #define | QUERY_PORT() query_get_port() |
| Get query server port (debug builds only) | |
This header provides the public C API for the query tool, which enables runtime variable inspection via HTTP queries. The tool uses an external LLDB process to attach to the running application and read variable values.
Note: All functions and macros compile out completely in release builds (when NDEBUG is defined). The query tool has zero runtime overhead in production builds.
| #define QUERY_ACTIVE | ( | ) | query_is_active() |
| #define QUERY_INIT | ( | port | ) | query_init(port) |
| #define QUERY_PORT | ( | ) | query_get_port() |
| #define QUERY_SHUTDOWN | ( | ) | query_shutdown() |
| int query_get_port | ( | void | ) |
| int query_init | ( | int | preferred_port | ) |
#include <query.h>
Initialize the query tool by spawning the controller process.
This function spawns the ascii-query-server process, which attaches to the current process via LLDB and starts an HTTP server on the specified port.
The controller process is completely separate from the target process:
| preferred_port | The port number for the HTTP server (e.g., 9999) |
Platform notes:
Definition at line 216 of file query.c.
References errno, HEALTH_CHECK_TIMEOUT_MS, and query_shutdown().
| bool query_is_active | ( | void | ) |
#include <query.h>
Check if the query tool controller is currently active.
Definition at line 375 of file query.c.
| void query_shutdown | ( | void | ) |
#include <query.h>
Shutdown the query tool and terminate the controller process.
This function cleanly terminates the ascii-query-server process. The target process continues running normally after shutdown.
Definition at line 317 of file query.c.
Referenced by query_init().