From f61e8dff4e912067f688104581810b9a3c1b0006 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 25 Jun 2008 19:49:01 +0200 Subject: [PATCH] Moved regex functions to lib/regex.h. --- lib/Makefile | 5 ++--- lib/lib.h | 9 --------- lib/regex.c | 1 + lib/regex.h | 21 +++++++++++++++++++++ 4 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 lib/regex.h diff --git a/lib/Makefile b/lib/Makefile index e8db62e7..470feabc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -40,7 +40,8 @@ LIBUCW_INCLUDES= \ mempool.h pagecache.h \ arraysort.h \ lists.h clists.h slists.h simple-lists.h \ - string.h \ + string.h stkstring.h unicode.h chartype.h regex.h \ + wildmatch.h patmatch.h \ unaligned.h prefetch.h \ bbuf.h gbuf.h bitarray.h bitsig.h \ hashfunc.h hashtable.h \ @@ -51,8 +52,6 @@ LIBUCW_INCLUDES= \ conf.h getopt.h ipaccess.h \ profile.h \ fastbuf.h lfs.h ff-unicode.h ff-binary.h \ - chartype.h unicode.h stkstring.h \ - wildmatch.h patmatch.h \ db.h \ url.h \ mainloop.h \ diff --git a/lib/lib.h b/lib/lib.h index 1ce5a463..cd3ba862 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -201,15 +201,6 @@ void init_timer(timestamp_t *timer); uns get_timer(timestamp_t *timer); uns switch_timer(timestamp_t *old, timestamp_t *new); -/* regex.c */ - -typedef struct regex regex; - -regex *rx_compile(const char *r, int icase); -void rx_free(regex *r); -int rx_match(regex *r, const char *s); -int rx_subst(regex *r, const char *by, const char *src, char *dest, uns destlen); - /* random.c */ uns random_u32(void); diff --git a/lib/regex.c b/lib/regex.c index cfabd4d0..8eb24432 100644 --- a/lib/regex.c +++ b/lib/regex.c @@ -11,6 +11,7 @@ #include "lib/lib.h" #include "lib/chartype.h" #include "lib/hashfunc.h" +#include "lib/regex.h" #include #include diff --git a/lib/regex.h b/lib/regex.h new file mode 100644 index 00000000..584d70cc --- /dev/null +++ b/lib/regex.h @@ -0,0 +1,21 @@ +/* + * UCW Library -- Interface to Regular Expression Libraries + * + * (c) 1997--2004 Martin Mares + * (c) 2001 Robert Spalek + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. + */ + +#ifndef _UCW_REGEX_H +#define _UCW_REGEX_H + +typedef struct regex regex; + +regex *rx_compile(const char *r, int icase); +void rx_free(regex *r); +int rx_match(regex *r, const char *s); +int rx_subst(regex *r, const char *by, const char *src, char *dest, uns destlen); + +#endif -- 2.39.2