|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
🏗️ Common platform abstraction stubs (OS-specific code in posix/ and windows/ subdirectories) More...
Go to the source code of this file.
Functions | |
| size_t | platform_write_all (int fd, const void *buf, size_t count) |
| Write all data to file descriptor with automatic retry on transient errors. | |
| bool | terminal_should_use_control_sequences (int fd) |
| Check if terminal control sequences should be used for the given fd. | |
🏗️ Common platform abstraction stubs (OS-specific code in posix/ and windows/ subdirectories)
Definition in file abstraction.c.
| size_t platform_write_all | ( | int | fd, |
| const void * | buf, | ||
| size_t | count | ||
| ) |
Write all data to file descriptor with automatic retry on transient errors.
Handles incomplete writes and transient errors (EAGAIN, EWOULDBLOCK) by retrying. This ensures complete writes even under high load or when piping to tools like tee.
| fd | File descriptor to write to |
| buf | Buffer containing data to write |
| count | Number of bytes to write |
Definition at line 39 of file abstraction.c.
References platform_sleep_us(), and platform_write().
Referenced by ascii_write(), config_create_default(), interactive_grep_render_input_line(), log_console_impl(), log_json_async_safe(), session_client_like_run(), session_display_render_frame(), session_display_write_raw(), and terminal_screen_render().
| bool terminal_should_use_control_sequences | ( | int | fd | ) |
Check if terminal control sequences should be used for the given fd.
| fd | File descriptor to check |
This function determines whether to send terminal POSITIONING and CONTROL sequences (cursor home, clear screen, hide cursor, etc.) which should only be sent to TTY and never to pipes/redirected output.
Note: This does NOT control ANSI COLOR CODES, which are controlled by –color-mode option and may be sent to pipes if explicitly requested.
Definition at line 90 of file abstraction.c.
References platform_isatty().
Referenced by ascii_write(), ascii_write_destroy(), and ascii_write_init().