diff --git a/src/fcint.h b/src/fcint.h index 88e0701..08a0cd6 100644 --- a/src/fcint.h +++ b/src/fcint.h @@ -1328,6 +1328,9 @@ FcStrLastSlash (const FcChar8 *path); FcPrivate FcChar32 FcStrHashIgnoreCase (const FcChar8 *s); +FcPrivate FcChar32 +FcStrHashIgnoreBlanksAndCase (const FcChar8 *s); + FcPrivate FcChar8 * FcStrCanonFilename (const FcChar8 *s); diff --git a/src/fcstr.c b/src/fcstr.c index 39ecbbb..dc9940a 100644 --- a/src/fcstr.c +++ b/src/fcstr.c @@ -320,6 +320,19 @@ FcStrHashIgnoreCase (const FcChar8 *s) return h; } +FcChar32 +FcStrHashIgnoreBlanksAndCase (const FcChar8 *s) +{ + FcChar32 h = 0; + FcCaseWalker w; + FcChar8 c; + + FcStrCaseWalkerInit (s, &w); + while ((c = FcStrCaseWalkerNextNonBlank (&w))) + h = ((h << 3) ^ (h >> 3)) ^ c; + return h; +} + /* * Is the head of s1 equal to s2? */