/usr/include/wnn/rk_spclval.h is in libwnn-dev 1.1.1~a021+cvs20130302-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | /*
* $Id: rk_spclval.h,v 1.5 2005/04/10 15:26:37 aonoto Exp $
*/
/*
* FreeWnn is a network-extensible Kana-to-Kanji conversion system.
* This file is part of FreeWnn.
*
* Copyright Kyoto University Research Institute for Mathematical Sciences
* 1987, 1988, 1989, 1990, 1991, 1992
* Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999
* Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992
* Copyright FreeWnn Project 1999, 2000
*
* Maintainer: FreeWnn Project <freewnn@tomo.gr.jp>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/***********************************************************************
rk_spclval.h
87.12. 3 ²þ Àµ
ËÜÊÑ´¹¤Ç»È¤Ã¤Æ¤¤¤ëÆüì¤ÊÃͤÎÄêµÁ¡Ê³°Éô¤Ë¤â½Ð¤¹¡Ë¡£¥Þ¥¯¥í
´Ø¿ô¤â¡¢ctype.h¤ò»È¤¦¤â¤Î°Ê³°¤Ï¤³¤Á¤é¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
rk_macros.h ¤Ëinclude¤µ¤ì¤Æ¤¤¤ë¡£
***********************************************************************/
/*
* Version 3.0
*/
#ifndef RK_SPCLVAL_H
#define RK_SPCLVAL_H
#ifndef EOLTTR
typedef unsigned int letter; /* ʸ»ú¤Ï°ìÈ̤ˤ³¤Î·¿¤Çɽ¤¹ */
typedef unsigned char uns_chr;
#define LTRHUG (~(0xff000000))
/* ÆâÉôɽ¸½ µÚ¤Óµ¶Ê¸»ú¤ò½ü¤¯¡¢letter¤Î¼è¤êÆÀ¤ëºÇÂçÃÍ */
/* °Ê²¼¤ËÄêµÁ¤¹¤ëÃͤϡ¢ºÇ¾å°Ì¥Ð¥¤¥È¤¬255¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
¤³¤ì¤é¤Î¤¦¤Á¡¢³°¤Ë½Ð¤ë¤Î¤Ï EOLTTR¡¢CHMSIG¡¢NISEBP¡¢LTREOF¤È
REDRAW¡Êµ¶¥Ç¥ê¡¼¥È¤È¤·¤ÆNISEDL¤ò»È¤¦¾ì¹ç¤ÏNISEDL¤â¡Ë¡£ */
#define EOLTTR ((letter)-1) /* ʸ»úÎó¤Î½ªÃ¼¤òɽ¤¹¥³¡¼¥É */
/* ¥¡¼ÆþÎϤ¬¤¢¤Ã¤¿¤éɬ¤º²¿¤«¥³¡¼¥É¤òÊÖ¤¹¾õÂ֤ˤ·¤Æ
¤ª¤¯¤È¡¢ÆäËÊÖ¤¹¤Ù¤¤â¤Î¤¬¤Ê¤¤»þ¤Ï¤³¤ì¤òÊÖ¤¹¡£ */
#define ERRCOD ((letter)-2) /* (error)¤òɽ¤¹ÆâÉô¥³¡¼¥É */
#define CHMSIG ((letter)-3) /* ¥â¡¼¥É¥Á¥§¥ó¥¸¤òɽ¤¹¥³¡¼¥É */
#define NISEBP ((letter)-4) /* ¥¨¥é¡¼·Ù¹ðÍѤε¶BEL¥³¡¼¥É */
#define VARRNG ((letter)-5) /* ÊѰ褬Æó¤Ä¤Îʸ»ú¤Î´Ö¤Ç¤¢¤ë¤Î¤ò¼¨¤¹ÆâÉô¥³¡¼¥É */
#define UNUSDC ((letter)-6) /* ¥Þ¥Ã¥Á¤ò¼ºÇÔ¤µ¤»¤ë¤¿¤á¤ÎÆâÉô¥³¡¼¥É */
#define REASIG ((letter)-7) /* ɽ¤ÎºÆÀßÄê¤òÍ׵᤹¤ë¤¿¤á¤ÎÆâÉô¥³¡¼¥É */
#define URBFCL ((letter)-8) /* ΢¥Ð¥Ã¥Õ¥¡¤ÎÌÀ¼¨Åª¥¯¥ê¥¢¤òÍ׵᤹¤ëÆâÉô¥³¡¼¥É */
#define LTREOF ((letter)-9) /* romkan_next()¡¢Æ±getc()¤¬EOF¤ÎÂå¤ï¤ê¤ËÊÖ¤¹¤â¤Î
¡Ê¤Ç¤¤ì¤ÐEOF¤ÈƱ¤¸¤Ë¤·¤¿¤¤¤¬¡Ä¡Ë */
#define REDRAW ((letter)-10) /* Wnn¤ËÊÑ´¹¹Ô¤Îredraw¤òÍ׵᤹¤ëÆü쥳¡¼¥É */
#define NISEDL ((letter)-11) /* µ¶¥Ç¥ê¡¼¥È¤È¤·¤ÆÄê¿ô¤ò»È¤¤¤¿¤¤¿Í¤Î¤¿¤á¤Ë½àÈ÷
¤µ¤ì¤¿Äê¿ô¡Ê⤷¡¢»È¤¤¤¿¤¯¤Ê¤±¤ì¤Ð»È¤ï¤Ê¤¯¤Æ¤â
¤¤¤¤¡Ë¡£ÊÑ¿ônisedl¤Ë¥»¥Ã¥È¤·¤Æ»È¤¦ */
/* romkan_init3()¤Î°ú¿ô¤Î¥Õ¥é¥°¤Ë»È¤¦ÃÍ */
#define RK_CHMOUT 01 /* ¥â¡¼¥É¥Á¥§¥ó¥¸¤òÃΤ餻¤ë¥³¡¼¥É¤òÊÖ¤¹¤«¡© */
#define RK_KEYACK 02 /* ¥¡¼¥¤¥ó¤ËÂФ·É¬¤º²¿¤«¤òÊÖ¤¹¤« */
#define RK_DSPNIL 04 /* ¥â¡¼¥Éɽ¼¨Ê¸»úÎó̵»ØÄê¤Î»þ¤Ë¶õʸ»úÎó¤òÊÖ¤¹¤«¡Ê¥Ç¥Õ
¥©¥ë¥È¤ÏNULL¡Ë¡£¸ß´¹ÀÊÝ»ý¤Î¤¿¤á */
#define RK_NONISE 010 /* µ¶¥³¡¼¥É¤ò½Ð¤µ¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤« */
#define RK_REDRAW 020 /* WnnÍÑÆüì¥Õ¥é¥°¡ÊredrawÍѤΥե饰¤ò½Ð¤¹¤«¤É¤¦¤«¡Ë */
#define RK_SIMPLD 040 /* delete¤ÎÆ°ºî¤òñ½ã¤Ë¤¹¤ë¤« */
#define RK_VERBOS 0100 /* »ÈÍѤ¹¤ëɽ¤Î°ìÍ÷¤ò¥ê¥Ý¡¼¥È¤¹¤ë¤« */
/* ¥³¡¼¥É¤Î¶èÊ̤˻Ȥ¦¥Þ¥¯¥í */
#define HG1BIT (0x80000000) /* ºÇ¾å°Ì¥Ó¥Ã¥È¤À¤è */
#define SHUBET(X) ((letter)(X) >> (int)24)
/* ÆâÉôɽ¸½¤Ç¡¢¾å£±¥Ð¥¤¥È¤ò¼ïÊÌɽ¸½¤Ë»È¤Ã¤Æ¤ë */
#define LWRMSK(X) ((X) & ~(0xff000000)) /* ¾å£±¥Ð¥¤¥È¤ò¼è¤ê½ü¤¯ */
#define LWRCUT(X) ((X) &= ~(0xff000000)) /* ¾å£±¥Ð¥¤¥È¤ò¼è¤ê½ü¤¯ */
#define is_HON(X) (SHUBET(X) == 0) /* ËÜʪ¤Îʸ»ú¤« */
#define NAIBEX(X) (0 < SHUBET(X) && SHUBET(X) < 0x80) /* ÆâÉôɽ¸½¤ò¼¨¤¹Ãͤ« */
#define isNISE(X) (SHUBET(X) == 0x80) /* µ¶Êª¤Îʸ»ú¤«¡ÊºÇ¾å°Ì¥Ó¥Ã¥È¤¬Î©¤Ä¡Ë */
#define isSPCL(X) (SHUBET(X) == 0xff) /* rk_spclval.h¤ÇÄêµÁ¤µ¤ì¤ëÃͤ«¤É¤¦¤« */
/* NISEDL¤Ê¤É¤ò´Þ¤á¤¿µ¶¤Îʸ»ú¤Ç¤¢¤ë¤«¤É¤¦¤«¤òȽÄꤹ¤ë¤Ë¤Ï¡¢~is_HON(X) ¤«¡¢
isNISE(X) || isSPCL(X) ¤È¤·¤ÆȽÄꤷ¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£ */
#define toNISE(X) ((X) | HG1BIT)
#define to_HON(X) ((X) & ~HG1BIT)
/* ¸ß´¹À¤Î¤¿¤áÍÑ°Õ¤·¤Æ¤¢¤ëÊÌ̾ */
#define REALCD(X) is_HON(X)
#define NISECD(X) isNISE(X)
#define SPCLCD(X) isSPCL(X)
/** Ⱦ³Ñʸ»ú¤Î¥³¡¼¥É¤Îdefine */
#ifndef HNKAK1
# ifdef IKIS
# define HNKAK1 0xA8
# else
# define HNKAK1 0x8E
# endif
#endif
/** rk_bltinfn.c ¤ÎÊä´°¤Î¤¿¤á¤Î¥Þ¥¯¥í
¡Ê°ú¿ô¤òÊ£¿ô²óɾ²Á¤¹¤ë¤â¤Î¤â¿¤¤¤Î¤ÇÃí°Õ¡Ë*/
#define HKKBGN (HNKAK1 * 0x100 + 0xA1) /* Ⱦ³Ñ¥«¥Ê¤Î¶çÅÀ */
#define HKKEND (HNKAK1 * 0x100 + 0xDF) /* ¡· ȾÂùÅÀ */
#define HIRBGN (0xA4A1) /* ¤¡ */
#define HIREND (0xA4F3) /* ¤ó */ /* ¤Ò¤é¤¬¤Ê¡§"¤¡"¡Á"¤ó" */
#define KATBGN (0xA5A1) /* ¥¡ */
#define KATEND (0xA5F6) /* ¥ö */ /* ¥«¥¿¥«¥Ê¡§"¥¡"¡Á"¥ó"¡Á"¥ö" */
#define _to_kata(l) ((l) + (KATBGN - HIRBGN)) /** ¥«¥¿¥«¥Ê¤Ø¡ÊÄêµÁ°èÀ©¸Â¡Ë*/
#define _to_hira(l) ((l) - (KATBGN - HIRBGN)) /** ¤Ò¤é¤¬¤Ê¤Ø¡ÊÄêµÁ°èÀ©¸Â¡Ë*/
#define is_hira(l) (HIRBGN <= (l) && (l) <= HIREND) /** ¤Ò¤é¤¬¤Ê¤«¡© */
#define is_kata(l) (KATBGN <= (l) && (l) <= KATEND) /** ¥«¥¿¥«¥Ê¤«¡© */
#define is_kata2(l) (_to_kata(HIRBGN) <= (l) && (l) <= _to_kata(HIREND))
/** Âбþ¤¹¤ë¤Ò¤é¤¬¤Ê¤Î¤¢¤ë¥«¥¿¥«¥Ê¤«¡© */
#define to_kata(l) (is_hira(l) ? _to_kata(l) : (l)) /** ¥«¥¿¥«¥Ê¤Ø */
#define to_hira(l) (is_kata2(l) ? _to_hira(l) : (l))
/** ¤Ò¤é¤¬¤Ê¤Ø¡£¡Ö¥ô¥õ¥ö¡×¤Ï¥«¥¿¥«¥Ê¤Î¤Þ¤Þ»Ä¤ë¡£*/
#define is_hankata(l) (HKKBGN <= (l) && (l) <= HKKEND)
/** Ⱦ³Ñ¥«¥Ê¡Ê¶çÅÀ¤Ê¤É¤ò´Þ¤à¡Ë¤«¡© */
/* ¤½¤Î¾¤Î¥Þ¥¯¥í´Ø¿ô·²¡Ê°ú¿ô¤òÊ£¿ô²óɾ²Á¤¹¤ë¤â¤Î¤â¿¤¤¤Î¤ÇÃí°Õ¡Ë */
#define numberof(array) (sizeof(array) / sizeof(*array))
/* ¥Ý¥¤¥ó¥¿¤òletter¤ÎÎó¤ÎËöÈø¤Ø¤â¤Ã¤Æ¤¤¤¯¡£letter *lp */
#define totail(lp) {while(*(lp) != EOLTTR) (lp)++;}
/* ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò¤½¤Îʸ»úÎó¤ÎºÇ¸åÈø¤Ø¡£totail¤ÎcharÈÇ¡£char *sp */
#define strtail(sp) {while(*(sp)) (sp)++;}
/* ¸ÂÄêÈÇromkan_init3 */
#define romkan_init4(pathname, delchr, nisedl, keyin, bytecount, flg) \
romkan_init3(pathname, delchr, nisedl, EOLTTR, \
keyin, bytecount, bytecount, 0, flg)
#define romkan_init5(pathname, delchr, keyin, bytecount, flg) \
romkan_init4(pathname, delchr, toNISE(delchr), keyin, bytecount, flg)
#endif /* of ifndef EOLTTR */
#endif /* RK_SPCLVAL_H */
|