Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

C API
[shwild API]


Detailed Description

These types, constants and functions form the core of the shwild API.


Classes

struct  shwild_slice_t
 Length-aware C-style string. More...

Typedefs

typedef shwild_handle_t_ * shwild_handle_t
 Handle to compiled pattern.

Functions

int shwild_match (char const *pattern, char const *string, unsigned flags)
 Matches a string against an shwild pattern.
int shwild_match_s (shwild_slice_t const *pattern, shwild_slice_t const *string, unsigned flags)
 Synonym for shwild_match() using length-aware C-style string arguments.
int shwild_compile_pattern (char const *pattern, unsigned flags, shwild_handle_t *phCompiledPattern)
 Compiles a pattern into an efficient form for use in multiple match operations.
int shwild_compile_pattern_s (shwild_slice_t const *pattern, unsigned flags, shwild_handle_t *phCompiledPattern)
 Synonym for shwild_compile_pattern() using length-aware C-style string arguments.
int shwild_match_pattern (shwild_handle_t hCompiledPattern, char const *string)
 Matches a string against against a pre-compiled shwild pattern.
int shwild_match_pattern_s (shwild_handle_t hCompiledPattern, shwild_slice_t const *string)
 Synonym for shwild_match_pattern() using length-aware C-style string arguments.
void shwild_destroy_pattern (shwild_handle_t hCompiledPattern)
 Releases all resources associated with a pre-compiled shwild pattern.


Typedef Documentation

typedef struct shwild_handle_t_* shwild_handle_t
 

Handle to compiled pattern.

Used by shwild_compile_pattern(), shwild_match_pattern() and shwild_destroy_pattern()


Function Documentation

int shwild_compile_pattern char const *  pattern,
unsigned  flags,
shwild_handle_t phCompiledPattern
 

Compiles a pattern into an efficient form for use in multiple match operations.

Parameters:
pattern The shwild pattern against which matching will be performed
flags Flags which moderate the search.
phCompiledPattern Pointer to a variable to hold the compiled pattern
Returns:
Status indicating whether the operating completed successfully
Return values:
<0 The operation failed
>=0 The operation succeeded. The value indicates the number of match sub-components created to represent the pattern. The compiled pattern must be destroyed when it is no longer needed, by shwild_destroy_pattern(), to avoid memory leaks.

int shwild_compile_pattern_s shwild_slice_t const *  pattern,
unsigned  flags,
shwild_handle_t phCompiledPattern
 

Synonym for shwild_compile_pattern() using length-aware C-style string arguments.

void shwild_destroy_pattern shwild_handle_t  hCompiledPattern  ) 
 

Releases all resources associated with a pre-compiled shwild pattern.

Parameters:
hCompiledPattern The pattern to be destroyed.

int shwild_match char const *  pattern,
char const *  string,
unsigned  flags
 

Matches a string against an shwild pattern.

Parameters:
pattern The shwild pattern against which matching will be performed
string The string to match against the pattern
flags Flags which moderate the search.
Returns:
Status indicating whether the string matched against the given pattern
Return values:
<0 An error code (one of SHWILD_RC_*)
0 The string matched the pattern
non-0 The string did not match the pattern
Examples:
example_c_1.c.

int shwild_match_pattern shwild_handle_t  hCompiledPattern,
char const *  string
 

Matches a string against against a pre-compiled shwild pattern.

Parameters:
hCompiledPattern The precompiled shwild pattern against which matching will be performed
string The string to match against the pattern
Returns:
Status indicating whether the string matched against the given pattern
Return values:
0 The string did not match the pattern
non-0 The string matched against the pattern

int shwild_match_pattern_s shwild_handle_t  hCompiledPattern,
shwild_slice_t const *  string
 

Synonym for shwild_match_pattern() using length-aware C-style string arguments.

int shwild_match_s shwild_slice_t const *  pattern,
shwild_slice_t const *  string,
unsigned  flags
 

Synonym for shwild_match() using length-aware C-style string arguments.


shwild Library documentation Matthew Wilson and Sean Kelly, 2004-2006 SourceForge.net Logo