blob: d894e011bcb8dbf705f68d77f44da6cb9606e930 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#if 0
#include <stdlib.h>
#include <string.h>
#include "_assert.h"
/** collate strings **/
int strcoll(const char *s1, const char *s2)
{
char *x1 = NULL;
char *x2 = NULL;
int ret = 0;
ASSERT_NONNULL(s1);
ASSERT_NONNULL(s2);
x1 = malloc(strxfrm(x1, s1, 0));
x2 = malloc(strxfrm(x2, s2, 0));
if (x1 && x2) {
strxfrm(x1, s1, 0);
strxfrm(x2, s2, 0);
ret = strcmp(x1, x2);
}
free(x1);
free(x2);
/*
RETURN(NEGATIVE, ARGUMENT(s1) collates before ARGUMENT(s2));
RETURN(ZERO, ARGUMENT(s1) collates equal to ARGUMENT(s2));
RETURN(POSITIVE, ARGUMENT(s1) collates after ARGUMENT(s2));
*/
return ret;
}
/***
compares the collation values of the strings at ARGUMENT(s1) and ARGUMENT(s2).
***/
/*
LC_COLLATE
STDC(1)
*/
#endif
|