This file is indexed.

/usr/include/kwnn/jslib.h is in libkwnn-dev 1.1.1~a021+cvs20130302-7.

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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
/*
 *  $Id: jslib.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_JSLIB_H
#define WNN_JSLIB_H

#ifndef _WNN_SETJMP
#define _WNN_SETJMP
#include <setjmp.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define JLIB_VERSION    0x4003

#ifndef w_char
#define w_char  unsigned short
#endif /* w_char */

/* Á°Ã¼¥Ù¥¯¥¿(ÉÊ»ìÈÖ¹æ)¤ÎÄêµÁ */
#define WNN_BUN_SENTOU  -1      /* ÂçʸÀá¤ÎÀèƬ¤Ë¤Ê¤ì¤ëÅÛ */
#define WNN_ALL_HINSI   -2      /* ¤Ê¤ó¤Ç¤â¤¨¤¨¤è */
/* ½ªÃ¼¥Ù¥¯¥¿¤ÎÄêµÁ */
#define WNN_VECT_KANREN 0       /* ϢʸÀáÊÑ´¹¤Î½ªÃ¼¥Ù¥¯¥¿¡¼ */
#define WNN_VECT_KANTAN 1       /* ñʸÀáÊÑ´¹¤Î½ªÃ¼¥Ù¥¯¥¿¡¼ */
#define WNN_VECT_KANZEN 1       /* Á´¸õÊä¼è½Ð¤·¤Î½ªÃ¼¥Ù¥¯¥¿¡¼ 
                                   ñʸÀáÊÑ´¹»þ¤Î¤â¤Î¤ÈÅù¤·¤¤¡£ */
#define WNN_VECT_BUNSETSU 2     /* ϢʸÀáÊÑ´¹»þ¤Î¡¢³ÆʸÀá¤Î½ªÃ¼¥Ù¥¯¥¿¡¼ */
#define WNN_VECT_NO     -1      /* ½ªÃ¼¥Ù¥¯¥¿1 ̵¤· */
/* ʸÀá¤Î½ªÃ¼¤ÎÀܳ¾ðÊó */
#define WNN_CONNECT_BK  1       /* »ØÄꤵ¤ì¤¿½ªÃ¼¥Ù¥¯¥¿¡¼¤ËÀܳ¤Ç¤­¤¿¡£ */
#define WNN_NOT_CONNECT_BK      0       /* */
/* ʸÀá¤ÎÁ°Ã¼¤ÎÀܳ¾ðÊó */
#define WNN_CONNECT     1       /* »ØÄꤵ¤ì¤¿(Éʻ졢ÉÕ°¸ì)¤ËÀܳ¤Ç¤­¤¿¡£ */
#define WNN_SENTOU      2       /* ÂçʸÀá¤ÎÀèƬ */
#define WNN_NOT_CONNECT 3       /* ÀèƬ¤Ë¤Ê¤ì¤Ê¤¤¤·¡¢Á°¤ËÀܳ¤Ç¤­¤Ê¤¤ */
#define WNN_GIJI        4       /* µ¿»÷ʸÀá¤òºî¤Ã¤¿¡£ */

/* µ¿»÷ʸÀá¤ÎľÁ°¤ËÁªÂò¤·¤¿¸õÊä */
#define WNN_HIRAGANA    -1      /* ¤Ò¤é¤¬¤Ê */  /* ÆÉ¤ß¤Î¤Þ¤Þ */
#define WNN_KATAKANA    -11     /* ¥«¥¿¥«¥Ê */
/* ¿ô»ú */
#define WNN_NUM_HAN     -2      /* Ⱦ³Ñ¿ô»ú */  /* ÆÉ¤ß¤Î¤Þ¤Þ */
#define WNN_NUM_ZEN     -12     /* Á´³Ñ¿ô»ú */  /* £±£²£³ */
#define WNN_NUM_KAN     -13     /* ´Á¿ô»ú */    /* °ìÆó»° */
#define WNN_NUM_KANSUUJI -15    /* ´Á¿ô»ú */    /* É´Æó½½»° */
#define WNN_NUM_KANOLD  -16     /* ´Á¿ô»ú */    /* °íÉ´Æõ½¦»² */
#define WNN_NUM_HANCAN  -17     /* Ⱦ³Ñ¿ô»ú */  /* 1,234 */
#define WNN_NUM_ZENCAN  -18     /* Á´³Ñ¿ô»ú */  /* £±¡¤£²£³£´ */
/* 񥨓 */
#define WNN_ALP_HAN     -4      /* Ⱦ³Ñ */      /* ÆÉ¤ß¤Î¤Þ¤Þ */
#define WNN_ALP_ZEN     -30     /* Á´³Ñ */
/* µ­¹æ */
#define WNN_KIG_HAN     -5      /* Ⱦ³Ñ */      /* ÆÉ¤ß¤Î¤Þ¤Þ */
#define WNN_KIG_JIS     -40     /* Á´³Ñ(JIS) */
#define WNN_KIG_ASC     -41     /* Á´³Ñ(ASC) */

#define WNN_FT_DICT_FILE 1
#define WNN_FT_HINDO_FILE 2
#define WNN_FT_FUZOKUGO_FILE 3

#define WNN_STATIC_DICT 1       /* static dict */
#define WNN_UD_DICT 2           /* updatable dict */
#define WNN_REV_DICT 3          /* Updatable Dictonary with Reverse Index */
#define WNN_REG_DICT 4          /* Regular Expressino Dictonary */

/* for CHINESE PIN-IN : with Si Sheng (»ÍÀ¼) */
#define CWNN_REV_DICT           0x103   /* Updatable with Reverse Index */

/* for CHINESE: Bi Xing (É®·Á) */
#define BWNN_REV_DICT           0x203   /* Updatable with Reverse Index */

#define WNN_DIC_RDONLY  1
#define WNN_DIC_RW      0

#define WNN_DIC_ADD_REV 1       /* µÕÊÑ´¹ */
#define WNN_DIC_ADD_NOR 0       /* Ä̾ï¤ÎÊÑ´¹ */

/* header file for dic_syurui */
#define WNN_FILE_NOT_EXIST -1
#define WNN_NOT_A_JISHO 0
/* KURI
#define WNN_USER_DIC 1
#define WNN_SYSTEM_DIC 3
*/
#define WNN_HINDO_FILE 4
#define WNN_FUZOKUGO_FILE 5

/* set_hindo operation */
#define WNN_HINDO_NOP -2
#define WNN_IMA_ON -3
#define WNN_IMA_OFF -4
#define WNN_HINDO_INC -3
#define WNN_HINDO_DECL -4
#define WNN_ENTRY_NO_USE -1

/*      Wnn constant
*/
#define WNN_HOSTLEN 16
#define WNN_ENVNAME_LEN 32

/*      js_who  */
#define WNN_MAX_ENV_OF_A_CLIENT 32

struct wnn_jwho
{
  int sd;                       /* jserver Æâ¤Î¥½¥±¥Ã¥È¥Ç¥£¥¹¥¯¥ê¥×¥¿ */
  char user_name[64];           /* ¥æ¡¼¥¶Ì¾ */
  char host_name[64];           /* ¥Û¥¹¥È̾ */
  int env[WNN_MAX_ENV_OF_A_CLIENT];     /* ¤³¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬»ÈÍѤ·¤Æ¤¤¤ë
                                           ´Ä¶­ÈÖ¹æ¤ÎÎ󡣶õ¤¤¤Æ¤¤¤ë¤È¤³¤í¤Ë¤Ï¡¢-1 ¤¬Æþ¤ë */
};
typedef struct wnn_jwho WNN_JWHO;

/*      js_env_list     */
#define WNN_MAX_JISHO_OF_AN_ENV 30
#define WNN_MAX_FILE_OF_AN_ENV 60

struct wnn_env_info
{
  int env_id;                   /* ´Ä¶­ÈÖ¹æ */
  char env_name[WNN_ENVNAME_LEN];       /* ´Ä¶­Ì¾ */
  int ref_count;                /* »²¾È¿ô */
  /* struct wnn_param; */
  int fzk_fid;                  /* ÉÕ°¸ì¤Î¥Õ¥¡¥¤¥ëÈÖ¹æ */
  int jishomax;                 /* »ÈÍѤ·¤Æ¤¤¤ë¼­½ñ¤Î¸Ä¿ô */
  int jisho[WNN_MAX_JISHO_OF_AN_ENV];   /* »ÈÍѤ·¤Æ¤¤¤ë¼­½ñ¤Î¼­½ñÈֹ档
                                           ºÇ½é¤Îjishomax¸Ä¤À¤±°ÕÌ£¤¬¤¢¤ë */
  int file[WNN_MAX_FILE_OF_AN_ENV];     /* ¤³¤Î´Ä¶­¤Ë¤Ä¤Ê¤¬¤Ã¤Æ¤¤¤ë
                                           ¥Õ¥¡¥¤¥ëÈÖ¹æ(¶õ¤¤¤Æ¤¤¤ë¤È¤³¤í¤Ë¤Ï¡¢-1 ¤¬Æþ¤ë) */
};
typedef struct wnn_env_info WNN_ENV_INFO;

#define WNN_COMMENT_LEN 512     /* jisho no comment no nagasa */
#define WNN_F_NAMELEN 100
#define WNN_PASSWD_LEN 16       /* File Passwd Length */


struct wnn_dic_info
{
  int dic_no;                   /* ¼­½ñÈÖ¹æ */
  int body;                     /* ¼­½ñËÜÂΤΥե¡¥¤¥ëÈÖ¹æ */
  int hindo;                    /* ÉÑÅ٤Υե¡¥¤¥ëÈÖ¹æ */
  int rw;                       /* ¼­½ñ¤¬ÅÐÏ¿²Äǽ¤«¤É¤¦¤«
                                   (WNN_DIC_RW, WNN_DIC_RDONLY) */
  int hindo_rw;                 /* ÉÑÅÙ¤¬¹¹¿·²Äǽ¤«¤É¤¦¤«
                                   (WNN_DIC_RW, WNN_DIC_RDONLY) */
  int enablef;                  /* ¼­½ñ¤¬»ÈÍÑÃ椫¤É¤¦¤«
                                   (1 = »ÈÍÑÃæ, 0 = »ÈÍÑÃæÃÇ) */
  int nice;                     /* ¼­½ñ¤ÎÊÑ´¹»þ¤ÎÍ¥ÀèÅÙ */
  int rev;                      /* µÕÊÑ´¹¤«¡¢¤É¤¦¤«(1 = µÕÊÑ´¹, 0 = ÀµÊÑ´¹) */
/* added H.T */
  w_char comment[WNN_COMMENT_LEN];      /* ¼­½ñ¤Î¥³¥á¥ó¥È */
  char fname[WNN_F_NAMELEN];    /* ¼­½ñ¤Î¥Õ¥¡¥¤¥ë̾ */
  char hfname[WNN_F_NAMELEN];   /* ÉÑÅ٤Υե¡¥¤¥ë̾ */
  char passwd[WNN_PASSWD_LEN];  /* ¼­½ñ¤Î¥Ñ¥¹¥ï¡¼¥É */
  char hpasswd[WNN_PASSWD_LEN]; /* ÉÑÅ٤Υѥ¹¥ï¡¼¥É */
  int type;                     /* ¼­½ñ¤Î¼ïÎà(WNN_UD_DICT,WNN_STATIC_DICT) */
  int gosuu;                    /* ¼­½ñ¤Î¸ì¿ô */
  int localf;
  int hlocalf;
};

typedef struct wnn_dic_info WNN_DIC_INFO;

struct wnn_file_stat
{
  int type;                     /* ¥Õ¥¡¥¤¥ë¤Î¼ïÎà
                                   WNN_STATIC_DICT              ¸ÇÄê·Á¼°¼­½ñ
                                   WNN_UD_DICT          ÅÐÏ¿²Äǽ·Á¼°¼­½ñ
                                   WNN_HINDO_FILE               ÉÑÅÙ¥Õ¥¡¥¤¥ë
                                   WNN_FUZOKUGO_FILE    ÉÕ°¸ì¥Õ¥¡¥¤¥ë
                                   WNN_NOT_A_JISHO              ¤½¤Î¾   */
};

typedef struct wnn_file_stat WNN_FILE_STAT;

/*      */
extern int wnn_errorno;         /* Wnn¤Î¥¨¥é¡¼¤Ï¤³¤ÎÊÑ¿ô¤ËÊó¹ð¤µ¤ì¤ë */

extern char *wnn_dic_types[];   /* "¸ÇÄê","ÅÐÏ¿","µÕÊÑ´¹","Àµµ¬" */

extern char *cwnn_dic_types[];  /* "¸ÇÄê","ÅÐÏ¿","µÕÊÑ´¹","Àµµ¬" */
extern char *bwnn_dic_types[];  /* "¸ÇÄê","ÅÐÏ¿","µÕÊÑ´¹","Àµµ¬" */

#define FILE_ALREADY_READ -2

/* ¤³¤Î¹½Â¤ÂΤϡ¢¥é¥¤¥Ö¥é¥êÆâÉô¤ÇÍѤ¤¤é¤ì¤ë */
struct wnn_jserver_id
{
  int sd;
  char js_name[40];
  int js_dead;
  jmp_buf js_dead_env;          /* ¥µ¡¼¥Ð¤¬»à¤ó¤À»þ¤ËÈô¤ó¤Ç¤¤¤¯env */
  int js_dead_env_flg;          /* jd_server_dead_env¤¬Í­¸ú¤«Èݤ«  */
};

typedef struct wnn_jserver_id WNN_JSERVER_ID;

/* ¤³¤Î¹½Â¤ÂΤϡ¢¥é¥¤¥Ö¥é¥êÆâÉô¤ÇÍѤ¤¤é¤ì¤ë */
struct wnn_env
{
  int env_id;
  WNN_JSERVER_ID *js_id;
  char lang[16];                /* for exsample "ja_JP" */
};

typedef struct wnn_env WNN_ENV;

struct wnn_param
{
  int n;                        /* £Î(Âç)ʸÀá²òÀϤΣΠ*/
  int nsho;                     /* ÂçʸÀáÃæ¤Î¾®Ê¸Àá¤ÎºÇÂç¿ô */
  int p1;                       /* ¼«Î©¸ì¤ÎÉÑÅ٤Υѥé¥á¡¼¥¿ */
  int p2;                       /* ¾®Ê¸ÀáĹ¤Î¥Ñ¥é¥á¡¼¥¿ */
  int p3;                       /* ¼«Î©¸ìĹ¤Î¥Ñ¥é¥á¡¼¥¿ */
  int p4;                       /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È¤Î¥Ñ¥é¥á¡¼¥¿ */
  int p5;                       /* ¼­½ñ¤Î¥Ñ¥é¥á¡¼¥¿ */
  int p6;                       /* ¾®Ê¸Àá¤Îɾ²ÁÃͤΥѥé¥á¡¼¥¿ */
  int p7;                       /* ÂçʸÀáĹ¤Î¥Ñ¥é¥á¡¼¥¿ */
  int p8;                       /* ¾®Ê¸Àá¿ô¤Î¥Ñ¥é¥á¡¼¥¿ */
  int p9;                       /* µ¿»÷ÉÊ»ì ¿ô»ú¤ÎÉÑÅÙ */
  int p10;                      /* µ¿»÷ÉÊ»ì ¥«¥Ê¤ÎÉÑÅÙ *//* CWNN:±Ñ¿ô¤ÎÉÑÅÙ */
  int p11;                      /* µ¿»÷ÉÊ»ì ±Ñ¿ô¤ÎÉÑÅÙ *//* CWNN:µ­¹æ¤ÎÉÑÅÙ */
  int p12;                      /* µ¿»÷ÉÊ»ì µ­¹æ¤ÎÉÑÅÙ *//* CWNN:³«³ç¸Ì¤ÎÉÑÅÙ */
  int p13;                      /* µ¿»÷ÉÊ»ì Êijç¸Ì¤ÎÉÑÅÙ *//* CWNN:Êijç¸Ì¤ÎÉÑÅÙ */
  int p14;                      /* µ¿»÷ÉÊ»ì ÉÕ°¸ì¤ÎÉÑÅÙ *//* BWNN:No of koho */
  int p15;                      /* µ¿»÷ÉÊ»ì ³«³ç¸Ì¤ÎÉÑÅÙ *//* CWNN:Not used */
};

#ifdef nodef
struct wnn_dic_info_struct
{
  int body_fid;
  int hindo_fid;
  int enablef;
  int rw;
  int hindo_rw;
  int nice;
};

typedef struct wnn_dic_info_struct WNN_DIC_INFO_STRUCT;
#endif

struct wnn_file_info_struct
{
  int fid;                      /* ¥Õ¥¡¥¤¥ëÈÖ¹æ */
  char name[WNN_F_NAMELEN];     /* ¥Õ¥¡¥¤¥ë̾ */
  int localf;                   /* ¥µ¡¼¥Ð¡¦¥µ¥¤¥È¤Î¥Õ¥¡¥¤¥ë¤«¤É¤¦¤«
                                   1: ¥µ¡¼¥Ð¡¦¥µ¥¤¥È
                                   0: ¥¯¥é¥¤¥¢¥ó¥È¡¦¥µ¥¤¥È   */
  int type;                     /* ¥Õ¥¡¥¤¥ë¤Î¼ïÎà */
  int ref_count;                /* (´Ä¶­¤«¤é¤Î)»²¾È¿ô */
};

typedef struct wnn_file_info_struct WNN_FILE_INFO_STRUCT;

#define WNN_VECT_L      ((256+8*4-1)/(8*4) + 5) /***** !!!!! ****/

struct wnn_sho_bunsetsu
{
  int end;                      /* ¸õÊäʸÀá¤Î end char index */
  int start;                    /* ¸õÊäʸÀá¤Î top char index */
  int jiriend;                  /* ¸õÊäʸÀá¤Î¼«Î©¸ì end char index */
  int dic_no;                   /* ¼«Î©¸ì¤Î¼­½ñÆâ¤Î¥¨¥ó¥È¥êÈÖ¹æ */
  int entry;                    /* ¸õÊäʸÀá¤Î¼«Î©¸ì¼­½ñ entry */

  int hinsi;                    /* ¼«Î©¸ìÉÊ»ì */
  int status;                   /* ÂçʸÀá¤ÎÀèƬ¤« */
  int status_bkwd;              /* usiro ¤ÎʸÀá¤ËÀܳ¤Ç¤­¤ë¤« */
  int hindo;                    /* ¸õÊ伫Ω¸ì¤ÎÉÑÅÙ */
  int ima;                      /* ¸õÊ伫Ω¸ì¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È */
  int kangovect;                /* Àܳ¥Ù¥¯¥È¥ë¥Æ¡¼¥Ö¥ë¤Ø¤Î¥Ý¥¤¥ó¥¿ */
  int hyoka;                    /* ¾®Ê¸Àáɾ²ÁÃÍ */
  w_char *kanji;                /* ¼«Î©¸ìʸ»úÎó */
  w_char *yomi;                 /* ¼«Î©¸ì¤ÎÆɤßʸ»úÎó */
  w_char *fuzoku;               /* ÉÕ°¸ìʸ»úÎó */
/*
 *ÉÑÅ٤ˤĤ¤¤Æ¤Ï¡¢ÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë»þ¤Ï¡¢
 *hindo = ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î(¼Â)ÉÑÅÙÃÍ + ¼­½ñÆâ¤Î(¼Â)ÉÑÅÙÃÍ
 *ima = ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È
 *
 *ÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤»þ¤Ë¤Ï¡¢
 *hindo = ¼­½ñÆâ¤Î(¼Â)ÉÑÅÙÃÍ¡¢ima = ¼­½ñÆâ¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È
 *¤Ç¤¢¤ë¡£¤³¤³¤Ç¡¢¼ÂÉÑÅÙÃͤȤϡ¢·×»»µ¡Æâ¤Ç7¥Ó¥Ã¥È¤Ë°µ½Ì¤µ¤ì¤¿ÃͤǤ¢¤ë¡£
 *²¾ÁÛÉÑÅÙÃͤǤϤʤ¯¼ÂÉÑÅÙÃͤòÊÖ¤¹¤Î¤Ï¡¢ÊÑ´¹·ë²Ì¤Î¥Ç¥Ð¥Ã¥°¤Î¤¿¤á¤Ç¤¢¤ë¡£
 */
};

struct wnn_dai_bunsetsu
{
  int end;                      /* ¸õÊäʸÀá¤Î end char index */
  int start;                    /* ¸õÊäʸÀá¤Î top char index */
  struct wnn_sho_bunsetsu *sbn; /* ¾®Ê¸Àá²òÀÏ·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿ */
  int hyoka;                    /* ÂçʸÀáɾ²ÁÃÍ */
  int sbncnt;                   /* ¾®Ê¸Àá¿ô (¼¡¸õÊä¤Î¾ì¹ç¤Ï¡¢¼¡¸õÊä¿ô)
                                   DSD_SBN¤Ï¡¢*sbn ¤«¤é sbncnt ¤À¤±¤¢¤ë */
};

struct wnn_jdata
{
  int dic_no;                   /* ¼­½ñÈÖ¹æ */
  int serial;                   /* ¼­½ñÆâ¤Î¥¨¥ó¥È¥êÈÖ¹æ */
  int hinshi;                   /* ÉÊ»ìÈÖ¹æ(ÉÊ»ìÈÖ¹æ¤ÈÉÊ»ì̾¤ÎÂбþ¤Ï¡¢manual/etc
                                   ¤Î²¼¤ò»²¾È) */
  int hindo;                    /* ÉÑÅÙ */
  int ima;                      /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È */
  int int_hindo;                /* ¼­½ñÆâÉÑÅÙ */
  int int_ima;                  /* ¼­½ñÆâ¡¢º£»È¤Ã¤¿¤è¥Ó¥Ã¥È */
  w_char *yomi;                 /* ÆɤߤÎʸ»úÎó */
  w_char *kanji;                /* ´Á»úʸ»úÎó */
  w_char *com;                  /* ¥¨¥ó¥È¥ê¤Î¥³¥á¥ó¥Èʸ»úÎó */
/*
 *ÉÑÅ٤ˤĤ¤¤Æ¤Ï¡¢ÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë»þ¤Ï¡¢
 *hindo = ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î(²¾ÁÛ)ÉÑÅÙÃÍ¡¢ima = ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È
 *int_hindo = ¼­½ñÆâ¤Î(²¾ÁÛ)ÉÑÅÙÃÍ¡¢int_ima = ¼­½ñÆâ¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È
 *
 *ÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤»þ¤Ë¤Ï¡¢
 *hindo = ¼­½ñÆâ¤Î(²¾ÁÛ)ÉÑÅÙÃÍ¡¢ima = ¼­½ñÆâ¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È
 *int_hindo = -1¡¢int_ima = -1
 *
 *¤¿¤À¤·¡¢¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢¥¨¥ó¥È¥ê¤¬»ÈÍÑÃæ»ß¤Î¾õÂ֤λþ¤Ë¤Ï¡¢
 *hindo = -1, ima = 0 ¤¢¤ë¤¤¤Ï¡¢
 *int_hindo = -1, int_ima = 0 ¤È¤Ê¤ë¡£
 *¤³¤³¤Ç¡¢(²¾ÁÛ)ÉÑÅÙÃͤȤϡ¢·×»»µ¡Æâ¤Ç7¥Ó¥Ã¥È¤Ë°µ½Ì¤µ¤ì¤¿ÉÑÅÙÃͤ«¤é¡¢
 *¼ÂºÝ¤ÎÃͤòÁÛÄꤷ¤¿ÃͤǤ¢¤ë¡£
 */
};

struct wnn_ret_buf
{
  int size;                     /* buf ¤«¤é alloc ¤µ¤ì¤Æ¤¤¤ëÂ礭¤µ */
  char *buf;                    /* malloc ¤Ê¤É¤Ç¤È¤é¤ì¤¿Îΰè */
};


#define WNN_F_UNIQ_LEN  (sizeof(struct wnn_file_uniq))

/* ¤³¤Î¹½Â¤ÂΤϡ¢¥é¥¤¥Ö¥é¥êÆâÉô¤ÇÍѤ¤¤é¤ì¤ë */
struct wnn_file_head
{
  struct wnn_file_uniq
  {
    int time;
    int dev;
    int inode;
    char createhost[WNN_HOSTLEN];
  }
  file_uniq;
  struct wnn_file_uniq file_uniq_org;
  int file_type;
  char file_passwd[WNN_PASSWD_LEN];
};

#define WNN_HINSI_NAME_LEN 64

#define WNN_FILE_HEADER_LEN     (WNN_PASSWD_LEN + 8 + WNN_FILE_STRING_LEN + \
                                 sizeof(struct wnn_file_uniq) * 2 + 4)
                                /*
                                   8 is for future use 
                                   4 is for file_type.
                                 */

#ifndef JSERVER
/*
  JSLIB function declaration
*/
#define js_open(server, timeout)        js_open_lang(server, "ja_JP", timeout)
#define js_connect(server,env_name)     js_connect_lang(server, env_name, "ja_JP")

#ifndef FRWNN_PARAMS
/*
 * I currently think ANSI-C is not sufficiant on building your clients
 * linked with libwnn. (aonoto)
 */
#if __STDC__		/* Sufficient? */
#define FRWNN_PARAMS(paramlist)	paramlist
#else
#define FRWNN_PARAMS(paramlist)	()
#endif
#endif

extern WNN_JSERVER_ID *js_open_lang FRWNN_PARAMS((register char *server, register char *lang, register int timeout));
extern int js_close      FRWNN_PARAMS((WNN_JSERVER_ID *server));
/* extern WNN_JSERVER_ID *js_change_current_jserver (); */ /* Not exist? */
extern struct wnn_env *js_connect_lang FRWNN_PARAMS((WNN_JSERVER_ID *server, register char *env_name, char *lang));
extern int js_disconnect FRWNN_PARAMS((register struct wnn_env *env));
extern int js_env_list   FRWNN_PARAMS((WNN_JSERVER_ID *server, struct wnn_ret_buf *ret));
extern int js_param_set  FRWNN_PARAMS((struct wnn_env *env, register struct wnn_param *para));
extern int js_param_get  FRWNN_PARAMS((struct wnn_env *env, register struct wnn_param *para));
extern char *js_get_lang FRWNN_PARAMS((struct wnn_env *env));
/**************************************/
extern int js_access     FRWNN_PARAMS((struct wnn_env *env, char *path, int amode));
extern int js_dic_add    FRWNN_PARAMS((struct wnn_env *env, int fid, int hfid, int rev,int jnice, int rw, int hrw, char *pw1, char *pw2));
extern int js_dic_delete      FRWNN_PARAMS((struct wnn_env *env, int dicno));
extern int js_dic_file_create FRWNN_PARAMS((struct wnn_env *env, char *fn, int type, w_char *comment, char *passwd, char *hpasswd));
extern int js_dic_file_create_client FRWNN_PARAMS((struct wnn_env *env, char *fn, int type, w_char *comment, char *passwd, char *hpasswd));
extern int js_dic_info     FRWNN_PARAMS((struct wnn_env *env, int dic_no, register WNN_DIC_INFO *ret));
extern int js_dic_list     FRWNN_PARAMS((struct wnn_env *env, struct wnn_ret_buf *ret));
extern int js_dic_list_all FRWNN_PARAMS((WNN_JSERVER_ID *server, struct wnn_ret_buf *ret));
extern int js_dic_use      FRWNN_PARAMS((struct wnn_env *env, int dic_no, int flag));
extern int js_env_exist     FRWNN_PARAMS((register WNN_JSERVER_ID *server, register char *env_name));
extern int js_env_sticky    FRWNN_PARAMS((register struct wnn_env *env));
extern int js_env_un_sticky FRWNN_PARAMS((register struct wnn_env *env));
extern int js_file_comment_set FRWNN_PARAMS((struct wnn_env *env, int fid, w_char *comment));
extern int js_file_discard FRWNN_PARAMS((struct wnn_env *env, int fid));
extern int js_file_info    FRWNN_PARAMS((struct wnn_env *env, int fid, register WNN_FILE_INFO_STRUCT *file));
extern int js_file_list    FRWNN_PARAMS((struct wnn_env *env, struct wnn_ret_buf *ret));
extern int js_file_list_all FRWNN_PARAMS((WNN_JSERVER_ID *server, struct wnn_ret_buf *ret));
extern int js_file_loaded  FRWNN_PARAMS((WNN_JSERVER_ID *server, char *path));
extern int js_file_loaded_local FRWNN_PARAMS((WNN_JSERVER_ID *server, char *path));
extern int js_file_password_set FRWNN_PARAMS((struct wnn_env *env, int fid, int which, char *old_passwd, char *new_passwd));
extern int js_file_read    FRWNN_PARAMS((struct wnn_env *env, char *fn));
extern int js_file_receive FRWNN_PARAMS((struct wnn_env *env, int fid, char *fn));
extern int js_file_remove  FRWNN_PARAMS((WNN_JSERVER_ID *server, char *n, char *pwd));
extern int js_file_remove_client FRWNN_PARAMS((WNN_JSERVER_ID *server, char *n, char *pwd));
extern int js_file_send    FRWNN_PARAMS((struct wnn_env *env, char *fn));
extern int js_file_stat    FRWNN_PARAMS((struct wnn_env *env, char *path, WNN_FILE_STAT *s));
extern int js_file_write   FRWNN_PARAMS((struct wnn_env *env, int fid, char *fn));
extern void js_flush FRWNN_PARAMS((struct wnn_env *env));
extern int js_fuzokugo_get FRWNN_PARAMS((struct wnn_env *env));
extern int js_fuzokugo_set FRWNN_PARAMS((struct wnn_env *env, int fid));
extern int js_hindo_file_create FRWNN_PARAMS((struct wnn_env *env, int fid, char *fn, w_char *comment, char *hpasswd));
extern int js_hindo_file_create_client FRWNN_PARAMS((struct wnn_env *env, int fid, char *fn, w_char *com, char *hpasswd));
extern int js_hindo_set    FRWNN_PARAMS((struct wnn_env *env, int dic, int entry, int ima, int hindo));
extern int js_hinsi_dicts  FRWNN_PARAMS((struct wnn_env *env, int no, struct wnn_ret_buf *rb));
extern int js_hinsi_list   FRWNN_PARAMS((struct wnn_env *env, int dic_no, w_char *name, struct wnn_ret_buf *rb));
extern int js_hinsi_name   FRWNN_PARAMS((WNN_JSERVER_ID *server, int no,  struct wnn_ret_buf *rb));
extern int js_hinsi_number FRWNN_PARAMS((WNN_JSERVER_ID *server, w_char *name));
extern int js_hinsi_table_set FRWNN_PARAMS((struct wnn_env *env, int dic_no, w_char *hinsi_table));
extern int js_isconnect FRWNN_PARAMS((register struct wnn_env *env));
extern int js_kanren FRWNN_PARAMS((struct wnn_env *env, w_char *yomi, int hinsi, w_char *fzk, int vec, int vec1, int vec2, struct wnn_ret_buf *rb));
extern int js_kantan_dai FRWNN_PARAMS((struct wnn_env *env, w_char *yomi, int hinsi, w_char *fzk, int vec, int vec1, struct wnn_ret_buf *rb));
extern int js_kantan_sho FRWNN_PARAMS((struct wnn_env *env, w_char *yomi, int hinsi, w_char *fzk, int vec, int vec1, struct wnn_ret_buf *rb));
extern int js_kanzen_dai FRWNN_PARAMS((struct wnn_env *env, w_char *yomi, int hinsi, w_char *fzk, int vec, int vec1, struct wnn_ret_buf *rb));
extern int js_kanzen_sho FRWNN_PARAMS((struct wnn_env *env, w_char *yomi, int hinsi, w_char *fzk, int vec, int vec1, struct wnn_ret_buf *rb));
extern int js_kill    FRWNN_PARAMS((WNN_JSERVER_ID *server));
extern int js_mkdir   FRWNN_PARAMS((struct wnn_env *env, char *path));
extern int js_version FRWNN_PARAMS((WNN_JSERVER_ID *server, int *serv, int *libv));
extern int js_who     FRWNN_PARAMS((WNN_JSERVER_ID *server, struct wnn_ret_buf *ret));
extern int js_word_add    FRWNN_PARAMS((struct wnn_env *env, int dic_no, w_char *yomi, w_char *kanji, w_char *comment, int hinshi, int init_hindo));
extern int js_word_comment_set FRWNN_PARAMS((struct wnn_env *env, int dic_no, int entry, w_char *comment));
extern int js_word_delete FRWNN_PARAMS((struct wnn_env *env, int dic_no, int entry));
extern int js_word_info   FRWNN_PARAMS((struct wnn_env *env, int dic_no, int entry, struct wnn_ret_buf *ret));
extern int js_word_search FRWNN_PARAMS((struct wnn_env *env, int dic_no, w_char *yomi, struct wnn_ret_buf *ret));
extern int js_word_search_by_env FRWNN_PARAMS((struct wnn_env *env, w_char *yomi, struct wnn_ret_buf *ret));

#endif	/* !JSERVER */

#ifdef __cplusplus
}
#endif

#endif  /* WNN_JSLIB_H */