summaryrefslogtreecommitdiff
path: root/src/rexp.h
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2003-12-07 01:46:44 +0000
committerIan C <ianc@noddybox.co.uk>2003-12-07 01:46:44 +0000
commit787bb7625c9abc6b09efbc6bbe004a19d4b96166 (patch)
tree87b38cae639ced0b5a705a3d1e45d977ea419756 /src/rexp.h
parentf1658930db64af8fecff9c8697592f676114409c (diff)
Made RE compiled once and added memory release
Diffstat (limited to 'src/rexp.h')
-rw-r--r--src/rexp.h21
1 files changed, 13 insertions, 8 deletions
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