1 /***************************************************************************
2  *   Copyright (C) 2004 by TAM(Teppei Tamra)                               *
3  *   tam-t@par.odn.ne.jp                                                   *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19  ***************************************************************************/
20 
21 /* う ぜ ぇ */
22 #ifndef WNNPROTO_H
23 #define WNNPROTO_H
24 
25 #ifdef HAVE_CONFIG_H
26 #include <config.h>
27 #endif
28 
29 extern "C" {
30 
31     /* 基礎的なん */
32     #define w_char unsigned short
33     struct wnn_buf *jl_open_lang(char *,char *,char *,char *,int (*)(char *),int(*)(char *),int);
34     #define jl_open(a,b,c,d,e,f) jl_open_lang(a,b,NULL,c,d,e,f)
35     void jl_close(struct wnn_buf*);
36 
37 
38 
39 
40     /* conversion */
41     int jl_fi_ren_conv(struct wnn_buf*,w_char*,int,int,int);
42     int jl_optimize_fi(struct wnn_buf*,int,int);
43     int jl_fi_nobi_conv(struct wnn_buf*,int,int,int,int,int);
44     int jl_zenkouho_suu(struct wnn_buf*);
45     int jl_kill(struct wnn_buf*,int,int);
46     int jl_zenkouho(struct wnn_buf*,int,int,int);
47     int jl_zenkouho_dai(struct wnn_buf*,int,int,int,int);
48 
49     int jl_set_jikouho(struct wnn_buf*,int);
50     int jl_set_jikouho_dai(struct wnn_buf*,int);
51     int jl_dic_save_all(struct wnn_buf*);
52 
53     #ifdef HAVE_LIBWNN7
54         /* wnn6sdk is not having it.*/
55         int jl_zenikeiji_dai(struct wnn_buf*,int,int,int,int);
56         int jl_zenassoc_dai(struct wnn_buf*,int,int,int,int);
57         int wnn_get_area(struct wnn_buf*,int,int,w_char*,int,int);
58         void jl_get_zenkouho_kanji(struct wnn_buf*,int ,w_char *,int);
59         #define jl_get_zenkouho_kanji(a,b,c) jl_get_zenkouho_kanji(a,b,c,512)
60         #define jl_get_kanji(buf,bun1,bun2,area) wnn_get_area(buf,bun1,bun2,area,1,512)
61         #define jl_get_yomi(buf,bun1,bun2,area) wnn_get_area(buf,bun1,bun2,area,0,512)
62 
63         // input completion for Wnn7
64         extern int ykYosokuKouhoNum;
65         extern char **ykYosokuKouho;
66         extern int jl_yosoku_init(struct wnn_buf*);
67         extern int jl_yosoku_set_param(struct wnn_buf*,int,int,int);
68         extern int jl_yosoku_free(struct wnn_buf*);
69         extern int jl_yosoku_yosoku(struct wnn_buf*,char *);
70         extern int jl_yosoku_toroku(struct wnn_buf*,w_char*,short);
71         extern int jl_yosoku_selected_cand(struct wnn_buf*,int);
72         extern int jl_yosoku_delete_cand(struct wnn_buf*,int);
73         extern int jl_yosoku_save_datalist(struct wnn_buf*);
74         extern int jl_yosoku_cancel_toroku(struct wnn_buf *);
75         extern int jl_yosoku_ikkatsu_toroku(struct wnn_buf *,char *,int);
76         extern int jl_yosoku_ikkatsu_toroku_init(struct wnn_buf *);
77         extern int jl_yosoku_ikkatsu_toroku_end(struct wnn_buf *);
78         extern int jl_yosoku_toroku(struct wnn_buf *,w_char *,short);
79 
80     #else
81         int wnn_get_area(struct wnn_buf*,int,int,w_char*,int);
82         void jl_get_zenkouho_kanji(struct wnn_buf*,int ,w_char *);
83         #define jl_get_kanji(buf,bun1,bun2,area) wnn_get_area(buf,bun1,bun2,area,1)
84         #define jl_get_yomi(buf,bun1,bun2,area) wnn_get_area(buf,bun1,bun2,area,0)
85     #endif
86 
87 
88     #define WNN_NO_USE    0
89     #define WNN_USE_MAE   1
90     #define WNN_USE_ATO   2
91     #define WNN_USE_ZENGO (WNN_USE_MAE | WNN_USE_ATO)
92 
93     #define WNN_UNIQ_KNJ 2
94     #define WNN_UNIQ 1
95     #define WNN_NO_UNIQ  0
96 
97     #define WNN_NO_CREATE 0
98     #define WNN_CREATE (-1)
99 
100     #define WNN_SHO 0
101     #define WNN_DAI 1
102 
103 
104 }
105 
106 #endif
107 
108