|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
Centralized enum and mode string conversion - single source of truth. More...
Go to the source code of this file.
Data Structures | |
| struct | mode_descriptor_t |
| Mode descriptor for string conversion. More... | |
Functions | |
| const char * | asciichat_mode_to_string (asciichat_mode_t mode) |
| asciichat_mode_t | asciichat_string_to_mode (const char *str) |
| bool | asciichat_is_valid_mode_string (const char *str) |
| size_t | asciichat_get_all_mode_strings (const char ***out_names) |
| const char * | asciichat_suggest_mode (const char *input) |
| const char * | color_mode_to_string (terminal_color_mode_t mode) |
| const char * | render_mode_to_string (render_mode_t mode) |
| const char * | palette_type_to_string (palette_type_t type) |
| const char * | asciichat_suggest_enum_value (const char *option_name, const char *input) |
Centralized enum and mode string conversion - single source of truth.
This module provides bidirectional conversion between enums and strings:
All mode and enum string conversions should use this module.
Definition in file options/strings.c.
| size_t asciichat_get_all_mode_strings | ( | const char *** | out_names | ) |
Definition at line 85 of file options/strings.c.
References mode_descriptor_t::name.
Referenced by asciichat_suggest_mode().
| bool asciichat_is_valid_mode_string | ( | const char * | str | ) |
Definition at line 81 of file options/strings.c.
References asciichat_string_to_mode().
| const char * asciichat_mode_to_string | ( | asciichat_mode_t | mode | ) |
Definition at line 53 of file options/strings.c.
References mode_descriptor_t::name.
| asciichat_mode_t asciichat_string_to_mode | ( | const char * | str | ) |
Definition at line 67 of file options/strings.c.
References mode_descriptor_t::mode, and mode_descriptor_t::name.
Referenced by asciichat_is_valid_mode_string().
| const char * asciichat_suggest_enum_value | ( | const char * | option_name, |
| const char * | input | ||
| ) |
Definition at line 192 of file options/strings.c.
References levenshtein_find_similar(), and options_get_enum_values().
Referenced by parse_color_mode(), parse_palette_type(), and parse_render_mode().
| const char * asciichat_suggest_mode | ( | const char * | input | ) |
Definition at line 109 of file options/strings.c.
References asciichat_get_all_mode_strings(), and levenshtein_find_similar().
| const char * color_mode_to_string | ( | terminal_color_mode_t | mode | ) |
Definition at line 131 of file options/strings.c.
Referenced by session_display_render_help().
| const char * palette_type_to_string | ( | palette_type_t | type | ) |
Definition at line 169 of file options/strings.c.
| const char * render_mode_to_string | ( | render_mode_t | mode | ) |
Definition at line 152 of file options/strings.c.
Referenced by session_display_render_help().