summaryrefslogtreecommitdiff
path: root/source3/include/kanji.h
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1997-08-21 20:03:45 +0000
committerSamba Release Account <samba-bugs@samba.org>1997-08-21 20:03:45 +0000
commitbce14d3642ca510c2237d3b39da47099207752c8 (patch)
tree0dcf0a2486d338d2e8bf7d531e01bd19ee41d0fd /source3/include/kanji.h
parent7a72b0b313be3c226923849ef37a049a2b3d6a62 (diff)
downloadsamba-bce14d3642ca510c2237d3b39da47099207752c8.tar.gz
samba-bce14d3642ca510c2237d3b39da47099207752c8.tar.bz2
samba-bce14d3642ca510c2237d3b39da47099207752c8.zip
Kanji fixes for upper/lower case conversion with sjis characters.
Code from Takashi Fujita <fujita@ainix.isac.co.jp>. Jeremy (jallison@whistle.com) (This used to be commit 07f7e378c4839d0ca4bb79c8755481f4bf5637de)
Diffstat (limited to 'source3/include/kanji.h')
-rw-r--r--source3/include/kanji.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/include/kanji.h b/source3/include/kanji.h
index ee3ba7e09a..865ac3b2c9 100644
--- a/source3/include/kanji.h
+++ b/source3/include/kanji.h
@@ -22,6 +22,7 @@
and extend coding system to EUC/SJIS/JIS/HEX at 1994.10.11
and add all jis codes sequence at 1995.8.16
Notes: Hexadecimal code by <ohki@gssm.otuka.tsukuba.ac.jp>
+ and add upper/lower case conversion 1997.8.21
*/
#ifndef _KANJI_H_
#define _KANJI_H_
@@ -37,6 +38,22 @@
&& ((unsigned char) (c)) != 0x7f)
#define is_kana(c) ((0xa0 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xdf))
+/* case conversion */
+#define is_sj_upper2(c) \
+ ((0x60 <= (unsigned char) (c)) && ((unsigned char) (c) <= 0x79))
+#define is_sj_lower2(c) \
+ ((0x81 <= (unsigned char) (c)) && ((unsigned char) (c) <= 0x9A))
+#define sjis_alph 0x82
+#define is_sj_alph(c) (sjis_alph == (unsigned char) (c))
+#define is_sj_upper(c1, c2) (is_sj_alph (c1) && is_sj_upper2 (c2))
+#define is_sj_lower(c1, c2) (is_sj_alph (c1) && is_sj_lower2 (c2))
+#define sj_toupper2(c) \
+ (is_sj_lower2 (c) ? ((int) ((unsigned char) (c) - 0x81 + 0x60)) : \
+ ((int) (unsigned char) (c)))
+#define sj_tolower2(c) \
+ (is_sj_upper2 (c) ? ((int) ((unsigned char) (c) - 0x60 + 0x81)) : \
+ ((int) (unsigned char) (c)))
+
#ifdef _KANJI_C_
/* FOR EUC CODE */
#define euc_kana (0x8e)