ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
event.h
Go to the documentation of this file.
1#pragma once
2
4#include <libplatform/socket.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
18typedef void (*platform_event_task_fn)(void *arg);
19typedef void (*platform_event_read_fn)(platform_event_stream_t *, const void *,
20 size_t, void *);
23typedef void (*platform_event_queue_fn)(void *, size_t);
25typedef void (*platform_event_work_fn)(void *);
27 bool closing);
28
33 void *arg);
36const char *platform_event_backend(void);
42
58 socket_t *,
66 const socket_buffer_t *, size_t,
78 bool enabled);
81 uint64_t timeout_ms);
83 struct sockaddr_storage *,
84 socklen_t *);
99 void *);
100
101#ifdef __cplusplus
102}
103#endif
Synchronized per-thread pending error stacks and value snapshots. SET_ERRNO pushes,...
asciichat_error_t platform_event_loop_destroy(platform_event_loop_t *loop)
Definition event.c:277
asciichat_error_t platform_event_loop_post(platform_event_loop_t *loop, platform_event_task_fn fn, void *arg)
Definition event.c:247
struct platform_event_listener platform_event_listener_t
Definition event.h:17
struct platform_event_loop platform_event_loop_t
Definition event.h:15
size_t platform_event_stream_queued_bytes(const platform_event_stream_t *)
Definition event.c:746
void(* platform_event_work_fn)(void *)
Definition event.h:25
void(* platform_event_accept_fn)(platform_event_stream_t *, void *)
Definition event.h:24
void platform_event_loop_stop(platform_event_loop_t *loop)
Definition event.c:266
void platform_event_stream_request_close(platform_event_stream_t *, asciichat_error_t)
Definition event.c:662
asciichat_error_t platform_event_stream_resume(platform_event_stream_t *)
Definition event.c:364
asciichat_error_t platform_event_stream_peer(platform_event_stream_t *, struct sockaddr_storage *, socklen_t *)
Definition event.c:878
void platform_event_stream_set_zerocopy(platform_event_stream_t *, bool enabled)
Definition event.c:653
void(* platform_event_close_fn)(void *, asciichat_error_t)
Definition event.h:21
struct platform_event_stream platform_event_stream_t
Definition event.h:16
void platform_event_listener_close(platform_event_listener_t *)
Definition event.c:169
asciichat_error_t platform_event_loop_work(platform_event_loop_t *, platform_event_task_fn, platform_event_task_fn, void *)
Definition event.c:816
asciichat_error_t platform_event_loop_run(platform_event_loop_t *loop)
Definition event.c:240
asciichat_error_t platform_event_stream_deadline(platform_event_stream_t *, uint64_t timeout_ms)
Definition event.c:377
asciichat_error_t platform_event_loop_create(platform_event_loop_t **out)
Definition event.c:210
void(* platform_event_work_done_fn)(platform_event_stream_t *, void *, bool closing)
Definition event.h:26
void(* platform_event_task_fn)(void *arg)
Definition event.h:18
asciichat_error_t platform_event_stream_write(platform_event_stream_t *, const socket_buffer_t *, size_t, platform_event_write_fn, void *)
Definition event.c:675
asciichat_error_t platform_event_stream_adopt(platform_event_loop_t *, socket_t *, platform_event_stream_t **)
Definition event.c:434
asciichat_error_t platform_event_listen(platform_event_loop_t *, socket_t *, platform_event_accept_fn, void *, platform_event_listener_t **)
Definition event.c:476
void(* platform_event_queue_fn)(void *, size_t)
Definition event.h:23
asciichat_error_t platform_event_stream_start(platform_event_stream_t *, platform_event_read_fn, platform_event_close_fn, void *)
Definition event.c:341
void platform_event_stream_observe_queue(platform_event_stream_t *, platform_event_queue_fn, void *)
Definition event.c:755
const char * platform_event_backend(void)
Definition event.c:288
asciichat_error_t platform_event_stream_work(platform_event_stream_t *, platform_event_work_fn, platform_event_work_done_fn, void *)
Definition event.c:853
void(* platform_event_write_fn)(void *, asciichat_error_t)
Definition event.h:22
void platform_event_stream_pause(platform_event_stream_t *)
Definition event.c:358
void platform_event_stream_close(platform_event_stream_t *, asciichat_error_t)
Definition event.c:123
void(* platform_event_read_fn)(platform_event_stream_t *, const void *, size_t, void *)
Definition event.h:19
asciichat_error_t platform_event_loop_tick(platform_event_loop_t *, uint64_t, platform_event_task_fn, void *)
Definition event.c:306
bool enabled
Is filtering active?
Definition grep.c:63
unsigned long long uint64_t
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
int socket_t
static bool size_t gotel_query_t * out
Definition queries.h:10
platform event stream is intentionally a small, concrete record. Fields such as listener,...
Definition event.c:79
The useful part of event write is in request, stream, done, arg: together they describe what is pendi...
Definition event.c:45