X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fmatchstr.c;fp=util%2Fmatchstr.c;h=0000000000000000000000000000000000000000;hb=c6e47cbbff56f39f6d81b079ebaeac41d793d4d9;hp=e2231326f14063c949c958358f2467fa4f5232e3;hpb=c71d717ada2a9ef730d527f161eb5ba9aa641a9f;p=yaz-moved-to-github.git diff --git a/util/matchstr.c b/util/matchstr.c deleted file mode 100644 index e223132..0000000 --- a/util/matchstr.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: matchstr.c,v 1.7 2003-02-12 21:34:57 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include - -/* - * Match strings, independently of case and occurences of '-'. - * fairly inefficient - will be replaced with an indexing scheme for - * the various subsystems if we get a bottleneck here. - */ - -int yaz_matchstr(const char *s1, const char *s2) -{ - while (*s1 && *s2) - { - char c1 = *s1; - char c2 = *s2; - - if (c2 == '?') - return 0; - if (c1 == '-') - c1 = *++s1; - if (c2 == '-') - c2 = *++s2; - if (!c1 || !c2) - break; - if (c2 != '.') - { - if (isupper(c1)) - c1 = tolower(c1); - if (isupper(c2)) - c2 = tolower(c2); - if (c1 != c2) - break; - } - s1++; - s2++; - } - return *s1 || *s2; -} - -int yaz_strcmp_del(const char *a, const char *b, const char *b_del) -{ - while (*a && *b) - { - if (*a != *b) - return *a - *b; - a++; - b++; - } - if (b_del && strchr(b_del, *b)) - return *a; - return *a - *b; -} - -#ifdef __GNUC__ -#ifdef __CHECKER__ -void __assert_fail (const char *assertion, const char *file, - unsigned int line, const char *function) -{ - fprintf (stderr, "%s in file %s line %d func %s\n", - assertion, file, line, function); - abort (); -} -#endif -#endif