ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
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
102/* ============================================================================
103 * Configuration Structure
104 * ============================================================================ */
105
114 /* ================================================================ */
115 /* Required */
116 /* ================================================================ */
117
120
122 asciichat_error_t (*prepare_fn)(void *user_data);
123
126
127 /* ================================================================ */
128 /* Networking (NULL for mirror mode) */
129 /* ================================================================ */
130
133
142
143 /* ================================================================ */
144 /* Exit Condition */
145 /* ================================================================ */
146
157 bool (*custom_should_exit)(void *user_data);
158
161
162 /* ================================================================ */
163 /* Reconnection Logic (for client/discovery retry loops) */
164 /* ================================================================ */
165
179
194 bool (*should_reconnect_callback)(asciichat_error_t last_error, int attempt_number, void *user_data);
195
198
207 unsigned int reconnect_delay_ms;
208
209 /* ================================================================ */
210 /* Keyboard Handler */
211 /* ================================================================ */
212
221
222 /* ================================================================ */
223 /* Terminal Behavior */
224 /* ================================================================ */
225
235
236/* ============================================================================
237 * Entry Point
238 * ============================================================================ */
250
263
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:48
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)