0
|
1 /*
|
|
2 * $Id: chkutil.c,v 1.2 2001/06/14 18:16:11 ura Exp $
|
|
3 */
|
|
4
|
|
5 /*
|
|
6 * FreeWnn is a network-extensible Kana-to-Kanji conversion system.
|
|
7 * This file is part of FreeWnn.
|
|
8 *
|
|
9 * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999
|
|
10 *
|
|
11 * Author: OMRON SOFTWARE Co., Ltd. <freewnn@rd.kyoto.omronsoft.co.jp>
|
|
12 *
|
|
13 * This program is free software; you can redistribute it and/or modify
|
|
14 * it under the terms of the GNU General Public License as published by
|
|
15 * the Free Software Foundation; either version 2, or (at your option)
|
|
16 * any later version.
|
|
17 *
|
|
18 * This program is distributed in the hope that it will be useful,
|
|
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21 * GNU General Public License for more details.
|
|
22 *
|
|
23 * You should have received a copy of the GNU General Public License
|
|
24 * along with GNU Emacs; see the file COPYING. If not, write to the
|
|
25 * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
26 *
|
|
27 * Commentary:
|
|
28 *
|
|
29 * Change log:
|
|
30 *
|
|
31 * Last modified date: 8,Feb.1999
|
|
32 *
|
|
33 * Code:
|
|
34 *
|
|
35 */
|
|
36 /*
|
|
37 * X11R5 Input Method Test Program
|
|
38 * chkutil.c v 1.0 Thu Mar 7 18:27:37 JST 1991
|
|
39 */
|
|
40
|
|
41 /*
|
|
42 * Author: Takashi Inoue OMRON Corporation
|
|
43 * takashi@ari.ncl.omron.co.jp
|
|
44 */
|
|
45
|
|
46 #include <stdio.h>
|
|
47 #include "exvalue.h"
|
|
48 #include "func.h"
|
|
49
|
|
50 void
|
|
51 chkutil (im, ic, locale) /* CHecK UTILity funcions */
|
|
52 XIM im;
|
|
53 XIC ic;
|
|
54 char *locale;
|
|
55 {
|
|
56 XIM retim;
|
|
57 Display *retdpy;
|
|
58 char *retlocale;
|
|
59 char tmplocale[MAX_BUF];
|
|
60 char *cnt;
|
|
61
|
|
62 cls (prdisp); /* clear screen */
|
|
63
|
|
64 prstatus ("Test of XIMOfIC()..."); /* test of XIMOfIC() */
|
|
65 retim = XIMOfIC (ic);
|
|
66 prstatus ("done.");
|
|
67 if (retim != im)
|
|
68 {
|
|
69 prprint ("Test of XIMOfIC() is failed.\n\n");
|
|
70 fprintf (icfp, "Test of XIMOfIC() is failed.\n");
|
|
71 fprintf (icfp, "id of im : 0x%-10X, id of retim : 0x%-10X\n\n", im, retim);
|
|
72 }
|
|
73 else
|
|
74 {
|
|
75 prprint ("Test of XIMOfIC() is succeeded.\n\n");
|
|
76 fprintf (icfp, "Test of XIMOfIC() is succeeded.\n");
|
|
77 fprintf (icfp, "id of im : 0x%-10X, id of returned ic : 0x%-10X\n\n", im, retim);
|
|
78 }
|
|
79
|
|
80 prstatus ("Test of XDisplayOfIM()..."); /* test of XDisplayOfIM() */
|
|
81 retdpy = XDisplayOfIM (im);
|
|
82 prstatus ("done.");
|
|
83 if (retdpy != dpy)
|
|
84 {
|
|
85 prprint ("Test of XDisplayOfIM() is failed.\n\n");
|
|
86 fprintf (icfp, "Test of XDisplayOfIM() is failed.\n\n");
|
|
87 fprintf (icfp, "id of Display : 0x%-10X, id of retuened Display : 0x%-10X\n\n", dpy, retdpy);
|
|
88 }
|
|
89 else
|
|
90 {
|
|
91 prprint ("Test of XDisplayOfIM() is succeeded.\n\n");
|
|
92 fprintf (icfp, "Test of XDisplayOfIM() is succeeded.\n");
|
|
93 fprintf (icfp, "id of Display : 0x%-10X, id of returned Display : 0x%-10X\n\n", dpy, retdpy);
|
|
94 }
|
|
95
|
|
96 prstatus ("Test of XLocaleOfIM()..."); /* test of XLocaleOfIM() */
|
|
97 strcpy (tmplocale, locale);
|
|
98 for (cnt = tmplocale; (*cnt != '\0') && (*cnt != '@'); cnt++)
|
|
99 ;
|
|
100 *cnt = '\0';
|
|
101 retlocale = XLocaleOfIM (im);
|
|
102 prstatus ("done.");
|
|
103 if (strcmp (retlocale, tmplocale))
|
|
104 {
|
|
105 prprint ("Test of XLocaleOfIM() is failed.\n\n");
|
|
106 fprintf (icfp, "Test of XLocaleOfIM() is failed.\n");
|
|
107 fprintf (icfp, "name of locale : %s, name of retuened locale : %s\n\n", tmplocale, retlocale);
|
|
108 }
|
|
109 else
|
|
110 {
|
|
111 prprint ("Test of XLocaleOfIM() is succeeded.\n\n");
|
|
112 fprintf (icfp, "Test of XLocaleOfIM() is succeeded.\n");
|
|
113 fprintf (icfp, "name of locale : %s, name of retruned locale : %s\n\n", tmplocale, retlocale);
|
|
114 }
|
|
115 prpok ();
|
|
116 }
|