|
libose
the C library every o.se host is built on
|
Pattern matching functions. More...
Go to the source code of this file.
Macros | |
| #define | OSE_MATCH_BACKTRACK_LIMIT 100 |
| Set this to control the number of backtracking branches. | |
| #define | OSE_MATCH_ENABLE_2STARS 1 |
| Switch this off to disable matching against a pattern with 2 stars. | |
| #define | OSE_MATCH_ENABLE_NSTARS 1 |
| Switch this off to disable matching against a pattern with more than 2 stars which will be done recursively. | |
| #define | OSE_MATCH_ALLOW_STAR_IN_ADDRESS |
| Allow the star wildcard in addresses. | |
| #define | OSE_MATCH_DESCENDANTS |
| #define | OSE_MATCH_REPETITION |
Enumerations | |
| enum | ose_match_retval { OSE_MATCH_NOMATCH = 0 , OSE_MATCH_ADDRESS_COMPLETE , OSE_MATCH_PATTERN_COMPLETE , OSE_MATCH_BOTH_COMPLETE , OSE_MATCH_ERROR_UNMATCHED_LEFT_SQUARE_BRACKET , OSE_MATCH_ERROR_UNMATCHED_RIGHT_SQUARE_BRACKET , OSE_MATCH_ERROR_UNMATCHED_LEFT_CURLY_BRACE , OSE_MATCH_ERROR_UNMATCHED_RIGHT_CURLY_BRACE , OSE_MATCH_ERROR_PATTERN_NO_LEADING_SLASH , OSE_MATCH_ERROR_ADDRESS_NO_LEADING_SLASH , OSE_MATCH_ERROR_INVALID_CHARACTER_CLASS , OSE_MATCH_ERROR_BACKTRACK_LIMIT_EXCEEDED , OSE_MATCH_ERROR_INVALID_REPETITION } |
| Pattern matching return codes. | |
Functions | |
| enum ose_match_retval | ose_match_pattern (const char *const pattern, const char *const address, int32_t *pattern_offset, int32_t *address_offset) |
| Match an address against a pattern. | |
Pattern matching functions.
| #define OSE_MATCH_ALLOW_STAR_IN_ADDRESS |
Allow the star wildcard in addresses.
Wildcards are only allowed in patterns since matching patterns against patterns can be ambiguous and confusing. One exception is the star wildcard, which, if enabled here and found in an address, simply skips that address container.
| enum ose_match_retval ose_match_pattern | ( | const char *const | pattern, |
| const char *const | address, | ||
| int32_t * | pattern_offset, | ||
| int32_t * | address_offset | ||
| ) |
Match an address against a pattern.
| pattern | the pattern to match |
| address | the address to match |
| pattern_offset | the number of bytes into the pattern that were matched successfully |
| address_offset | the number of bytes into the address that were matched successfully |
| ose_match_retval |