jfclere 2004/06/22 07:30:58
Modified: build gen_aliases.awk
Log:
Add code for EBCDIC host. (Was already in charset_alias.h).
Revision Changes Path
1.2 +14 -0 apr-iconv/build/gen_aliases.awk
Index: gen_aliases.awk
===================================================================
RCS file: /home/cvs/apr-iconv/build/gen_aliases.awk,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gen_aliases.awk 12 Jan 2003 23:46:29 -0000 1.1
+++ gen_aliases.awk 22 Jun 2004 14:30:58 -0000 1.2
@@ -63,6 +63,20 @@
print "{";
print " struct charset_alias key;";
print " struct charset_alias *alias;";
+ print "#if 'A' == '\\xC1' /* if EBCDIC host */";
+ print " /* The table is sorted in ASCII collation order, not in
EBCDIC order.";
+ print " * At the first access, we sort it automatically";
+ print " * Criterion for the 1st time initialization is the fact that
the";
+ print " * 1st name in the list starts with a digit (in ASCII,
numbers";
+ print " * have a lower ordinal value than alphabetic characters;
while";
+ print " * in EBCDIC, their ordinal value is higher)";
+ print " */";
+ print " if (isdigit(charset_alias_list[0].name[0])) {";
+ print " qsort((void *)charset_alias_list, charset_alias_count,";
+ print " sizeof(charset_alias_list[0]),";
+ print " charset_alias_compare);";
+ print " }";
+#endif
print " key.name = name;";
print " alias = bsearch(&key, charset_alias_list,
charset_alias_count,";
print " sizeof(charset_alias_list[0]),";