1 /*
2  *  $Id: jlib.h,v 1.3 2001/06/14 18:15:59 ura Exp $
3  */
4 
5 /*
6  * FreeWnn is a network-extensible Kana-to-Kanji conversion system.
7  * This file is part of FreeWnn.
8  *
9  * Copyright Kyoto University Research Institute for Mathematical Sciences
10  *                 1987, 1988, 1989, 1990, 1991, 1992
11  * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999
12  * Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992
13  * Copyright FreeWnn Project 1999, 2000
14  *
15  * Maintainer:  FreeWnn Project   <freewnn@tomo.gr.jp>
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation; either version 2 of the License, or
20  * (at your option) any later version.
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
30  */
31 
32 /*
33         Nihongo Henkan  Library Header File
34 */
35 
36 #include <setjmp.h>
37 
38 #define w_char  unsigned short
39 #ifndef WCHAR_T
40 #define wchar_t w_char
41 #define wchar   w_char
42 #define WCHAR_T
43 #endif
44 
45 #define JLIB
46 
47 /* header file for dic_syurui */
48 #define NO_EXIST        -1
49 #define NOT_A_JISHO     0
50 #define USER_DIC        1
51 #define SYSTEM_DIC      3
52 
53 extern jmp_buf jd_server_dead_env;      /* �����Ф�������������Ǥ���env */
54 extern int jd_server_dead_env_flg;      /* jd_server_dead_env��ͭ�����ݤ�  */
55 extern int wnn_errorno;         /* Wnn�Υ��顼�Ϥ����ѿ��������� */
56 
57 
58 struct kouho_entry
59 {
60   int s_ichi;                   /*      ���ʥХåե��ؤΥ��ե��å�      */
61   int jl;                       /*      ��Ω���Ĺ��                    */
62   int fl;                       /*      ��°���Ĺ��                    */
63   int pl;                       /*      �ǥ����ץ쥤����Ĺ��            */
64   int jishono;                  /*      ��Ω��μ����ֹ�                */
65   int serial;                   /*      ��Ω����ֹ�                    */
66   w_char *k_data;               /*      �����Хåե��ؤΥݥ���        */
67 };
68 #define KOUHO_ENT       struct  kouho_entry
69 
70 
71 struct jikouho_entry
72 {
73   int jl;                       /*      ��Ω���Ĺ��                    */
74   int jishono;                  /*      ��Ω��μ����ֹ�                */
75   int serial;                   /*      ��Ω����ֹ�                    */
76   w_char *k_data;               /*      �����Хåե��ؤΥݥ���        */
77 };
78 #define JIKOUHO_ENT     struct  jikouho_entry
79 
80 
81 struct bunjoho
82 {
83   w_char *kana_buf;             /*      ���ʥХåե�                    */
84   int kana_size;                /*      ���ʥХåե���Ĺ��              */
85   KOUHO_ENT *klist;             /*      ����ꥹ�ȡ��Хåե�            */
86   int klist_size;               /*      ����ꥹ�ȡ��Хåե���Ĺ��      */
87   w_char *kanji_buf;            /*      �����Хåե�                    */
88   int kanji_buf_size;           /*      �����Хåե� ��Ĺ��             */
89 };
90 
91 
92 struct jikouhojoho
93 {
94   JIKOUHO_ENT *jlist;           /*      ������Хåե�                  */
95   int jlist_size;               /*      ������Хåե���Ĺ��            */
96   w_char *kanji_buf;            /*      �����Хåե�                    */
97   int kanji_buf_size;           /*      �����Хåե���Ĺ��              */
98 };
99 #define JIKOUHOJOHO     struct  jikouhojoho
100 
101 
102 struct jishojoho
103 {
104   w_char *k_data;               /*      �����Хåե��ؤΥݥ���        */
105   int bumpo;                    /*      ʸˡ����                        */
106   int hindo;                    /*      ����                            */
107   int jisho;                    /*      �����ֹ�                        */
108   int serial;                   /*      �����ֹ�                        */
109 };
110 #define JISHOJOHO       struct  jishojoho
111 
112 
113 struct dicinfo
114 {
115   int dic_no;                   /*      �����ֹ�                        */
116   int dic_size;                 /*      ñ���                          */
117   int ttl_hindo;                /*      �������                        */
118   int dic_type;                 /*      1:�桼��,2:�����ƥ�             */
119   int udp;                      /*      0:������Ǥʤ�,1:������         */
120   int prio;                     /*      ����ץ饤����ƥ�              */
121   int rdonly;                   /*      0:�饤�Ȳ�ǽ,1:�꡼�ɥ���꡼   */
122   char *file_name;              /*      ����ե�����̾                  */
123   char *h_file_name;            /*      ���٥ե�����̾                  */
124 };
125 #define DICINFO         struct  dicinfo
126 
127 
128 struct jwho
129 {
130   int sd;                       /* socket discripter in jserver */
131   char *user_name;              /* user name */
132   char *host_name;              /* host name */
133 };
134 #define JWHO            struct jwho
135