ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
search.h
Go to the documentation of this file.
1
21#pragma once
22
26#include <stdbool.h>
27#include <stddef.h>
28
37
38/* ============================================================================
39 * Lifecycle Functions
40 * ========================================================================== */
41
50
56void log_search_destroy(void);
57
58/* ============================================================================
59 * Mode Management
60 * ========================================================================== */
61
68void log_search_enter_mode(void);
69
77void log_search_exit_mode(bool accept);
78
83bool log_search_is_entering(void);
84
89bool log_search_is_active(void);
90
91/* ============================================================================
92 * Keyboard Handling
93 * ========================================================================== */
94
104bool log_search_should_handle(int key);
105
119
120/* ============================================================================
121 * Log Filtering and Display
122 * ========================================================================== */
123
140
150void log_search_render_input_line(int width);
151
162bool log_search_get_match_info(const char *message, size_t *out_match_start, size_t *out_match_len);
163
172
182
183/* ============================================================================
184 * Signal-Safe Interface
185 * ========================================================================== */
186
194
201void log_search_signal_cancel(void);
202
210
211/* ============================================================================
212 * Re-render Notification
213 * ========================================================================== */
214
223
224/* ============================================================================
225 * Internal Access (for atomic rendering)
226 * ========================================================================== */
227
235void *log_search_get_mutex(void);
236
244
252
259const char *log_search_get_input_buffer(void);
260
⚠️‼️ Comprehensive thread-local error context system for ascii-chat
asciichat_error_t
Error and exit codes - unified status values (0-255)
Definition error_codes.h:49
keyboard_key_t
Unified keyboard key code enumeration.
Definition keyboard.h:54
Thread-safe circular log buffer for session screens (status, splash)
🎮 Cross-platform keyboard input interface for ascii-chat
asciichat_error_t log_search_init(void)
Initialize interactive grep subsystem.
Definition search.c:125
void * log_search_get_mutex(void)
Get the mutex protecting grep state.
Definition search.c:936
bool log_search_needs_rerender(void)
Check if screen needs immediate re-render.
Definition search.c:884
bool log_search_check_signal_cancel(void)
Check and clear the signal-cancel flag.
Definition search.c:380
void log_search_signal_cancel(void)
Cancel grep mode from a signal handler (async-signal-safe)
Definition search.c:376
bool log_search_is_entering(void)
Check if currently in input mode (typing pattern)
Definition search.c:385
log_search_mode_t
Search mode states.
Definition search.h:32
@ LOG_SEARCH_MODE_ACTIVE
Pattern accepted and filtering.
Definition search.h:35
@ LOG_SEARCH_MODE_ENTERING
'/' pressed, typing pattern
Definition search.h:34
@ LOG_SEARCH_MODE_INACTIVE
Not in search mode.
Definition search.h:33
bool log_search_get_global_highlight(void)
Check if global highlighting (/g flag) is enabled in current pattern.
Definition search.c:896
int log_search_get_input_len(void)
Get current input buffer length (must hold mutex)
Definition search.c:940
void log_search_enter_mode(void)
Enter search mode (user pressed '/')
Definition search.c:214
const char * log_search_get_input_buffer(void)
Get current input buffer content (must hold mutex)
Definition search.c:948
bool log_search_is_active(void)
Check if filtering is active.
Definition search.c:390
bool log_search_get_case_insensitive(void)
Check if case-insensitive flag is set (must hold mutex)
Definition search.c:952
void log_search_exit_mode(bool accept)
Exit search mode.
Definition search.c:287
void * log_search_get_pattern_singleton(void)
Get the compiled regex pattern for interactive grep (internal use)
Definition search.c:911
bool log_search_get_match_info(const char *message, size_t *out_match_start, size_t *out_match_len)
Get match info for highlighting a log message.
Definition search.c:729
bool log_search_should_handle(int key)
Check if a key should be handled by grep module.
Definition search.c:399
void log_search_destroy(void)
Clean up interactive grep subsystem.
Definition search.c:192
int log_search_get_cursor_position(void)
Get current cursor position in input buffer (must hold mutex)
Definition search.c:944
asciichat_error_t log_search_handle_key(keyboard_key_t key)
Process keyboard input for grep.
Definition search.c:414
void log_search_render_input_line(int width)
Render grep input line at bottom of screen.
Definition search.c:691
bool log_search_is_entering_atomic(void)
Check if grep is in entering mode (async-signal-safe)
Definition search.c:372
asciichat_error_t log_search_gather_and_filter_logs(session_log_entry_t **out_entries, size_t *out_count)
Gather and filter logs for display.
Definition search.c:530
ClangTool/LibTooling compatibility shim for stdbool.h.
Single log entry with sequence number for ordering.