ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
util/string.h
Go to the documentation of this file.
1#pragma once
2
43#include <stddef.h>
44#include <stdbool.h>
45
46/* ============================================================================
47 * String Escaping Functions
48 * @{
49 */
50
68void escape_ascii(const char *str, const char *escape_char, char *out_buffer, size_t out_buffer_size);
69
101bool validate_shell_safe(const char *str, const char *allowed_chars);
102
128bool escape_shell_single_quotes(const char *str, char *out_buffer, size_t out_buffer_size);
129
154bool escape_shell_double_quotes(const char *str, char *out_buffer, size_t out_buffer_size);
155
182bool string_needs_shell_quoting(const char *str);
183
214bool escape_path_for_shell(const char *path, char *out_buffer, size_t out_buffer_size);
215
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)
Definition string.c:143
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)
Definition string.c:101
bool string_needs_shell_quoting(const char *str)
Check if a string needs shell quoting (contains spaces or special chars)
Definition string.c:188
bool validate_shell_safe(const char *str, const char *allowed_chars)
Validate that a string contains only safe characters for shell commands.
Definition string.c:54
void escape_ascii(const char *str, const char *escape_char, char *out_buffer, size_t out_buffer_size)
Escape ASCII characters in a string.
Definition string.c:12
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)
Definition string.c:213