3010
|
1 /* CANNA interface -*- coding: euc-jp -*-
|
|
2
|
|
3 Copyright (C) 1995 Free Software Foundation, Inc.
|
|
4 Copyright (C) 1995 Sun Microsystems, Inc.
|
3071
|
5 Copyright (C) 2005 Ben Wing.
|
3010
|
6
|
|
7 This file is part of XEmacs.
|
|
8
|
|
9 XEmacs is free software; you can redistribute it and/or modify it
|
|
10 under the terms of the GNU General Public License as published by the
|
|
11 Free Software Foundation; either version 2, or (at your option) any
|
|
12 later version.
|
|
13
|
|
14 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
17 for more details.
|
|
18
|
|
19 You should have received a copy of the GNU General Public License
|
|
20 along with XEmacs; see the file COPYING. If not, write to
|
|
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
22 Boston, MA 02111-1307, USA. */
|
|
23
|
|
24 /* Synched up with: Mule 2.3. Not in FSF. */
|
|
25
|
|
26 /* Japanese comments were translated 2000-12-06 by Stephen Turnbull
|
|
27 <stephen@xemacs.org>. I haven't verified that the Japanese comments
|
|
28 were correct. YMMV, NO WARRANTY, not even the implied warranty of
|
|
29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. (^^;;; as the
|
|
30 Japanese say. */
|
|
31
|
|
32 /*
|
|
33
|
|
34 Authors: Akira Kon (kon@uxd.fc.nec.co.jp)
|
|
35 Ichiro Hirakura (hirakura@uxd.fc.nec.co.jp)
|
|
36
|
|
37 Functions defined in this file are
|
|
38
|
|
39 (canna-key-proc key)
|
|
40 key: single STRING
|
|
41 RETURNS:
|
|
42 Length of converted string if no error occurs.
|
|
43 Error string if error occurs.
|
|
44 DESCRIPTION:
|
|
45 Convert a key input to a set of strings. The
|
|
46 strings contain both well-formed string and a
|
|
47 intermediate result to show the translation
|
|
48 information to a user. converted strings are
|
|
49 stored in specific variables.
|
|
50
|
|
51 (canna-initialize)
|
|
52 RETURNS:
|
|
53 List of the following things:
|
|
54 - list of keys to toggle Japanese-mode
|
|
55 - error message
|
|
56 - list of warning messages
|
|
57 DESCRIPTION:
|
|
58 Initialize ``canna'', which is a kana-to-kanji
|
|
59 converter for XEmacs. The first arg
|
|
60 specifies if inserting space character between
|
|
61 BUNSETSU when candidates are displayed. The
|
|
62 second arg specifies server. The third arg
|
|
63 specifies a file which will be used as a
|
|
64 customization description. If nil is
|
|
65 specified for each arg, the default value will
|
|
66 be used.
|
|
67
|
|
68 (canna-finalize)
|
|
69 RETURNS:
|
|
70 list of warning messages
|
|
71 DESCRIPTION:
|
|
72 finalize ``canna'', which is a kana-to-kanji
|
|
73 converter for XEmacs. This cause to write
|
|
74 miscellaneous informations to kana-to-kanji
|
|
75 dictionary.
|
|
76
|
|
77 (canna-touroku-string string)
|
|
78 string:
|
|
79 String to register to a dictionary.
|
|
80 RETURNS:
|
|
81 The same thing returns as canna-key-proc does.
|
|
82 DESCRIPTION:
|
|
83 Register Kanji words into kana-to-kanji
|
|
84 conversion dictionary.
|
|
85
|
|
86 (canna-set-width width)
|
|
87 width:
|
|
88 Column width of the place where the candidates
|
|
89 of kana-to-kanji conversion will be shown.
|
|
90 RETURNS:
|
|
91 nil
|
|
92 DESCRIPTION:
|
|
93 Set status-line width information, which is
|
|
94 used to display kanji candidates.
|
|
95
|
|
96 (canna-change-mode num)
|
|
97 num:
|
|
98 The mode number of Canna.
|
|
99 RETURNS:
|
|
100 The same thing returns as canna-key-proc does.
|
|
101 DESCRIPTION:
|
|
102 Change Japanese pre-edit mode.
|
|
103
|
|
104 (canna-store-yomi yomi roma)
|
|
105 yomi:
|
|
106 ``Yomi'' to be stored.
|
|
107 roma:
|
|
108 ``Romaji'' which corresponds to the ``Yomi''.
|
|
109 RETURNS:
|
|
110 The same thing returns as canna-key-proc does.
|
|
111 DESCRIPTION:
|
|
112 Store yomi characters as a YOMI of
|
|
113 kana-to-kanji conversion.
|
|
114
|
|
115 (canna-do-function num ch)
|
|
116 num:
|
|
117 A function number to be called.
|
|
118 ch:
|
|
119 A character will be specified in order to feed
|
|
120 the character to the function if the function
|
|
121 needs a input character.
|
|
122 RETURNS:
|
|
123 The same thing returns as canna-key-proc does.
|
|
124 DESCRIPTION:
|
|
125 Do specified function at current mode.
|
|
126
|
|
127 (canna-parse string)
|
|
128 string:
|
|
129 To be parsed.
|
|
130 RETURNS:
|
|
131 List of warning messages.
|
|
132 DESCRIPTION:
|
|
133 Parse customize string.
|
|
134
|
|
135 (canna-query-mode)
|
|
136 RETURNS:
|
|
137 A string which indicate the current mode.
|
|
138 DESCRIPTION:
|
|
139 Get current mode string.
|
|
140
|
|
141 Functions below are used for KKCP compatible library. These
|
|
142 functions provides a base kana-to-kanji conversion system for EGG.
|
|
143 These functions may be used when users want to change the engine
|
|
144 from Wnn to Canna without changing user interface of Japanese input.
|
|
145
|
|
146 (canna-henkan-begin)
|
|
147 (canna-henkan-next)
|
|
148 (canna-bunsetu-henkou)
|
|
149 (canna-henkan-kakutei)
|
|
150 (canna-henkan-end)
|
|
151 (canna-henkan-quit)
|
|
152
|
|
153 */
|
|
154
|
|
155 #include <config.h>
|
|
156 #include "lisp.h"
|
|
157 #ifdef HAVE_SHLIB
|
|
158 #include "emodules.h"
|
|
159 #endif
|
|
160
|
|
161 #include "buffer.h"
|
|
162 #include "file-coding.h"
|
|
163
|
|
164 #ifdef CANNA2
|
|
165 #define IROHA_BC
|
|
166 #define CANNA_NEW_WCHAR_AWARE
|
|
167 #include "canna/jrkanji.h"
|
|
168 #include "canna/RK.h"
|
|
169 #else /* !CANNA2 */
|
|
170 #include "iroha/jrkanji.h"
|
|
171 #include "iroha/RK.h"
|
|
172 #endif /* !CANNA2 */
|
|
173 extern char *jrKanjiError;
|
|
174
|
|
175 extern int (*jrBeepFunc) (void);
|
|
176
|
|
177 /* #### is this global really necessary? */
|
|
178 #define KEYTOSTRSIZE 2048
|
3071
|
179 static Extbyte key_buffer[KEYTOSTRSIZE];
|
3010
|
180
|
|
181 static int canna_empty_info, canna_through_info;
|
|
182 static int canna_underline;
|
|
183 static int canna_inhibit_hankakukana;
|
|
184
|
|
185 static Lisp_Object Vcanna_kakutei_string;
|
|
186 static Lisp_Object Vcanna_kakutei_yomi;
|
|
187 static Lisp_Object Vcanna_kakutei_romaji;
|
|
188 static Lisp_Object Vcanna_henkan_string;
|
|
189 static Fixnum canna_henkan_length;
|
|
190 static Fixnum canna_henkan_revPos;
|
|
191 static Fixnum canna_henkan_revLen;
|
|
192 static Lisp_Object Vcanna_ichiran_string;
|
|
193 static Fixnum canna_ichiran_length;
|
|
194 static Fixnum canna_ichiran_revPos;
|
|
195 static Fixnum canna_ichiran_revLen;
|
|
196 static Lisp_Object Vcanna_mode_string;
|
|
197
|
|
198 static int IRCP_context;
|
|
199
|
|
200 static Lisp_Object storeResults (char *, int, jrKanjiStatus *);
|
|
201 static Lisp_Object kanjiYomiList (int, int);
|
|
202 static Lisp_Object CANNA_mode_keys (void);
|
3071
|
203 static Lisp_Object Qeuc_jp;
|
|
204
|
|
205 #define make_euc_string(p, len) make_ext_string ((Extbyte *) p, len, Qeuc_jp)
|
|
206 #define build_euc_string(p) build_ext_string ((Extbyte *) p, Qeuc_jp)
|
3010
|
207
|
|
208 #ifdef CANNA_MULE
|
3071
|
209 static int euc_jp_num_chars (unsigned char *, int);
|
|
210 static void count_char (unsigned char *,int, int, int, Fixnum *, Fixnum *,
|
|
211 Fixnum *);
|
3010
|
212 #endif
|
|
213
|
|
214 /* Lisp functions definition */
|
|
215
|
|
216 DEFUN ("canna-key-proc", Fcanna_key_proc, 1, 1, 0, /*
|
|
217 Translate a key input to a set of strings. The strings contain both
|
|
218 well-formed string and intermediate result to show the translation
|
|
219 information to a user. Converted strings are stored in specific
|
|
220 variables.
|
|
221 */
|
|
222 (ch))
|
|
223 {
|
|
224 jrKanjiStatus ks;
|
|
225 int len;
|
|
226
|
|
227 CHECK_CHAR_COERCE_INT (ch);
|
|
228 len = jrKanjiString (0, XCHAR (ch), key_buffer, KEYTOSTRSIZE, &ks);
|
|
229 return storeResults (key_buffer, len, &ks);
|
|
230 }
|
|
231
|
|
232 static Lisp_Object
|
|
233 storeResults (char *buf, int len, jrKanjiStatus *ks)
|
|
234 {
|
|
235 Lisp_Object val = Qnil;
|
|
236
|
|
237 if (len < 0)
|
|
238 { /* Error detected */
|
3071
|
239 val = build_euc_string (jrKanjiError);
|
3010
|
240 }
|
|
241 else
|
|
242 {
|
|
243 /* ³ÎÄꤷ¤¿Ê¸»úÎó (the confirmed string) */
|
3071
|
244 Vcanna_kakutei_string = make_euc_string (buf, len);
|
3010
|
245 val = make_int (len);
|
|
246 /* ³ÎÄꤷ¤¿Ê¸»úÎó¤ÎÆɤߤξðÊó...
|
|
247 (info about the reading of the confirmed string) */
|
|
248 Vcanna_kakutei_yomi = Vcanna_kakutei_romaji = Qnil;
|
|
249 if (ks->info & KanjiYomiInfo)
|
|
250 {
|
|
251 char *p = buf + len + 1;
|
|
252 int yomilen = strlen (p);
|
|
253
|
|
254 if (len + yomilen + 1 < KEYTOSTRSIZE)
|
|
255 {
|
|
256 int yomilen2;
|
|
257
|
|
258 Vcanna_kakutei_yomi =
|
3071
|
259 make_euc_string (p, yomilen); /* ÆÉ¤ß (reading) */
|
3010
|
260 p += yomilen + 1;
|
|
261 yomilen2 = strlen (p);
|
|
262 if (len + yomilen + yomilen2 + 2 < KEYTOSTRSIZE)
|
|
263 {
|
|
264 Vcanna_kakutei_romaji =
|
3071
|
265 make_euc_string (p, yomilen2);
|
3010
|
266 /* ¥í¡¼¥Þ»ú (romanization) */
|
|
267 }
|
|
268 }
|
|
269 }
|
|
270
|
|
271
|
|
272 /* ¸õÊäɽ¼¨¤Îʸ»úÎó¤Ç¤¹¡£
|
|
273 (string for displaying candidate translations) */
|
|
274 Vcanna_henkan_string = Qnil;
|
|
275 if (ks->length >= 0)
|
|
276 {
|
3071
|
277 Vcanna_henkan_string = make_euc_string (ks->echoStr, ks->length);
|
3010
|
278 #ifndef CANNA_MULE
|
|
279 canna_henkan_length = ks->length;
|
|
280 canna_henkan_revPos = ks->revPos;
|
|
281 canna_henkan_revLen = ks->revLen;
|
|
282 #else /* CANNA_MULE */
|
|
283 if (canna_underline)
|
|
284 {
|
3071
|
285 canna_henkan_length = euc_jp_num_chars (ks->echoStr,ks->length);
|
|
286 canna_henkan_revPos = euc_jp_num_chars (ks->echoStr,ks->revPos);
|
|
287 canna_henkan_revLen = euc_jp_num_chars (ks->echoStr+ks->revPos,
|
|
288 ks->revLen);
|
3010
|
289 }
|
|
290 else
|
|
291 {
|
|
292 count_char (ks->echoStr, ks->length, ks->revPos, ks->revLen,
|
|
293 &canna_henkan_length, &canna_henkan_revPos,
|
|
294 &canna_henkan_revLen);
|
|
295 }
|
|
296 #endif /* CANNA_MULE */
|
|
297 }
|
|
298
|
|
299 /* °ìÍ÷¤Î¾ðÊó (information about the echo area menu) */
|
|
300 Vcanna_ichiran_string = Qnil;
|
|
301 if (ks->info & KanjiGLineInfo && ks->gline.length >= 0)
|
|
302 {
|
3071
|
303 Vcanna_ichiran_string = make_euc_string (ks->gline.line,
|
|
304 ks->gline.length);
|
3010
|
305 #ifndef CANNA_MULE
|
|
306 canna_ichiran_length = ks->gline.length;
|
|
307 canna_ichiran_revPos = ks->gline.revPos;
|
|
308 canna_ichiran_revLen = ks->gline.revLen;
|
|
309 #else /* CANNA_MULE */
|
|
310 count_char (ks->gline.line, ks->gline.length,
|
|
311 ks->gline.revPos, ks->gline.revLen,
|
|
312 &canna_ichiran_length,
|
|
313 &canna_ichiran_revPos, &canna_ichiran_revLen);
|
|
314 #endif /* CANNA_MULE */
|
|
315 }
|
|
316
|
|
317 /* ¥â¡¼¥É¤Î¾ðÊó (mode information) */
|
|
318 Vcanna_mode_string = Qnil;
|
|
319 if (ks->info & KanjiModeInfo)
|
|
320 {
|
3071
|
321 Vcanna_mode_string = build_euc_string ((Extbyte *) ks->mode);
|
3010
|
322 }
|
|
323
|
|
324 /* ¤½¤Î¾¤Î¾ðÊó (other information) */
|
|
325 canna_empty_info = (ks->info & KanjiEmptyInfo) ? 1 : 0;
|
|
326 canna_through_info = (ks->info & KanjiThroughInfo) ? 1 : 0;
|
|
327 }
|
|
328
|
|
329 return val;
|
|
330 }
|
|
331
|
|
332 DEFUN ("canna-set-bunsetsu-kugiri", Fcanna_set_bunsetsu, 0, 1, 0, /*
|
|
333 This function sets the clause separator.
|
|
334 If non-nil value is specified, the white space separator will be used.
|
|
335 No separator will be used otherwise.
|
|
336 */
|
|
337 (num))
|
|
338 {
|
|
339 int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© (display clause separator?) */
|
|
340
|
|
341 kugiri = NILP (num) ? 0 : 1;
|
|
342
|
|
343 jrKanjiControl (0, KC_SETBUNSETSUKUGIRI, (char *) kugiri);
|
|
344
|
|
345 return Qnil;
|
|
346 }
|
|
347
|
|
348 /* For whatever reason, calling Fding directly from libCanna loses */
|
|
349 static int
|
|
350 call_Fding (void)
|
|
351 {
|
|
352 Fding (Qnil, Qnil, Qnil);
|
|
353 return 0;
|
|
354 }
|
|
355
|
|
356 DEFUN ("canna-initialize", Fcanna_initialize, 0, 3, 0, /*
|
|
357 Initialize ``canna'', which is a kana-to-kanji converter for XEmacs.
|
|
358 The first arg specifies if inserting space character between BUNSETSU when
|
|
359 candidates are displayed.
|
|
360 The second arg specifies server.
|
|
361 The third arg specifies a file which will be used as a customization
|
|
362 description.
|
|
363 If nil is specified for each arg, the default value will be used.
|
|
364 */
|
|
365 (num, server, rcfile))
|
|
366 {
|
|
367 Lisp_Object val;
|
|
368 int res;
|
3071
|
369 char **p, **q;
|
3010
|
370
|
|
371 int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© (display clause separator?) */
|
|
372
|
|
373 IRCP_context = -1;
|
|
374
|
|
375 if (NILP (num))
|
|
376 {
|
|
377 kugiri = 1;
|
|
378 }
|
|
379 else
|
|
380 {
|
|
381 CHECK_INT (num);
|
|
382 kugiri = XINT (num);
|
|
383 kugiri = (kugiri == 1) ? 1 : 0;
|
|
384 }
|
|
385
|
|
386 if (NILP (server))
|
|
387 {
|
|
388 jrKanjiControl (0, KC_SETSERVERNAME, (char *) 0);
|
|
389 }
|
|
390 else
|
|
391 {
|
|
392 CHECK_STRING (server);
|
3071
|
393 jrKanjiControl (0, KC_SETSERVERNAME,
|
|
394 /* !!#### Check encoding */
|
|
395 NEW_LISP_STRING_TO_EXTERNAL (server, Qnative));
|
3010
|
396 }
|
|
397
|
|
398 if (NILP (rcfile))
|
|
399 {
|
|
400 jrKanjiControl (0, KC_SETINITFILENAME, (char *) 0);
|
|
401 }
|
|
402 else
|
|
403 {
|
|
404 CHECK_STRING (rcfile);
|
3071
|
405 jrKanjiControl (0, KC_SETINITFILENAME,
|
|
406 NEW_LISP_STRING_TO_EXTERNAL (rcfile, Qfile_name));
|
3010
|
407 }
|
|
408
|
3071
|
409 {
|
|
410 char **warning = (char **) 0;
|
3010
|
411 #ifdef nec_ews_svr4
|
3071
|
412 stop_polling ();
|
3010
|
413 #endif /* nec_ews_svr4 */
|
3071
|
414 res = jrKanjiControl (0, KC_INITIALIZE, (char *) &warning);
|
3010
|
415 #ifdef nec_ews_svr4
|
3071
|
416 start_polling ();
|
3010
|
417 #endif /* nec_ews_svr4 */
|
3071
|
418 val = Qnil;
|
|
419 if (warning)
|
|
420 {
|
|
421 for (p = q = warning ; *q ; q++)
|
|
422 ;
|
|
423 while (p < q)
|
|
424 {
|
|
425 q--;
|
|
426 val = Fcons (build_euc_string (*q), val);
|
|
427 }
|
|
428 }
|
|
429 val = Fcons (val, Qnil);
|
|
430 }
|
3010
|
431
|
|
432 if (res == -1)
|
|
433 {
|
3071
|
434 val = Fcons (build_euc_string (jrKanjiError), val);
|
3010
|
435 /* ¥¤¥Ë¥·¥ã¥é¥¤¥º¤Ç¼ºÇÔ¤·¤¿¾ì¹ç¡£ (on initialization failure) */
|
|
436 return Fcons (Qnil, val);
|
|
437 }
|
|
438 else
|
|
439 {
|
|
440 jrBeepFunc = call_Fding;
|
|
441
|
|
442 #ifdef KC_SETAPPNAME
|
|
443 #ifndef CANNA_MULE
|
|
444 jrKanjiControl (0, KC_SETAPPNAME, "nemacs");
|
|
445 #else /* CANNA_MULE */
|
|
446 jrKanjiControl (0, KC_SETAPPNAME, "mule");
|
|
447 #endif /* CANNA_MULE */
|
|
448 #endif /* KC_SETAPPNAME */
|
|
449
|
|
450 jrKanjiControl (0, KC_SETBUNSETSUKUGIRI, (char *) kugiri);
|
|
451 jrKanjiControl (0, KC_SETWIDTH, (char *) 78);
|
|
452 #ifndef CANNA_MULE
|
|
453 jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1);
|
|
454 #else
|
|
455 /* mule ¤À¤Ã¤¿¤éȾ³Ñ¥«¥¿¥«¥Ê¤â»È¤¨¤ë
|
|
456 (Mule can use half-width katakana) */
|
|
457 if (canna_inhibit_hankakukana)
|
|
458 jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1);
|
|
459 #endif
|
|
460 jrKanjiControl (0, KC_YOMIINFO, (char *) 2); /* ¢¨£²: ¥í¡¼¥Þ»ú¤Þ¤ÇÊÖ¤¹
|
|
461 (*2: return to
|
|
462 romanized form) */
|
|
463 val = Fcons (Qnil, val);
|
|
464 return Fcons (CANNA_mode_keys (), val);
|
|
465 }
|
|
466 }
|
|
467
|
|
468 DEFUN ("canna-finalize", Fcanna_finalize, 0, 0, 0, /*
|
|
469 finalize ``canna'', which is a kana-to-kanji converter for XEmacs.
|
|
470 This cause to write miscellaneous informations to kana-to-kanji dictionary.
|
|
471 */
|
|
472 ())
|
|
473 {
|
|
474 Lisp_Object val;
|
3071
|
475 char **p;
|
|
476 char **warning = (char **) 0;
|
3010
|
477
|
3071
|
478 jrKanjiControl (0, KC_FINALIZE, (char *) &warning);
|
3010
|
479
|
|
480 val = Qnil;
|
|
481 if (warning)
|
|
482 {
|
3071
|
483 for (p = warning ; *p; p++)
|
3010
|
484 {
|
3071
|
485 /* !!#### This is almost certainly wrong; `canna-initialize
|
|
486 starts at the end of the warnings so the resulting list is
|
|
487 in the correct order. We should do the same. */
|
|
488 val = Fcons (build_euc_string (*p), val);
|
3010
|
489 }
|
|
490 }
|
|
491 val = Fcons (val, Qnil);
|
|
492 IRCP_context = -1;
|
|
493 return val;
|
|
494 }
|
|
495
|
|
496 DEFUN ("canna-touroku-string", Fcanna_touroku_string, 1, 1, 0, /*
|
|
497 Register Kanji words into kana-to-kanji conversion dictionary.
|
|
498 */
|
|
499 (str))
|
|
500 {
|
|
501 jrKanjiStatusWithValue ksv;
|
|
502 jrKanjiStatus ks;
|
|
503
|
|
504 CHECK_STRING (str);
|
|
505 ksv.buffer = (unsigned char *) key_buffer;
|
|
506 ksv.bytes_buffer = KEYTOSTRSIZE;
|
3071
|
507 LISP_STRING_TO_SIZED_EXTERNAL (str, ks.echoStr, ks.length, Qeuc_jp);
|
3010
|
508 ksv.ks = &ks;
|
|
509 jrKanjiControl (0, KC_DEFINEKANJI, (char *)&ksv);
|
|
510 return storeResults (key_buffer, ksv.val, ksv.ks);
|
|
511 }
|
|
512
|
|
513 DEFUN ("canna-set-width", Fcanna_set_width, 1, 1, 0, /*
|
|
514 Set status-line width information, which is used to display
|
|
515 kanji candidates.
|
|
516 */
|
|
517 (num))
|
|
518 {
|
|
519 CHECK_INT (num);
|
|
520
|
|
521 jrKanjiControl (0, KC_SETWIDTH, (char *) XINT (num));
|
|
522 return Qnil;
|
|
523 }
|
|
524
|
|
525 DEFUN ("canna-change-mode", Fcanna_change_mode, 1, 1, 0, /*
|
|
526 Change Japanese pre-edit mode.
|
|
527 */
|
|
528 (num))
|
|
529 {
|
|
530 jrKanjiStatusWithValue ksv;
|
|
531 jrKanjiStatus ks;
|
|
532
|
|
533 CHECK_INT (num);
|
|
534
|
|
535 ksv.buffer = (unsigned char *) key_buffer;
|
|
536 ksv.bytes_buffer = KEYTOSTRSIZE;
|
|
537 ksv.ks = &ks;
|
|
538 ksv.val = XINT (num);
|
|
539 jrKanjiControl (0, KC_CHANGEMODE, (char *)&ksv);
|
|
540 return storeResults (key_buffer, ksv.val, ksv.ks);
|
|
541 }
|
|
542
|
|
543 static Lisp_Object
|
|
544 CANNA_mode_keys (void)
|
|
545 {
|
|
546 #define CANNAWORKBUFSIZE 32
|
|
547 char xxx[CANNAWORKBUFSIZE];
|
|
548 Lisp_Object val;
|
|
549 int i, n;
|
|
550
|
|
551 n = jrKanjiControl (0, KC_MODEKEYS, xxx);
|
|
552 val = Qnil;
|
|
553 for (i = n ; i > 0 ;)
|
|
554 {
|
|
555 --i;
|
|
556 /* !!#### something fucked here */
|
|
557 val = Fcons (make_char ((int)(0xFF & (unsigned char) xxx[i])), val);
|
|
558 }
|
|
559 return val;
|
|
560 }
|
|
561
|
|
562 DEFUN ("canna-store-yomi", Fcanna_store_yomi, 1, 2, 0, /*
|
|
563 Store yomi characters as a YOMI of kana-to-kanji conversion.
|
|
564 */
|
|
565 (yomi, roma))
|
|
566 {
|
|
567 jrKanjiStatusWithValue ksv;
|
|
568 jrKanjiStatus ks;
|
3071
|
569 Extbyte *ext;
|
3010
|
570
|
|
571 CHECK_STRING (yomi);
|
3071
|
572 LISP_STRING_TO_EXTERNAL (yomi, ext, Qeuc_jp);
|
|
573 strncpy (key_buffer, ext, sizeof (key_buffer));
|
|
574 key_buffer[sizeof (key_buffer) - 1] = '\0';
|
3010
|
575 ks.length = strlen (key_buffer);
|
|
576
|
|
577 if (NILP (roma))
|
|
578 {
|
|
579 ks.mode = 0;
|
|
580 }
|
|
581 else
|
|
582 {
|
|
583 CHECK_STRING (roma);
|
3071
|
584 LISP_STRING_TO_EXTERNAL (roma, ext, Qeuc_jp);
|
|
585 ks.mode = (unsigned char *) (key_buffer + ks.length + 1);
|
|
586 strncpy (key_buffer + ks.length + 1, ext,
|
|
587 sizeof (key_buffer) - ks.length - 1);
|
|
588 key_buffer[sizeof (key_buffer) - 1] = '\0';
|
3010
|
589 }
|
|
590
|
|
591 ks.echoStr = (unsigned char *) key_buffer;
|
|
592 ksv.buffer = (unsigned char *) key_buffer; /* ÊÖÃÍÍÑ (return value) */
|
|
593 ksv.bytes_buffer = KEYTOSTRSIZE;
|
|
594 ksv.ks = &ks;
|
|
595
|
|
596 jrKanjiControl (0, KC_STOREYOMI, (char *)&ksv);
|
|
597
|
|
598 return storeResults (key_buffer, ksv.val, ksv.ks);
|
|
599 }
|
|
600
|
|
601 DEFUN ("canna-do-function", Fcanna_do_function, 1, 2, 0, /*
|
|
602 Do specified function at current mode.
|
|
603 */
|
|
604 (num, ch))
|
|
605 {
|
|
606 jrKanjiStatusWithValue ksv;
|
|
607 jrKanjiStatus ks;
|
|
608
|
|
609 CHECK_INT (num);
|
|
610
|
|
611 if (NILP (ch))
|
|
612 {
|
|
613 *key_buffer = '@';
|
|
614 }
|
|
615 else
|
|
616 {
|
|
617 CHECK_CHAR (ch);
|
|
618 *key_buffer = XCHAR (ch);
|
|
619 }
|
|
620
|
|
621 ksv.buffer = (unsigned char *) key_buffer;
|
|
622 ksv.bytes_buffer = KEYTOSTRSIZE;
|
|
623 ksv.ks = &ks;
|
|
624 ksv.val = XINT (num);
|
|
625 jrKanjiControl (0, KC_DO, (char *) &ksv);
|
|
626 return storeResults (key_buffer, ksv.val, ksv.ks);
|
|
627 }
|
|
628
|
|
629 DEFUN ("canna-parse", Fcanna_parse, 1, 1, 0, /*
|
|
630 Parse customize string.
|
|
631 */
|
|
632 (str))
|
|
633 {
|
|
634 Lisp_Object val;
|
3071
|
635 Extbyte **p;
|
3010
|
636 int n;
|
3071
|
637 Extbyte *ext;
|
3010
|
638
|
|
639 CHECK_STRING (str);
|
3071
|
640 LISP_STRING_TO_EXTERNAL (str, ext, Qeuc_jp);
|
|
641 strncpy (key_buffer, ext, sizeof (key_buffer));
|
|
642 key_buffer[sizeof (key_buffer) - 1] = '\0';
|
|
643 p = (Extbyte **) key_buffer;
|
3010
|
644 n = jrKanjiControl (0, KC_PARSE, (char *) &p);
|
|
645 val = Qnil;
|
|
646 while (n > 0)
|
|
647 {
|
|
648 n--;
|
3071
|
649 val = Fcons (build_euc_string (p[n]), val);
|
3010
|
650 }
|
|
651 return val;
|
|
652 }
|
|
653
|
|
654 DEFUN ("canna-query-mode", Fcanna_query_mode, 0, 0, 0, /*
|
|
655 Get current mode string.
|
|
656 */
|
|
657 ())
|
|
658 {
|
|
659 char buf[256];
|
|
660
|
|
661 jrKanjiControl (0, KC_QUERYMODE, buf);
|
3071
|
662 return build_euc_string (buf);
|
3010
|
663 }
|
|
664
|
|
665 /*
|
|
666 * Functions following this line are for KKCP interface compatible
|
|
667 * library. These functions may be used by MILK system.
|
|
668 */
|
|
669
|
|
670 #define RKBUFSIZE 1024
|
|
671
|
|
672 static unsigned char yomibuf[RKBUFSIZE];
|
|
673 static short kugiri[RKBUFSIZE / 2];
|
|
674
|
|
675 static int
|
|
676 confirmContext (void)
|
|
677 {
|
|
678 if (IRCP_context < 0)
|
|
679 {
|
|
680 int context;
|
|
681
|
|
682 if ((context = jrKanjiControl (0, KC_GETCONTEXT, (char *) 0)) == -1)
|
|
683 {
|
|
684 return 0;
|
|
685 }
|
|
686 IRCP_context = context;
|
|
687 }
|
|
688 return 1;
|
|
689 }
|
|
690
|
|
691 static int
|
|
692 byteLen (int bun, int len)
|
|
693 {
|
|
694 int i = 0, offset = 0, ch;
|
|
695
|
|
696 if (0 <= bun && bun < RKBUFSIZE)
|
|
697 {
|
|
698 offset = kugiri[bun];
|
|
699 }
|
|
700
|
|
701 while (len-- > 0 && (ch = (int) yomibuf[offset + i]))
|
|
702 {
|
|
703 i++;
|
|
704 if (ch & 0x80)
|
|
705 {
|
|
706 i++;
|
|
707 }
|
|
708 }
|
|
709 return i;
|
|
710 }
|
|
711
|
|
712 DEFUN ("canna-henkan-begin", Fcanna_henkan_begin, 1, 1, 0, /*
|
|
713 Return the result of kana-to-kanji conversion.
|
|
714 Clause separator is set.
|
|
715 */
|
|
716 (yomi))
|
|
717 {
|
|
718 int nbun;
|
3071
|
719 Extbyte *ext;
|
3010
|
720
|
|
721 CHECK_STRING (yomi);
|
|
722 if (confirmContext () == 0)
|
|
723 {
|
|
724 return Qnil;
|
|
725 }
|
3071
|
726
|
|
727 LISP_STRING_TO_EXTERNAL (yomi, ext, Qeuc_jp);
|
|
728 strncpy ((char *) yomibuf, ext, sizeof (yomibuf));
|
|
729 yomibuf[sizeof (yomibuf) - 1] = '\0';
|
|
730
|
|
731 nbun = RkBgnBun (IRCP_context, yomibuf, strlen ((char *) yomibuf),
|
3010
|
732 (RK_XFER << RK_XFERBITS) | RK_KFER);
|
|
733
|
|
734 return kanjiYomiList (IRCP_context, nbun);
|
|
735 }
|
|
736
|
|
737 static Lisp_Object
|
|
738 kanjiYomiList (int context, int nbun)
|
|
739 {
|
|
740 Lisp_Object val, res = Qnil;
|
3071
|
741 UExtbyte RkBuf[RKBUFSIZE];
|
3010
|
742 int len, i, total;
|
|
743
|
|
744 for (i = nbun ; i > 0 ; )
|
|
745 {
|
|
746 i--;
|
|
747 RkGoTo (context, i);
|
|
748 len = RkGetKanji (context, RkBuf, RKBUFSIZE);
|
3071
|
749 val = make_euc_string (RkBuf, len);
|
3010
|
750 len = RkGetYomi (context, RkBuf, RKBUFSIZE);
|
3071
|
751 res = Fcons (Fcons (val, make_euc_string (RkBuf, len)), res);
|
3010
|
752 if (i < RKBUFSIZE / 2)
|
|
753 {
|
|
754 kugiri[i] = len;
|
|
755 }
|
|
756 }
|
|
757 for (i = 0, total = 0 ; i < nbun ; i++)
|
|
758 {
|
|
759 int temp = kugiri[i];
|
|
760 kugiri[i] = total;
|
|
761 total += temp;
|
|
762 }
|
|
763 return res;
|
|
764 }
|
|
765
|
|
766 DEFUN ("canna-henkan-next", Fcanna_henkan_next, 1, 1, 0, /*
|
|
767 Return the list of candidates.
|
|
768 */
|
|
769 (bunsetsu))
|
|
770 {
|
|
771 int i, slen, len;
|
3071
|
772 UExtbyte *p, RkBuf[RKBUFSIZE];
|
3010
|
773 Lisp_Object res = Qnil;
|
|
774
|
|
775 CHECK_INT (bunsetsu);
|
|
776 if (confirmContext () == 0)
|
|
777 {
|
|
778 return Qnil;
|
|
779 }
|
|
780 RkGoTo (IRCP_context, XINT (bunsetsu));
|
|
781 len = RkGetKanjiList (IRCP_context, RkBuf, RKBUFSIZE);
|
|
782 p = RkBuf;
|
|
783 for (i = 0 ; i < len ; i++)
|
|
784 {
|
3071
|
785 slen = strlen ((char *) p);
|
3010
|
786 if (NILP(res))
|
|
787 {
|
3071
|
788 res = Fcons (make_euc_string (p, slen), Qnil);
|
3010
|
789 }
|
|
790 else
|
|
791 {
|
3071
|
792 XCDR (res) = Fcons (make_euc_string (p, slen), Qnil);
|
3010
|
793 }
|
|
794 p += slen + 1;
|
|
795 }
|
|
796 return res;
|
|
797 }
|
|
798
|
|
799 DEFUN ("canna-bunsetu-henkou", Fcanna_bunsetu_henkou, 2, 2, 0, /*
|
|
800 Specify the length of a clause.
|
|
801 */
|
|
802 (bunsetsu, bunlen))
|
|
803 {
|
|
804 int nbun, len;
|
|
805
|
|
806 CHECK_INT (bunsetsu);
|
|
807 CHECK_INT (bunlen);
|
|
808
|
|
809 nbun = XINT (bunsetsu);
|
|
810 if (confirmContext () == 0)
|
|
811 {
|
|
812 return Qnil;
|
|
813 }
|
|
814 RkGoTo (IRCP_context, nbun);
|
|
815 len = byteLen (nbun, XINT (bunlen));
|
|
816 return kanjiYomiList (IRCP_context, RkResize (IRCP_context, len));
|
|
817 }
|
|
818
|
|
819 DEFUN ("canna-henkan-kakutei", Fcanna_henkan_kakutei, 2, 2, 0, /*
|
|
820 Select a candidate.
|
|
821 */
|
|
822 (bun, kouho))
|
|
823 {
|
|
824 int nbun, nkouho;
|
|
825
|
|
826 if (confirmContext () == 0)
|
|
827 {
|
|
828 return Qnil;
|
|
829 }
|
|
830 nbun = XINT(bun);
|
|
831 RkGoTo (IRCP_context, nbun);
|
|
832
|
|
833 nkouho = XINT(kouho);
|
|
834 RkXfer (IRCP_context, nkouho);
|
|
835 return Qt;
|
|
836 }
|
|
837
|
|
838 DEFUN ("canna-henkan-end", Fcanna_henkan_end, 0, 0, 0, /*
|
|
839 End conversion.
|
|
840 */
|
|
841 ())
|
|
842 {
|
|
843 if (confirmContext () == 0)
|
|
844 {
|
|
845 return Qnil;
|
|
846 }
|
|
847 RkEndBun (IRCP_context, 1); /* ³Ø½¬¤Ï¤¤¤Ä¤Ç¤â¹Ô¤Ã¤ÆÎɤ¤¤â¤Î¤Ê¤Î¤«¡©
|
|
848 (is it OK to invoke learning function
|
|
849 at arbitrary times?) */
|
|
850 return Qt;
|
|
851 }
|
|
852
|
|
853 DEFUN ("canna-henkan-quit", Fcanna_henkan_quit, 0, 0, 0, /*
|
|
854 Quit conversion.
|
|
855 */
|
|
856 ())
|
|
857 {
|
|
858 if (confirmContext () == 0)
|
|
859 {
|
|
860 return Qnil;
|
|
861 }
|
|
862 RkEndBun (IRCP_context, 0);
|
|
863 return Qt;
|
|
864 }
|
|
865
|
|
866 /* variables below this line is constants of Canna */
|
|
867
|
|
868 static Fixnum canna_mode_AlphaMode;
|
|
869 static Fixnum canna_mode_EmptyMode;
|
|
870 static Fixnum canna_mode_KigoMode;
|
|
871 static Fixnum canna_mode_YomiMode;
|
|
872 static Fixnum canna_mode_JishuMode;
|
|
873 static Fixnum canna_mode_TankouhoMode;
|
|
874 static Fixnum canna_mode_IchiranMode;
|
|
875 static Fixnum canna_mode_YesNoMode;
|
|
876 static Fixnum canna_mode_OnOffMode;
|
|
877 #ifdef CANNA_MODE_AdjustBunsetsuMode
|
|
878 static Fixnum canna_mode_AdjustBunsetsuMode;
|
|
879 #endif
|
|
880 #ifdef CANNA_MODE_ChikujiYomiMode
|
|
881 static Fixnum canna_mode_ChikujiYomiMode;
|
|
882 static Fixnum canna_mode_ChikujiTanMode;
|
|
883 #endif
|
|
884
|
|
885 static Fixnum canna_mode_HenkanMode;
|
|
886 #ifdef CANNA_MODE_HenkanNyuryokuMode
|
|
887 static Fixnum canna_mode_HenkanNyuryokuMode;
|
|
888 #endif
|
|
889 #ifdef CANNA_MODE_ZenHiraHenkanMode
|
|
890 static Fixnum canna_mode_ZenHiraHenkanMode;
|
|
891 #ifdef CANNA_MODE_HanHiraHenkanMode
|
|
892 static Fixnum canna_mode_HanHiraHenkanMode;
|
|
893 #endif
|
|
894 static Fixnum canna_mode_ZenKataHenkanMode;
|
|
895 static Fixnum canna_mode_HanKataHenkanMode;
|
|
896 static Fixnum canna_mode_ZenAlphaHenkanMode;
|
|
897 static Fixnum canna_mode_HanAlphaHenkanMode;
|
|
898 #endif
|
|
899 static Fixnum canna_mode_ZenHiraKakuteiMode;
|
|
900 #ifdef CANNA_MODE_HanHiraKakuteiMode
|
|
901 static Fixnum canna_mode_HanHiraKakuteiMode;
|
|
902 #endif
|
|
903 static Fixnum canna_mode_ZenKataKakuteiMode;
|
|
904 static Fixnum canna_mode_HanKataKakuteiMode;
|
|
905 static Fixnum canna_mode_ZenAlphaKakuteiMode;
|
|
906 static Fixnum canna_mode_HanAlphaKakuteiMode;
|
|
907 static Fixnum canna_mode_HexMode;
|
|
908 static Fixnum canna_mode_BushuMode;
|
|
909 static Fixnum canna_mode_ExtendMode;
|
|
910 static Fixnum canna_mode_RussianMode;
|
|
911 static Fixnum canna_mode_GreekMode;
|
|
912 static Fixnum canna_mode_LineMode;
|
|
913 static Fixnum canna_mode_ChangingServerMode;
|
|
914 static Fixnum canna_mode_HenkanMethodMode;
|
|
915 static Fixnum canna_mode_DeleteDicMode;
|
|
916 static Fixnum canna_mode_TourokuMode;
|
|
917 static Fixnum canna_mode_TourokuEmptyMode;
|
|
918 static Fixnum canna_mode_TourokuHinshiMode;
|
|
919 static Fixnum canna_mode_TourokuDicMode;
|
|
920 static Fixnum canna_mode_QuotedInsertMode;
|
|
921 static Fixnum canna_mode_BubunMuhenkanMode;
|
|
922 static Fixnum canna_mode_MountDicMode;
|
|
923
|
|
924 static Fixnum canna_fn_SelfInsert;
|
|
925 static Fixnum canna_fn_FunctionalInsert;
|
|
926 static Fixnum canna_fn_QuotedInsert;
|
|
927 static Fixnum canna_fn_JapaneseMode;
|
|
928 static Fixnum canna_fn_AlphaMode;
|
|
929 static Fixnum canna_fn_HenkanNyuryokuMode;
|
|
930 static Fixnum canna_fn_Forward;
|
|
931 static Fixnum canna_fn_Backward;
|
|
932 static Fixnum canna_fn_Next;
|
|
933 static Fixnum canna_fn_Prev;
|
|
934 static Fixnum canna_fn_BeginningOfLine;
|
|
935 static Fixnum canna_fn_EndOfLine;
|
|
936 static Fixnum canna_fn_DeleteNext;
|
|
937 static Fixnum canna_fn_DeletePrevious;
|
|
938 static Fixnum canna_fn_KillToEndOfLine;
|
|
939 static Fixnum canna_fn_Henkan;
|
|
940 static Fixnum canna_fn_Kakutei;
|
|
941 static Fixnum canna_fn_Extend;
|
|
942 static Fixnum canna_fn_Shrink;
|
|
943 #ifdef CANNA_FN_AdjustBunsetsu
|
|
944 static Fixnum canna_fn_AdjustBunsetsu;
|
|
945 #endif
|
|
946 static Fixnum canna_fn_Quit;
|
|
947 static Fixnum canna_fn_ConvertAsHex;
|
|
948 static Fixnum canna_fn_ConvertAsBushu;
|
|
949 static Fixnum canna_fn_KouhoIchiran;
|
|
950 static Fixnum canna_fn_BubunMuhenkan;
|
|
951 static Fixnum canna_fn_Zenkaku;
|
|
952 static Fixnum canna_fn_Hankaku;
|
|
953 static Fixnum canna_fn_ToUpper;
|
|
954 static Fixnum canna_fn_Capitalize;
|
|
955 static Fixnum canna_fn_ToLower;
|
|
956 static Fixnum canna_fn_Hiragana;
|
|
957 static Fixnum canna_fn_Katakana;
|
|
958 static Fixnum canna_fn_Romaji;
|
|
959 #ifdef CANNA_FN_BaseHiragana
|
|
960 static Fixnum canna_fn_BaseHiragana;
|
|
961 static Fixnum canna_fn_BaseKatakana;
|
|
962 static Fixnum canna_fn_BaseEisu;
|
|
963 static Fixnum canna_fn_BaseZenkaku;
|
|
964 static Fixnum canna_fn_BaseHankaku;
|
|
965 static Fixnum canna_fn_BaseKana;
|
|
966 static Fixnum canna_fn_BaseKakutei;
|
|
967 static Fixnum canna_fn_BaseHenkan;
|
|
968 static Fixnum canna_fn_BaseHiraKataToggle;
|
|
969 static Fixnum canna_fn_BaseZenHanToggle;
|
|
970 static Fixnum canna_fn_BaseKanaEisuToggle;
|
|
971 static Fixnum canna_fn_BaseKakuteiHenkanToggle;
|
|
972 static Fixnum canna_fn_BaseRotateForward;
|
|
973 static Fixnum canna_fn_BaseRotateBackward;
|
|
974 #endif
|
|
975 static Fixnum canna_fn_ExtendMode;
|
|
976 static Fixnum canna_fn_Touroku;
|
|
977 static Fixnum canna_fn_HexMode;
|
|
978 static Fixnum canna_fn_BushuMode;
|
|
979 static Fixnum canna_fn_KigouMode;
|
|
980 #ifdef CANNA_FN_Mark
|
|
981 static Fixnum canna_fn_Mark;
|
|
982 #endif
|
|
983 #ifdef CANNA_FN_TemporalMode
|
|
984 static Fixnum canna_fn_TemporalMode;
|
|
985 #endif
|
|
986
|
|
987 static Fixnum canna_key_Nfer;
|
|
988 static Fixnum canna_key_Xfer;
|
|
989 static Fixnum canna_key_Up;
|
|
990 static Fixnum canna_key_Left;
|
|
991 static Fixnum canna_key_Right;
|
|
992 static Fixnum canna_key_Down;
|
|
993 static Fixnum canna_key_Insert;
|
|
994 static Fixnum canna_key_Rollup;
|
|
995 static Fixnum canna_key_Rolldown;
|
|
996 static Fixnum canna_key_Home;
|
|
997 static Fixnum canna_key_Help;
|
|
998 static Fixnum canna_key_KP_Key;
|
|
999 static Fixnum canna_key_Shift_Nfer;
|
|
1000 static Fixnum canna_key_Shift_Xfer;
|
|
1001 static Fixnum canna_key_Shift_Up;
|
|
1002 static Fixnum canna_key_Shift_Left;
|
|
1003 static Fixnum canna_key_Shift_Right;
|
|
1004 static Fixnum canna_key_Shift_Down;
|
|
1005 static Fixnum canna_key_Cntrl_Nfer;
|
|
1006 static Fixnum canna_key_Cntrl_Xfer;
|
|
1007 static Fixnum canna_key_Cntrl_Up;
|
|
1008 static Fixnum canna_key_Cntrl_Left;
|
|
1009 static Fixnum canna_key_Cntrl_Right;
|
|
1010 static Fixnum canna_key_Cntrl_Down;
|
|
1011
|
|
1012 Lisp_Object VCANNA; /* by MORIOKA Tomohiko <morioka@jaist.ac.jp>
|
|
1013 1996/6/7 */
|
|
1014
|
|
1015 /*
|
|
1016 * Each dynamically loaded Emacs module is given a name at compile
|
|
1017 * time. This is a short name, and must be a valid part of a C
|
|
1018 * identifier. This name is used to construct the name of several
|
|
1019 * functions which must appear in the module source code.
|
|
1020 * The first such function, modules_of_XXXX, should load in any dependent
|
|
1021 * modules. This function is optional, and the module will still load if
|
|
1022 * it is not present in the module.
|
|
1023 *
|
|
1024 * The second function, which is NOT optional, is syms_of_XXXX, in which
|
|
1025 * all functions that the module will be provided are declared. This
|
|
1026 * function will contain calls to DEFSUBR().
|
|
1027 *
|
|
1028 * The third function, which is also NOT optional, is vars_of_XXXX, in
|
|
1029 * which you declare all variables that the module provides. This
|
|
1030 * function will contain calls to DEFVAR_LISP(), DEFVAR_BOOL() etc.
|
|
1031 *
|
|
1032 * When declaring functions and variables in the syms_of_XXXX and
|
|
1033 * vars_of_XXXX functions, you use the exact same syntax that you
|
|
1034 * would as if this module were being compiled into the pure Emacs.
|
|
1035 *
|
|
1036 * The fourth function, which is optional, is unload_XXXX, in which actions
|
|
1037 * that must be taken to unload the module are listed. XEmacs will unbind
|
|
1038 * functions and variables for you. Anything else that must be done should
|
|
1039 * appear in this function.
|
|
1040 *
|
|
1041 * All four of these functions are declared as void functions,
|
|
1042 * taking no parameters. Since this sample module is called 'sample',
|
|
1043 * the functions will be named 'modules_of_sample', 'syms_of_sample',
|
|
1044 * 'vars_of_sample', and 'unload_sample'.
|
|
1045 */
|
|
1046
|
|
1047 #if 0
|
|
1048 void
|
|
1049 modules_of_canna_api (void)
|
|
1050 {
|
|
1051 /*
|
|
1052 * This function isn't actually required as we will not be loading
|
|
1053 * in any dependent modules, but if we were, we would do something like:
|
|
1054 * emodules_load ("dependent.ell", "canna2", "1.0.0");
|
|
1055 */
|
|
1056 }
|
|
1057 #endif
|
|
1058
|
|
1059 void
|
|
1060 syms_of_canna_api (void)
|
|
1061 {
|
|
1062 DEFSUBR (Fcanna_key_proc);
|
|
1063 DEFSUBR (Fcanna_initialize);
|
|
1064 DEFSUBR (Fcanna_finalize);
|
|
1065 DEFSUBR (Fcanna_touroku_string);
|
|
1066 DEFSUBR (Fcanna_set_width);
|
|
1067 DEFSUBR (Fcanna_change_mode);
|
|
1068 DEFSUBR (Fcanna_store_yomi);
|
|
1069 DEFSUBR (Fcanna_do_function);
|
|
1070 DEFSUBR (Fcanna_parse);
|
|
1071 DEFSUBR (Fcanna_query_mode);
|
|
1072 DEFSUBR (Fcanna_set_bunsetsu);
|
|
1073
|
|
1074 DEFSUBR (Fcanna_henkan_begin);
|
|
1075 DEFSUBR (Fcanna_henkan_next);
|
|
1076 DEFSUBR (Fcanna_bunsetu_henkou);
|
|
1077 DEFSUBR (Fcanna_henkan_kakutei);
|
|
1078 DEFSUBR (Fcanna_henkan_end);
|
|
1079 DEFSUBR (Fcanna_henkan_quit);
|
3071
|
1080
|
|
1081 DEFSYMBOL (Qeuc_jp);
|
3010
|
1082 }
|
|
1083
|
|
1084 void
|
|
1085 vars_of_canna_api (void)
|
|
1086 {
|
|
1087 DEFVAR_LISP ("CANNA", &VCANNA); /* hir@nec, 1992.5.21 */
|
|
1088 VCANNA = Qt; /* hir@nec, 1992.5.21 */
|
|
1089
|
|
1090 DEFVAR_LISP ("canna-kakutei-string", &Vcanna_kakutei_string /*
|
|
1091
|
|
1092 */ );
|
|
1093 Vcanna_kakutei_string = Qnil;
|
|
1094
|
|
1095 DEFVAR_LISP ("canna-kakutei-yomi", &Vcanna_kakutei_yomi /*
|
|
1096
|
|
1097 */ );
|
|
1098 Vcanna_kakutei_yomi = Qnil;
|
|
1099
|
|
1100 DEFVAR_LISP ("canna-kakutei-romaji", &Vcanna_kakutei_romaji /*
|
|
1101
|
|
1102 */ );
|
|
1103 Vcanna_kakutei_romaji = Qnil;
|
|
1104
|
|
1105 DEFVAR_LISP ("canna-henkan-string", &Vcanna_henkan_string /*
|
|
1106
|
|
1107 */ );
|
|
1108 Vcanna_henkan_string = Qnil;
|
|
1109
|
|
1110 DEFVAR_INT ("canna-henkan-length", &canna_henkan_length /*
|
|
1111
|
|
1112 */ );
|
|
1113 canna_henkan_length = 0;
|
|
1114
|
|
1115 DEFVAR_INT ("canna-henkan-revpos", &canna_henkan_revPos /*
|
|
1116
|
|
1117 */ );
|
|
1118 canna_henkan_revPos = 0;
|
|
1119
|
|
1120 DEFVAR_INT ("canna-henkan-revlen", &canna_henkan_revLen /*
|
|
1121
|
|
1122 */ );
|
|
1123 canna_henkan_revLen = 0;
|
|
1124
|
|
1125 DEFVAR_LISP ("canna-ichiran-string", &Vcanna_ichiran_string /*
|
|
1126
|
|
1127 */ );
|
|
1128 Vcanna_ichiran_string = Qnil;
|
|
1129
|
|
1130 DEFVAR_INT ("canna-ichiran-length", &canna_ichiran_length /*
|
|
1131
|
|
1132 */ );
|
|
1133 canna_ichiran_length = 0;
|
|
1134
|
|
1135 DEFVAR_INT ("canna-ichiran-revpos", &canna_ichiran_revPos /*
|
|
1136
|
|
1137 */ );
|
|
1138 canna_ichiran_revPos = 0;
|
|
1139
|
|
1140 DEFVAR_INT ("canna-ichiran-revlen", &canna_ichiran_revLen /*
|
|
1141
|
|
1142 */ );
|
|
1143 canna_ichiran_revLen = 0;
|
|
1144
|
|
1145 DEFVAR_LISP ("canna-mode-string", &Vcanna_mode_string /*
|
|
1146
|
|
1147 */ );
|
|
1148 Vcanna_mode_string = Qnil;
|
|
1149
|
|
1150 DEFVAR_BOOL ("canna-empty-info", &canna_empty_info /*
|
|
1151 For canna
|
|
1152 */ );
|
|
1153 canna_empty_info = 0;
|
|
1154
|
|
1155 DEFVAR_BOOL ("canna-through-info", &canna_through_info /*
|
|
1156 For canna
|
|
1157 */ );
|
|
1158 canna_through_info = 0;
|
|
1159
|
|
1160 DEFVAR_BOOL ("canna-underline", &canna_underline /*
|
|
1161 For canna
|
|
1162 */ );
|
|
1163 canna_underline = 0;
|
|
1164
|
|
1165 DEFVAR_BOOL ("canna-inhibit-hankakukana", &canna_inhibit_hankakukana /*
|
|
1166 For canna
|
|
1167 */ );
|
|
1168 canna_inhibit_hankakukana = 0;
|
|
1169
|
|
1170 DEFVAR_INT ("canna-mode-alpha-mode", &canna_mode_AlphaMode /*
|
|
1171
|
|
1172 */ );
|
|
1173 canna_mode_AlphaMode = IROHA_MODE_AlphaMode;
|
|
1174
|
|
1175 DEFVAR_INT ("canna-mode-empty-mode", &canna_mode_EmptyMode /*
|
|
1176
|
|
1177 */ );
|
|
1178 canna_mode_EmptyMode = IROHA_MODE_EmptyMode;
|
|
1179
|
|
1180 DEFVAR_INT ("canna-mode-kigo-mode", &canna_mode_KigoMode /*
|
|
1181
|
|
1182 */ );
|
|
1183 canna_mode_KigoMode = IROHA_MODE_KigoMode;
|
|
1184
|
|
1185 DEFVAR_INT ("canna-mode-yomi-mode", &canna_mode_YomiMode /*
|
|
1186
|
|
1187 */ );
|
|
1188 canna_mode_YomiMode = IROHA_MODE_YomiMode;
|
|
1189
|
|
1190 DEFVAR_INT ("canna-mode-jishu-mode", &canna_mode_JishuMode /*
|
|
1191
|
|
1192 */ );
|
|
1193 canna_mode_JishuMode = IROHA_MODE_JishuMode;
|
|
1194
|
|
1195 DEFVAR_INT ("canna-mode-tankouho-mode", &canna_mode_TankouhoMode /*
|
|
1196
|
|
1197 */ );
|
|
1198 canna_mode_TankouhoMode = IROHA_MODE_TankouhoMode;
|
|
1199
|
|
1200 DEFVAR_INT ("canna-mode-ichiran-mode", &canna_mode_IchiranMode /*
|
|
1201
|
|
1202 */ );
|
|
1203 canna_mode_IchiranMode = IROHA_MODE_IchiranMode;
|
|
1204
|
|
1205 DEFVAR_INT ("canna-mode-yes-no-mode", &canna_mode_YesNoMode /*
|
|
1206
|
|
1207 */ );
|
|
1208 canna_mode_YesNoMode = IROHA_MODE_YesNoMode;
|
|
1209
|
|
1210 DEFVAR_INT ("canna-mode-on-off-mode", &canna_mode_OnOffMode /*
|
|
1211
|
|
1212 */ );
|
|
1213 canna_mode_OnOffMode = IROHA_MODE_OnOffMode;
|
|
1214
|
|
1215 #ifdef CANNA_MODE_AdjustBunsetsuMode
|
|
1216 DEFVAR_INT ("canna-mode-adjust-bunsetsu-mode",
|
|
1217 &canna_mode_AdjustBunsetsuMode /*
|
|
1218
|
|
1219 */ );
|
|
1220 canna_mode_AdjustBunsetsuMode = CANNA_MODE_AdjustBunsetsuMode;
|
|
1221 #endif
|
|
1222 #ifdef CANNA_MODE_ChikujiYomiMode
|
|
1223 DEFVAR_INT ("canna-mode-chikuji-yomi-mode", &canna_mode_ChikujiYomiMode /*
|
|
1224
|
|
1225 */ );
|
|
1226 canna_mode_ChikujiYomiMode = CANNA_MODE_ChikujiYomiMode;
|
|
1227
|
|
1228 DEFVAR_INT ("canna-mode-chikuji-bunsetsu-mode",
|
|
1229 &canna_mode_ChikujiTanMode /*
|
|
1230
|
|
1231 */ );
|
|
1232 canna_mode_ChikujiTanMode = CANNA_MODE_ChikujiTanMode;
|
|
1233 #endif
|
|
1234
|
|
1235 DEFVAR_INT ("canna-mode-henkan-mode", &canna_mode_HenkanMode /*
|
|
1236
|
|
1237 */ );
|
|
1238 canna_mode_HenkanMode = IROHA_MODE_HenkanMode;
|
|
1239
|
|
1240 #ifdef CANNA_MODE_HenkanNyuryokuMode
|
|
1241 DEFVAR_INT ("canna-mode-henkan-nyuuryoku-mode",
|
|
1242 &canna_mode_HenkanNyuryokuMode /*
|
|
1243
|
|
1244 */ );
|
|
1245 canna_mode_HenkanNyuryokuMode = CANNA_MODE_HenkanNyuryokuMode;
|
|
1246 #endif
|
|
1247 #ifdef CANNA_MODE_ZenHiraHenkanMode
|
|
1248 DEFVAR_INT ("canna-mode-zen-hira-henkan-mode",
|
|
1249 &canna_mode_ZenHiraHenkanMode /*
|
|
1250
|
|
1251 */ );
|
|
1252 canna_mode_ZenHiraHenkanMode = CANNA_MODE_ZenHiraHenkanMode;
|
|
1253 #ifdef CANNA_MODE_HanHiraHenkanMode
|
|
1254 DEFVAR_INT ("canna-mode-han-hira-henkan-mode",
|
|
1255 &canna_mode_HanHiraHenkanMode /*
|
|
1256
|
|
1257 */ );
|
|
1258 canna_mode_HanHiraHenkanMode = CANNA_MODE_HanHiraHenkanMode;
|
|
1259 #endif
|
|
1260 DEFVAR_INT ("canna-mode-zen-kata-henkan-mode",
|
|
1261 &canna_mode_ZenKataHenkanMode /*
|
|
1262
|
|
1263 */ );
|
|
1264 canna_mode_ZenKataHenkanMode = CANNA_MODE_ZenKataHenkanMode;
|
|
1265
|
|
1266 DEFVAR_INT ("canna-mode-han-kata-henkan-mode",
|
|
1267 &canna_mode_HanKataHenkanMode /*
|
|
1268
|
|
1269 */ );
|
|
1270 canna_mode_HanKataHenkanMode = CANNA_MODE_HanKataHenkanMode;
|
|
1271
|
|
1272 DEFVAR_INT ("canna-mode-zen-alpha-henkan-mode",
|
|
1273 &canna_mode_ZenAlphaHenkanMode /*
|
|
1274
|
|
1275 */ );
|
|
1276 canna_mode_ZenAlphaHenkanMode = CANNA_MODE_ZenAlphaHenkanMode;
|
|
1277
|
|
1278 DEFVAR_INT ("canna-mode-han-alpha-henkan-mode",
|
|
1279 &canna_mode_HanAlphaHenkanMode /*
|
|
1280
|
|
1281 */ );
|
|
1282 canna_mode_HanAlphaHenkanMode = CANNA_MODE_HanAlphaHenkanMode;
|
|
1283 #endif
|
|
1284 DEFVAR_INT ("canna-mode-zen-hira-kakutei-mode",
|
|
1285 &canna_mode_ZenHiraKakuteiMode /*
|
|
1286
|
|
1287 */ );
|
|
1288 canna_mode_ZenHiraKakuteiMode = IROHA_MODE_ZenHiraKakuteiMode;
|
|
1289 #ifdef CANNA_MODE_HanHiraKakuteiMode
|
|
1290 DEFVAR_INT ("canna-mode-han-hira-kakutei-mode",
|
|
1291 &canna_mode_HanHiraKakuteiMode /*
|
|
1292
|
|
1293 */ );
|
|
1294 canna_mode_HanHiraKakuteiMode = CANNA_MODE_HanHiraKakuteiMode;
|
|
1295 #endif
|
|
1296 DEFVAR_INT ("canna-mode-zen-kata-kakutei-mode",
|
|
1297 &canna_mode_ZenKataKakuteiMode /*
|
|
1298
|
|
1299 */ );
|
|
1300 canna_mode_ZenKataKakuteiMode = IROHA_MODE_ZenKataKakuteiMode;
|
|
1301
|
|
1302 DEFVAR_INT ("canna-mode-han-kata-kakutei-mode",
|
|
1303 &canna_mode_HanKataKakuteiMode /*
|
|
1304
|
|
1305 */ );
|
|
1306 canna_mode_HanKataKakuteiMode = IROHA_MODE_HanKataKakuteiMode;
|
|
1307
|
|
1308 DEFVAR_INT ("canna-mode-zen-alpha-kakutei-mode",
|
|
1309 &canna_mode_ZenAlphaKakuteiMode /*
|
|
1310
|
|
1311 */ );
|
|
1312 canna_mode_ZenAlphaKakuteiMode = IROHA_MODE_ZenAlphaKakuteiMode;
|
|
1313
|
|
1314 DEFVAR_INT ("canna-mode-han-alpha-kakutei-mode",
|
|
1315 &canna_mode_HanAlphaKakuteiMode /*
|
|
1316
|
|
1317 */ );
|
|
1318 canna_mode_HanAlphaKakuteiMode = IROHA_MODE_HanAlphaKakuteiMode;
|
|
1319
|
|
1320 DEFVAR_INT ("canna-mode-hex-mode", &canna_mode_HexMode /*
|
|
1321
|
|
1322 */ );
|
|
1323 canna_mode_HexMode = IROHA_MODE_HexMode;
|
|
1324
|
|
1325 DEFVAR_INT ("canna-mode-bushu-mode", &canna_mode_BushuMode /*
|
|
1326
|
|
1327 */ );
|
|
1328 canna_mode_BushuMode = IROHA_MODE_BushuMode;
|
|
1329
|
|
1330 DEFVAR_INT ("canna-mode-extend-mode", &canna_mode_ExtendMode /*
|
|
1331
|
|
1332 */ );
|
|
1333 canna_mode_ExtendMode = IROHA_MODE_ExtendMode;
|
|
1334
|
|
1335 DEFVAR_INT ("canna-mode-russian-mode", &canna_mode_RussianMode /*
|
|
1336
|
|
1337 */ );
|
|
1338 canna_mode_RussianMode = IROHA_MODE_RussianMode;
|
|
1339
|
|
1340 DEFVAR_INT ("canna-mode-greek-mode", &canna_mode_GreekMode /*
|
|
1341
|
|
1342 */ );
|
|
1343 canna_mode_GreekMode = IROHA_MODE_GreekMode;
|
|
1344
|
|
1345 DEFVAR_INT ("canna-mode-line-mode", &canna_mode_LineMode /*
|
|
1346
|
|
1347 */ );
|
|
1348 canna_mode_LineMode = IROHA_MODE_LineMode;
|
|
1349
|
|
1350 DEFVAR_INT ("canna-mode-changing-server-mode",
|
|
1351 &canna_mode_ChangingServerMode /*
|
|
1352
|
|
1353 */ );
|
|
1354 canna_mode_ChangingServerMode = IROHA_MODE_ChangingServerMode;
|
|
1355
|
|
1356 DEFVAR_INT ("canna-mode-henkan-method-mode",
|
|
1357 &canna_mode_HenkanMethodMode /*
|
|
1358
|
|
1359 */ );
|
|
1360 canna_mode_HenkanMethodMode = IROHA_MODE_HenkanMethodMode;
|
|
1361
|
|
1362 DEFVAR_INT ("canna-mode-delete-dic-mode", &canna_mode_DeleteDicMode /*
|
|
1363
|
|
1364 */ );
|
|
1365 canna_mode_DeleteDicMode = IROHA_MODE_DeleteDicMode;
|
|
1366
|
|
1367 DEFVAR_INT ("canna-mode-touroku-mode", &canna_mode_TourokuMode /*
|
|
1368
|
|
1369 */ );
|
|
1370 canna_mode_TourokuMode = IROHA_MODE_TourokuMode;
|
|
1371
|
|
1372 DEFVAR_INT ("canna-mode-touroku-empty-mode",
|
|
1373 &canna_mode_TourokuEmptyMode /*
|
|
1374
|
|
1375 */ );
|
|
1376 canna_mode_TourokuEmptyMode = IROHA_MODE_TourokuEmptyMode;
|
|
1377
|
|
1378 DEFVAR_INT ("canna-mode-touroku-hinshi-mode",
|
|
1379 &canna_mode_TourokuHinshiMode /*
|
|
1380
|
|
1381 */ );
|
|
1382 canna_mode_TourokuHinshiMode = IROHA_MODE_TourokuHinshiMode;
|
|
1383
|
|
1384 DEFVAR_INT ("canna-mode-touroku-dic-mode", &canna_mode_TourokuDicMode /*
|
|
1385
|
|
1386 */ );
|
|
1387 canna_mode_TourokuDicMode = IROHA_MODE_TourokuDicMode;
|
|
1388
|
|
1389 DEFVAR_INT ("canna-mode-quoted-insert-mode",
|
|
1390 &canna_mode_QuotedInsertMode /*
|
|
1391
|
|
1392 */ );
|
|
1393 canna_mode_QuotedInsertMode = IROHA_MODE_QuotedInsertMode;
|
|
1394
|
|
1395 DEFVAR_INT ("canna-mode-bubun-muhenkan-mode",
|
|
1396 &canna_mode_BubunMuhenkanMode /*
|
|
1397
|
|
1398 */ );
|
|
1399 canna_mode_BubunMuhenkanMode = IROHA_MODE_BubunMuhenkanMode;
|
|
1400
|
|
1401 DEFVAR_INT ("canna-mode-mount-dic-mode", &canna_mode_MountDicMode /*
|
|
1402
|
|
1403 */ );
|
|
1404 canna_mode_MountDicMode = IROHA_MODE_MountDicMode;
|
|
1405
|
|
1406 DEFVAR_INT ("canna-func-self-insert", &canna_fn_SelfInsert /*
|
|
1407
|
|
1408 */ );
|
|
1409 canna_fn_SelfInsert = IROHA_FN_SelfInsert;
|
|
1410
|
|
1411 DEFVAR_INT ("canna-func-functional-insert", &canna_fn_FunctionalInsert /*
|
|
1412
|
|
1413 */ );
|
|
1414 canna_fn_FunctionalInsert = IROHA_FN_FunctionalInsert;
|
|
1415
|
|
1416 DEFVAR_INT ("canna-func-quoted-insert", &canna_fn_QuotedInsert /*
|
|
1417
|
|
1418 */ );
|
|
1419 canna_fn_QuotedInsert = IROHA_FN_QuotedInsert;
|
|
1420
|
|
1421 DEFVAR_INT ("canna-func-japanese-mode", &canna_fn_JapaneseMode /*
|
|
1422
|
|
1423 */ );
|
|
1424 canna_fn_JapaneseMode = IROHA_FN_JapaneseMode;
|
|
1425
|
|
1426 DEFVAR_INT ("canna-func-alpha-mode", &canna_fn_AlphaMode /*
|
|
1427
|
|
1428 */ );
|
|
1429 canna_fn_AlphaMode = IROHA_FN_AlphaMode;
|
|
1430
|
|
1431 DEFVAR_INT ("canna-func-henkan-nyuryoku-mode",
|
|
1432 &canna_fn_HenkanNyuryokuMode /*
|
|
1433
|
|
1434 */ );
|
|
1435 canna_fn_HenkanNyuryokuMode = IROHA_FN_HenkanNyuryokuMode;
|
|
1436
|
|
1437 DEFVAR_INT ("canna-func-forward", &canna_fn_Forward /*
|
|
1438
|
|
1439 */ );
|
|
1440 canna_fn_Forward = IROHA_FN_Forward;
|
|
1441
|
|
1442 DEFVAR_INT ("canna-func-backward", &canna_fn_Backward /*
|
|
1443
|
|
1444 */ );
|
|
1445 canna_fn_Backward = IROHA_FN_Backward;
|
|
1446
|
|
1447 DEFVAR_INT ("canna-func-next", &canna_fn_Next /*
|
|
1448
|
|
1449 */ );
|
|
1450 canna_fn_Next = IROHA_FN_Next;
|
|
1451
|
|
1452 DEFVAR_INT ("canna-func-previous", &canna_fn_Prev /*
|
|
1453
|
|
1454 */ );
|
|
1455 canna_fn_Prev = IROHA_FN_Prev;
|
|
1456
|
|
1457 DEFVAR_INT ("canna-func-beginning-of-line", &canna_fn_BeginningOfLine /*
|
|
1458
|
|
1459 */ );
|
|
1460 canna_fn_BeginningOfLine = IROHA_FN_BeginningOfLine;
|
|
1461
|
|
1462 DEFVAR_INT ("canna-func-end-of-line", &canna_fn_EndOfLine /*
|
|
1463
|
|
1464 */ );
|
|
1465 canna_fn_EndOfLine = IROHA_FN_EndOfLine;
|
|
1466
|
|
1467 DEFVAR_INT ("canna-func-delete-next", &canna_fn_DeleteNext /*
|
|
1468
|
|
1469 */ );
|
|
1470 canna_fn_DeleteNext = IROHA_FN_DeleteNext;
|
|
1471
|
|
1472 DEFVAR_INT ("canna-func-delete-previous", &canna_fn_DeletePrevious /*
|
|
1473
|
|
1474 */ );
|
|
1475 canna_fn_DeletePrevious = IROHA_FN_DeletePrevious;
|
|
1476
|
|
1477 DEFVAR_INT ("canna-func-kill-to-end-of-line", &canna_fn_KillToEndOfLine /*
|
|
1478
|
|
1479 */ );
|
|
1480 canna_fn_KillToEndOfLine = IROHA_FN_KillToEndOfLine;
|
|
1481
|
|
1482 DEFVAR_INT ("canna-func-henkan", &canna_fn_Henkan /*
|
|
1483
|
|
1484 */ );
|
|
1485 canna_fn_Henkan = IROHA_FN_Henkan;
|
|
1486
|
|
1487 DEFVAR_INT ("canna-func-kakutei", &canna_fn_Kakutei /*
|
|
1488
|
|
1489 */ );
|
|
1490 canna_fn_Kakutei = IROHA_FN_Kakutei;
|
|
1491
|
|
1492 DEFVAR_INT ("canna-func-extend", &canna_fn_Extend /*
|
|
1493
|
|
1494 */ );
|
|
1495 canna_fn_Extend = IROHA_FN_Extend;
|
|
1496
|
|
1497 DEFVAR_INT ("canna-func-shrink", &canna_fn_Shrink /*
|
|
1498
|
|
1499 */ );
|
|
1500 canna_fn_Shrink = IROHA_FN_Shrink;
|
|
1501
|
|
1502 #ifdef CANNA_FN_AdjustBunsetsu
|
|
1503 DEFVAR_INT ("canna-func-adjust-bunsetsu", &canna_fn_AdjustBunsetsu /*
|
|
1504
|
|
1505 */ );
|
|
1506 canna_fn_AdjustBunsetsu = CANNA_FN_AdjustBunsetsu;
|
|
1507 #endif
|
|
1508 DEFVAR_INT ("canna-func-quit", &canna_fn_Quit /*
|
|
1509
|
|
1510 */ );
|
|
1511 canna_fn_Quit = IROHA_FN_Quit;
|
|
1512
|
|
1513 DEFVAR_INT ("canna-func-convert-as-hex", &canna_fn_ConvertAsHex /*
|
|
1514
|
|
1515 */ );
|
|
1516 canna_fn_ConvertAsHex = IROHA_FN_ConvertAsHex;
|
|
1517
|
|
1518 DEFVAR_INT ("canna-func-convert-as-bushu", &canna_fn_ConvertAsBushu /*
|
|
1519
|
|
1520 */ );
|
|
1521 canna_fn_ConvertAsBushu = IROHA_FN_ConvertAsBushu;
|
|
1522
|
|
1523 DEFVAR_INT ("canna-func-kouho-ichiran", &canna_fn_KouhoIchiran /*
|
|
1524
|
|
1525 */ );
|
|
1526 canna_fn_KouhoIchiran = IROHA_FN_KouhoIchiran;
|
|
1527
|
|
1528 DEFVAR_INT ("canna-func-bubun-muhenkan", &canna_fn_BubunMuhenkan /*
|
|
1529
|
|
1530 */ );
|
|
1531 canna_fn_BubunMuhenkan = IROHA_FN_BubunMuhenkan;
|
|
1532
|
|
1533 DEFVAR_INT ("canna-func-zenkaku", &canna_fn_Zenkaku /*
|
|
1534
|
|
1535 */ );
|
|
1536 canna_fn_Zenkaku = IROHA_FN_Zenkaku;
|
|
1537
|
|
1538 DEFVAR_INT ("canna-func-hankaku", &canna_fn_Hankaku /*
|
|
1539
|
|
1540 */ );
|
|
1541 canna_fn_Hankaku = IROHA_FN_Hankaku;
|
|
1542
|
|
1543 DEFVAR_INT ("canna-func-to-upper", &canna_fn_ToUpper /*
|
|
1544
|
|
1545 */ );
|
|
1546 canna_fn_ToUpper = IROHA_FN_ToUpper;
|
|
1547
|
|
1548 DEFVAR_INT ("canna-func-capitalize", &canna_fn_Capitalize /*
|
|
1549
|
|
1550 */ );
|
|
1551 canna_fn_Capitalize = IROHA_FN_Capitalize;
|
|
1552
|
|
1553 DEFVAR_INT ("canna-func-to-lower", &canna_fn_ToLower /*
|
|
1554
|
|
1555 */ );
|
|
1556 canna_fn_ToLower = IROHA_FN_ToLower;
|
|
1557
|
|
1558 DEFVAR_INT ("canna-func-hiragana", &canna_fn_Hiragana /*
|
|
1559
|
|
1560 */ );
|
|
1561 canna_fn_Hiragana = IROHA_FN_Hiragana;
|
|
1562
|
|
1563 DEFVAR_INT ("canna-func-katakana", &canna_fn_Katakana /*
|
|
1564
|
|
1565 */ );
|
|
1566 canna_fn_Katakana = IROHA_FN_Katakana;
|
|
1567
|
|
1568 DEFVAR_INT ("canna-func-romaji", &canna_fn_Romaji /*
|
|
1569
|
|
1570 */ );
|
|
1571 canna_fn_Romaji = IROHA_FN_Romaji;
|
|
1572
|
|
1573 #ifdef CANNA_FN_BaseHiragana
|
|
1574 DEFVAR_INT ("canna-func-base-hiragana", &canna_fn_BaseHiragana /*
|
|
1575
|
|
1576 */ );
|
|
1577 canna_fn_BaseHiragana = CANNA_FN_BaseHiragana;
|
|
1578
|
|
1579 DEFVAR_INT ("canna-func-base-katakana", &canna_fn_BaseKatakana /*
|
|
1580
|
|
1581 */ );
|
|
1582 canna_fn_BaseKatakana = CANNA_FN_BaseKatakana;
|
|
1583
|
|
1584 DEFVAR_INT ("canna-func-base-eisu", &canna_fn_BaseEisu /*
|
|
1585
|
|
1586 */ );
|
|
1587 canna_fn_BaseEisu = CANNA_FN_BaseEisu;
|
|
1588
|
|
1589 DEFVAR_INT ("canna-func-base-zenkaku", &canna_fn_BaseZenkaku /*
|
|
1590
|
|
1591 */ );
|
|
1592 canna_fn_BaseZenkaku = CANNA_FN_BaseZenkaku;
|
|
1593
|
|
1594 DEFVAR_INT ("canna-func-base-hankaku", &canna_fn_BaseHankaku /*
|
|
1595
|
|
1596 */ );
|
|
1597 canna_fn_BaseHankaku = CANNA_FN_BaseHankaku;
|
|
1598
|
|
1599 DEFVAR_INT ("canna-func-base-kana", &canna_fn_BaseKana /*
|
|
1600
|
|
1601 */ );
|
|
1602 canna_fn_BaseKana = CANNA_FN_BaseKana;
|
|
1603
|
|
1604 DEFVAR_INT ("canna-func-base-kakutei", &canna_fn_BaseKakutei /*
|
|
1605
|
|
1606 */ );
|
|
1607 canna_fn_BaseKakutei = CANNA_FN_BaseKakutei;
|
|
1608
|
|
1609 DEFVAR_INT ("canna-func-base-henkan", &canna_fn_BaseHenkan /*
|
|
1610
|
|
1611 */ );
|
|
1612 canna_fn_BaseHenkan = CANNA_FN_BaseHenkan;
|
|
1613
|
|
1614 DEFVAR_INT ("canna-func-base-hiragana-katakana-toggle",
|
|
1615 &canna_fn_BaseHiraKataToggle /*
|
|
1616
|
|
1617 */ );
|
|
1618 canna_fn_BaseHiraKataToggle = CANNA_FN_BaseHiraKataToggle;
|
|
1619
|
|
1620 DEFVAR_INT ("canna-func-base-zenkaku-hankaku-toggle",
|
|
1621 &canna_fn_BaseZenHanToggle /*
|
|
1622
|
|
1623 */ );
|
|
1624 canna_fn_BaseZenHanToggle = CANNA_FN_BaseZenHanToggle;
|
|
1625
|
|
1626 DEFVAR_INT ("canna-func-base-kana-eisu-toggle",
|
|
1627 &canna_fn_BaseKanaEisuToggle /*
|
|
1628
|
|
1629 */ );
|
|
1630 canna_fn_BaseKanaEisuToggle = CANNA_FN_BaseKanaEisuToggle;
|
|
1631
|
|
1632 DEFVAR_INT ("canna-func-base-kakutei-henkan-toggle",
|
|
1633 &canna_fn_BaseKakuteiHenkanToggle /*
|
|
1634
|
|
1635 */ );
|
|
1636 canna_fn_BaseKakuteiHenkanToggle = CANNA_FN_BaseKakuteiHenkanToggle;
|
|
1637
|
|
1638 DEFVAR_INT ("canna-func-base-rotate-forward",
|
|
1639 &canna_fn_BaseRotateForward /*
|
|
1640
|
|
1641 */ );
|
|
1642 canna_fn_BaseRotateForward = CANNA_FN_BaseRotateForward;
|
|
1643
|
|
1644 DEFVAR_INT ("canna-func-base-rotate-backward",
|
|
1645 &canna_fn_BaseRotateBackward /*
|
|
1646
|
|
1647 */ );
|
|
1648 canna_fn_BaseRotateBackward = CANNA_FN_BaseRotateBackward;
|
|
1649
|
|
1650 #endif
|
|
1651 DEFVAR_INT ("canna-func-extend-mode", &canna_fn_ExtendMode /*
|
|
1652
|
|
1653 */ );
|
|
1654 canna_fn_ExtendMode = IROHA_FN_ExtendMode;
|
|
1655
|
|
1656 DEFVAR_INT ("canna-func-touroku", &canna_fn_Touroku /*
|
|
1657
|
|
1658 */ );
|
|
1659 canna_fn_Touroku = IROHA_FN_Touroku;
|
|
1660
|
|
1661 DEFVAR_INT ("canna-func-hex-mode", &canna_fn_HexMode /*
|
|
1662
|
|
1663 */ );
|
|
1664 canna_fn_HexMode = IROHA_FN_HexMode;
|
|
1665
|
|
1666 DEFVAR_INT ("canna-func-bushu-mode", &canna_fn_BushuMode /*
|
|
1667
|
|
1668 */ );
|
|
1669 canna_fn_BushuMode = IROHA_FN_BushuMode;
|
|
1670
|
|
1671 DEFVAR_INT ("canna-func-kigo-mode", &canna_fn_KigouMode /*
|
|
1672
|
|
1673 */ );
|
|
1674 canna_fn_KigouMode = IROHA_FN_KigouMode;
|
|
1675
|
|
1676 #ifdef CANNA_FN_Mark
|
|
1677 DEFVAR_INT ("canna-func-mark", &canna_fn_Mark /*
|
|
1678
|
|
1679 */ );
|
|
1680 canna_fn_Mark = CANNA_FN_Mark;
|
|
1681 #endif
|
|
1682 #ifdef CANNA_FN_TemporalMode
|
|
1683 DEFVAR_INT ("canna-func-temporal-mode", &canna_fn_TemporalMode /*
|
|
1684
|
|
1685 */ );
|
|
1686 canna_fn_TemporalMode = CANNA_FN_TemporalMode;
|
|
1687 #endif
|
|
1688
|
|
1689 DEFVAR_INT ("canna-key-nfer", &canna_key_Nfer /*
|
|
1690
|
|
1691 */ );
|
|
1692 canna_key_Nfer = IROHA_KEY_Nfer;
|
|
1693
|
|
1694 DEFVAR_INT ("canna-key-xfer", &canna_key_Xfer /*
|
|
1695
|
|
1696 */ );
|
|
1697 canna_key_Xfer = IROHA_KEY_Xfer;
|
|
1698
|
|
1699 DEFVAR_INT ("canna-key-up", &canna_key_Up /*
|
|
1700
|
|
1701 */ );
|
|
1702 canna_key_Up = IROHA_KEY_Up;
|
|
1703
|
|
1704 DEFVAR_INT ("canna-key-left", &canna_key_Left /*
|
|
1705
|
|
1706 */ );
|
|
1707 canna_key_Left = IROHA_KEY_Left;
|
|
1708
|
|
1709 DEFVAR_INT ("canna-key-right", &canna_key_Right /*
|
|
1710
|
|
1711 */ );
|
|
1712 canna_key_Right = IROHA_KEY_Right;
|
|
1713
|
|
1714 DEFVAR_INT ("canna-key-down", &canna_key_Down /*
|
|
1715
|
|
1716 */ );
|
|
1717 canna_key_Down = IROHA_KEY_Down;
|
|
1718
|
|
1719 DEFVAR_INT ("canna-key-insert", &canna_key_Insert /*
|
|
1720
|
|
1721 */ );
|
|
1722 canna_key_Insert = IROHA_KEY_Insert;
|
|
1723
|
|
1724 DEFVAR_INT ("canna-key-rollup", &canna_key_Rollup /*
|
|
1725
|
|
1726 */ );
|
|
1727 canna_key_Rollup = IROHA_KEY_Rollup;
|
|
1728
|
|
1729 DEFVAR_INT ("canna-key-rolldown", &canna_key_Rolldown /*
|
|
1730
|
|
1731 */ );
|
|
1732 canna_key_Rolldown = IROHA_KEY_Rolldown;
|
|
1733
|
|
1734 DEFVAR_INT ("canna-key-home", &canna_key_Home /*
|
|
1735
|
|
1736 */ );
|
|
1737 canna_key_Home = IROHA_KEY_Home;
|
|
1738
|
|
1739 DEFVAR_INT ("canna-key-help", &canna_key_Help /*
|
|
1740
|
|
1741 */ );
|
|
1742 canna_key_Help = IROHA_KEY_Help;
|
|
1743
|
|
1744 DEFVAR_INT ("canna-key-kp-key", &canna_key_KP_Key /*
|
|
1745
|
|
1746 */ );
|
|
1747 canna_key_KP_Key = IROHA_KEY_KP_Key;
|
|
1748
|
|
1749 DEFVAR_INT ("canna-key-shift-nfer", &canna_key_Shift_Nfer /*
|
|
1750
|
|
1751 */ );
|
|
1752 canna_key_Shift_Nfer = IROHA_KEY_Shift_Nfer;
|
|
1753
|
|
1754 DEFVAR_INT ("canna-key-shift-xfer", &canna_key_Shift_Xfer /*
|
|
1755
|
|
1756 */ );
|
|
1757 canna_key_Shift_Xfer = IROHA_KEY_Shift_Xfer;
|
|
1758
|
|
1759 DEFVAR_INT ("canna-key-shift-up", &canna_key_Shift_Up /*
|
|
1760
|
|
1761 */ );
|
|
1762 canna_key_Shift_Up = IROHA_KEY_Shift_Up;
|
|
1763
|
|
1764 DEFVAR_INT ("canna-key-shift-left", &canna_key_Shift_Left /*
|
|
1765
|
|
1766 */ );
|
|
1767 canna_key_Shift_Left = IROHA_KEY_Shift_Left;
|
|
1768
|
|
1769 DEFVAR_INT ("canna-key-shift-right", &canna_key_Shift_Right /*
|
|
1770
|
|
1771 */ );
|
|
1772 canna_key_Shift_Right = IROHA_KEY_Shift_Right;
|
|
1773
|
|
1774 DEFVAR_INT ("canna-key-shift-down", &canna_key_Shift_Down /*
|
|
1775
|
|
1776 */ );
|
|
1777 canna_key_Shift_Down = IROHA_KEY_Shift_Down;
|
|
1778
|
|
1779 DEFVAR_INT ("canna-key-control-nfer", &canna_key_Cntrl_Nfer /*
|
|
1780
|
|
1781 */ );
|
|
1782 canna_key_Cntrl_Nfer = IROHA_KEY_Cntrl_Nfer;
|
|
1783
|
|
1784 DEFVAR_INT ("canna-key-control-xfer", &canna_key_Cntrl_Xfer /*
|
|
1785
|
|
1786 */ );
|
|
1787 canna_key_Cntrl_Xfer = IROHA_KEY_Cntrl_Xfer;
|
|
1788
|
|
1789 DEFVAR_INT ("canna-key-control-up", &canna_key_Cntrl_Up /*
|
|
1790
|
|
1791 */ );
|
|
1792 canna_key_Cntrl_Up = IROHA_KEY_Cntrl_Up;
|
|
1793
|
|
1794 DEFVAR_INT ("canna-key-control-left", &canna_key_Cntrl_Left /*
|
|
1795
|
|
1796 */ );
|
|
1797 canna_key_Cntrl_Left = IROHA_KEY_Cntrl_Left;
|
|
1798
|
|
1799 DEFVAR_INT ("canna-key-control-right", &canna_key_Cntrl_Right /*
|
|
1800
|
|
1801 */ );
|
|
1802 canna_key_Cntrl_Right = IROHA_KEY_Cntrl_Right;
|
|
1803
|
|
1804 DEFVAR_INT ("canna-key-control-down", &canna_key_Cntrl_Down /*
|
|
1805
|
|
1806 */ );
|
|
1807 canna_key_Cntrl_Down = IROHA_KEY_Cntrl_Down;
|
|
1808
|
|
1809 Fprovide (intern ("CANNA"));
|
|
1810 }
|
|
1811
|
|
1812 #if 0
|
|
1813 #ifdef HAVE_SHLIB
|
|
1814 void unload_canna_api (void);
|
|
1815 void
|
|
1816 unload_canna_api (void)
|
|
1817 {
|
|
1818 /* We don't need to do anything here in the sample case. However, if you
|
|
1819 create any new types with INIT_LRECORD_IMPLEMENTATION (sample_type), then
|
|
1820 UNDEF_LRECORD_IMPLEMENTATION (sample_type) must appear here. Also, any
|
|
1821 symbols declared with DEFSYMBOL (Qsample_var), or one of its variants,
|
|
1822 must have a corresponding unstaticpro_nodump (&Qsample_var) here. */
|
|
1823 }
|
|
1824 #endif
|
|
1825 #endif
|
|
1826
|
|
1827 #ifdef CANNA_MULE
|
|
1828
|
3071
|
1829 /* Return the number of characters in an EUC-JP string. */
|
3010
|
1830 static int
|
3071
|
1831 euc_jp_num_chars (unsigned char *p, int l)
|
3010
|
1832 {
|
|
1833 unsigned char ch, *cp = p;
|
|
1834 int len = 0;
|
|
1835
|
|
1836 while ((cp < p + l) && (ch = *cp))
|
|
1837 {
|
|
1838 if ((unsigned char) ch == ISO_CODE_SS2)
|
|
1839 {
|
|
1840 len++;
|
|
1841 cp += 2;
|
|
1842 }
|
|
1843 else if ((unsigned char) ch == ISO_CODE_SS3)
|
|
1844 {
|
|
1845 len++;
|
|
1846 cp += 3;
|
|
1847 }
|
|
1848 else if (ch & 0x80)
|
|
1849 {
|
|
1850 len++;
|
|
1851 cp += 2;
|
|
1852 }
|
|
1853 else
|
|
1854 {
|
|
1855 len++;
|
|
1856 cp++;
|
|
1857 }
|
|
1858 }
|
|
1859 return (len);
|
|
1860 }
|
|
1861
|
|
1862 /* count number of characters */
|
|
1863 static void
|
|
1864 count_char (unsigned char *p, int len, int pos, int rev,
|
|
1865 Fixnum *clen, Fixnum *cpos, Fixnum *crev)
|
|
1866 {
|
|
1867 unsigned char *q = p;
|
|
1868
|
|
1869 *clen = *cpos = *crev = 0;
|
|
1870 if (len == 0) return;
|
|
1871 while (q < p + pos)
|
|
1872 {
|
|
1873 (*clen)++;
|
|
1874 (*cpos)++;
|
|
1875 if (*q++ & 0x80) q++;
|
|
1876 }
|
|
1877 while (q < p + pos + rev)
|
|
1878 {
|
|
1879 (*clen)++;
|
|
1880 (*crev)++;
|
|
1881 if (*q++ & 0x80) q++;
|
|
1882 }
|
|
1883 while (q < p + len)
|
|
1884 {
|
|
1885 (*clen)++;
|
|
1886 if (*q++ & 0x80) q++;
|
|
1887 }
|
|
1888 }
|
|
1889 #endif /* CANNA_MULE */
|