X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffstrcmp.h;fp=lib%2Ffstrcmp.h;h=807b0ae64bb5e8804c39dc85ae1ed940cc13f938;hb=4facad5a3d557a73ea0bb1cf8b6e835163e1def1;hp=76fa393d20ad7a975c47151fe18109ca97fd8588;hpb=044cf1cc450503a8917b3e2fa2731b8d0076d4b9;p=gnulib.git diff --git a/lib/fstrcmp.h b/lib/fstrcmp.h index 76fa393d2..807b0ae64 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 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