/usr/include/kwnn/jllib.h is in libkwnn-dev 1.1.1~a021+cvs20130302-5build1.
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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | /*
* $Id: jllib.h,v 1.6 2008/10/26 10:27:53 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, 2008
*
* Maintainer: FreeWnn Project
*
* 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.
*/
/*
* Nihongo Henkan Library Header File
*/
#ifndef WNN_JLLIB_H
#define WNN_JLLIB_H
#include "jslib.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤Ï¡¢Ä¾Àܤ³¤Î¹½Â¤ÂΤÎÆâÍƤò¥¢¥¯¥»¥¹¤¹¤ëɬÍפÏ̵¤¤¤Ï¤º¡£
¥é¥¤¥Ö¥é¥ê´Ø¿ô¤òÍѤ¤¤ë¤³¤È¡£
*/
#define WNN_YOMI_SIZE 10
typedef struct wnn_jl_bun WNN_BUN;
struct wnn_jl_bun
{
int jirilen; /* ¸õÊäʸÀá¤Î¼«Î©¸ì */
int dic_no;
int entry;
int kangovect; /* Àܳ¥Ù¥¯¥È¥ë¥Æ¡¼¥Ö¥ë¤Ø¤Î¥Ý¥¤¥ó¥¿ */
int hinsi; /* ÉÊ»ì */
int hindo:16; /* ÉÑÅÙ(²¾ÁÛÃÍ) */
int ref_cnt:4; /* ʸÀá¥ê¥¹¥È¤Ë»È¤ï¤ì¤Æ¤¤¤ë */
/* BUG FIX signed --> unsigned */
unsigned int ima:1; /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È */
unsigned int hindo_updated:1; /* ¤³¤ÎʸÀá¤ÎÉÑÅ٤Ϲ¹¿·¤µ¤ì¤Æ¤¤¤ë */
unsigned int nobi_top:1; /* ¿¤Ð¤·½Ì¤ß¤ò¹Ô¤Ã¤¿¤«¤ò¼¨¤¹¡£ */
/* egg ¤ß¤¿¤¤¤Ë¿¤Ð¤·½Ì¤ß¤ò·«¤êÊÖ¤·¹Ô¤¦»þ¤Ë¡¢ÅÓÃæ¤Ë¸½¤ì¤ë¸õÊä¤Îº£
»È¤Ã¤¿¤è ¥Ó¥Ã¥È¤ò Íî¤È¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ */
unsigned int dai_top:1; /* ÂçʸÀá¤ÎÀèƬ */
unsigned int dai_end:1; /* ÂçʸÀá¤Îsaigo *//* ¼¡¸õÊä nomi */
unsigned int from_zenkouho:2; /*¼¡¸õÊ䤫¤éÁªÂò¤µ¤ì¤¿Ê¸Àᤫ¤É¤¦¤« */
unsigned int bug:1; /* BUG FIX ¤È¤ê¤¢¤¨¤º */
/* BUG FIX signed --> unsigned */
int hyoka;
int daihyoka;
short yomilen;
short kanjilen;
WNN_BUN *down; /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È¤òÍî¤È¤¹ÂоݤÎʸÀá */
w_char yomi[WNN_YOMI_SIZE]; /* Æɤߡ¢´Á»ú¤¬Æþ¤ë¡£Æþ¤êÀÚ¤é¤Ê¤¤»þ¤Ë¤Ï
¼¡¤Ë¤Ä¤Ê¤²¤ë */
WNN_BUN *next; /* ¼¡¤Î¥¹¥È¥é¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ */
WNN_BUN *free_next; /* ¼¡¤Î¥¹¥È¥é¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ */
};
struct wnn_buf
{
struct wnn_env *env; /* ´Ä¶ */
int bun_suu; /* ʸÀá¿ô */
int zenkouho_suu; /* Á´¸õÊä¤Î¿ô */
WNN_BUN **bun; /* ʸÀá¤Ø¤Î¥Ý¥¤¥ó¥¿ */
WNN_BUN **down_bnst; /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È¤òÍî¤È¤¹ÂоݤÎʸÀá */
WNN_BUN **zenkouho; /* Á´¸õÊä¤Ø¤Î¥Ý¥¤¥ó¥¿ */
int *zenkouho_dai; /* daibunsetsu zenkouho */
int zenkouho_dai_suu; /* daibunsetsu zenkouho suu */
short c_zenkouho; /* Á´¸õÊäÃæ¡¢ÃíÌܤ·¤Æ¤¤¤ë¸õÊä */
short zenkouho_daip;
int zenkouho_bun; /* Á´¸õÊä¤ò¼è¤Ã¤Æ¤¤¤ëʸÀá */
int zenkouho_end_bun; /* Á´¸õÊä(dai)¤ò¼è¤Ã¤Æ¤¤¤ëºÇ¸å¤ÎʸÀá */
int zenkouho_endvect; /* Á´¸õÊä¤ò¼è¤Ã¤¿ endvect *//* ADD KURI */
WNN_BUN *free_heap;
char *heap; /* linked list of alloced area */
int msize_bun;
int msize_zenkouho;
};
#define WNN_SHO 0
#define WNN_DAI 1
#define WNN_NO_USE 0
#define WNN_USE_MAE 1
#define WNN_USE_ATO 2
#define WNN_USE_ZENGO (WNN_USE_MAE | WNN_USE_ATO)
/* #define WNN_ZENGO_YUUSEN 4 */
#define WNN_UNIQ_KNJ 2
#define WNN_UNIQ 1
#define WNN_NO_UNIQ 0
#define WNN_NO_CREATE 0
#define WNN_CREATE (-1)
#define WNN_DIC_PRIO_DEFAULT 5
#define WNN_YOMI 0
#define WNN_KANJI 1
#define jl_next(buf) jl_set_jikouho((buf), (buf)->c_zenkouho + 1)
#define jl_previous(buf) jl_set_jikouho((buf), (buf)->c_zenkouho - 1)
#define jl_next_dai(buf) jl_set_jikouho_dai((buf), (buf)->c_zenkouho + 1)
#define jl_previous_dai(buf) jl_set_jikouho_dai((buf), (buf)->c_zenkouho - 1)
#define jl_get_kanji(buf, bun_no, bun_no2, area)\
wnn_get_area(buf, bun_no, bun_no2, area, WNN_KANJI)
#define jl_get_yomi(buf, bun_no, bun_no2, area)\
wnn_get_area(buf, bun_no, bun_no2, area, WNN_YOMI)
#define jl_bun_suu(buf) ((buf)->bun_suu)
#define jl_zenkouho_suu(buf) ((buf)->zenkouho_daip? (buf)->zenkouho_dai_suu:(buf)->zenkouho_suu)
#define jl_zenkouho_bun(buf) ((buf)->zenkouho_bun)
#define jl_c_zenkouho(buf) ((buf)->c_zenkouho)
#define jl_zenkouho_daip(buf) ((buf)->zenkouho_daip)
#define jl_dai_top(buf, k) ((buf)->bun[k]->dai_top)
#define jl_jiri_len(buf, k) ((buf)->bun[k]->jirilen)
#define jl_fuzoku_len(buf, k) \
(jl_yomi_len((buf), k, k+1) - jl_jiri_len((buf), k))
#define jl_jiri_kanji_len(buf, k) \
(jl_kanji_len((buf), k, k+1) - jl_fuzoku_len((buf), k))
/* Macros to create library functions from "_e" libraries */
#define jl_env(buf) ((buf)->env)
#define jl_dic_add(buf,dic_name,hindo_name,rev, prio,rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler)\
jl_dic_add_e(jl_env(buf),dic_name,hindo_name,rev,prio,rw, hrw, pwd_dic,\
pwd_hindo, error_handler, message_handler)
#define jl_fuzokugo_set(buf, fname) jl_fuzokugo_set_e(jl_env(buf), fname)
#define jl_fuzokugo_get(buf, fname) jl_fuzokugo_get_e(jl_env(buf), fname)
#define jl_dic_save(buf,dic_no) jl_dic_save_e(jl_env(buf),dic_no)
#define jl_dic_save_all(buf) jl_dic_save_all_e(jl_env(buf))
#define jl_dic_list(buf, dip) jl_dic_list_e(jl_env(buf), dip)
#define jl_word_search(buf,dic_no, yomi, jdp) \
jl_word_search_e(jl_env(buf),dic_no, yomi, jdp)
#define jl_word_search_by_env(buf, yomi, jdp) \
jl_word_search_by_env_e(jl_env(buf), yomi, jdp)
#define jl_word_use(buf, dic_no, entry) \
jl_word_use_e(jl_env(buf), dic_no, entry)
#define jl_param_set(buf, param) jl_param_set_e(jl_env(buf), param)
#define jl_param_get(buf, param) jl_param_get_e(jl_env(buf), param)
#define jl_dic_delete(buf, dic_no) jl_dic_delete_e(jl_env(buf), dic_no)
#define jl_dic_use(buf, dic_no, flag) jl_dic_use_e(jl_env(buf), dic_no, flag)
#define jl_word_add(buf, dic, yomi, kanji, com, hinsi, hindo) \
jl_word_add_e(jl_env(buf), dic, yomi, kanji, com, hinsi, hindo)
#define jl_word_delete(buf, dic, entry)\
jl_word_delete_e(jl_env(buf), dic, entry)
#define jl_word_info(buf, dic_no, entry)\
jl_word_info_e(jl_env(buf), dic_no, entry)
#define jl_inspect(buf, bun_no)\
jl_word_info(buf, (buf)->bun[bun_no]->dic_no,(buf)->bun[bun_no]->entry)
#define jl_hinsi_number(buf, name) jl_hinsi_number_e(jl_env(buf), name)
#define jl_hinsi_name(buf, no) jl_hinsi_name_e(jl_env(buf), no)
#define jl_word_comment_set(buf, dic, entry, comm) \
jl_word_comment_set_e((buf)->env, dic, entry, comm)
#define jl_dic_comment_set(buf, dic, comm) \
jl_dic_comment_set_e((buf)->env, dic, comm)
#define jl_hinsi_list(buf, dic_no, name, area) \
jl_hinsi_list_e(jl_env(buf), dic_no, name, area)
#define jl_hinsi_dicts(buf, no, area) \
jl_hinsi_dicts_e(jl_env(buf), no, area)
#ifdef nodef /*ÅöÌ̤δ֡¢ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î¥³¥á¥ó¥È¤Ï¥æ¡¼¥¶¤Ë¸«¤»¤Ê¤¤¡£ */
#define jl_hindo_comment_set(buf, dic, comm) \
jl_hindo_comment_set_e((buf)->env, dic, comm)
#endif
#define jl_isconnect(buf) jl_isconnect_e((buf)->env)
#define jl_env_sticky(buf) js_env_sticky((buf)->env)
#define jl_env_sticky_e(env) js_env_sticky(env)
#define jl_env_un_sticky(buf) js_env_un_sticky((buf)->env)
#define jl_env_un_sticky_e(env) js_env_un_sticky(env)
/* for select server by useing $LANG */
#define jl_open(env_n, server_n, wnnrc_n, error_handler, message_handler, timeout) \
jl_open_lang(env_n, server_n, NULL, wnnrc_n, error_handler, message_handler, timeout)
#define jl_connect(env_n, server_n, wnnrc_n, error_handler, message_handler, timeout) \
jl_connect_lang(env_n, server_n, NULL, wnnrc_n, error_handler, message_handler, timeout)
#define jl_get_lang(buf) js_get_lang((buf)->env)
#define jl_set_lang(buf, lang) js_set_lang((buf)->env, lang)
/* extern function defines */
/* Note: FRWNN_PARAMS is defined in jslib.h . */
extern struct wnn_buf *jl_open_lang FRWNN_PARAMS((char *env_n, char *server_n, char *lang, char *wnnrc_n, int (*error_handler) (), int (*message_handler) (), int timeout));
extern struct wnn_env *jl_connect_lang FRWNN_PARAMS((register char *env_n, register char *server_n, register char *lang, register char *wnnrc_n, int (*error_handler) (), int (*message_handler) (), int timeout));
extern struct wnn_env *jl_env_get FRWNN_PARAMS((register struct wnn_buf *buf));
extern struct wnn_jdata *jl_word_info_e FRWNN_PARAMS((register struct wnn_env *env, int dic_no, int entry));
extern w_char *jl_hinsi_name_e FRWNN_PARAMS((register struct wnn_env *env, register int no));
extern void jl_close FRWNN_PARAMS((register struct wnn_buf *buf));
extern int jl_dic_add_e FRWNN_PARAMS((register struct wnn_env *env, char *dic_name, char *hindo_name, int rev, int prio, int rw, int hrw, char *pwd_dic, char *pwd_hindo, int (*error_handler) (), int (*message_handler) () ));
extern int jl_dic_comment_set_e FRWNN_PARAMS((register struct wnn_env *env, int dic_no, w_char *comment));
extern int jl_dic_delete_e FRWNN_PARAMS((register struct wnn_env *env, register int dic_no));
extern int jl_dic_list_e FRWNN_PARAMS((struct wnn_env *env, WNN_DIC_INFO **dicinfo));
extern int jl_dic_save_all_e FRWNN_PARAMS((struct wnn_env *env));
extern int jl_dic_save_e FRWNN_PARAMS((register struct wnn_env *env, int dic_no));
extern int jl_dic_use_e FRWNN_PARAMS((struct wnn_env *env, int dic_no, int flag));
extern void jl_disconnect FRWNN_PARAMS((register struct wnn_env *env));
extern void jl_disconnect_if_server_dead FRWNN_PARAMS((register struct wnn_env *env));
extern void jl_env_set FRWNN_PARAMS((register struct wnn_buf *buf, register struct wnn_env *env));
extern int jl_fuzokugo_get_e FRWNN_PARAMS((register struct wnn_env *env, char *fname));
extern int jl_fuzokugo_set_e FRWNN_PARAMS((struct wnn_env *env, char *fname));
extern void jl_get_zenkouho_kanji FRWNN_PARAMS((register struct wnn_buf *buf, int zen_num, w_char *area));
extern int jl_hinsi_dicts_e FRWNN_PARAMS((register struct wnn_env *env, int no, int **area));
extern int jl_hinsi_list_e FRWNN_PARAMS((register struct wnn_env *env, int dic_no, w_char *name, w_char ***area));
extern int jl_hinsi_number_e FRWNN_PARAMS((register struct wnn_env *env, w_char *name));
extern int jl_isconnect_e FRWNN_PARAMS((register struct wnn_env *env));
extern int jl_kanji_len FRWNN_PARAMS((struct wnn_buf *buf, register int bun_no, register int bun_no2));
extern int jl_kill FRWNN_PARAMS((struct wnn_buf *buf, register int bun_no, register int bun_no2));
extern int jl_nobi_conv FRWNN_PARAMS((register struct wnn_buf *buf, register int bun_no, int ichbn_len, register int bun_no2, int use_maep, int ich_shop));
extern int jl_nobi_conv_e2 FRWNN_PARAMS((register struct wnn_buf *buf, struct wnn_env *env, register int bun_no, int ichbn_len, register int bun_no2, int use_maep, int ich_shop));
extern int jl_param_get_e FRWNN_PARAMS((struct wnn_env *env, struct wnn_param *para));
extern int jl_param_set_e FRWNN_PARAMS((register struct wnn_env *env, struct wnn_param *para));
extern int jl_ren_conv FRWNN_PARAMS((register struct wnn_buf *buf, register w_char *yomi, int bun_no, int bun_no2, int use_maep));
extern int jl_set_env_wnnrc FRWNN_PARAMS((register struct wnn_env *env, char *wnnrc_n, int (*error_handler) (), int (*message_handler) () ));
extern int jl_set_env_wnnrc1 FRWNN_PARAMS((register struct wnn_env *env, char *wnnrc_n, int (*error_handler) (), int (*message_handler) (), int level));
extern int jl_set_jikouho FRWNN_PARAMS((register struct wnn_buf *buf, register int offset));
extern int jl_set_jikouho_dai FRWNN_PARAMS((register struct wnn_buf *buf, int offset));
extern int jl_tan_conv FRWNN_PARAMS((register struct wnn_buf *buf, w_char *yomi, register int bun_no, register int bun_no2, int use_maep, int ich_shop));
extern int jl_update_hindo FRWNN_PARAMS((register struct wnn_buf *buf, int bun_no, int bun_no2));
extern int jl_word_add_e FRWNN_PARAMS((struct wnn_env *env, int dic_no, w_char *yomi, w_char *kanji, w_char *comment, int hinsi, int init_hindo));
extern int jl_word_comment_set_e FRWNN_PARAMS((register struct wnn_env *env, int dic_no, int entry, w_char *comment));
extern int jl_word_delete_e FRWNN_PARAMS((struct wnn_env *env, int dic_no, int entry));
extern int jl_word_search_by_env_e FRWNN_PARAMS((register struct wnn_env *env, w_char *yomi, struct wnn_jdata **jdp));
extern int jl_word_search_e FRWNN_PARAMS((register struct wnn_env *env, int dic_no, w_char *yomi, struct wnn_jdata **jdp));
extern int jl_word_use_e FRWNN_PARAMS((register struct wnn_env *env, int dic_no, int entry));
extern int jl_yomi_len FRWNN_PARAMS((struct wnn_buf *buf, register int bun_no, register int bun_no2));
extern int jl_zenkouho FRWNN_PARAMS((register struct wnn_buf *buf, int bun_no, int use_maep, int uniq_level));
extern int jl_zenkouho_dai FRWNN_PARAMS((register struct wnn_buf *buf, int bun_no, int bun_no2, int use_maep, int uniq_level));
extern int wnn_get_area FRWNN_PARAMS((struct wnn_buf *buf, register int bun_no, register int bun_no2, w_char *area, int kanjip));
extern char *wnn_perror FRWNN_PARAMS((void));
extern char *wnn_perror_lang FRWNN_PARAMS((char *lang));
#ifdef CONVERT_by_STROKE
extern void jl_get_zenkouho_yomi FRWNN_PARAMS((register struct wnn_buf *buf, int zen_num, w_char *area));
#endif
#ifdef __cplusplus
}
#endif
#endif /* WNN_JLLIB_H */
|