1 /*
2  * $Id: w_string.c,v 1.2 2001/06/14 18:16:18 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 Kyoto University Research Institute for Mathematical Sciences
10  *                 1987, 1988, 1989, 1990, 1991, 1992
11  * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999
12  * Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992
13  * Copyright 1991, 1992 by Massachusetts Institute of Technology
14  *
15  * Author: OMRON SOFTWARE Co., Ltd. <freewnn@rd.kyoto.omronsoft.co.jp>
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation; either version 2, or (at your option)
20  * any later version.
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with GNU Emacs; see the file COPYING.  If not, write to the
29  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30  *
31  * Commentary:
32  *
33  * Change log:
34  *
35  * Last modified date: 8,Feb.1999
36  *
37  * Code:
38  *
39  */
40 /*      Version 4.0
41  */
42 #include <stdio.h>
43 #include "commonhd.h"
44 #include "sdefine.h"
45 #ifdef  XJUTIL
46 #include "xjutil.h"
47 #include "sxheader.h"
48 #include "xext.h"
49 #define CSWIDTH_ID      xjutil->cswidth_id
50 #else /* XJUTIL */
51 #include "xim.h"
52 #include "sheader.h"
53 #include "ext.h"
54 #define CSWIDTH_ID      cur_lang->cswidth_id
55 #endif /* XJUTIL */
56 #define CONTLINE '$'
57 
58 int
wchartochar(w,c)59 wchartochar (w, c)
60      w_char *w;
61      UCHAR *c;
62 {
63   int flg = 0;
64   w_char *w0 = w;
65 
66   for (; *w != 0; w++)
67     {
68       if ((*w) > 0xff)
69         flg = 1;
70     }
71   sStrcpy (c, w0);
72   return (flg);
73 }
74 
75 int
sStrcpy(c,w)76 sStrcpy (c, w)
77      register UCHAR *c;
78      register w_char *w;
79 {
80   set_cswidth (CSWIDTH_ID);
81   return (wnn_sStrcpy (c, w));
82 }
83 
84 int
Sstrcpy(w,c)85 Sstrcpy (w, c)
86      register w_char *w;
87      register UCHAR *c;
88 {
89   set_cswidth (CSWIDTH_ID);
90   return (wnn_Sstrcpy (w, c));
91 }
92 
93 w_char *
Strcat(w1,w2)94 Strcat (w1, w2)
95      register w_char *w1, *w2;
96 {
97   return (wnn_Strcat (w1, w2));
98 }
99 
100 w_char *
Strncat(w1,w2,n)101 Strncat (w1, w2, n)
102      register w_char *w1, *w2;
103      register int n;
104 {
105   return (wnn_Strncat (w1, w2, n));
106 }
107 
108 int
Strncmp(w1,w2,n)109 Strncmp (w1, w2, n)
110      register w_char *w1, *w2;
111      register int n;
112 {
113   return (wnn_Strncmp (w1, w2, n));
114 }
115 
116 w_char *
Strcpy(w1,w2)117 Strcpy (w1, w2)
118      register w_char *w1, *w2;
119 {
120   return (wnn_Strcpy (w1, w2));
121 }
122 
123 w_char *
Strncpy(w1,w2,n)124 Strncpy (w1, w2, n)
125      register w_char *w1, *w2;
126      register int n;
127 {
128   return (wnn_Strncpy (w1, w2, n));
129 }
130 
131 int
Strlen(w)132 Strlen (w)
133      register w_char *w;
134 {
135   return (wnn_Strlen (w));
136 }
137 
138 void
delete_w_ss2(s,n)139 delete_w_ss2 (s, n)
140      register w_char *s;
141      register int n;
142 {
143   wnn_delete_w_ss2 (s, n);
144 }
145