1 /* Copyright 1992 NEC Corporation, Tokyo, Japan.
2  *
3  * Permission to use, copy, modify, distribute and sell this software
4  * and its documentation for any purpose is hereby granted without
5  * fee, provided that the above copyright notice appear in all copies
6  * and that both that copyright notice and this permission notice
7  * appear in supporting documentation, and that the name of NEC
8  * Corporation not be used in advertising or publicity pertaining to
9  * distribution of the software without specific, written prior
10  * permission.  NEC Corporation makes no representations about the
11  * suitability of this software for any purpose.  It is provided "as
12  * is" without express or implied warranty.
13  *
14  * NEC CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
16  * NO EVENT SHALL NEC CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
18  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19  * OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20  * PERFORMANCE OF THIS SOFTWARE.
21  */
22 
23 #if !defined(lint) && !defined(__CODECENTER__)
24 static char rcs_id[] = "@(#) 102.1 $Id: empty.c,v 1.2 2003/09/17 08:50:53 aida_s Exp $";
25 #endif /* lint */
26 
27 #include "canna.h"
28 #include "patchlevel.h"
29 
30 extern KanjiModeRec yomi_mode, cy_mode;
31 
32 /* EmptySelfInsert -- ��ʬ���Ȥ����ʸ����Ȥ����֤��ؿ���
33  *
34  */
35 
36 static
inEmptySelfInsert(d)37 inEmptySelfInsert(d)
38 uiContext d;
39 {
40   yomiContext yc = (yomiContext)d->modec;
41   int res = 0;
42 
43   d->kanji_status_return->info |= KanjiThroughInfo | KanjiEmptyInfo;
44   if (!(yc->generalFlags & CANNA_YOMI_END_IF_KAKUTEI)) {
45     res = d->nbytes;
46   }
47   /* else { ����ǡ����������ԤäƤ���ͤˤϳ���ǡ������Ϥ��ʤ� } */
48 
49   return res;
50 }
51 
52 static EmptySelfInsert pro((uiContext));
53 
54 static
EmptySelfInsert(d)55 EmptySelfInsert(d)
56 uiContext d;
57 {
58   yomiContext yc = (yomiContext)d->modec;
59   int res = inEmptySelfInsert(d);
60 
61 /* ñ����Ͽ�ΤȤ��� yomi mode �γ��ꥭ���� empty mode �Ǥϳ��ꥭ���Ǥ�
62    ���ä��ꤹ��ȡ����Υ����β����ǻ��Ǥ��ޤä��ꤹ��Τεߺѡ�yomi
63    mode �ξ�� yomi mode ����äƤ���Τ�ñ����Ͽ�λ����餤�����ȸ�
64    �����Ȥ�Ƚ�Ǥκ����ˤ��Ƥ��롣�����Ϥ���ʤ��Ȥ�ꤿ���ʤ��� */
65 
66   if (yc->next && yc->next->id == YOMI_CONTEXT &&
67       yomi_mode.keytbl[d->buffer_return[0]] == CANNA_FN_Kakutei) {
68     d->status = EXIT_CALLBACK;
69     if (d->cb->func[EXIT_CALLBACK] != NO_CALLBACK) {
70       d->kanji_status_return->info &= ~KanjiThroughInfo; /* �Ż����� */
71       popYomiMode(d);
72     }
73   }
74   return res;
75 }
76 
77 /* EmptyYomiInsert -- ���⡼�ɤ˰ܹԤ����ɤߤ����Ϥ���ؿ�
78  *
79  */
80 
81 static EmptyYomiInsert pro((uiContext));
82 
83 static
EmptyYomiInsert(d)84 EmptyYomiInsert(d)
85 uiContext d;
86 {
87   yomiContext yc = (yomiContext)d->modec;
88 
89   d->current_mode = (yc->generalFlags & CANNA_YOMI_CHIKUJI_MODE) ?
90     &cy_mode : &yomi_mode;
91   RomajiClearYomi(d);
92   return YomiInsert(d); /* ������Хå��Υ����å��� YomiInsert �Ǥ���� */
93 }
94 
95 /* EmptyQuotedInsert -- ���ΰ�����ɤΤ褦��ʸ���Ǥ⥹�롼���̤��ؿ���
96  *
97  */
98 
99 /*
100   Empty �⡼�ɤǤ� quotedInset �� ^Q �Τ褦��ʸ������� Emacs �ʤɤ���
101   ���̤äƤ��ޤ��Хޥåפ��֤��Ƥ��ޤ��Τǡ����ʴ����Ѵ������Dz�����
102   ����ʤ�Ƥ��Ȥ�ɬ�פʤ��ΤǤϤʤ��Τ��ʤ���
103  */
104 
105 static EmptyQuotedInsert pro((uiContext));
106 
107 static
EmptyQuotedInsert(d)108 EmptyQuotedInsert(d)
109 uiContext d;
110 {
111   yomiContext yc = (yomiContext)d->modec;
112 
113   d->current_mode = (yc->generalFlags & CANNA_YOMI_CHIKUJI_MODE) ?
114     &cy_mode : &yomi_mode;
115   return YomiQuotedInsert(d);
116 }
117 
118 /*
119   AlphaSelfInsert -- ��ʬ���Ȥ����ʸ����Ȥ����֤��ؿ���
120  */
121 
122 static AlphaSelfInsert pro((uiContext));
123 
124 static
AlphaSelfInsert(d)125 AlphaSelfInsert(d)
126 uiContext d;
127 {
128   unsigned kanap = (unsigned)d->ch;
129 
130   d->kanji_status_return->length = 0;
131   d->kanji_status_return->info |= KanjiEmptyInfo;
132   d->kanji_status_return->info |= KanjiThroughInfo;
133   if ( d->nbytes != 1 || kanap <= 0xa0 || 0xe0 <= kanap ) {
134     return d->nbytes;
135   }
136   else { /* ��̾�������Ϥξ�� */
137     if (d->n_buffer > 1) {
138       return 1;
139     }
140     else {
141       return 0;
142     }
143   }
144 }
145 
146 static AlphaNop pro((uiContext));
147 
148 static
AlphaNop(d)149 AlphaNop(d)
150 uiContext d;
151 {
152   /* currentModeInfo �ǥ⡼�ɾ���ɬ���֤�褦�˥��ߡ��Υ⡼�ɤ�����Ƥ��� */
153   d->majorMode = d->minorMode = CANNA_MODE_KigoMode;
154   currentModeInfo(d);
155   return 0;
156 }
157 
158 static EmptyQuit pro((uiContext));
159 
160 static
EmptyQuit(d)161 EmptyQuit(d)
162 uiContext d;
163 {
164   int res;
165 
166   res = inEmptySelfInsert(d);
167   d->status = QUIT_CALLBACK;
168   if (d->cb->func[QUIT_CALLBACK] != NO_CALLBACK) {
169     d->kanji_status_return->info &= ~KanjiThroughInfo; /* �Ż����� */
170     popYomiMode(d);
171   }
172   return res;
173 }
174 
175 static EmptyKakutei pro((uiContext));
176 
177 static
EmptyKakutei(d)178 EmptyKakutei(d)
179 uiContext d;
180 {
181   int res;
182 
183   res = inEmptySelfInsert(d);
184   d->status = EXIT_CALLBACK;
185   if (d->cb->func[EXIT_CALLBACK] != NO_CALLBACK) {
186     d->kanji_status_return->info &= ~KanjiThroughInfo; /* �Ż����� */
187     popYomiMode(d);
188   }
189   return res;
190 }
191 
192 static EmptyDeletePrevious pro((uiContext));
193 
194 static
EmptyDeletePrevious(d)195 EmptyDeletePrevious(d)
196 uiContext d;
197 {
198   yomiContext yc = (yomiContext)d->modec;
199 
200   if (yc->generalFlags & CANNA_YOMI_DELETE_DONT_QUIT) {
201     /* Delete �� QUIT ���ʤ��ΤǤ���С�selfInsert */
202     return inEmptySelfInsert(d);
203   }
204   else {
205     return EmptyQuit(d);
206   }
207 }
208 
209 extraFunc *
FindExtraFunc(fnum)210 FindExtraFunc(fnum)
211 int fnum;
212 {
213   extern extraFunc *extrafuncp;
214   extraFunc *extrafunc;
215 
216   for (extrafunc = extrafuncp; extrafunc; extrafunc = extrafunc->next) {
217     if (extrafunc->fnum == fnum) {
218       return extrafunc;
219     }
220   }
221   return (extraFunc *)0;
222 }
223 
224 static
UserMode(d,estruct)225 UserMode(d, estruct)
226 uiContext d;
227 extraFunc *estruct;
228 {
229   newmode *nmode = estruct->u.modeptr;
230   yomiContext yc = (yomiContext)d->modec;
231   int modeid
232     = estruct->fnum - CANNA_FN_MAX_FUNC + CANNA_MODE_MAX_IMAGINARY_MODE;
233 
234   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
235     return NothingChangedWithBeep(d);
236   }
237 
238   yc->generalFlags &= ~CANNA_YOMI_ATTRFUNCS;
239   yc->generalFlags |= nmode->flags;
240   if (yc->generalFlags & CANNA_YOMI_END_IF_KAKUTEI) {
241     /* ����ǽ����褦�ʥ⡼�ɤ��ä������⡼�ɤˤʤ�ʤ� */
242     yc->generalFlags &= ~CANNA_YOMI_KAKUTEI;
243   }
244   yc->romdic = nmode->romdic;
245   d->current_mode = yc->myEmptyMode = nmode->emode;
246 
247   yc->majorMode = yc->minorMode = yc->myMinorMode = (BYTE)modeid;
248 
249   currentModeInfo(d);
250 
251   d->kanji_status_return->length = 0;
252   return 0;
253 }
254 
255 #ifndef NO_EXTEND_MENU /* continues to the bottom of this file */
256 static
UserSelect(d,estruct)257 UserSelect(d, estruct)
258 uiContext d;
259 extraFunc *estruct;
260 {
261   int curkigo = 0, *posp = (int *)0;
262   kigoIchiran *kigop = (kigoIchiran *)0;
263   extern int uuKigoGeneralExitCatch(), uuKigoMake();
264   selectinfo *selinfo = (selectinfo *)0, *info;
265   yomiContext yc = (yomiContext)d->modec;
266 
267   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
268     return NothingChangedWithBeep(d);
269   }
270   info = d->selinfo;
271   while (info) {
272     if (info->ichiran == estruct->u.kigoptr) {
273       selinfo = info;
274       break;
275     }
276     info = info->next;
277   }
278 
279   if (!selinfo) {
280     selinfo = (selectinfo *)malloc(sizeof(selectinfo));
281     /* malloc �˼��Ԥ������ϡ������������ֹ椬��¸����ʤ� */
282     if (selinfo) {
283       selinfo->ichiran = estruct->u.kigoptr;
284       selinfo->curnum = 0;
285       selinfo->next = d->selinfo;
286       d->selinfo = selinfo;
287     }
288   }
289 
290   if (selinfo) {
291     curkigo = selinfo->curnum;
292     posp = &selinfo->curnum;
293   }
294 
295   kigop = estruct->u.kigoptr;
296   if (!kigop) {
297     return NothingChangedWithBeep(d);
298   }
299   return uuKigoMake(d, kigop->kigo_data, kigop->kigo_size,
300                     curkigo, kigop->kigo_mode, uuKigoGeneralExitCatch, posp);
301 }
302 
303 static
UserMenu(d,estruct)304 UserMenu(d, estruct)
305 uiContext d;
306 extraFunc *estruct;
307 {
308   return showmenu(d, estruct->u.menuptr);
309 }
310 #endif /* NO_EXTEND_MENU */
311 
312 /* �ǥե���Ȱʳ��Υ⡼�ɻ��ѻ��˸ƤӽФ��ؿ����ڤ�ʬ���� */
313 
314 static
ProcExtraFunc(d,fnum)315 ProcExtraFunc(d, fnum)
316 uiContext d;
317 int fnum;
318 {
319   extraFunc *extrafunc;
320 
321   extrafunc = FindExtraFunc(fnum);
322   if (extrafunc) {
323     switch (extrafunc->keyword) {
324       case EXTRA_FUNC_DEFMODE:
325         return UserMode(d, extrafunc);
326 #ifndef NO_EXTEND_MENU
327       case EXTRA_FUNC_DEFSELECTION:
328         return UserSelect(d, extrafunc);
329       case EXTRA_FUNC_DEFMENU:
330         return UserMenu(d, extrafunc);
331 #endif
332       default:
333         break;
334     }
335   }
336   return NothingChangedWithBeep(d);
337 }
338 
getBaseMode(yc)339 getBaseMode(yc)
340 yomiContext yc;
341 {
342   int res;
343   long fl = yc->generalFlags;
344 
345   if (yc->myMinorMode) {
346     return yc->myMinorMode;
347   }
348   else if (fl & CANNA_YOMI_ROMAJI) {
349     res = CANNA_MODE_ZenAlphaHenkanMode;
350   }
351   else if (fl & CANNA_YOMI_KATAKANA) {
352     res = CANNA_MODE_ZenKataHenkanMode;
353   }
354   else {
355     res = CANNA_MODE_ZenHiraHenkanMode;
356   }
357   if (fl & CANNA_YOMI_BASE_HANKAKU) {
358     res++;
359   }
360   if (fl & CANNA_YOMI_KAKUTEI) {
361     res += CANNA_MODE_ZenHiraKakuteiMode - CANNA_MODE_ZenHiraHenkanMode;
362   }
363   if (res == CANNA_MODE_ZenHiraHenkanMode) {
364     if (chikujip(yc)) {
365       res = CANNA_MODE_ChikujiYomiMode;
366     }
367     else {
368       res = CANNA_MODE_HenkanMode;
369     }
370   }
371   return res;
372 }
373 
374 /* �١���ʸ�����ڤ��ؤ� */
375 
376 void
EmptyBaseModeInfo(d,yc)377 EmptyBaseModeInfo(d, yc)
378 uiContext d;
379 yomiContext yc;
380 {
381   coreContext cc = (coreContext)d->modec;
382 
383   cc->minorMode = getBaseMode(yc);
384   currentModeInfo(d);
385 }
386 
EmptyBaseHira(d)387 EmptyBaseHira(d)
388 uiContext d;
389 {
390   yomiContext yc = (yomiContext)d->modec;
391 
392   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
393     return NothingChangedWithBeep(d);
394   }
395   yc->generalFlags &= ~(CANNA_YOMI_KATAKANA | CANNA_YOMI_HANKAKU |
396 			CANNA_YOMI_ROMAJI | CANNA_YOMI_ZENKAKU);
397   EmptyBaseModeInfo(d, yc);
398   return 0;
399 }
400 
EmptyBaseKata(d)401 EmptyBaseKata(d)
402 uiContext d;
403 {
404   yomiContext yc = (yomiContext)d->modec;
405 
406   if ((yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED)
407       || (cannaconf.InhibitHankakuKana
408 	  && (yc->generalFlags & CANNA_YOMI_BASE_HANKAKU))) {
409     return NothingChangedWithBeep(d);
410   }
411   yc->generalFlags &= ~(CANNA_YOMI_ROMAJI | CANNA_YOMI_ZENKAKU);
412   yc->generalFlags |= CANNA_YOMI_KATAKANA |
413     ((yc->generalFlags & CANNA_YOMI_BASE_HANKAKU) ? CANNA_YOMI_HANKAKU : 0);
414   EmptyBaseModeInfo(d, yc);
415   return 0;
416 }
417 
EmptyBaseEisu(d)418 EmptyBaseEisu(d)
419 uiContext d;
420 {
421   yomiContext yc = (yomiContext)d->modec;
422 
423   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
424     return NothingChangedWithBeep(d);
425   }
426 /*  yc->generalFlags &= ~CANNA_YOMI_ATTRFUNCS; ���ꥢ����Τ�� */
427   yc->generalFlags |= CANNA_YOMI_ROMAJI |
428     ((yc->generalFlags & CANNA_YOMI_BASE_HANKAKU) ? 0 : CANNA_YOMI_ZENKAKU);
429   EmptyBaseModeInfo(d, yc);
430   return 0;
431 }
432 
EmptyBaseZen(d)433 EmptyBaseZen(d)
434 uiContext d;
435 {
436   yomiContext yc = (yomiContext)d->modec;
437 
438   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
439     return NothingChangedWithBeep(d);
440   }
441   yc->generalFlags &= ~CANNA_YOMI_BASE_HANKAKU;
442   if (yc->generalFlags & CANNA_YOMI_ROMAJI) {
443     yc->generalFlags |= CANNA_YOMI_ZENKAKU;
444   }
445   /* ���� ���޻��⡼�ɤǤ��ĥ������ʥ⡼�ɤλ�������
446           (���ξ��ɽ�̾�ϥ��޻��⡼��) */
447   if (yc->generalFlags & CANNA_YOMI_KATAKANA) {
448     yc->generalFlags &= ~CANNA_YOMI_HANKAKU;
449   }
450   EmptyBaseModeInfo(d, yc);
451   return 0;
452 }
453 
EmptyBaseHan(d)454 EmptyBaseHan(d)
455 uiContext d;
456 {
457   yomiContext yc = (yomiContext)d->modec;
458 
459   if ((yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) ||
460       /* �⡼���ѹ����ػߤ���Ƥ���Ȥ� */
461       (cannaconf.InhibitHankakuKana &&
462        (yc->generalFlags & CANNA_YOMI_KATAKANA) &&
463        !(yc->generalFlags & CANNA_YOMI_ROMAJI))) {
464     /* Ⱦ�ѥ��ʤ��ػߤ���Ƥ���Τ�Ⱦ�ѥ��ʤˤ��������ʤȤ� */
465     return NothingChangedWithBeep(d);
466   }
467   yc->generalFlags |= CANNA_YOMI_BASE_HANKAKU;
468   if (yc->generalFlags & CANNA_YOMI_ROMAJI) {
469     yc->generalFlags &= ~CANNA_YOMI_ZENKAKU;
470   }
471   /* ���� ���޻��⡼�ɤǤ��ĥ������ʥ⡼�ɤλ�������
472           (���ξ��ɽ�̾�ϥ��޻��⡼��) */
473   if (yc->generalFlags & CANNA_YOMI_KATAKANA) {
474     if (!cannaconf.InhibitHankakuKana) {
475       yc->generalFlags |= CANNA_YOMI_HANKAKU;
476     }
477   }
478   EmptyBaseModeInfo(d, yc);
479   return 0;
480 }
481 
EmptyBaseKana(d)482 EmptyBaseKana(d)
483 uiContext d;
484 {
485   yomiContext yc = (yomiContext)d->modec;
486 
487   if ((yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) ||
488       /* �⡼���ѹ����ػߤ���Ƥ����� */
489       (!cannaconf.InhibitHankakuKana &&
490        (yc->generalFlags & CANNA_YOMI_KATAKANA) &&
491        (yc->generalFlags & CANNA_YOMI_BASE_HANKAKU))) {
492     /* Ⱦ�ѥ��ʤ��ػߤ���Ƥ���Τ�Ⱦ�ѥ��ʤˤʤäƤ��ޤ������ʾ�� */
493     return NothingChangedWithBeep(d);
494   }
495   yc->generalFlags &= ~(CANNA_YOMI_ROMAJI | CANNA_YOMI_ZENKAKU);
496 
497   if ((yc->generalFlags & CANNA_YOMI_BASE_HANKAKU) &&
498       (yc->generalFlags & CANNA_YOMI_KATAKANA)) {
499     yc->generalFlags |= CANNA_YOMI_HANKAKU;
500   }
501   EmptyBaseModeInfo(d, yc);
502   return 0;
503 }
504 
EmptyBaseKakutei(d)505 EmptyBaseKakutei(d)
506 uiContext d;
507 {
508   yomiContext yc = (yomiContext)d->modec;
509 
510   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
511     return NothingChangedWithBeep(d);
512   }
513   yc->generalFlags |= CANNA_YOMI_KAKUTEI;
514 
515   EmptyBaseModeInfo(d, yc);
516   return 0;
517 }
518 
EmptyBaseHenkan(d)519 EmptyBaseHenkan(d)
520 uiContext d;
521 {
522   yomiContext yc = (yomiContext)d->modec;
523 
524   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
525     return NothingChangedWithBeep(d);
526   }
527   yc->generalFlags &= ~CANNA_YOMI_KAKUTEI;
528 
529   EmptyBaseModeInfo(d, yc);
530   return 0;
531 }
532 
533 #ifndef NO_EXTEND_MENU
534 static int
renbunInit(d)535 renbunInit(d)
536 uiContext d;
537 {
538   yomiContext yc = (yomiContext)d->modec;
539 
540   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
541     return NothingChangedWithBeep(d);
542   }
543   d->status = 0;
544   killmenu(d);
545   if (ToggleChikuji(d, 0) == -1) {
546     jrKanjiError = "\317\242\312\270\300\341\312\321\264\271\244\313\300\332"
547 	"\302\330\244\250\244\353\244\263\244\310\244\254\244\307\244\255"
548 	"\244\336\244\273\244\363";
549                    /* Ϣʸ���Ѵ������ؤ��뤳�Ȥ��Ǥ��ޤ��� */
550     makeGLineMessageFromString(d, jrKanjiError);
551     currentModeInfo(d);
552     return(-1);
553   }
554   else {
555     makeGLineMessageFromString(d, "\317\242\312\270\300\341\312\321\264\271"
556 	"\244\313\300\332\302\330\244\250\244\336\244\267\244\277");
557                    /* Ϣʸ���Ѵ������ؤ��ޤ��� */
558     currentModeInfo(d);
559     return 0;
560   }
561 }
562 
563 static int
showVersion(d)564 showVersion(d)
565 uiContext d;
566 {
567   int retval = 0;
568   char s[512];
569   yomiContext yc = (yomiContext)d->modec;
570 
571   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
572     return NothingChangedWithBeep(d);
573   }
574   d->status = 0;
575   killmenu(d);
576 
577   sprintf(s, "\306\374\313\334\270\354\306\376\316\317\245\267\245\271\245\306"
578 	"\245\340\241\330\244\253\244\363\244\312\241\331Version %d.%d",
579 	  cannaconf.CannaVersion / 1000, cannaconf.CannaVersion % 1000);
580              /* ���ܸ����ϥ����ƥ�ؤ���ʡ� */
581   strcat(s, CANNA_PATCH_LEVEL);
582   makeGLineMessageFromString(d, s);
583   currentModeInfo(d);
584 
585   return (retval);
586 }
587 
588 static int
showServer(d)589 showServer(d)
590 uiContext d;
591 {
592 #ifndef STANDALONE /* This is not used in Windows environment 1996.7.30 kon */
593   int retval = 0;
594   char s[512];
595   extern defaultContext;
596   yomiContext yc = (yomiContext)d->modec;
597 
598   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
599     return NothingChangedWithBeep(d);
600   }
601   d->status = 0;
602   killmenu(d);
603 
604   if(defaultContext == -1) {
605     sprintf(s, "\244\253\244\312\264\301\273\372\312\321\264\271\245\265"
606 	"\241\274\245\320\244\310\244\316\300\334\302\263\244\254\300\332"
607 	"\244\354\244\306\244\244\244\336\244\271");
608                /* ���ʴ����Ѵ������ФȤ���³���ڤ�Ƥ��ޤ� */
609   }
610   else {
611     sprintf(s, "%s \244\316\244\253\244\312\264\301\273\372\312\321\264\271"
612 	"\245\265\241\274\245\320\244\313\300\334\302\263\244\267\244\306"
613 	"\244\244\244\336\244\271", RkwGetServerName());
614                /* �Τ��ʴ����Ѵ������Ф���³���Ƥ��ޤ� */
615   }
616   makeGLineMessageFromString(d, s);
617   currentModeInfo(d);
618 
619   return (retval);
620 #else
621   return (0);
622 #endif /* STANDALONE */
623 }
624 
625 static int
showGakushu(d)626 showGakushu(d)
627 uiContext d;
628 {
629   int retval = 0;
630   yomiContext yc = (yomiContext)d->modec;
631 
632   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
633     return NothingChangedWithBeep(d);
634   }
635   d->status = 0;
636   killmenu(d);
637 
638   if (cannaconf.Gakushu == 1) {
639     makeGLineMessageFromString(d, "\263\330\275\254\244\254\243\317\243\316"
640 	"\244\316\276\365\302\326\244\307\244\271");
641                                   /* �ؽ����ϣΤξ��֤Ǥ� */
642   }
643   else {
644     makeGLineMessageFromString(d, "\263\330\275\254\244\254\243\317\243\306"
645 	"\243\306\244\316\276\365\302\326\244\307\244\271");
646                                   /* �ؽ����ϣƣƤξ��֤Ǥ� */
647   }
648     currentModeInfo(d);
649 
650   return (retval);
651 }
652 
653 static int
showInitFile(d)654 showInitFile(d)
655 uiContext d;
656 {
657   int retval = 0;
658   char s[512];
659   extern char *CANNA_initfilename;
660   yomiContext yc = (yomiContext)d->modec;
661 
662   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
663     return NothingChangedWithBeep(d);
664   }
665   d->status = 0;
666   killmenu(d);
667 
668   if (CANNA_initfilename && strlen(CANNA_initfilename)) {
669     sprintf(s, "\245\253\245\271\245\277\245\336\245\244\245\272\245\325"
670 	"\245\241\245\244\245\353\244\317 %s \244\362\273\310\315\321\244\267"
671 	"\244\306\244\244\244\336\244\271", CANNA_initfilename);
672                /* �������ޥ����ե������ %s ����Ѥ��Ƥ��ޤ� */
673     makeGLineMessageFromString(d, s);
674   }
675   else {
676     sprintf(s, "\245\253\245\271\245\277\245\336\245\244\245\272\245\325"
677 	"\245\241\245\244\245\353\244\317\300\337\304\352\244\265\244\354"
678 	"\244\306\244\244\244\336\244\273\244\363");
679                /* �������ޥ����ե���������ꤵ��Ƥ��ޤ��� */
680     makeGLineMessageFromString(d, s);
681   }
682     currentModeInfo(d);
683 
684   return (retval);
685 }
686 
687 static int
showRomkanaFile(d)688 showRomkanaFile(d)
689 uiContext d;
690 {
691   int retval = 0;
692   char s[512];
693   extern char *RomkanaTable;
694   yomiContext yc = (yomiContext)d->modec;
695 
696   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
697     return NothingChangedWithBeep(d);
698   }
699   d->status = 0;
700   killmenu(d);
701 
702   if (RomkanaTable && romajidic) {
703     sprintf(s, "\245\355\241\274\245\336\273\372\244\253\244\312\312\321"
704 	"\264\271\245\306\241\274\245\326\245\353\244\317 %s \244\362\273\310"
705 	"\315\321\244\267\244\306\244\244\244\336\244\271",
706 	    RomkanaTable);
707                /* ���޻������Ѵ��ơ��֥�� %s ����Ѥ��Ƥ��ޤ� */
708     makeGLineMessageFromString(d, s);
709   }
710   else {
711     sprintf(s, "\245\355\241\274\245\336\273\372\244\253\244\312\312\321"
712 	"\264\271\245\306\241\274\245\326\245\353\244\317\273\310\315\321"
713 	"\244\265\244\354\244\306\244\244\244\336\244\273\244\363");
714                /* ���޻������Ѵ��ơ��֥�ϻ��Ѥ���Ƥ��ޤ��� */
715     makeGLineMessageFromString(d, s);
716   }
717     currentModeInfo(d);
718 
719   return (retval);
720 }
721 
722 static int
dicSync(d)723 dicSync(d)
724 uiContext d;
725 {
726   int retval = 0;
727   char s[512];
728   extern defaultContext;
729   yomiContext yc = (yomiContext)d->modec;
730 
731   if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
732     return NothingChangedWithBeep(d);
733   }
734   d->status = 0;
735   killmenu(d);
736 
737   retval = RkwSync(defaultContext, "");
738   sprintf(s, "\274\255\275\361\244\316 Sync \275\350\315\375%s",
739           retval < 0 ? "\244\313\274\272\307\324\244\267\244\336\244\267"
740 	"\244\277" : "\244\362\271\324\244\244\244\336\244\267\244\277");
741           /* ����� Sync ����%s",
742                 retval < 0 ? "�˼��Ԥ��ޤ���" : "��Ԥ��ޤ��� */
743   makeGLineMessageFromString(d, s);
744   currentModeInfo(d);
745 
746   return 0;
747 }
748 #endif /* not NO_EXTEND_MENU */
749 
750 #include "emptymap.h"
751 #include "alphamap.h"
752