aboutsummaryrefslogtreecommitdiff
path: root/src/stringprep/uni_parse2.tcl
diff options
context:
space:
mode:
authorAlexey Shchepin <alexey@process-one.net>2003-10-07 20:31:44 +0000
committerAlexey Shchepin <alexey@process-one.net>2003-10-07 20:31:44 +0000
commit61875f80b30676305fe851cfbf7d2b9bb698e199 (patch)
tree44c49c7bfbe5c642f0370caaa8eb110178545e00 /src/stringprep/uni_parse2.tcl
parent*** empty log message *** (diff)
* (all): Changed JID storage format, added support for stringprep
* src/stringprep/: Added support for Unicode normalization form KC * src/stringprep/: Added support for case convertion to multiple characters * src/cyrsasl_digest.erl: Temporary removed "auth-int" QOP SVN Revision: 144
Diffstat (limited to 'src/stringprep/uni_parse2.tcl')
-rw-r--r--src/stringprep/uni_parse2.tcl75
1 files changed, 6 insertions, 69 deletions
diff --git a/src/stringprep/uni_parse2.tcl b/src/stringprep/uni_parse2.tcl
index 456b9d134..2f3ef7ecd 100644
--- a/src/stringprep/uni_parse2.tcl
+++ b/src/stringprep/uni_parse2.tcl
@@ -283,6 +283,12 @@ proc uni::buildTables {} {
if {[info exists decomp_map($i)]} {
set decomp $decomp_map($i)
+ #puts -$decomp
+ while {[info exists decomp_map([set ch1 [lindex $decomp 0]])]} {
+ set decomp [concat $decomp_map($ch1) [lreplace $decomp 0 0]]
+ #puts +$decomp
+ }
+
if {[info exists decomp_used($decomp)]} {
lappend decomp_info $decomp_used($decomp)
} else {
@@ -442,75 +448,6 @@ static unsigned char cclassGroupMap\[\] = {"
puts $f $line
puts $f "};
-/*
- * Each group represents a unique set of character attributes. The attributes
- * are encoded into a 32-bit value as follows:
- *
- * Bits 0-4 Character category: see the constants listed below.
- *
- * Bits 5-7 Case delta type: 000 = identity
- * 010 = add delta for lower
- * 011 = add delta for lower, add 1 for title
- * 100 = sutract delta for title/upper
- * 101 = sub delta for upper, sub 1 for title
- * 110 = sub delta for upper, add delta for lower
- *
- * Bits 8-21 Reserved for future use.
- *
- * Bits 22-31 Case delta: delta for case conversions. This should be the
- * highest field so we can easily sign extend.
- */
-
-static int cclass_groups\[\] = {"
- set line " "
- set last [expr {[llength $groups] - 1}]
- for {set i 0} {$i <= $last} {incr i} {
- foreach {type toupper tolower totitle} [split [lindex $groups $i] ,] {}
-
- # Compute the case conversion type and delta
-
- if {$totitle != ""} {
- if {$totitle == $toupper} {
- # subtract delta for title or upper
- set case 4
- set delta $toupper
- } elseif {$toupper != ""} {
- # subtract delta for upper, subtract 1 for title
- set case 5
- set delta $toupper
- } else {
- # add delta for lower, add 1 for title
- set case 3
- set delta $tolower
- }
- } elseif {$toupper != ""} {
- # subtract delta for upper, add delta for lower
- set case 6
- set delta $toupper
- } elseif {$tolower != ""} {
- # add delta for lower
- set case 2
- set delta $tolower
- } else {
- # noop
- set case 0
- set delta 0
- }
-
- set val [expr {($delta << 22) | ($case << 5) | $type}]
-
- append line [format "%d" $val]
- if {$i != $last} {
- append line ", "
- }
- if {[string length $line] > 65} {
- puts $f $line
- set line " "
- }
- }
- puts $f $line
- puts $f "};
-
#define GetUniCharCClass(ch) (cclassGroupMap\[(cclassPageMap\[(((int)(ch)) & 0xffff) >> CCLASS_OFFSET_BITS\] << CCLASS_OFFSET_BITS) | ((ch) & ((1 << CCLASS_OFFSET_BITS)-1))\])