ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
grep_pattern_t Struct Reference

grep pattern keeps the values that move through the subsystem: original, parsed_pattern, compiled, is_fixed_string. Some members are pointers into caller- or subsystem-owned memory, so lifetime follows the API that populated them rather than the struct copy itself. More...

Data Fields

const char * original
 Original pattern string (for display).
char * parsed_pattern
 Parsed pattern (without delimiters/flags).
pcre2_code * compiled
 Compiled pattern (NULL if fixed string).
bool is_fixed_string
 True for fixed string matching (no regex).
bool case_insensitive
 Case-insensitive matching (i flag).
bool invert
 Invert match (I flag).
bool global_flag
 Highlight all matches (g flag).
int context_before
 Lines before match (B flag).
int context_after
 Lines after match (A flag).

Detailed Description

grep pattern keeps the values that move through the subsystem: original, parsed_pattern, compiled, is_fixed_string. Some members are pointers into caller- or subsystem-owned memory, so lifetime follows the API that populated them rather than the struct copy itself.

Compiled filter entry used to match logs and print context

Definition at line 43 of file grep.c.

Field Documentation

◆ case_insensitive

bool grep_pattern_t::case_insensitive

Case-insensitive matching (i flag).

Definition at line 48 of file grep.c.

Referenced by grep_highlight_colored(), grep_init(), and grep_should_output().

◆ compiled

pcre2_code* grep_pattern_t::compiled

Compiled pattern (NULL if fixed string).

Definition at line 46 of file grep.c.

Referenced by grep_destroy(), grep_highlight_colored(), grep_init(), and grep_should_output().

◆ context_after

int grep_pattern_t::context_after

Lines after match (A flag).

Definition at line 52 of file grep.c.

Referenced by grep_init(), and grep_should_output().

◆ context_before

int grep_pattern_t::context_before

Lines before match (B flag).

Definition at line 51 of file grep.c.

Referenced by grep_init(), and grep_should_output().

◆ global_flag

bool grep_pattern_t::global_flag

Highlight all matches (g flag).

Definition at line 50 of file grep.c.

Referenced by grep_init().

◆ invert

bool grep_pattern_t::invert

Invert match (I flag).

Definition at line 49 of file grep.c.

Referenced by grep_init(), and grep_should_output().

◆ is_fixed_string

bool grep_pattern_t::is_fixed_string

True for fixed string matching (no regex).

Definition at line 47 of file grep.c.

Referenced by grep_highlight_colored(), grep_init(), and grep_should_output().

◆ original

const char* grep_pattern_t::original

Original pattern string (for display).

Definition at line 44 of file grep.c.

Referenced by grep_destroy(), and grep_init().

◆ parsed_pattern

char* grep_pattern_t::parsed_pattern

Parsed pattern (without delimiters/flags).

Definition at line 45 of file grep.c.

Referenced by grep_destroy(), grep_highlight_colored(), grep_init(), and grep_should_output().


The documentation for this struct was generated from the following file: