/*
- * Sherlock Library -- Interface to Regular Expression Libraries
+ * UCW Library -- Interface to Regular Expression Libraries
*
* (c) 1997--2004 Martin Mares <mj@ucw.cz>
* (c) 2001 Robert Spalek <robert@ucw.cz>
#include <stdio.h>
#include <string.h>
-#include <stdlib.h>
#if defined(CONFIG_OWN_REGEX) || defined(CONFIG_POSIX_REGEX)
};
regex *
-rx_compile(byte *p, int icase)
+rx_compile(const byte *p, int icase)
{
regex *r = xmalloc_zero(sizeof(regex));
}
int
-rx_match(regex *r, byte *s)
+rx_match(regex *r, const byte *s)
{
int err = regexec(&r->rx, s, 10, r->matches, 0);
if (!err)
}
int
-rx_subst(regex *r, byte *by, byte *src, byte *dest, uns destlen)
+rx_subst(regex *r, const byte *by, const byte *src, byte *dest, uns destlen)
{
byte *end = dest + destlen - 1;
uns j = *by++ - '0';
if (j <= r->rx.re_nsub && r->matches[j].rm_so >= 0)
{
- byte *s = src + r->matches[j].rm_so;
+ const byte *s = src + r->matches[j].rm_so;
uns i = r->matches[j].rm_eo - r->matches[j].rm_so;
if (dest + i >= end)
return -1;