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/************************************************************************/
24/* THIS SOURCE CODE IS MODIFIED FOR TKO BY T.MURAI 1997
25/************************************************************************/
26
27
28#if !defined(lint) && !defined(__CODECENTER__)
29static	char	rcs_id[] = "@(#) 102.1 $Id: kigo.c 14875 2005-11-12 21:25:31Z bonefish $";
30#endif /* lint */
31
32#include	"canna.h"
33
34#define BYTE1		84	/* JIS������������������������������������������������ */
35#define BYTE2		94	/* JIS������������������������������������������������ */
36#define KIGOSU		(((BYTE1 - 1) * BYTE2) + 4)
37    				/* �������������������� */
38
39#define KIGOSIZE	1	/* �������������������������������� */
40#define KIGOCOLS	2	/* ������������������������������������ */
41#define KIGOSPACE	2	/* �������������������������������������������������������� */
42#define KIGOWIDTH	(KIGOCOLS + KIGOSPACE)
43					/* bangomax������������������������������������ */
44
45#define NKAKKOCHARS	1	/* JIS������������������������������������������������ */
46#define KAKKOCOLS       2       /* �������������������� */
47#define NKCODECHARS	4	/* JIS���������������������������������������������������� */
48#define KCODECOLS       4       /* �������������������� */
49/* JIS�������������������������������������������� */
50#define NKCODEALLCHARS	(NKAKKOCHARS + NKAKKOCHARS + NKCODECHARS)
51/* �������������������� */
52#define KCODEALLCOLS    (KAKKOCOLS + KAKKOCOLS + KCODECOLS)
53
54static void freeKigoContext(ichiranContext kc);
55static void makeKigoGlineStatus(uiContext d);
56static int makeKigoInfo(uiContext d, int headkouho);
57static int kigoIchiranExitCatch(uiContext d, int retval, mode_context env);
58static int kigoIchiranQuitCatch(uiContext d, int retval, mode_context env);
59static int KigoNop(uiContext d);
60static int KigoForwardKouho(uiContext d);
61static int KigoBackwardKouho(uiContext d);
62static int KigoPreviousKouhoretsu(uiContext d);
63static int KigoNextKouhoretsu(uiContext d);
64static int KigoBeginningOfKouho(uiContext d);
65static int KigoEndOfKouho(uiContext d);
66static int KigoKakutei(uiContext d);
67static int KigoBangoKouho(uiContext d);
68static int KigoQuit(uiContext d);
69
70static int kigo_curIkouho;
71
72void
73initKigoTable(void)
74{
75}
76
77/* cfunc ichiranContext
78 *
79 * ichiranContext
80 *
81 */
82inline void
83clearKigoContext(ichiranContext p)
84{
85  p->id = ICHIRAN_CONTEXT;
86  p->svIkouho = 0;
87  p->curIkouho = 0;
88  p->nIkouho = 0;
89  p->tooSmall = 0;
90  p->curIchar = 0;
91  p->allkouho = 0;
92  p->glinebufp = 0;
93  p->kouhoifp = (kouhoinfo *)0;
94  p->glineifp = (glineinfo *)0;
95  p->flags = (unsigned char)0;
96}
97
98inline ichiranContext
99newKigoContext(void)
100{
101  ichiranContext kcxt;
102
103  if((kcxt = (ichiranContext)malloc(sizeof(ichiranContextRec)))
104                                         == (ichiranContext)NULL) {
105#ifndef WIN
106    jrKanjiError = "malloc (newKigoContext) ��������������������������������";
107#else
108    jrKanjiError = "malloc (newKigoContext) \244\307\244\255\244\336\244\273"
109	"\244\363\244\307\244\267\244\277";
110#endif
111    return (ichiranContext)0;
112  }
113  clearKigoContext(kcxt);
114
115  return kcxt;
116}
117
118
119#ifdef	SOMEONE_USES_THIS
120static void
121freeKigoContext(ichiranContext kc)
122{
123  free(kc);
124}
125#endif	/* SOMEONE_USES_THIS */
126
127/*
128 * ��������������������������������
129 */
130inline
131int getKigoContext(uiContext d, canna_callback_t everyTimeCallback, canna_callback_t exitCallback, canna_callback_t quitCallback, canna_callback_t auxCallback)
132{
133  extern KanjiModeRec kigo_mode;
134  ichiranContext kc;
135  int retval = 0;
136
137  if(pushCallback(d, d->modec,
138	everyTimeCallback, exitCallback, quitCallback, auxCallback) == 0) {
139    jrKanjiError = "malloc (pushCallback) \244\307\244\255\244\336\244\273"
140	"\244\363\244\307\244\267\244\277";
141                                         /* �������������������������������� */
142    return(NG);
143  }
144
145  if((kc = newKigoContext()) == (ichiranContext)NULL) {
146    popCallback(d);
147    return(NG);
148  }
149  kc->next = d->modec;
150  d->modec = (mode_context)kc;
151
152  kc->prevMode = d->current_mode;
153  d->current_mode = &kigo_mode;
154
155  return(retval);
156}
157
158#ifndef NO_EXTEND_MENU
159inline void
160popKigoMode(uiContext d)
161{
162  ichiranContext kc = (ichiranContext)d->modec;
163
164  d->modec = kc->next;
165  d->current_mode = kc->prevMode;
166  freeIchiranContext(kc);
167}
168
169/*
170 * ��������������������������������������������������������������������������������
171 *
172 * �������������������������������������������� kouhoinfo ���� glineinfo ����������������������������������������
173 * ����������������������������������������������������������������������������������������
174 *
175 * ������������	RomeStruct
176 * ������������	��������
177 */
178static void
179makeKigoGlineStatus(uiContext d)
180{
181  ichiranContext kc = (ichiranContext)d->modec;
182  WCHAR_T *gptr;
183  char xxx[3];
184  char *yyy = xxx;
185  int  i, b1, b2;
186
187  gptr = kc->glineifp->gldata + NKAKKOCHARS;
188
189  /* ����������������������������JIS������������������������������������������������������������������������ */
190  WCstombs(xxx, kc->kouhoifp[*(kc->curIkouho)].khdata, 3);
191
192  for(i=0; i<2; i++, yyy++) {
193    b1 = (((unsigned long)*yyy & 0x7f) >> 4);
194    b2 = (*yyy & 0x0f);
195    *gptr++ = b1 + ((b1 > 0x09) ? ('a' - 10) : '0');
196    *gptr++ = b2 + ((b2 > 0x09) ? ('a' - 10) : '0');
197  }
198
199  d->kanji_status_return->info |= KanjiGLineInfo;
200  d->kanji_status_return->gline.line = kc->glineifp->gldata;
201  d->kanji_status_return->gline.length = kc->glineifp->gllen;
202  d->kanji_status_return->gline.revPos =
203    kc->kouhoifp[*(kc->curIkouho)].khpoint;
204  d->kanji_status_return->gline.revLen = KIGOSIZE;
205
206}
207
208/* ������������������������glineinfo����kouhoinfo������������
209 *
210 * ����glineinfo����
211 *    int glkosu   : int glhead     : int gllen  : WCHAR_T *gldata
212 *    ������������������������ : ��������������������     : �������������������� : ������������������������������������
213 *                 : ���������������������������� :
214 * -------------------------------------------------------------------------
215 * 0 | 6           : 0              : 24         : ������������������������������������������������
216 *
217 *  ����kouhoinfo����
218 *    int khretsu  : int khpoint  : WCHAR_T *khdata
219 *    ������������       : ������������������������ : ��������������������
220 *                 : ������������������������ :
221 * -------------------------------------------------------------------------
222 * 0 | 0           : 0            : ����
223 * 1 | 0           : 4            : ����
224 * 2 | 0           : 8            : ����
225 *          :               :
226 *
227 * ������������	headkouho	��������������������������������������������������������������������
228 *					(2121������������������������(2121����������������))
229 *		uiContext
230 * ������������	�������������������� 0
231 */
232static
233int makeKigoInfo(uiContext d, int headkouho)
234{
235  ichiranContext kc = (ichiranContext)d->modec;
236  WCHAR_T *gptr;
237  int  i, b1, b2, lnko, cn;
238  int  byte1hex = 0xa1;
239  int  byte2hex = 0xa1;
240  char xxx[3];
241
242  b2 = headkouho % BYTE2;	/* JIS��������������������(��������)������������ (����-1) */
243  b1 = headkouho / BYTE2;	/* JIS��������������������(��������)������������ (����-1) */
244
245  xxx[2] = '\0';
246
247#if defined(DEBUG) && !defined(WIN)
248  if (iroha_debug) {
249    printf("kigoinfo = bangomax %d, b1 %d, b2 %d\n", kc->nIkouho, b1, b2);
250    printf("kigoinfo = headkouho %d, curIkouho %d\n",
251	   headkouho, *(kc->curIkouho));
252  }
253#endif
254
255  /* ������������������������glineinfo����kouhoinfo������������ */
256  gptr = kc->glinebufp;
257
258  kc->glineifp->glhead = headkouho;
259  kc->glineifp->gldata = gptr;
260
261  /* JIS���������������������������������������������������������������� */
262  MBstowcs(gptr, "\241\316", 1);
263                 /* ���� */
264  for(i=0, gptr++; i<NKCODECHARS; i++)
265    *gptr++ = ' ';
266  MBstowcs(gptr++, "\241\317", 1);
267                 /* ���� */
268
269  for(cn=NKCODEALLCHARS, lnko=0;
270      b1<BYTE1 && lnko<kc->nIkouho && (headkouho+lnko)<KIGOSU ; b1++) {
271    for(; b2<BYTE2 && lnko<kc->nIkouho && (headkouho+lnko)<KIGOSU; b2++, lnko++) {
272
273      /* �������������������������������������������������������� */
274      if(lnko != 0) {
275	MBstowcs(gptr++, "\241\241", 1);
276                         /* ���� */
277	cn ++;
278      }
279
280      kc->kouhoifp[lnko].khpoint = cn;
281      kc->kouhoifp[lnko].khdata = gptr;
282
283      /* �������������������������������� */
284      *xxx = (char)byte1hex + b1;
285      *(xxx + 1) = (char)byte2hex + b2;
286      MBstowcs(gptr++, xxx, 1);
287      cn ++;
288    }
289    b2 = 0;
290  }
291  *gptr = (WCHAR_T)0;
292  kc->glineifp->glkosu = lnko;
293  kc->glineifp->gllen = WStrlen(kc->glineifp->gldata);
294
295  return(0);
296}
297
298/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
299 * ����������������                                                                  *
300 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
301
302static
303int kigoIchiranExitCatch(uiContext d, int retval, mode_context env)
304     /* ARGSUSED */
305{
306  popCallback(d);
307  retval = YomiExit(d, retval);
308  currentModeInfo(d);
309
310  killmenu(d);
311
312  return(retval);
313}
314
315static
316int kigoIchiranQuitCatch(uiContext d, int retval, mode_context env)
317     /* ARGSUSED */
318{
319  popCallback(d);
320  currentModeInfo(d);
321
322  return prevMenuIfExist(d);
323}
324#endif /* NO_EXTEND_MENU */
325
326int KigoIchiran(uiContext d)
327{
328  yomiContext yc = (yomiContext)d->modec;
329
330  if (yc->generalFlags & CANNA_YOMI_CHGMODE_INHIBITTED) {
331    return NothingChangedWithBeep(d);
332  }
333
334#ifdef NO_EXTEND_MENU
335  d->kanji_status_return->info |= KanjiKigoInfo;
336  return 0;
337#else
338  if(makeKigoIchiran(d, CANNA_MODE_KigoMode) == NG)
339    return(GLineNGReturn(d));
340  else
341    return(0);
342#endif
343}
344
345#ifndef NO_EXTEND_MENU
346/*
347 * ����������������������������������������
348 *
349 * ������������	uiContext
350 * ������������	�������������������� 0	�������������������� -1
351 */
352int makeKigoIchiran(uiContext d, int major_mode)
353{
354  ichiranContext kc;
355  int            headkouho;
356
357  if(d->ncolumns < (KCODEALLCOLS + KIGOCOLS)) {
358    NothingChangedWithBeep(d);
359    jrKanjiError = "\270\365\312\344\260\354\315\367\315\321\244\316\311\375"
360	"\244\254\266\271\244\244\244\316\244\307\265\255\271\346\260\354"
361	"\315\367\244\307\244\255\244\336\244\273\244\363";
362                   /* ������������������������������������������������������������������������������������ */
363    return(NG);
364  }
365
366  if(getKigoContext(d, NO_CALLBACK, kigoIchiranExitCatch, kigoIchiranQuitCatch, NO_CALLBACK) == NG)
367    return(NG);
368
369  kc = (ichiranContext)d->modec;
370  kc->majorMode = major_mode;
371  kc->minorMode = CANNA_MODE_KigoMode;
372  kc->flags |= cannaconf.quickly_escape ? 0 : ICHIRAN_STAY_LONG;
373
374  currentModeInfo(d);
375
376  /* �������������������������������������������� */
377  /* ���������������������������� "����JIS ����" �������������������������������������������� */
378  if((kc->nIkouho =
379      (((d->ncolumns - KCODEALLCOLS - KIGOCOLS) / KIGOWIDTH) + 1))
380                                                  > KIGOBANGOMAX) {
381    kc->nIkouho = KIGOBANGOMAX;
382  }
383
384  kc->curIkouho = &kigo_curIkouho;
385
386  if(allocIchiranBuf(d) == NG) { /* ���������������������������� */
387    popKigoMode(d);
388    popCallback(d);
389    return(NG);
390  }
391
392  /* ������������������������������������������������������������������������������������
393     ������������������������������������������������������������������������ */
394  if(d->curkigo) {		/* a1a1������������������������������������ */
395    headkouho = (d->curkigo / kc->nIkouho) * kc->nIkouho;
396    *(kc->curIkouho) = d->curkigo % kc->nIkouho;
397  } else {
398    d->curkigo = 0;
399    headkouho = 0;
400    *(kc->curIkouho) = 0;
401  }
402
403  /* �������������������������������� C-t ������������ Gline ������������������������������������������������������������
404     ���������������������������������������� */
405  d->flags &= ~(PLEASE_CLEAR_GLINE | PCG_RECOGNIZED);
406
407  /* glineinfo����kouhoinfo������������ */
408  makeKigoInfo(d, headkouho);
409
410  /* kanji_status_return������������ */
411  makeKigoGlineStatus(d);
412
413  return(0);
414}
415
416static
417int KigoNop(uiContext d)
418{
419  /* currentModeInfo ������������������������������������������������������������������������������������������������������������ */
420  d->majorMode = d->minorMode = CANNA_MODE_AlphaMode;
421  currentModeInfo(d);
422
423  makeKigoGlineStatus(d);
424  return 0;
425}
426
427/*
428 * ����������������������������������������������������������������
429 *
430 * ������������	uiContext
431 * ������������	�������������������� 0
432 */
433static
434int KigoForwardKouho(uiContext d)
435{
436  ichiranContext kc = (ichiranContext)d->modec;
437  int  headkouho;
438
439  /* ���������������������������� */
440  ++*(kc->curIkouho);
441
442  /* �������������������������������������������������������������������������������������������������������������������������������������������� */
443  if((*(kc->curIkouho) >= kc->nIkouho) ||
444     (kc->glineifp->glhead + *(kc->curIkouho) >= KIGOSU)) {
445    headkouho  = kc->glineifp->glhead + kc->nIkouho;
446    if(headkouho >= KIGOSU)
447      headkouho = 0;
448    *(kc->curIkouho) = 0;
449    makeKigoInfo(d, headkouho);
450  }
451
452  /* kanji_status_retusrn ������������ */
453  makeKigoGlineStatus(d);
454  /* d->status = EVERYTIME_CALLBACK; */
455
456  return(0);
457}
458
459/*
460 * ����������������������������������������������������������������
461 *
462 * ������������	uiContext
463 * ������������	�������������������� 0
464 */
465static
466int KigoBackwardKouho(uiContext d)
467{
468  ichiranContext kc = (ichiranContext)d->modec;
469  int  headkouho;
470
471  /* ���������������������������� */
472  --*(kc->curIkouho);
473
474  /* �������������������������������������������������������������������������������������������������������������������������������������������� */
475  if(*(kc->curIkouho) < 0) {
476    headkouho  = kc->glineifp->glhead - kc->nIkouho;
477    if(headkouho < 0)
478      headkouho = ((KIGOSU - 1) / kc->nIkouho) * kc->nIkouho;
479    makeKigoInfo(d, headkouho);
480    *(kc->curIkouho) = kc->glineifp->glkosu - 1;
481  }
482
483  /* kanji_status_retusrn ������������ */
484  makeKigoGlineStatus(d);
485  /* d->status = EVERYTIME_CALLBACK; */
486
487  return(0);
488}
489
490/*
491 * ��������������������������������������������
492 *
493 * ������������	uiContext
494 * ������������	�������������������� 0
495 */
496static
497int KigoPreviousKouhoretsu(uiContext d)
498{
499  ichiranContext kc = (ichiranContext)d->modec;
500  int headkouho;
501
502  /** ���������������������������� **/
503  headkouho  = kc->glineifp->glhead - kc->nIkouho;
504  if(headkouho < 0)
505    headkouho = ((KIGOSU -1) / kc->nIkouho) * kc->nIkouho;
506  makeKigoInfo(d, headkouho);
507
508  /* *(kc->curIkouho) ��������������������������������������������������������������������������������������������������������
509     �������������������������������������������������������� */
510  if(*(kc->curIkouho) >= kc->glineifp->glkosu)
511    *(kc->curIkouho) = kc->glineifp->glkosu - 1;
512
513  /* kanji_status_retusrn ������������ */
514  makeKigoGlineStatus(d);
515  /* d->status = EVERYTIME_CALLBACK; */
516
517  return(0);
518}
519
520/*
521 * ��������������������������������������������
522 *
523 * ������������	uiContext
524 * ������������	�������������������� 0
525 */
526static
527int KigoNextKouhoretsu(uiContext d)
528{
529  ichiranContext kc = (ichiranContext)d->modec;
530  int headkouho;
531
532  /** ���������������������������� **/
533  headkouho = kc->glineifp->glhead + kc->nIkouho;
534  if(headkouho >= KIGOSU)
535    headkouho = 0;
536  makeKigoInfo(d, headkouho);
537
538  /* *(kc->curIkouho) ��������������������������������������������������������������������������������������������������������
539     �������������������������������������������������������� */
540  if(*(kc->curIkouho) >= kc->glineifp->glkosu)
541    *(kc->curIkouho) = kc->glineifp->glkosu - 1;
542
543  /* kanji_status_retusrn ������������ */
544  makeKigoGlineStatus(d);
545  /* d->status = EVERYTIME_CALLBACK; */
546
547  return(0);
548}
549
550/*
551 * ��������������������������������������������������������������������
552 *
553 * ������������	uiContext
554 * ������������	�������������������� 0
555 */
556static
557int KigoBeginningOfKouho(uiContext d)
558{
559  ichiranContext kc = (ichiranContext)d->modec;
560
561  /* ������������������������������������������������������������������������ */
562  *(kc->curIkouho) = 0;
563
564  /* kanji_status_retusrn ������������ */
565  makeKigoGlineStatus(d);
566  /* d->status = EVERYTIME_CALLBACK; */
567
568  return(0);
569}
570
571/*
572 * ��������������������������������������������������������������������
573 *
574 * ������������	uiContext
575 * ������������	�������������������� 0
576 */
577static
578int KigoEndOfKouho(uiContext d)
579{
580  ichiranContext kc = (ichiranContext)d->modec;
581
582  /** ������������������������������������������������������������������������ **/
583  *(kc->curIkouho) = kc->glineifp->glkosu - 1;
584
585  /* kanji_status_retusrn ������������ */
586  makeKigoGlineStatus(d);
587  /* d->status = EVERYTIME_CALLBACK; */
588
589  return(0);
590}
591
592/*
593 * ��������������������������������������������������������������������������������
594 *
595 * ������������������������������������������������������������������������������������������������������������������������������������
596 *   ��������������������������������������������������������
597 *
598 * ������������	uiContext
599 * ������������	�������������������� 0
600 */
601static
602int KigoKakutei(uiContext d)
603{
604  ichiranContext kc = (ichiranContext)d->modec;
605
606  /* ������������������������������������������������ */
607  d->curkigo = kc->glineifp->glhead + *(kc->curIkouho);
608
609  /* �������������������������������������������������������������������� */
610  if (d->n_buffer >= KIGOSIZE) {
611    d->nbytes = KIGOSIZE;
612    WStrncpy(d->buffer_return, kc->kouhoifp[*(kc->curIkouho)].khdata,
613	    d->nbytes);
614    d->buffer_return[KIGOSIZE] = (WCHAR_T)0;
615  }
616  else {
617    d->nbytes = 0;
618  }
619
620  if (kc->flags & ICHIRAN_STAY_LONG) {
621    kc->flags |= ICHIRAN_NEXT_EXIT;
622    d->status = EVERYTIME_CALLBACK;
623  }
624  else {
625    freeIchiranBuf(kc);
626    popKigoMode(d);
627    GlineClear(d);
628
629    d->status = EXIT_CALLBACK;
630  }
631
632  return(d->nbytes);
633}
634
635#ifdef	SOMEONE_USES_THIS
636/*
637 * ����������������������������������������������������������������������������������������  ��������������������
638 *
639 * ������������	uiContext
640 * ������������	�������������������� 0
641 */
642static
643KigoBangoKouho(uiContext d)
644{
645  ichiranContext kc = (ichiranContext)d->modec;
646  int num;
647
648  /* ������������������������ ������������ ������������ �������� */
649  if(((0x30 <= d->ch) && (d->ch <= 0x39))
650     || ((0x61 <= d->ch) && (d->ch <= 0x66))) {
651    if((0x30 <= d->ch) && (d->ch <= 0x39))
652      num = (int)(d->ch & 0x0f);
653    else if((0x61 <= d->ch) && (d->ch <= 0x66))
654      num = (int)(d->ch - 0x57);
655  }
656  else {
657    /* ���������������������������������������������������������������� */
658    return NothingChangedWithBeep(d);
659  }
660  /* ������������������������ ���������������������������������������������������� */
661  if(num >= kc->glineifp->glkosu) {
662    /* ���������������������������������������������������������������� */
663    return NothingChangedWithBeep(d);
664  }
665
666  /* �������������������������������������������� */
667  *(kc->curIkouho) = num;
668
669  /* SelectDirect ���������������������������������������� */
670  if (cannaconf.SelectDirect) /* ON */ {
671    return(KigoKakutei(d));
672  } else           /* OFF */ {
673    /* kanji_status_retusrn ������������ */
674    makeKigoGlineStatus(d);
675
676    return(0);
677  }
678}
679#endif	/* SOMEONE_USES_THIS */
680
681/*
682 * ����������������������������������������
683 *
684 * ������������	uiContext
685 * ������������	�������������������� 0
686 */
687static
688int KigoQuit(uiContext d)
689{
690  ichiranContext kc = (ichiranContext)d->modec;
691  BYTE fl = kc->flags;
692
693  freeIchiranBuf(kc);
694  popKigoMode(d);
695  /* gline ������������������������ */
696  GlineClear(d);
697  d->status = (fl & ICHIRAN_NEXT_EXIT) ? EXIT_CALLBACK : QUIT_CALLBACK;
698  return 0;
699}
700#endif /* NO_EXTEND_MENU */
701
702#include	"kigomap.h"
703