From 787bb7625c9abc6b09efbc6bbe004a19d4b96166 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 7 Dec 2003 01:46:44 +0000 Subject: Made RE compiled once and added memory release --- src/rexp.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/rexp.h') diff --git a/src/rexp.h b/src/rexp.h index 04d1bb6..98d685f 100644 --- a/src/rexp.h +++ b/src/rexp.h @@ -33,18 +33,23 @@ /* ---------------------------------------- INTERFACES */ +typedef void *RE_Expression; -typedef enum - { - RE_Found, - RE_NotFound, - RE_BadExpression, - } RExpStatus; + +/* Compile a regular expression for use. Returns NULL if the expression + cannot be compiled. +*/ +RE_Expression RECompile(const char *regexpr); + + +/* Search string for regexpr. Returns TRUE for match. +*/ +int RESearch(const RE_Expression re, const char *string); -/* Search string for regexpr +/* Free a regular expression */ -RExpStatus RExpSearch(const char *regexpr, const char *string); +void REFree(RE_Expression re); #endif -- cgit v1.2.3