ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
query.h
Go to the documentation of this file.
1
47#pragma once
48
49#include <stdbool.h>
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
78int query_init(int preferred_port);
79
89void query_shutdown(void);
90
99bool query_is_active(void);
100
108int query_get_port(void);
109
117#ifndef NDEBUG
123#define QUERY_INIT(port) query_init(port)
124
128#define QUERY_SHUTDOWN() query_shutdown()
129
134#define QUERY_ACTIVE() query_is_active()
135
140#define QUERY_PORT() query_get_port()
141
142#else /* NDEBUG defined - release build */
143
144#define QUERY_INIT(port) ((void)(port), -1)
145#define QUERY_SHUTDOWN() ((void)0)
146#define QUERY_ACTIVE() (false)
147#define QUERY_PORT() (-1)
148
149#endif /* NDEBUG */
150
153#ifdef __cplusplus
154}
155#endif
int query_init(int preferred_port)
Initialize the query tool by spawning the controller process.
Definition query.c:216
bool query_is_active(void)
Check if the query tool controller is currently active.
Definition query.c:375
int query_get_port(void)
Get the port number of the active query server.
Definition query.c:407
void query_shutdown(void)
Shutdown the query tool and terminate the controller process.
Definition query.c:317