git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4798 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-03-30 00:13:31 +00:00
parent 643ca5c4e7
commit debdfb1aab
139 changed files with 2075 additions and 3970 deletions

View File

@@ -33,15 +33,11 @@
#include <switch.h>
#include <pcre.h>
SWITCH_DECLARE(switch_regex_t *) switch_regex_compile(const char *pattern,
int options,
SWITCH_DECLARE(switch_regex_t *) switch_regex_compile(const char *pattern,
int options, const char **errorptr, int *erroroffset,
const unsigned char *tables)
{
return pcre_compile(pattern, options, errorptr, erroroffset, tables);
{
return pcre_compile(pattern, options, errorptr, erroroffset, tables);
@@ -49,8 +45,7 @@
SWITCH_DECLARE(int) switch_regex_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int size)
{
return pcre_copy_substring(subject, ovector, stringcount, stringnumber, buffer, size);
{
return pcre_copy_substring(subject, ovector, stringcount, stringnumber, buffer, size);
}
@@ -92,7 +87,7 @@ SWITCH_DECLARE(void) switch_regex_free(void *data)
olen); /* number of elements (NOT size in bytes) */
if (match_count <= 0) {
switch_regex_safe_free(re);
switch_regex_safe_free(re);
match_count = 0;
}
@@ -149,16 +144,13 @@ SWITCH_DECLARE(void) switch_perform_substitution(switch_regex_t *re, int match_c
int offset_vectors[2]; //not used, but has to exist or pcre won't even try to find a match
//Compile the expression
pcre_prepared = pcre_compile(expression, 0, &error, &error_offset, NULL);
pcre_prepared = pcre_compile(expression, 0, &error, &error_offset, NULL);
//See if there was an error in the expression
if (error != NULL) {
//Clean up after ourselves
if (pcre_prepared) {
pcre_prepared = NULL;
}
//Note our error
pcre_free(pcre_prepared);
pcre_prepared = NULL;
}
//Note our error