From 337379bc207a951cc298b1cffbb6a286e376cd08 Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Thu, 17 Jul 2008 10:57:02 +0200 Subject: [PATCH] Move context matching to libgather --- ucw/Makefile | 2 +- ucw/ctmatch.c | 44 -------------------------------------------- ucw/lib.h | 4 ---- 3 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 ucw/ctmatch.c diff --git a/ucw/Makefile b/ucw/Makefile index 500922ca..c505e7eb 100644 --- a/ucw/Makefile +++ b/ucw/Makefile @@ -21,7 +21,7 @@ LIBUCW_MODS= \ fastbuf ff-binary ff-string ff-printf ff-unicode \ fb-file carefulio fb-mem fb-temp fb-mmap fb-limfd fb-buffer fb-grow fb-pool fb-atomic fb-param fb-socket \ char-cat char-upper char-lower unicode stkstring \ - wildmatch ctmatch regex \ + wildmatch regex \ prime primetable random timer randomkey \ bit-ffs bit-fls \ db \ diff --git a/ucw/ctmatch.c b/ucw/ctmatch.c deleted file mode 100644 index 6e5aed3f..00000000 --- a/ucw/ctmatch.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * UCW Library -- Content-Type Pattern Matching - * - * (c) 1997 Martin Mares - * - * This software may be freely distributed and used according to the terms - * of the GNU Lesser General Public License. - */ - -#include "ucw/lib.h" -#include "ucw/chartype.h" - -int -match_ct_patt(const char *p, const char *t) -{ - if (*p == '*' && !p[1]) /* "*" matches everything */ - return 1; - - if (*p == '*' && p[1] == '/') /* "*" on the left-hand side */ - { - while (*t && *t != ' ' && *t != ';' && *t != '/') - t++; - p += 2; - } - else /* Normal left-hand side */ - { - while (*p != '/') - if (Cupcase(*p++) != Cupcase(*t++)) - return 0; - p++; - } - if (*t++ != '/') - return 0; - - if (*p == '*' && !p[1]) /* "*" on the right-hand side */ - return 1; - while (*p) - if (Cupcase(*p++) != Cupcase(*t++)) - return 0; - if (*t && *t != ' ' && *t != ';') - return 0; - - return 1; -} diff --git a/ucw/lib.h b/ucw/lib.h index 43a777e2..624da3ca 100644 --- a/ucw/lib.h +++ b/ucw/lib.h @@ -161,10 +161,6 @@ void xfree(void *); void *xmalloc_zero(uns) LIKE_MALLOC; char *xstrdup(const char *) LIKE_MALLOC; -/* Content-Type pattern matching and filters */ - -int match_ct_patt(const char *, const char *); - /* prime.c */ int isprime(uns x); -- 2.39.2