ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
search.h
Go to the documentation of this file.
1
20
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
121
124
125/* ============================================================================
126 * Log Filtering and Display
127 * ========================================================================== */
128
146 size_t *out_count);
147
158
169bool log_search_get_match_info(const char *message, size_t *out_match_start, size_t *out_match_len);
170
179
188void *log_search_copy_pattern(void);
189
190/* ============================================================================
191 * Signal-Safe Interface
192 * ========================================================================== */
193
201
208void log_search_signal_cancel(void);
209
217
218/* ============================================================================
219 * Re-render Notification
220 * ========================================================================== */
221
230
231/* ============================================================================
232 * Internal Access (for atomic rendering)
233 * ========================================================================== */
234
242void *log_search_get_mutex(void);
243
251
259
266const char *log_search_get_input_buffer(void);
267
Synchronized per-thread pending error stacks and value snapshots. SET_ERRNO pushes,...
unsigned int width
Definition fft.c:23
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
struct session_log_buffer session_log_buffer_t
Thread-safe fixed-size history ring for session-screen log lines.
keyboard_key_t
Options for interactive line editing.
Definition keyboard.h:53
asciichat_error_t log_search_init(void)
Initialize interactive grep subsystem.
Definition search.c:144
void * log_search_get_mutex(void)
Get the mutex protecting grep state.
Definition search.c:985
bool log_search_needs_rerender(void)
Check if screen needs immediate re-render.
Definition search.c:933
bool log_search_check_signal_cancel(void)
Check and clear the signal-cancel flag.
Definition search.c:403
void log_search_signal_cancel(void)
Cancel grep mode from a signal handler (async-signal-safe).
Definition search.c:399
bool log_search_is_entering(void)
Check if currently in input mode (typing pattern).
Definition search.c:408
void log_search_process_pending(void)
Definition search.c:469
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:945
int log_search_get_input_len(void)
Get current input buffer length (must hold mutex).
Definition search.c:989
void log_search_enter_mode(void)
Enter search mode (user pressed '/').
Definition search.c:226
asciichat_error_t log_search_insert_text(const char *text)
Definition search.c:480
const char * log_search_get_input_buffer(void)
Get current input buffer content (must hold mutex).
Definition search.c:997
bool log_search_is_active(void)
Check if filtering is active.
Definition search.c:413
bool log_search_get_case_insensitive(void)
Check if case-insensitive flag is set (must hold mutex).
Definition search.c:1001
void log_search_exit_mode(bool accept)
Exit search mode.
Definition search.c:303
void * log_search_copy_pattern(void)
Get the compiled regex pattern for interactive grep (internal use).
Definition search.c:960
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:773
bool log_search_should_handle(int key)
Check if a key should be handled by grep module.
Definition search.c:422
void log_search_destroy(void)
Clean up interactive grep subsystem.
Definition search.c:203
int log_search_get_cursor_position(void)
Get current cursor position in input buffer (must hold mutex).
Definition search.c:993
asciichat_error_t log_search_handle_key(keyboard_key_t key)
Process keyboard input for grep.
Definition search.c:508
void log_search_render_input_line(int width)
Render grep input line at bottom of screen.
Definition search.c:735
asciichat_error_t log_search_filter_buffer(session_log_buffer_t *logs, session_log_entry_t **out_entries, size_t *out_count)
Definition search.c:574
bool log_search_is_entering_atomic(void)
Check if grep is in entering mode (async-signal-safe).
Definition search.c:395
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:569
Thread-safe circular log buffer for session screens (status, splash).
One formatted session log line and its monotonic history sequence.