ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
query.c File Reference

Query tool runtime library implementation. More...

Go to the source code of this file.

Macros

#define TOOLING_QUERY_CMDLINE_BUFFER_SIZE   2048
#define TOOLING_QUERY_PORT_BUFFER_SIZE   16
#define TOOLING_QUERY_PID_BUFFER_SIZE   16
#define HEALTH_CHECK_TIMEOUT_NS   (10000LL * NS_PER_MS_INT)
#define HEALTH_CHECK_INTERVAL_NS   (100LL * NS_PER_MS_INT)
#define HEALTH_CHECK_CONNECT_TIMEOUT_NS   (500LL * NS_PER_MS_INT)

Functions

int query_init (int preferred_port)
 Initialize the query tool by spawning the controller process.
void query_destroy (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.

Detailed Description

Query tool runtime library implementation.

This provides the QUERY_INIT/QUERY_SHUTDOWN macros that applications use to auto-spawn the query controller process.

Platform support:

  • Unix (macOS/Linux): Uses fork/exec to spawn controller
  • Windows: Uses CreateProcess to spawn controller

Definition in file query.c.

Macro Definition Documentation

◆ HEALTH_CHECK_CONNECT_TIMEOUT_NS

#define HEALTH_CHECK_CONNECT_TIMEOUT_NS   (500LL * NS_PER_MS_INT)

Definition at line 47 of file query.c.

◆ HEALTH_CHECK_INTERVAL_NS

#define HEALTH_CHECK_INTERVAL_NS   (100LL * NS_PER_MS_INT)

Definition at line 46 of file query.c.

◆ HEALTH_CHECK_TIMEOUT_NS

#define HEALTH_CHECK_TIMEOUT_NS   (10000LL * NS_PER_MS_INT)

Definition at line 45 of file query.c.

Referenced by query_init().

◆ TOOLING_QUERY_CMDLINE_BUFFER_SIZE

#define TOOLING_QUERY_CMDLINE_BUFFER_SIZE   2048

Definition at line 14 of file query.c.

Referenced by query_init().

◆ TOOLING_QUERY_PID_BUFFER_SIZE

#define TOOLING_QUERY_PID_BUFFER_SIZE   16

Definition at line 16 of file query.c.

Referenced by query_init().

◆ TOOLING_QUERY_PORT_BUFFER_SIZE

#define TOOLING_QUERY_PORT_BUFFER_SIZE   16

Definition at line 15 of file query.c.

Referenced by query_init().