X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffstrcmp.h;h=343c5ee77921644fdc5d4762b88e490d4d70550f;hb=9a09e8291d1bd692b26684c2bb7d9379593e8846;hp=76fa393d20ad7a975c47151fe18109ca97fd8588;hpb=57fdfd3f8ec62b105c53bcdf6f127c35c7fe7391;p=gnulib.git diff --git a/lib/fstrcmp.h b/lib/fstrcmp.h index 76fa393d2..343c5ee77 100644 --- a/lib/fstrcmp.h +++ b/lib/fstrcmp.h @@ -1,5 +1,6 @@ /* Fuzzy string comparison. - Copyright (C) 1995, 2000, 2002-2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1995, 2000, 2002-2003, 2006, 2008-2010 Free Software + Foundation, Inc. This file was written by Peter Miller @@ -24,9 +25,19 @@ extern "C" { #endif /* Fuzzy compare of S1 and S2. Return a measure for the similarity of S1 - and S1. The higher the result, the more similar the strings are. */ + and S1. The higher the result, the more similar the strings are. + The result is bounded between 0 (meaning very dissimilar strings) and + 1 (meaning identical strings). */ extern double fstrcmp (const char *s1, const char *s2); +/* Like fstrcmp (S1, S2), except that if the result is < LOWER_BOUND, an + arbitrary other value < LOWER_BOUND can be returned. */ +extern double fstrcmp_bounded (const char *s1, const char *s2, + double lower_bound); + +/* A shortcut for fstrcmp. Avoids a function call. */ +#define fstrcmp(s1,s2) fstrcmp_bounded (s1, s2, 0.0) + #ifdef __cplusplus } #endif