|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
Go to the source code of this file.
Data Structures | |
| struct | grep_pattern_t |
| Single filter pattern with all its settings. More... | |
Macros | |
| #define | HIGHLIGHT_DARK_BG 70 |
| Default highlight colors (grey) Dark grey (70) for dark backgrounds, light grey (200) for light backgrounds. | |
| #define | HIGHLIGHT_LIGHT_BG 200 |
| #define | MIN_HIGHLIGHT_DISTANCE 40 |
| Minimum color difference threshold (0-255 scale) If background is within this distance of the highlight, use black/white instead. | |
Typedefs | |
| typedef grep_parse_result_t | parse_result_t |
Functions | |
| grep_parse_result_t | grep_parse_pattern (const char *input) |
| Parse pattern in /pattern/flags or pattern/flags format. | |
| asciichat_error_t | grep_init (const char *pattern) |
| bool | grep_should_output (const char *log_line, size_t *match_start, size_t *match_len) |
| char * | grep_highlight_colored_copy (const char *colored_text, const char *plain_text, size_t match_start, size_t match_len) |
| const char * | grep_highlight_colored (const char *colored_text, const char *plain_text, size_t match_start, size_t match_len) |
| const char * | grep_highlight (const char *log_line, size_t match_start, size_t match_len) |
| void | grep_destroy (void) |
| asciichat_error_t | grep_save_patterns (void) |
| asciichat_error_t | grep_restore_patterns (void) |
| void | grep_clear_patterns (void) |
| int | grep_get_pattern_count (void) |
| const char * | grep_get_last_pattern (void) |
| #define HIGHLIGHT_DARK_BG 70 |
| #define MIN_HIGHLIGHT_DISTANCE 40 |
| typedef grep_parse_result_t parse_result_t |
| void grep_clear_patterns | ( | void | ) |
| void grep_destroy | ( | void | ) |
Definition at line 1240 of file grep.c.
References grep_pattern_t::original, grep_pattern_t::parsed_pattern, and grep_pattern_t::singleton.
Referenced by log_destroy().
| const char * grep_get_last_pattern | ( | void | ) |
Definition at line 1389 of file grep.c.
Referenced by interactive_grep_enter_mode(), interactive_grep_init(), server_status_display(), and server_status_display_interactive().
| int grep_get_pattern_count | ( | void | ) |
| const char * grep_highlight | ( | const char * | log_line, |
| size_t | match_start, | ||
| size_t | match_len | ||
| ) |
Definition at line 1131 of file grep.c.
References append_truecolor_bg(), asciichat_pcre2_singleton_get_code(), and grep_pattern_t::singleton.
| const char * grep_highlight_colored | ( | const char * | colored_text, |
| const char * | plain_text, | ||
| size_t | match_start, | ||
| size_t | match_len | ||
| ) |
Definition at line 806 of file grep.c.
References append_truecolor_bg(), asciichat_pcre2_singleton_get_code(), interactive_grep_get_case_insensitive(), interactive_grep_get_global_highlight(), interactive_grep_get_input_buffer(), interactive_grep_get_input_len(), interactive_grep_get_pattern_singleton(), interactive_grep_is_active(), grep_pattern_t::singleton, and utf8_strcasestr().
Referenced by grep_highlight_colored_copy(), and terminal_screen_render().
| char * grep_highlight_colored_copy | ( | const char * | colored_text, |
| const char * | plain_text, | ||
| size_t | match_start, | ||
| size_t | match_len | ||
| ) |
Definition at line 792 of file grep.c.
References grep_highlight_colored().
| asciichat_error_t grep_init | ( | const char * | pattern | ) |
Definition at line 549 of file grep.c.
References asciichat_pcre2_singleton_get_code(), grep_pattern_t::case_insensitive, grep_pattern_t::context_after, grep_pattern_t::context_before, grep_pattern_t::global_flag, grep_parse_pattern(), grep_pattern_t::invert, grep_pattern_t::is_fixed_string, grep_pattern_t::original, grep_pattern_t::parsed_pattern, and grep_pattern_t::singleton.
Referenced by main().
| grep_parse_result_t grep_parse_pattern | ( | const char * | input | ) |
Parse pattern in /pattern/flags or pattern/flags format.
| input | Input pattern string (either /pattern/flags, pattern/flags, or plain pattern) |
Format 1 (with flags, explicit): /pattern/flags
Format 2 (with flags, implicit): pattern/flags
Format 3 (plain regex): pattern
Flags (formats 1 & 2):
Examples:
Definition at line 414 of file grep.c.
Referenced by grep_init(), interactive_grep_enter_mode(), interactive_grep_exit_mode(), interactive_grep_gather_and_filter_logs(), interactive_grep_get_match_info(), interactive_grep_handle_key(), and interactive_grep_init().
| asciichat_error_t grep_restore_patterns | ( | void | ) |
Definition at line 1328 of file grep.c.
References grep_pattern_t::parsed_pattern, and grep_pattern_t::singleton.
Referenced by interactive_grep_exit_mode().
| asciichat_error_t grep_save_patterns | ( | void | ) |
Definition at line 1278 of file grep.c.
References grep_pattern_t::parsed_pattern, and grep_pattern_t::singleton.
Referenced by interactive_grep_enter_mode().
| bool grep_should_output | ( | const char * | log_line, |
| size_t * | match_start, | ||
| size_t * | match_len | ||
| ) |
Definition at line 648 of file grep.c.
References asciichat_pcre2_singleton_get_code(), grep_pattern_t::case_insensitive, grep_pattern_t::context_after, grep_pattern_t::context_before, grep_pattern_t::invert, grep_pattern_t::is_fixed_string, grep_pattern_t::parsed_pattern, grep_pattern_t::singleton, and utf8_strcasestr().
| int buffer_size |
Size of circular buffer.
Definition at line 84 of file grep.c.
Referenced by crypto_get_rekey_status(), crypto_get_status(), format_duration_ms(), format_duration_ns(), format_duration_s(), format_uptime_hms(), framebuffer_clear(), get_required_argument(), image_print_16color(), image_print_16color_dithered(), image_print_16color_dithered_with_background(), manpage_merger_generate_synopsis(), safe_snprintf(), safe_vsnprintf(), strip_equals_prefix(), update_check_format_notification(), and update_check_get_upgrade_suggestion().
| bool enabled |
Is filtering active?
Definition at line 78 of file grep.c.
Referenced by log_set_force_stderr(), log_set_terminal_output(), set_flip_x(), and set_matrix_rain().
| char** line_buffer |
Circular buffer for context_before.
Definition at line 83 of file grep.c.
Referenced by sdp_parse().
| volatile int match_data_initialized |
| int max_context_after |
| int pattern_count |
Number of active patterns.
Definition at line 76 of file grep.c.
Referenced by interactive_grep_get_match_info().
| grep_pattern_t* patterns |
| grep_pattern_t* saved_patterns |