Functions to create and match glob-like patterns.
More...
Functions to create and match glob-like patterns.
Patterns consist of normal characters and the special characters '?' and '*', where ? matches against any character while
- matches against any number of characters.
s4_pattern_t* s4_pattern_create |
( |
const char * |
pattern, |
|
|
int |
casefold |
|
) |
| |
Creates a new pattern.
- Parameters
-
pattern | The string to use as the pattern |
casefold | Match 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().
Frees a pattern created with s4_pattern_create.
- Parameters
-
pattern | The pattern to free |
Referenced by CASE().
Matches a pattern against a value.
- Parameters
-
p | The pattern to use |
val | The value to match |
- Returns
- non-zero if the pattern matches the value, 0 otherwise