]> mj.ucw.cz Git - libucw.git/commitdiff
Move context matching to libgather
authorMichal Vaner <vorner@ucw.cz>
Thu, 17 Jul 2008 08:57:02 +0000 (10:57 +0200)
committerMartin Mares <mj@ucw.cz>
Thu, 17 Jul 2008 17:24:06 +0000 (19:24 +0200)
ucw/Makefile
ucw/ctmatch.c [deleted file]
ucw/lib.h

index 500922ca96545bb37a96a3c8e259e3d6cee8dbbf..c505e7ebf30f35091de770f9d91cc0674138184b 100644 (file)
@@ -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 (file)
index 6e5aed3..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *     UCW Library -- Content-Type Pattern Matching
- *
- *     (c) 1997 Martin Mares <mj@ucw.cz>
- *
- *     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;
-}
index 43a777e227e94037bdd09da721c7e141bd2c8ece..624da3ca694397ef9930fba3b200cca461c08287 100644 (file)
--- 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);