File: euc.h

package info (click to toggle)
lookup 1.08b-5
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 1,108 kB
  • ctags: 1,305
  • sloc: ansic: 12,634; makefile: 236; perl: 174; sh: 53
file content (37 lines) | stat: -rw-r--r-- 1,266 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef __EUC_H__ /* file wrapper */
#define __EUC_H__
/*
 * Jeffrey Friedl
 * Omron Corporation			ʳ
 * Nagaokakyoshi, Japan			617Ĺ
 *
 * jfriedl@nff.ncl.omron.co.jp
 *
 * This work is placed under the terms of the GNU General Purpose License
 * (the "GNU Copyleft").
 ********************************************************************
 *
 * Attempts to define some definitions useful for dealing with
 * Japanese EUC Packed Format text.
 *    Codeset 0: ASCII (or JIS-Roman). Bytes/char: 1
 *    Codeset 1: JIS X 0208            Bytes/char: 2
 *    Codeset 0: Halfwidth katakana.   Bytes/char: 2
 *    Codeset 0: JIS X 0212            Bytes/char: 3
 */

/* Returns the codeset number for a character whose first byte is given. */
#define EUC_CODESET(X) ((euc_info[X]>>_euc_codeset_shift)&_euc_codeset_mask)

/* Returns the length of a character whose first byte is given */
#define EUC_CHAR_LENGTH(X) ((euc_info[X]>>_euc_bpc_shift)&_euc_bpc_mask)


/****************************************************************************/
/* private stuff below */
extern unsigned const char euc_info[256];
#define _euc_bpc_shift			0
#define _euc_bpc_mask			3
#define _euc_codeset_shift		2
#define _euc_codeset_mask		3

#endif /* file wrapper */