]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcstr.c
Switch to RFC 3066 based lang names
[fontconfig.git] / src / fcstr.c
index 3d4a592e108a4f8b8176027d73bde1820e71b96f..bea05d90af13ea310bc70a34e72e0e7b4405e021 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $XFree86: xc/lib/fontconfig/src/fcstr.c,v 1.4 2002/05/21 17:06:22 keithp Exp $
+ * $XFree86: xc/lib/fontconfig/src/fcstr.c,v 1.5 2002/05/29 22:07:33 keithp Exp $
  *
  * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
  *
@@ -82,6 +82,29 @@ FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2)
     return (int) c1 - (int) c2;
 }
 
+int
+FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2)
+{
+    FcChar8 c1, c2;
+    
+    for (;;) 
+    {
+       do
+           c1 = *s1++;
+       while (c1 == ' ');
+       do
+           c2 = *s2++;
+       while (c2 == ' ');
+       if (!c1 || !c2)
+           break;
+       c1 = FcToLower (c1);
+       c2 = FcToLower (c2);
+       if (c1 != c2)
+           break;
+    }
+    return (int) c1 - (int) c2;
+}
+
 int
 FcStrCmp (const FcChar8 *s1, const FcChar8 *s2)
 {