diff options
author | Diego Nieto Cid <dnietoc@gmail.com> | 2011-04-03 19:18:59 -0300 |
---|---|---|
committer | Diego Nieto Cid <dnietoc@gmail.com> | 2011-04-16 23:45:23 -0300 |
commit | 806622f4dc67d84b12d51159b35aed790c84e64e (patch) | |
tree | 6946b0429824b5ed930eb25622665f1da598899b /console-client/xkb/kstoucs_map.sh | |
parent | 8582683290c390d8e5f551f35886eb2453f7f8e7 (diff) |
Reimplement KeySymToUcs4.
* console-client/Makefile (DIST_FILES): Add xkb/kstoucs_map.sh.
(kstoucs_map.c): New target.
* console-client/xkb/kstoucs.c: Reimplement KeySymToUcs4.
* console-client/xkb/kstoucs_map.sh: New file.
Diffstat (limited to 'console-client/xkb/kstoucs_map.sh')
-rw-r--r-- | console-client/xkb/kstoucs_map.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/console-client/xkb/kstoucs_map.sh b/console-client/xkb/kstoucs_map.sh new file mode 100644 index 00000000..624d3518 --- /dev/null +++ b/console-client/xkb/kstoucs_map.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +SED=${SED:-sed} +AWK=${AWK:-awk} + +$SED -n -e 's/#define XK_[a-zA-Z0-9_]\+\s\+\(0x[0-9a-fA-F]\+\)\s*\/\*\s*U+\([0-9a-fA-F]\+\).*\*\//\1\t0x\2/p' \ + | $AWK '{ print strtonum($1) "\t" $2; }' \ + | sort -n -k1 \ + | $AWK ' + BEGIN { print "struct ksmap kstoucs_map[] = {" } + { + if (NR == 1) + separator =" "; + else + separator =" , "; + + if (strtonum($1) < 0x1000000) + print separator "{ " $1 ", " $2 " }" + } + END { print "};" }' |