i3
match.h File Reference
#include <config.h>
Include dependency graph for match.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void match_init (Match *match)
 Initializes the Match data structure.
 
bool match_is_empty (Match *match)
 Check if a match is empty.
 
void match_copy (Match *dest, Match *src)
 Copies the data of a match from src to dest.
 
bool match_matches_window (Match *match, i3Window *window)
 Check if a match data structure matches the given window.
 
void match_free (Match *match)
 Frees the given match.
 
void match_parse_property (Match *match, const char *ctype, const char *cvalue)
 Interprets a ctype=cvalue pair and adds it to the given match specification.
 

Function Documentation

◆ match_copy()

void match_copy ( Match * dest,
Match * src )

Copies the data of a match from src to dest.

Definition at line 64 of file match.c.

References DUPLICATE_REGEX.

Referenced by CFGFUN(), CFGFUN(), CFGFUN(), and CFGFUN().

◆ match_free()

void match_free ( Match * match)

Frees the given match.

It must not be used afterwards!

Definition at line 279 of file match.c.

References Match::application, Match::class, Match::error, FREE, Match::instance, Match::machine, Match::mark, regex_free(), Match::title, Match::window_role, and Match::workspace.

Referenced by _remove_matches(), CFGFUN(), con_free(), free_configuration(), json_end_map(), manage_window(), and TAILQ_HEAD().

Here is the call graph for this function:

◆ match_init()

void match_init ( Match * match)

Initializes the Match data structure.

This function is necessary because the members representing boolean values (like dock) need to be initialized with -1 instead of 0.

Definition at line 26 of file match.c.

References Match::urgent, Match::window_mode, and Match::window_type.

Referenced by CFGFUN(), open_placeholder_window(), output_init_con(), and TAILQ_HEAD().

◆ match_is_empty()

bool match_is_empty ( Match * match)

Check if a match is empty.

This is necessary while parsing commands to see whether the user specified a match at all.

Definition at line 39 of file match.c.

References Match::application, Match::class, Match::con_id, Match::dock, Match::id, Match::instance, Match::machine, Match::mark, Match::match_all_windows, Match::title, Match::urgent, Match::window_mode, Match::window_role, Match::window_type, and Match::workspace.

Referenced by CFGFUN(), CFGFUN(), CFGFUN(), CFGFUN(), cmd_focus(), cmd_layout_toggle(), cmd_scratchpad_show(), and cmd_unmark().

◆ match_matches_window()

◆ match_parse_property()

void match_parse_property ( Match * match,
const char * ctype,
const char * cvalue )

Interprets a ctype=cvalue pair and adds it to the given match specification.

Definition at line 295 of file match.c.

References Match::class, Match::con_id, DLOG, ELOG, Match::error, focused, Match::id, Match::instance, Match::machine, Match::mark, Match::match_all_windows, parse_long(), regex_free(), regex_new(), sstrdup(), Match::title, Match::urgent, Match::window_mode, Match::window_role, Match::window_type, and Match::workspace.

Referenced by CFGFUN(), and cmd_criteria_add().

Here is the call graph for this function: