XMMS2
Typedefs | Functions
Pattern

Functions to create and match glob-like patterns. More...

Typedefs

typedef struct pattern_St pattern_t
 

Functions

s4_pattern_ts4_pattern_create (const char *pattern, int casefold)
 Creates a new pattern. More...
 
int s4_pattern_match (const s4_pattern_t *p, const s4_val_t *val)
 Matches a pattern against a value. More...
 
void s4_pattern_free (s4_pattern_t *pattern)
 Frees a pattern created with s4_pattern_create. More...
 

Detailed Description

Functions to create and match glob-like patterns.

Patterns consist of normal characters and the special characters '?' and '*', where ? matches against any character while

Typedef Documentation

typedef struct pattern_St pattern_t

Function Documentation

s4_pattern_t* s4_pattern_create ( const char *  pattern,
int  casefold 
)

Creates a new pattern.

Parameters
patternThe string to use as the pattern
casefoldMatch against both upper and lower case
Returns
A new pattern that may be used with s4_pattern_match. Must be freed with s4_pattern_free

Referenced by CASE().

void s4_pattern_free ( s4_pattern_t pattern)

Frees a pattern created with s4_pattern_create.

Parameters
patternThe pattern to free

Referenced by CASE().

int s4_pattern_match ( const s4_pattern_t p,
const s4_val_t val 
)

Matches a pattern against a value.

Parameters
pThe pattern to use
valThe value to match
Returns
non-zero if the pattern matches the value, 0 otherwise