82 pcre *gw_pcre_comp_real(
const Octstr *pattern,
int cflags,
const char *
file,
83 long line,
const char *func)
91 if ((preg = pcre_compile(pat, cflags, &err, &erroffset, NULL)) == NULL) {
92 error(0,
"%s:%ld: %s: pcre compilation `%s' failed at offset %d: %s " 93 "(Called from %s:%ld:%s.)",
95 erroffset, err, (
file), (
long) (line), (func));
102 int gw_pcre_exec_real(
const pcre *preg,
const Octstr *
string,
int start,
103 int eflags,
int *ovector,
int oveccount,
104 const char *
file,
long line,
const char *func)
115 if (rc < 0 && rc != PCRE_ERROR_NOMATCH) {
116 error(0,
"%s:%ld: %s: pcre execution on `%s' failed with error %d " 117 "(Called from %s:%ld:%s.)",
119 (
file), (
long) (line), (func));
134 int gw_pcre_match_real(
const Octstr *re,
const Octstr *os,
const char *
file,
135 long line,
const char *func)
139 int ovector[PCRE_OVECCOUNT];
142 regexp = gw_pcre_comp_real(re, 0,
file, line, func);
147 rc = gw_pcre_exec_real(regexp, os, 0, 0, ovector, PCRE_OVECCOUNT,
150 return (rc > 0) ? 1 : 0;
154 int gw_pcre_match_pre_real(
const pcre *preg,
const Octstr *os,
const char *
file,
155 long line,
const char *func)
158 int ovector[PCRE_OVECCOUNT];
163 rc = gw_pcre_exec_real(preg, os, 0, 0, ovector, PCRE_OVECCOUNT,
166 return (rc > 0) ? 1 : 0;
void error(int err, const char *fmt,...)
gw_assert(wtls_machine->packet_to_send !=NULL)
#define octstr_get_cstr(ostr)
long octstr_len(const Octstr *ostr)