ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
client_like.h
Go to the documentation of this file.
1
49
50#pragma once
51
52#include "session/capture.h"
53#include "session/display.h"
55#include "session/render.h"
57#include <stdbool.h>
58
60/* discovery_session is defined in src/discovery/session.h as an opaque type
61 Discovery mode should include that header and cast to/from void * */
62
68
69/* ============================================================================
70 * Callback Types
71 * ============================================================================ */
72
101 void *user_data);
102
103/* ============================================================================
104 * Configuration Structure
105 * ============================================================================ */
106
115 /* ================================================================ */
116 /* Required */
117 /* ================================================================ */
118
121
123 asciichat_error_t (*prepare_fn)(void *user_data);
124
127
128 /* ================================================================ */
129 /* Networking (NULL for mirror mode) */
130 /* ================================================================ */
131
134
143
144 /* ================================================================ */
145 /* Exit Condition */
146 /* ================================================================ */
147
158 bool (*custom_should_exit)(void *user_data);
159
162
163 /* ================================================================ */
164 /* Reconnection Logic (for client/discovery retry loops) */
165 /* ================================================================ */
166
180
195 bool (*should_reconnect_callback)(asciichat_error_t last_error, int attempt_number, void *user_data);
196
199
208 unsigned int reconnect_delay_ms;
209
210 /* ================================================================ */
211 /* Keyboard Handler */
212 /* ================================================================ */
213
222
223 /* ================================================================ */
224 /* Terminal Behavior */
225 /* ================================================================ */
226
236
237/* ============================================================================
238 * Entry Point
239 * ============================================================================ */
251
264
Synchronized per-thread pending error stacks and value snapshots. SET_ERRNO pushes,...
asciichat_error_t session_client_like_run(const session_client_like_config_t *config)
struct session_client_like_config session_client_like_config_t
session_client_like_kind
Definition client_like.h:63
@ SESSION_CLIENT_LIKE_KIND_CLIENT
Definition client_like.h:65
@ SESSION_CLIENT_LIKE_KIND_DISCOVERY
Definition client_like.h:66
@ SESSION_CLIENT_LIKE_KIND_MIRROR
Definition client_like.h:64
enum session_client_like_kind session_client_like_kind_t
asciichat_error_t(* session_client_like_run_fn)(session_capture_ctx_t *capture, session_display_ctx_t *display, void *user_data)
This is the handoff point for session client like config. Callers fill run_fn, run_user_data,...
bool(*)(void *) session_client_like_get_render_should_exit(void)
📹 Unified media capture abstraction for session-based video sources
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
void(* session_keyboard_handler_fn)(session_capture_ctx_t *capture, int key, void *user_data)
Keyboard input handler callback type.
struct session_display_ctx session_display_ctx_t
session display config is intentionally a small, concrete record. Fields such as snapshot_mode,...
struct session_capture_ctx session_capture_ctx_t
session capture config keeps the values that move through the subsystem: type, path,...
terminal_fd_reader_t * session_client_like_get_stdin_reader(void)
🎮 Keyboard input handler for interactive session controls
struct terminal_fd_reader_s terminal_fd_reader_t
🖥️ Unified terminal display abstraction for session-based rendering
Centralized render loop abstraction for all display modes.
session_client_like_kind_t kind
bool(* should_reconnect_callback)(asciichat_error_t last_error, int attempt_number, void *user_data)
session_keyboard_handler_fn keyboard_handler
unsigned int reconnect_delay_ms
session_client_like_run_fn run_fn
bool(* custom_should_exit)(void *user_data)
asciichat_error_t(* prepare_fn)(void *user_data)