ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
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
14typedef void (*platform_event_task_fn)(void *arg);
15typedef void (*platform_event_read_fn)(platform_event_stream_t *, const void *, size_t, void *);
18typedef void (*platform_event_queue_fn)(void *, size_t);
20typedef void (*platform_event_work_fn)(void *);
21typedef void (*platform_event_work_done_fn)(platform_event_stream_t *, void *, bool closing);
22
28const char *platform_event_backend(void);
31 void *);
32
59asciichat_error_t platform_event_stream_peer(platform_event_stream_t *, struct sockaddr_storage *, socklen_t *);
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:268
asciichat_error_t platform_event_loop_post(platform_event_loop_t *loop, platform_event_task_fn fn, void *arg)
Definition event.c:241
struct platform_event_listener platform_event_listener_t
Definition event.h:13
struct platform_event_loop platform_event_loop_t
Definition event.h:11
size_t platform_event_stream_queued_bytes(const platform_event_stream_t *)
Definition event.c:703
void(* platform_event_work_fn)(void *)
Definition event.h:20
void(* platform_event_accept_fn)(platform_event_stream_t *, void *)
Definition event.h:19
void platform_event_loop_stop(platform_event_loop_t *loop)
Definition event.c:257
void platform_event_stream_request_close(platform_event_stream_t *, asciichat_error_t)
Definition event.c:625
asciichat_error_t platform_event_stream_resume(platform_event_stream_t *)
Definition event.c:346
asciichat_error_t platform_event_stream_peer(platform_event_stream_t *, struct sockaddr_storage *, socklen_t *)
Definition event.c:822
void platform_event_stream_set_zerocopy(platform_event_stream_t *, bool enabled)
Definition event.c:617
void(* platform_event_close_fn)(void *, asciichat_error_t)
Definition event.h:16
struct platform_event_stream platform_event_stream_t
Definition event.h:12
void platform_event_listener_close(platform_event_listener_t *)
Definition event.c:165
asciichat_error_t platform_event_loop_work(platform_event_loop_t *, platform_event_task_fn, platform_event_task_fn, void *)
Definition event.c:768
asciichat_error_t platform_event_loop_run(platform_event_loop_t *loop)
Definition event.c:234
asciichat_error_t platform_event_stream_deadline(platform_event_stream_t *, uint64_t timeout_ms)
Definition event.c:357
asciichat_error_t platform_event_loop_create(platform_event_loop_t **out)
Definition event.c:205
void(* platform_event_work_done_fn)(platform_event_stream_t *, void *, bool closing)
Definition event.h:21
void(* platform_event_task_fn)(void *arg)
Definition event.h:14
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:637
asciichat_error_t platform_event_stream_adopt(platform_event_loop_t *, socket_t *, platform_event_stream_t **)
Definition event.c:410
asciichat_error_t platform_event_listen(platform_event_loop_t *, socket_t *, platform_event_accept_fn, void *, platform_event_listener_t **)
Definition event.c:451
void(* platform_event_queue_fn)(void *, size_t)
Definition event.h:18
asciichat_error_t platform_event_stream_start(platform_event_stream_t *, platform_event_read_fn, platform_event_close_fn, void *)
Definition event.c:326
void platform_event_stream_observe_queue(platform_event_stream_t *, platform_event_queue_fn, void *)
Definition event.c:712
const char * platform_event_backend(void)
Definition event.c:279
asciichat_error_t platform_event_stream_work(platform_event_stream_t *, platform_event_work_fn, platform_event_work_done_fn, void *)
Definition event.c:801
void(* platform_event_write_fn)(void *, asciichat_error_t)
Definition event.h:17
void platform_event_stream_pause(platform_event_stream_t *)
Definition event.c:341
void platform_event_stream_close(platform_event_stream_t *, asciichat_error_t)
Definition event.c:120
void(* platform_event_read_fn)(platform_event_stream_t *, const void *, size_t, void *)
Definition event.h:15
asciichat_error_t platform_event_loop_tick(platform_event_loop_t *, uint64_t, platform_event_task_fn, void *)
Definition event.c:296
bool enabled
Is filtering active?
Definition grep.c:62
unsigned long long uint64_t
Definition common.h:63
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
int socket_t
static bool size_t gotel_query_t * out
Definition queries.h:8
platform event stream is intentionally a small, concrete record. Fields such as listener,...
Definition event.c:76
The useful part of event write is in request, stream, done, arg: together they describe what is pendi...
Definition event.c:43