New module 'unicase/ulc-casecoll'.
[pspp] / lib / uninorm.h
index 6680f819ca226a07b18884b358f8aba16b19de7f..869630f799113e4d3c0cde3aa7efa02ecab2eb38 100644 (file)
@@ -151,17 +151,17 @@ extern uint32_t *
 
 /* Compare S1 and S2, ignoring differences in normalization.
    NF must be either UNINORM_NFD or UNINORM_NFKD.
-   If successful, set *RESULT to -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2, and
-   return 0.  Upon failure, return the error number.  */
+   If successful, set *RESULTP to -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2, and
+   return 0.  Upon failure, return -1 with errno set.  */
 extern int
        u8_normcmp (const uint8_t *s1, size_t n1, const uint8_t *s2, size_t n2,
-                  uninorm_t nf, int *result);
+                  uninorm_t nf, int *resultp);
 extern int
        u16_normcmp (const uint16_t *s1, size_t n1, const uint16_t *s2, size_t n2,
-                   uninorm_t nf, int *result);
+                   uninorm_t nf, int *resultp);
 extern int
        u32_normcmp (const uint32_t *s1, size_t n1, const uint32_t *s2, size_t n2,
-                   uninorm_t nf, int *result);
+                   uninorm_t nf, int *resultp);
 
 
 /* Converts the string S of length N to a string in locale encoding, in such a
@@ -179,6 +179,22 @@ extern char *
                     char *resultbuf, size_t *lengthp);
 
 
+/* Compare S1 and S2, ignoring differences in normalization, using the
+   collation rules of the current locale.
+   NF must be either UNINORM_NFC or UNINORM_NFKC.
+   If successful, set *RESULTP to -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2, and
+   return 0.  Upon failure, return -1 with errno set.  */
+extern int
+       u8_normcoll (const uint8_t *s1, size_t n1, const uint8_t *s2, size_t n2,
+                   uninorm_t nf, int *resultp);
+extern int
+       u16_normcoll (const uint16_t *s1, size_t n1, const uint16_t *s2, size_t n2,
+                    uninorm_t nf, int *resultp);
+extern int
+       u32_normcoll (const uint32_t *s1, size_t n1, const uint32_t *s2, size_t n2,
+                    uninorm_t nf, int *resultp);
+
+
 /* Normalization of a stream of Unicode characters.
 
    A "stream of Unicode characters" is essentially a function that accepts an