[EMAIL PROTECTED] wrote:
martin      2003/05/28 07:03:28

Modified: lib charset_alias.h

  Log:
  [Porting] Collation order is different for EBCDIC machines

Revision Changes Path
1.2 +14 -0 apr-iconv/lib/charset_alias.h
Index: charset_alias.h
===================================================================
RCS file: /home/cvs/apr-iconv/lib/charset_alias.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -u -r1.1 -r1.2
--- charset_alias.h 12 Jan 2003 23:46:28 -0000 1.1
+++ charset_alias.h 28 May 2003 14:03:28 -0000 1.2
@@ -394,6 +394,20 @@
{
struct charset_alias key;
struct charset_alias *alias;
+#if 'A' == '\xC1' /* if EBCDIC host */
+ /* The table is sorted in ASCII collation order, not in EBCDIC order.
+ * At the first access, we sort it automatically
+ * Criterion for the 1st time initialization is the fact that the
+ * 1st name in the list starts with a digit (in ASCII, numbers
+ * have a lower ordinal value than alphabetic characters; while
+ * in EBCDIC, their ordinal value is higher)
+ */
+ if (isdigit(charset_alias_list[0].name[0])) {
+ qsort((void *)charset_alias_list, charset_alias_count,
+ sizeof(charset_alias_list[0]),
+ charset_alias_compare);

should a mutex be held here for the check and optional sort?



Reply via email to