ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
string.h File Reference

🔤 String Manipulation and Shell Escaping Utilities More...

Go to the source code of this file.

Functions

void escape_ascii (const char *str, const char *escape_char, char *out_buffer, size_t out_buffer_size)
 Escape ASCII characters in a string.
 
bool validate_shell_safe (const char *str, const char *allowed_chars)
 Validate that a string contains only safe characters for shell commands.
 
bool escape_shell_single_quotes (const char *str, char *out_buffer, size_t out_buffer_size)
 Escape a string for safe use in shell commands (single quotes)
 
bool escape_shell_double_quotes (const char *str, char *out_buffer, size_t out_buffer_size)
 Escape a string for safe use in shell commands (double quotes, Windows-compatible)
 
bool string_needs_shell_quoting (const char *str)
 Check if a string needs shell quoting (contains spaces or special chars)
 
bool escape_path_for_shell (const char *path, char *out_buffer, size_t out_buffer_size)
 Escape a path for safe use in shell commands (auto-platform)
 
const char * colored_string (log_color_t color, const char *text)
 Build a colored string for terminal output.
 
void truncate_with_ellipsis (const char *input, char *output, size_t output_size, int max_width)
 Truncate a string to a maximum display width, with ellipsis.
 
void strip_ansi_codes (const char *input, char *output, size_t output_size)
 Strip ANSI escape codes from a string.
 

Detailed Description

🔤 String Manipulation and Shell Escaping Utilities

Definition in file util/string.h.