Example #1
0
int shwild_compile_pattern(char const *pattern, unsigned flags, shwild_handle_t *phCompiledPattern)
{
    SHWILD_ASSERT(NULL != pattern);

    shwild_slice_t  pattern_slice(::strlen(pattern), pattern);

    return shwild_compile_pattern_s(&pattern_slice, flags, phCompiledPattern);
}
Example #2
0
inline /* static */ shwild_handle_t Pattern::init_(slice_t const* pattern, unsigned flags, int &numMatches)
{
    shwild_handle_t hCompiledPattern;

    numMatches = shwild_compile_pattern_s(pattern, flags, &hCompiledPattern);

    if(numMatches < 0)
    {
        hCompiledPattern    =   NULL;

        throw PatternException("Failed to compile pattern", numMatches);
    }

    return hCompiledPattern;
}