adding const qualifiers across the api as appropriate.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5165 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2007-05-12 14:48:14 +00:00
parent 8107c49a64
commit a4ff7e88da
32 changed files with 255 additions and 206 deletions

View File

@@ -32,12 +32,19 @@
#include <switch.h>
#include <pcre.h>
SWITCH_DECLARE(switch_regex_t *) switch_regex_compile(const char *pattern,
int options, const char **errorptr, int *erroroffset,
const unsigned char *tables)
{
int options, const char **errorptr, int *erroroffset,
const unsigned char *tables)
{
return pcre_compile(pattern, options, errorptr, erroroffset, tables);
}
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);
}
@@ -45,7 +52,10 @@
SWITCH_DECLARE(void) switch_regex_free(void *data)
{
pcre_free(data);
{
}
SWITCH_DECLARE(int) switch_regex_perform(const char *field, const char *expression, switch_regex_t **new_re, int *ovector, uint32_t olen)
{
const char *error = NULL;
int erroffset = 0;
@@ -87,7 +97,7 @@ SWITCH_DECLARE(void) switch_regex_free(void *data)
}
switch_regex_safe_free(re);
SWITCH_DECLARE(void) switch_perform_substitution(switch_regex_t *re, int match_count, const char *data, const char *field_data,
char *substituted, uint32_t len, int *ovector)
{
char index[10] = "";
@@ -124,7 +134,8 @@ SWITCH_DECLARE(void) switch_perform_substitution(switch_regex_t *re, int match_c
}
substituted[y++] = '\0';
}
substituted[y++] = replace[r];
SWITCH_DECLARE(switch_status_t) switch_regex_match(const char *target, const char *expression)
{
const char *error = NULL; //Used to hold any errors
int error_offset = 0; //Holds the offset of an error