1 // natCollator.cc - Native code for collation.
3 /* Copyright (C) 1999 Free Software Foundation
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
11 // Written by Tom Tromey <tromey@cygnus.com>.
18 #include <java/text/Collator.h>
19 #include <java/lang/StringBuffer.h>
21 #include <java-chardecomp.h>
24 java::text::Collator::decomposeCharacter (jchar c
,
25 java::lang::StringBuffer
*buf
)
27 if (decmp
== NO_DECOMPOSITION
)
33 const struct decomp_entry
*base
;
36 if (decmp
== FULL_DECOMPOSITION
)
38 base
= full_decomposition
;
39 high
= sizeof (full_decomposition
) / sizeof (struct decomp_entry
);
43 base
= canonical_decomposition
;
44 high
= sizeof (canonical_decomposition
) / sizeof (struct decomp_entry
);
47 // FIXME: this is probably a bit slow for the task at hand.
54 else if (c
> base
[i
].key
)
63 // Not in table, so it expands to itself.
69 for (int j
= 0; base
[i
].value
[j
] != '\0'; j
+= 2)
71 jchar x
= (base
[i
].value
[j
] << 8) | (base
[i
].value
[j
+ 1]);