aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2016-08-27 01:22:46 +0200
committerUlrich Sibiller <uli42@gmx.de>2016-10-10 22:52:31 +0200
commit385dc2b070df1e19853a009bfe32204e0c5b2dd7 (patch)
tree6c18a91191560417fe9ae67ea10ca5905bc29fb2 /nx-X11
parente868fbbfdabe9cf45899054c8455d39acf800ede (diff)
downloadnx-libs-385dc2b070df1e19853a009bfe32204e0c5b2dd7.tar.gz
nx-libs-385dc2b070df1e19853a009bfe32204e0c5b2dd7.tar.bz2
nx-libs-385dc2b070df1e19853a009bfe32204e0c5b2dd7.zip
update xlibi18n files to libX11 1.3.4
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/lib/X11/ICWrap.c77
-rw-r--r--nx-X11/lib/X11/IMWrap.c47
-rw-r--r--nx-X11/lib/X11/XDefaultIMIF.c67
-rw-r--r--nx-X11/lib/X11/XDefaultOMIF.c82
-rw-r--r--nx-X11/lib/X11/Xaixlcint.h2
-rw-r--r--nx-X11/lib/X11/XimImSw.h4
-rw-r--r--nx-X11/lib/X11/XimProto.h4
-rw-r--r--nx-X11/lib/X11/XimThai.h30
-rw-r--r--nx-X11/lib/X11/XimTrInt.h47
-rw-r--r--nx-X11/lib/X11/XimTrX.h49
-rw-r--r--nx-X11/lib/X11/XimTrans.h55
-rw-r--r--nx-X11/lib/X11/Ximint.h32
-rw-r--r--nx-X11/lib/X11/XimintL.h60
-rw-r--r--nx-X11/lib/X11/XimintP.h59
-rw-r--r--nx-X11/lib/X11/XlcDL.c76
-rw-r--r--nx-X11/lib/X11/XlcGeneric.h4
-rw-r--r--nx-X11/lib/X11/XlcPubI.h10
-rw-r--r--nx-X11/lib/X11/XlcSL.c48
-rw-r--r--nx-X11/lib/X11/Xlcint.h47
-rw-r--r--nx-X11/lib/X11/imKStoUCS.c10
-rw-r--r--nx-X11/lib/X11/lcCT.c22
-rw-r--r--nx-X11/lib/X11/lcCharSet.c8
-rw-r--r--nx-X11/lib/X11/lcConv.c4
-rw-r--r--nx-X11/lib/X11/lcDB.c87
-rw-r--r--nx-X11/lib/X11/lcGeneric.c33
-rw-r--r--nx-X11/lib/X11/lcInit.c54
-rw-r--r--nx-X11/lib/X11/lcPrTxt.c4
-rw-r--r--nx-X11/lib/X11/lcPubWrap.c8
-rw-r--r--nx-X11/lib/X11/lcPublic.c8
-rw-r--r--nx-X11/lib/X11/lcStd.c4
-rw-r--r--nx-X11/lib/X11/lcTxtPr.c4
-rw-r--r--nx-X11/lib/X11/lcUTF8.c553
-rw-r--r--nx-X11/lib/X11/lcUtil.c4
-rw-r--r--nx-X11/lib/X11/lcWrap.c52
-rw-r--r--nx-X11/lib/X11/mbWrap.c14
-rw-r--r--nx-X11/lib/X11/utf8WMProps.c1
-rw-r--r--nx-X11/lib/X11/utf8Wrap.c15
-rw-r--r--nx-X11/lib/X11/wcWrap.c14
38 files changed, 1224 insertions, 475 deletions
diff --git a/nx-X11/lib/X11/ICWrap.c b/nx-X11/lib/X11/ICWrap.c
index 207681d31..1eacfa5f1 100644
--- a/nx-X11/lib/X11/ICWrap.c
+++ b/nx-X11/lib/X11/ICWrap.c
@@ -1,7 +1,4 @@
/*
- */
-
-/*
* Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation,
* and Nippon Telegraph and Telephone Corporation
* Copyright 1991 by the Open Software Foundation
@@ -12,30 +9,30 @@
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of OMRON, NTT Software, NTT, and
- * Open Software Foundation not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
+ * Open Software Foundation not be used in advertising or publicity
+ * pertaining to distribution of the software without specific,
* written prior permission. OMRON, NTT Software, NTT, and Open Software
* Foundation make no representations about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
- * OMRON, NTT SOFTWARE, NTT, AND OPEN SOFTWARE FOUNDATION
- * DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
+ * OMRON, NTT SOFTWARE, NTT, AND OPEN SOFTWARE FOUNDATION
+ * DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
* SHALL OMRON, NTT SOFTWARE, NTT, OR OPEN SOFTWARE FOUNDATION BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
+ *
* Authors: Li Yuhong OMRON Corporation
* Tatsuya Kato NTT Software Corporation
* Hiroshi Kuribayashi OMRON Coproration
* Muneiyoshi Suzuki Nippon Telegraph and Telephone Co.
- *
- * M. Collins OSF
+ *
+ * M. Collins OSF
* Takashi Fujiwara FUJITSU LIMITED
- */
+ */
/*
Copyright 1991, 1998 The Open Group
@@ -221,7 +218,7 @@ XGetIMValues(XIM im, ...)
}
/*
- * Create an input context within the input method,
+ * Create an input context within the input method,
* and return a pointer to the input context.
*/
@@ -232,7 +229,7 @@ XCreateIC(XIM im, ...)
int total_count;
XIMArg *args;
XIC ic;
-
+
/*
* so count the stuff dangling here
*/
@@ -260,8 +257,7 @@ XCreateIC(XIM im, ...)
* Free the input context.
*/
void
-XDestroyIC(ic)
- XIC ic;
+XDestroyIC(XIC ic)
{
XIM im = ic->core.im;
XIC *prev;
@@ -280,7 +276,7 @@ XDestroyIC(ic)
char *
XGetICValues(XIC ic, ...)
-{
+{
va_list var;
int total_count;
XIMArg *args;
@@ -343,8 +339,7 @@ XSetICValues(XIC ic, ...)
* argument.
*/
void
-XSetICFocus(ic)
- XIC ic;
+XSetICFocus(XIC ic)
{
if (ic && ic->core.im)
(*ic->methods->set_focus) (ic);
@@ -355,8 +350,7 @@ XSetICFocus(ic)
* argument.
*/
void
-XUnsetICFocus(ic)
- XIC ic;
+XUnsetICFocus(XIC ic)
{
if (ic->core.im)
(*ic->methods->unset_focus) (ic);
@@ -366,15 +360,13 @@ XUnsetICFocus(ic)
* Return the XIM associated with the input context.
*/
XIM
-XIMOfIC(ic)
- XIC ic;
+XIMOfIC(XIC ic)
{
return ic->core.im;
}
char *
-XmbResetIC(ic)
- XIC ic;
+XmbResetIC(XIC ic)
{
if (ic->core.im)
return (*ic->methods->mb_reset)(ic);
@@ -382,8 +374,7 @@ XmbResetIC(ic)
}
wchar_t *
-XwcResetIC(ic)
- XIC ic;
+XwcResetIC(XIC ic)
{
if (ic->core.im)
return (*ic->methods->wc_reset)(ic);
@@ -391,8 +382,7 @@ XwcResetIC(ic)
}
char *
-Xutf8ResetIC(ic)
- XIC ic;
+Xutf8ResetIC(XIC ic)
{
if (ic->core.im) {
if (ic->methods->utf8_reset)
@@ -404,13 +394,8 @@ Xutf8ResetIC(ic)
}
int
-XmbLookupString(ic, ev, buffer, nbytes, keysym, status)
- XIC ic;
- register XKeyEvent *ev;
- char *buffer;
- int nbytes;
- KeySym *keysym;
- Status *status;
+XmbLookupString(XIC ic, XKeyEvent *ev, char *buffer, int nbytes,
+ KeySym *keysym, Status *status)
{
if (ic->core.im)
return (*ic->methods->mb_lookup_string) (ic, ev, buffer, nbytes,
@@ -419,13 +404,8 @@ XmbLookupString(ic, ev, buffer, nbytes, keysym, status)
}
int
-XwcLookupString(ic, ev, buffer, nchars, keysym, status)
- XIC ic;
- register XKeyEvent *ev;
- wchar_t *buffer;
- int nchars;
- KeySym *keysym;
- Status *status;
+XwcLookupString(XIC ic, XKeyEvent *ev, wchar_t *buffer, int nchars,
+ KeySym *keysym, Status *status)
{
if (ic->core.im)
return (*ic->methods->wc_lookup_string) (ic, ev, buffer, nchars,
@@ -434,13 +414,8 @@ XwcLookupString(ic, ev, buffer, nchars, keysym, status)
}
int
-Xutf8LookupString(ic, ev, buffer, nbytes, keysym, status)
- XIC ic;
- register XKeyEvent *ev;
- char *buffer;
- int nbytes;
- KeySym *keysym;
- Status *status;
+Xutf8LookupString(XIC ic, XKeyEvent *ev, char *buffer, int nbytes,
+ KeySym *keysym, Status *status)
{
if (ic->core.im) {
if (ic->methods->utf8_lookup_string)
diff --git a/nx-X11/lib/X11/IMWrap.c b/nx-X11/lib/X11/IMWrap.c
index f592520a8..0f6ed5593 100644
--- a/nx-X11/lib/X11/IMWrap.c
+++ b/nx-X11/lib/X11/IMWrap.c
@@ -1,7 +1,4 @@
/*
- */
-
-/*
* Copyright 1991 by the Open Software Foundation
* Copyright 1993, 1994 by the Sony Corporation
*
@@ -10,10 +7,10 @@
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of Open Software Foundation and
- * Sony Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- * Open Software Foundation and Sony Corporation make no
- * representations about the suitability of this software for any purpose.
+ * Sony Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Open Software Foundation and Sony Corporation make no
+ * representations about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
* OPEN SOFTWARE FOUNDATION AND SONY CORPORATION DISCLAIM ALL
@@ -23,11 +20,11 @@
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * M. Collins OSF
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ * M. Collins OSF
* Makoto Wakamatsu Sony Corporation
- */
+ */
/*
Copyright 1991, 1998 The Open Group
@@ -67,9 +64,7 @@ from The Open Group.
* Compile the resource name. (resource_name ---> xrm_name)
*/
void
-_XIMCompileResourceList(res, num_res)
- register XIMResourceList res;
- unsigned int num_res;
+_XIMCompileResourceList(XIMResourceList res, unsigned int num_res)
{
register unsigned int count;
@@ -79,10 +74,7 @@ _XIMCompileResourceList(res, num_res)
}
void
-_XCopyToArg(src, dst, size)
- XPointer src;
- XPointer *dst;
- register unsigned int size;
+_XCopyToArg(XPointer src, XPointer *dst, unsigned int size)
{
if (!*dst) {
union {
@@ -119,12 +111,8 @@ _XCopyToArg(src, dst, size)
* a XIM object and return a pointer the newly created XIM back to the caller.
*/
-XIM
-XOpenIM( display, rdb, res_name, res_class )
- Display *display;
- XrmDatabase rdb;
- char *res_name;
- char *res_class;
+XIM
+XOpenIM(Display *display, XrmDatabase rdb, char *res_name, char *res_class)
{
XLCd lcd = _XOpenLC( (char *)NULL );
@@ -137,13 +125,12 @@ XOpenIM( display, rdb, res_name, res_class )
* Close the connection to the input manager, and free the XIM structure
*/
Status
-XCloseIM(im)
- XIM im;
+XCloseIM(XIM im)
{
Status s;
XIC ic;
XLCd lcd = im->core.lcd;
-
+
s = (im->methods->close) (im);
for (ic = im->core.ic_chain; ic; ic = ic->core.next)
ic->core.im = (XIM)NULL;
@@ -156,8 +143,7 @@ XCloseIM(im)
* Return the Display associated with the input method.
*/
Display *
-XDisplayOfIM(im)
- XIM im;
+XDisplayOfIM(XIM im)
{
return im->core.display;
}
@@ -166,8 +152,7 @@ XDisplayOfIM(im)
* Return the Locale associated with the input method.
*/
char *
-XLocaleOfIM(im)
- XIM im;
+XLocaleOfIM(XIM im)
{
return im->core.lcd->core->name;
}
diff --git a/nx-X11/lib/X11/XDefaultIMIF.c b/nx-X11/lib/X11/XDefaultIMIF.c
index 328cb5cad..d36962f05 100644
--- a/nx-X11/lib/X11/XDefaultIMIF.c
+++ b/nx-X11/lib/X11/XDefaultIMIF.c
@@ -1,8 +1,6 @@
/*
Copyright 1985, 1986, 1987, 1991, 1998 The Open Group
-Portions Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
-
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
@@ -14,21 +12,18 @@ permission notice shall be included in all copies or substantial
portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF
-ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
+EVEN IF ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
-Except as contained in this notice, the names of The Open Group and/or
-Sun Microsystems, Inc. shall not be used in advertising or otherwise to
-promote the sale, use or other dealings in this Software without prior
-written authorization from The Open Group and/or Sun Microsystems,
-Inc., as applicable.
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
X Window System is a trademark of The Open Group
@@ -41,6 +36,29 @@ interest in or to any trademark, service mark, logo or trade name of
Sun Microsystems, Inc. or its licensors is granted.
*/
+/*
+ * Copyright 2000 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -160,7 +178,7 @@ _XDefaultOpenIM(
XlcNCompoundText, lcd, XlcNMultiByte))) {
return((XIM)NULL);
}
-
+
if (!(ctow_conv = _XlcOpenConverter(lcd,
XlcNCompoundText, lcd, XlcNWideChar))) {
return((XIM)NULL);
@@ -240,17 +258,17 @@ _CloseIM(XIM xim)
}
static char *
-_SetIMValues(xim, arg)
-XIM xim;
-XIMArg *arg;
+_SetIMValues(
+ XIM xim,
+ XIMArg *arg)
{
return(arg->name); /* evil */
}
static char *
-_GetIMValues(xim, values)
-XIM xim;
-XIMArg *values;
+_GetIMValues(
+ XIM xim,
+ XIMArg *values)
{
XIMArg *p;
XIMStyles *styles;
@@ -357,8 +375,7 @@ _DestroyIC(XIC ic)
}
static void
-_SetFocus(ic)
-XIC ic;
+_SetFocus(XIC ic)
{
}
@@ -412,7 +429,7 @@ _MbLookupString(
{
XComposeStatus NotSupportedYet ;
int length;
-
+
length = XLookupString(ev, buffer, bytes, keysym, &NotSupportedYet);
if (keysym && *keysym == NoSymbol){
diff --git a/nx-X11/lib/X11/XDefaultOMIF.c b/nx-X11/lib/X11/XDefaultOMIF.c
index fcdd8a25c..dbadd90aa 100644
--- a/nx-X11/lib/X11/XDefaultOMIF.c
+++ b/nx-X11/lib/X11/XDefaultOMIF.c
@@ -1,8 +1,6 @@
/*
Copyright 1985, 1986, 1987, 1991, 1998 The Open Group
-Portions Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
-
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
@@ -14,21 +12,18 @@ permission notice shall be included in all copies or substantial
portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF
-ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
+EVEN IF ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
-Except as contained in this notice, the names of The Open Group and/or
-Sun Microsystems, Inc. shall not be used in advertising or otherwise to
-promote the sale, use or other dealings in this Software without prior
-written authorization from The Open Group and/or Sun Microsystems,
-Inc., as applicable.
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
X Window System is a trademark of The Open Group
@@ -41,6 +36,29 @@ interest in or to any trademark, service mark, logo or trade name of
Sun Microsystems, Inc. or its licensors is granted.
*/
+/*
+ * Copyright 2000 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -96,7 +114,7 @@ typedef struct _XOCGenericPart {
typedef struct _XOCGenericRec {
XOCMethods methods;
- XOCCoreRec core;
+ XOCCoreRec core;
XOCGenericPart gen;
} XOCGenericRec, *XOCGeneric;
@@ -132,7 +150,7 @@ get_prop_name(
unsigned long fp;
if (XGetFontProperty(fs, XA_FONT, &fp))
- return XGetAtomName(dpy, fp);
+ return XGetAtomName(dpy, fp);
return (char *) NULL;
}
@@ -158,7 +176,7 @@ check_charset(
if (length > name_len)
return(NULL);
-
+
if (_XlcCompareISOLatin1(last - length, font_data->name) == 0)
return font_data;
}
@@ -261,7 +279,7 @@ load_font_info(
return False;
if (fn_num > 0)
font_set->info->fid = XLoadFont(dpy, font_set->font_name);
-
+
if (fn_list) XFreeFontNames(fn_list);
}
return True;
@@ -373,7 +391,7 @@ get_font_name(
name = (char *) Xmalloc(strlen(*list) + 1);
if (name)
strcpy(name, *list);
-
+
XFreeFontNames(list);
} else {
fs = XLoadQueryFont(dpy, pattern);
@@ -479,7 +497,7 @@ Limit the length of the string copy to prevent stack corruption.
continue;
} else {
if (num_fields == 13 || num_fields == 14) {
- /*
+ /*
* There are 14 fields in an XLFD name -- make certain the
* charset (& encoding) is placed in the correct field.
*/
@@ -544,11 +562,11 @@ Limit the length of the string copy to prevent stack corruption.
strcpy(base_name, oc->core.base_name_list);
oc->core.base_name_list = base_name;
- XFreeStringList(name_list);
+ XFreeStringList(name_list);
return found_num;
err:
- XFreeStringList(name_list);
+ XFreeStringList(name_list);
return -1;
}
@@ -659,7 +677,7 @@ destroy_oc(
if (oc->core.res_class)
Xfree(oc->core.res_class);
#endif
-
+
Xfree(oc);
}
@@ -713,7 +731,7 @@ wcs_to_mbs(
&to_left, NULL, 0);
if (ret != 0 || length > 0)
return False;
-
+
return True;
}
@@ -842,7 +860,7 @@ _XmbDefaultTextPerCharExtents(XOC oc, _Xconst char *text, int length,
cs->rbearing);
overall.width += cs->width;
}
- (*num_chars)++;
+ (*num_chars)++;
}
if (overall_ink) {
@@ -997,12 +1015,12 @@ create_oc(
if (oc == NULL)
return (XOC) NULL;
bzero((char *) oc, sizeof(XOCGenericRec));
-
+
oc->core.om = om;
if (oc_resources[0].xrm_name == NULLQUARK)
_XlcCompileResourceList(oc_resources, XlcNumber(oc_resources));
-
+
if (_XlcSetValues((XPointer) oc, oc_resources, XlcNumber(oc_resources),
args, num_args, XlcCreateMask | XlcDefaultMask))
goto err;
@@ -1038,7 +1056,7 @@ close_om(
if ((data = gen->data)) {
if (data->font_data) {
for (font_data = data->font_data, count = data->font_data_count;
- count-- > 0 ; font_data++) {
+ count-- > 0 ; font_data++) {
if (font_data->name)
Xfree(font_data->name);
}
@@ -1136,7 +1154,7 @@ static _Xconst char *supported_charset_list[] = {
"SUNOLCURSOR-1",
"SUNOLGLYPH-1"
};
-
+
static Bool
init_om(
XOM om)
@@ -1229,7 +1247,7 @@ _XDefaultOpenOM(XLCd lcd, Display *dpy, XrmDatabase rdb,
if (om == NULL)
return (XOM) NULL;
bzero((char *) om, sizeof(XOMGenericRec));
-
+
om->methods = (XOMMethods)&methods;
om->core.lcd = lcd;
om->core.display = dpy;
@@ -1249,7 +1267,7 @@ _XDefaultOpenOM(XLCd lcd, Display *dpy, XrmDatabase rdb,
if (om_resources[0].xrm_name == NULLQUARK)
_XlcCompileResourceList(om_resources, XlcNumber(om_resources));
-
+
om->core.resources = om_resources;
om->core.num_resources = XlcNumber(om_resources);
diff --git a/nx-X11/lib/X11/Xaixlcint.h b/nx-X11/lib/X11/Xaixlcint.h
index 53553709e..446ba2581 100644
--- a/nx-X11/lib/X11/Xaixlcint.h
+++ b/nx-X11/lib/X11/Xaixlcint.h
@@ -13,7 +13,7 @@
* software without specific, written prior permission.
*
* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS, AND
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS, AND
* NONINFRINGEMENT OF THIRD PARTY RIGHTS, IN NO EVENT SHALL
* IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
diff --git a/nx-X11/lib/X11/XimImSw.h b/nx-X11/lib/X11/XimImSw.h
index ab99aac60..e3a962552 100644
--- a/nx-X11/lib/X11/XimImSw.h
+++ b/nx-X11/lib/X11/XimImSw.h
@@ -10,7 +10,7 @@ in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
-this software for any purpose.
+this software for any purpose.
It is provided "as is" without express or implied warranty.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
@@ -21,7 +21,7 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
- Author: Takashi Fujiwara FUJITSU LIMITED
+ Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
diff --git a/nx-X11/lib/X11/XimProto.h b/nx-X11/lib/X11/XimProto.h
index 5cb3a6dc9..6b0096dd6 100644
--- a/nx-X11/lib/X11/XimProto.h
+++ b/nx-X11/lib/X11/XimProto.h
@@ -10,7 +10,7 @@ in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
FUJITSU LIMITED makes no representations about the suitability of
-this software for any purpose.
+this software for any purpose.
It is provided "as is" without express or implied warranty.
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
@@ -21,7 +21,7 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
- Author: Takashi Fujiwara FUJITSU LIMITED
+ Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
diff --git a/nx-X11/lib/X11/XimThai.h b/nx-X11/lib/X11/XimThai.h
index 748a8e9c1..7cc238311 100644
--- a/nx-X11/lib/X11/XimThai.h
+++ b/nx-X11/lib/X11/XimThai.h
@@ -27,13 +27,13 @@ Copyright 1993 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
+both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
+software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
@@ -46,17 +46,17 @@ SOFTWARE.
******************************************************************/
/*
-**++
-** FACILITY:
-**
-** Xlib
-**
-** ABSTRACT:
-**
-** Definition file for Thai specific functions.
-**
-** MODIFICATION HISTORY:
-**
+**++
+** FACILITY:
+**
+** Xlib
+**
+** ABSTRACT:
+**
+** Definition file for Thai specific functions.
+**
+** MODIFICATION HISTORY:
+**
**/
#ifndef _XIMTHAI_H_
diff --git a/nx-X11/lib/X11/XimTrInt.h b/nx-X11/lib/X11/XimTrInt.h
index eb9780af2..b7e4439d2 100644
--- a/nx-X11/lib/X11/XimTrInt.h
+++ b/nx-X11/lib/X11/XimTrInt.h
@@ -1,26 +1,47 @@
+/*
+ * Copyright 1992 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
/******************************************************************
- Copyright 1992 by Sun Microsystems, Inc.
Copyright 1993, 1994 by FUJITSU LIMITED
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
-in supporting documentation, and that the name of Sun Microsystems, Inc.
+in supporting documentation, and that the name of FUJITSU LIMITED
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.
-Sun Microsystems, Inc. makes no representations about the suitability of
-this software for any purpose. It is provided "as is" without
-express or implied warranty.
+FUJITSU LIMITED makes no representations about the suitability of
+this software for any purpose.
+It is provided "as is" without express or implied warranty.
-Sun Microsystems Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
-IN NO EVENT SHALL Sun Microsystems, Inc. BE LIABLE FOR ANY SPECIAL, INDIRECT
-OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
-OR PERFORMANCE OF THIS SOFTWARE.
+FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
Author: Hideki Hiura (hhiura@Sun.COM) Sun Microsystems, Inc.
Takashi Fujiwara FUJITSU LIMITED
@@ -34,7 +55,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include "Ximint.h"
typedef struct {
- char *transportname;
+ const char *transportname;
Bool (*config)(
Xim,
char *
diff --git a/nx-X11/lib/X11/XimTrX.h b/nx-X11/lib/X11/XimTrX.h
index 72f30531c..1c24fe368 100644
--- a/nx-X11/lib/X11/XimTrX.h
+++ b/nx-X11/lib/X11/XimTrX.h
@@ -1,29 +1,50 @@
+/*
+ * Copyright 1992 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
/******************************************************************
- Copyright 1992 by Sun Microsystems, Inc.
Copyright 1992, 1993, 1994 by FUJITSU LIMITED
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
-in supporting documentation, and that the name of Sun Microsystems, Inc.
-and FUJITSU LIMITED not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior permission.
-Sun Microsystems, Inc. and FUJITSU LIMITED makes no representations about
-the suitability of this software for any purpose.
+in supporting documentation, and that the name of FUJITSU LIMITED
+not be used in advertising or publicity pertaining to distribution
+of the software without specific, written prior permission.
+FUJITSU LIMITED makes no representations about the suitability of
+this software for any purpose.
It is provided "as is" without express or implied warranty.
-Sun Microsystems Inc. AND FUJITSU LIMITED DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL Sun Microsystems, Inc. AND FUJITSU LIMITED
-BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
Author: Hideki Hiura (hhiura@Sun.COM) Sun Microsystems, Inc.
- Takashi Fujiwara FUJITSU LIMITED
+ Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
diff --git a/nx-X11/lib/X11/XimTrans.h b/nx-X11/lib/X11/XimTrans.h
index 0d2cd395a..987b5ee33 100644
--- a/nx-X11/lib/X11/XimTrans.h
+++ b/nx-X11/lib/X11/XimTrans.h
@@ -1,29 +1,50 @@
+/*
+ * Copyright 1992 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
/******************************************************************
- Copyright 1992 by Sun Microsystems, Inc.
Copyright 1992, 1993, 1994 by FUJITSU LIMITED
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
-in supporting documentation, and that the name of Sun Microsystems, Inc.
-and FUJITSU LIMITED not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior permission.
-Sun Microsystems, Inc. and FUJITSU LIMITED makes no representations about
-the suitability of this software for any purpose.
+in supporting documentation, and that the name of FUJITSU LIMITED
+not be used in advertising or publicity pertaining to distribution
+of the software without specific, written prior permission.
+FUJITSU LIMITED makes no representations about the suitability of
+this software for any purpose.
It is provided "as is" without express or implied warranty.
-Sun Microsystems Inc. AND FUJITSU LIMITED DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL Sun Microsystems, Inc. AND FUJITSU LIMITED
-BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
Author: Hideki Hiura (hhiura@Sun.COM) Sun Microsystems, Inc.
- Takashi Fujiwara FUJITSU LIMITED
+ Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
@@ -82,12 +103,6 @@ extern void _XimFreeTransIntrCallback(
Xim im
);
-extern Bool _XimTransIntrCallbackCheck(
- Xim im,
- INT16 len,
- XPointer data
-);
-
extern Bool _XimTransFilterWaitEvent(
Display *d,
Window w,
diff --git a/nx-X11/lib/X11/Ximint.h b/nx-X11/lib/X11/Ximint.h
index 01a535426..f39053f84 100644
--- a/nx-X11/lib/X11/Ximint.h
+++ b/nx-X11/lib/X11/Ximint.h
@@ -12,7 +12,7 @@ Sony Corporation not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission. FUJITSU LIMITED and Sony Corporation makes no
representations about the suitability of this software for any
-purpose. It is provided "as is" without express or implied warranty.
+purpose. It is provided "as is" without express or implied warranty.
FUJITSU LIMITED AND SONY CORPORATION DISCLAIM ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
@@ -21,9 +21,9 @@ SONY CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
+PERFORMANCE OF THIS SOFTWARE.
- Author: Takashi Fujiwara FUJITSU LIMITED
+ Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
Motifier: Makoto Wakamatsu Sony Corporation
makoto@sm.sony.co.jp
@@ -178,6 +178,8 @@ typedef struct _XimDefICValues {
#define XIM_FALSE False
#define XIM_OVERFLOW (-1)
+#define BRL_UC_ROW 0x2800
+
/*
* Global symbols
*/
@@ -225,7 +227,7 @@ extern Bool _XimCheckCreateICValues(
extern XIMResourceList _XimGetResourceListRec(
XIMResourceList res_list,
unsigned int list_num,
- char *name
+ const char *name
);
extern void _XimSetIMMode(
@@ -581,7 +583,7 @@ extern char * _XimEncodeIMATTRIBUTE(
Xim im,
XIMResourceList res_list,
unsigned int res_num,
- XIMArg *arg,
+ XIMArg *arg,
XIMArg **arg_ret,
char *buf,
int size,
@@ -594,7 +596,7 @@ extern char * _XimEncodeICATTRIBUTE(
Xic ic,
XIMResourceList res_list,
unsigned int res_num,
- XIMArg *arg,
+ XIMArg *arg,
XIMArg **arg_ret,
char *buf,
int size,
@@ -668,6 +670,10 @@ extern int _XimLcctstoutf8(
Status *state
);
+extern char _XimGetMyEndian(
+ void
+);
+
extern int _XimCheckDataSize(
XPointer buf,
int len
@@ -833,14 +839,6 @@ extern Bool _XimRead(
XPointer arg
);
-extern Bool _XimIntrCallback(
- Xim im,
- Bool (*callback)(
- Xim, INT16, XPointer, XPointer
- ),
- XPointer call_data
-);
-
extern void _XimFlush(
Xim im
);
@@ -862,9 +860,9 @@ extern CARD32 _XimExtenArgCheck(
#endif
extern Bool _XimCbDispatch(
- Xim im,
- INT16 len,
- XPointer data,
+ Xim im,
+ INT16 len,
+ XPointer data,
XPointer call_data
);
diff --git a/nx-X11/lib/X11/XimintL.h b/nx-X11/lib/X11/XimintL.h
index 7fc6163cd..d2d92387f 100644
--- a/nx-X11/lib/X11/XimintL.h
+++ b/nx-X11/lib/X11/XimintL.h
@@ -15,17 +15,17 @@ makes no representations about the suitability of this software for
any purpose. It is provided "as is" without express or implied
warranty.
-FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM ALL
-WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
-ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
-IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM ALL
+WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR
+ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
- Author: Takashi Fujiwara FUJITSU LIMITED
+ Author: Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
Modifier: Franky Ling Digital Equipment Corporation
frankyling@hgrd01.enet.dec.com
@@ -38,21 +38,36 @@ THIS SOFTWARE.
#define COMPOSE_FILE "Compose"
/*
- * Data Structure for Local Processing
+ * Data Structures for Local Processing
*/
+typedef INT32 DTIndex;
+typedef INT32 DTCharIndex;
+typedef BITS32 DTModifier;
+
typedef struct _DefTree {
- struct _DefTree *next; /* another Key definition */
- struct _DefTree *succession; /* successive Key Sequence */
+ DTIndex next;
+ DTIndex succession; /* successive Key Sequence */
/* Key definitions */
- unsigned modifier_mask;
- unsigned modifier;
+ DTModifier modifier_mask;
+ DTModifier modifier;
KeySym keysym; /* leaf only */
- char *mb;
- wchar_t *wc; /* make from mb */
- char *utf8; /* make from mb */
+ DTCharIndex mb;
+ DTCharIndex wc; /* make from mb */
+ DTCharIndex utf8; /* make from mb */
KeySym ks;
} DefTree;
+typedef struct _DefTreeBase {
+ DefTree *tree;
+ char *mb;
+ wchar_t *wc;
+ char *utf8;
+ DTIndex treeused, treesize;
+ DTCharIndex mbused, mbsize;
+ DTCharIndex wcused, wcsize;
+ DTCharIndex utf8used, utf8size;
+} DefTreeBase;
+
typedef struct _XimLocalPrivateRec {
/* The first fields are identical with XimCommonPrivateRec. */
XlcConv ctom_conv;
@@ -65,7 +80,8 @@ typedef struct _XimLocalPrivateRec {
XlcConv ucstoutf8_conv;
XIC current_ic;
- DefTree *top;
+ DefTreeBase base;
+ DTIndex top;
} XimLocalPrivateRec;
typedef struct _XicThaiPart {
@@ -76,11 +92,15 @@ typedef struct _XicThaiPart {
typedef struct _XicLocalPrivateRec {
long value_mask;
- DefTree *context;
- DefTree *composed;
+ DefTreeBase base;
+ DTIndex context;
+ DTIndex composed;
XicThaiPart thai;
XIMResourceList ic_resources;
unsigned int ic_num_resources;
+
+ unsigned char brl_pressed, brl_committing, brl_committed;
+ Time brl_release_start;
} XicLocalPrivateRec;
#endif /* _XIMINTL_H */
diff --git a/nx-X11/lib/X11/XimintP.h b/nx-X11/lib/X11/XimintP.h
index 809f59e18..89b7c214f 100644
--- a/nx-X11/lib/X11/XimintP.h
+++ b/nx-X11/lib/X11/XimintP.h
@@ -1,6 +1,27 @@
+/*
+ * Copyright 1991, 1992 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
/******************************************************************
- Copyright 1991, 1992 by Sun Microsystems, Inc.
Copyright 1992, 1993, 1994 by FUJITSU LIMITED
Copyright 1993, 1994 by Sony Corporation
@@ -8,25 +29,23 @@ Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
-documentation, and that the name of Sun Microsystems, Inc., FUJITSU
-LIMITED and Sony Corporation not be used in advertising or publicity
-pertaining to distribution of the software without specific, written
-prior permission. Sun Microsystems, Inc., FUJITSU LIMITED and Sony
-Corporation makes no representations about the suitability of this
+documentation, and that the name of FUJITSU LIMITED and Sony Corporation
+not be used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. FUJITSU LIMITED and
+Sony Corporation makes no representations about the suitability of this
software for any purpose. It is provided "as is" without express or
-implied warranty.
+implied warranty.
-Sun Microsystems Inc. ,FUJITSU LIMITED AND SONY CORPORATION DISCLAIMS ALL
-WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL Sun Microsystems, Inc.,
-FUJITSU LIMITED, SONY CORPORATIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
+FUJITSU LIMITED AND SONY CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
+TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL FUJITSU LIMITED OR SONY CORPORATION BE LIABLE
+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
+USE OR PERFORMANCE OF THIS SOFTWARE.
Author: Hideki Hiura (hhiura@Sun.COM) Sun Microsystems, Inc.
- Takashi Fujiwara FUJITSU LIMITED
+ Takashi Fujiwara FUJITSU LIMITED
fujiwara@a80.tech.yk.fujitsu.co.jp
Makoto Wakamatsu Sony Corporation
makoto@sm.sony.co.jp
@@ -242,6 +261,7 @@ typedef struct _XicProtoPrivateRec {
#define IC_CONNECTED (1L)
#define FABLICATED (1L << 1)
#define NEED_SYNC_REPLY (1L << 2)
+#define FOCUSED (1L << 3)
/*
* macro for the flag of XICPrivateRec
@@ -267,6 +287,13 @@ typedef struct _XicProtoPrivateRec {
#define UNMARK_NEED_SYNC_REPLY(ic) \
(((Xic)ic)->private.proto.flag &= ~NEED_SYNC_REPLY)
+#define IS_FOCUSED(ic) \
+ (((Xic)ic)->private.proto.flag & FOCUSED)
+#define MARK_FOCUSED(ic) \
+ (((Xic)ic)->private.proto.flag |= FOCUSED)
+#define UNMARK_FOCUSED(ic) \
+ (((Xic)ic)->private.proto.flag &= ~FOCUSED)
+
/*
* macro for the filter_event_mask of XICPrivateRec
*/
diff --git a/nx-X11/lib/X11/XlcDL.c b/nx-X11/lib/X11/XlcDL.c
index 3bacf6894..879bc51eb 100644
--- a/nx-X11/lib/X11/XlcDL.c
+++ b/nx-X11/lib/X11/XlcDL.c
@@ -1,8 +1,6 @@
/*
Copyright 1985, 1986, 1987, 1991, 1998 The Open Group
-Portions Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
-
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
@@ -14,21 +12,18 @@ permission notice shall be included in all copies or substantial
portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF
-ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
+EVEN IF ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
-Except as contained in this notice, the names of The Open Group and/or
-Sun Microsystems, Inc. shall not be used in advertising or otherwise to
-promote the sale, use or other dealings in this Software without prior
-written authorization from The Open Group and/or Sun Microsystems,
-Inc., as applicable.
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
X Window System is a trademark of The Open Group
@@ -41,6 +36,29 @@ interest in or to any trademark, service mark, logo or trade name of
Sun Microsystems, Inc. or its licensors is granted.
*/
+/*
+ * Copyright 2000 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -141,7 +159,7 @@ strdup_with_underscore(const char *symbol)
{
char *result;
- if ((result = malloc(strlen(symbol) + 2)) == NULL)
+ if ((result = malloc(strlen(symbol) + 2)) == NULL)
return NULL;
result[0] = '_';
strcpy(result + 1, symbol);
@@ -211,7 +229,7 @@ Limit the length of path to prevent stack buffer corruption.
if (!xi18n_objects_list) return;
}
n = parse_line(p, args, 6);
-
+
if (n == 3 || n == 5) {
if (!strcmp(args[0], "XLC")){
xi18n_objects_list[lc_count].type = XLC_OBJECT;
@@ -321,7 +339,7 @@ open_object(
char *lc_dir)
{
char *path;
-
+
if (object->refcount == 0) {
path = __lc_path(object->dl_name, lc_dir);
if (!path)
@@ -401,21 +419,25 @@ _XlcDynamicLoad(const char *lc_name)
dynamicLoadProc lc_loader = (dynamicLoadProc)NULL;
int count;
XI18NObjectsList objects_list;
- char lc_dir[BUFSIZE];
+ char lc_dir[BUFSIZE], lc_lib_dir[BUFSIZE];
if (lc_name == NULL) return (XLCd)NULL;
- if (_XlcLocaleDirName(lc_dir, BUFSIZE, (char *)lc_name) == (char*)NULL)
+ if (_XlcLocaleDirName(lc_dir, BUFSIZE, (char *)lc_name) == (char *)NULL)
+ return (XLCd)NULL;
+ if (_XlcLocaleLibDirName(lc_lib_dir, BUFSIZE, (char *)lc_name) == (char*)NULL)
return (XLCd)NULL;
resolve_object(lc_dir, lc_name);
+ resolve_object(lc_lib_dir, lc_name);
objects_list = xi18n_objects_list;
count = lc_count;
for (; count-- > 0; objects_list++) {
if (objects_list->type != XLC_OBJECT ||
strcmp(objects_list->locale_name, lc_name)) continue;
- if (!open_object (objects_list, lc_dir))
+ if (!open_object (objects_list, lc_dir) && \
+ !open_object (objects_list, lc_lib_dir))
continue;
lc_loader = (dynamicLoadProc)fetch_symbol (objects_list, objects_list->open);
@@ -424,7 +446,7 @@ _XlcDynamicLoad(const char *lc_name)
if (lcd != (XLCd)NULL) {
break;
}
-
+
close_object (objects_list);
}
return (XLCd)lcd;
@@ -446,7 +468,7 @@ _XDynamicOpenIM(XLCd lcd, Display *display, XrmDatabase rdb,
lc_name = lcd->core->name;
- if (_XlcLocaleDirName(lc_dir, BUFSIZE, lc_name) == NULL) return (XIM)0;
+ if (_XlcLocaleLibDirName(lc_dir, BUFSIZE, lc_name) == NULL) return (XIM)0;
count = lc_count;
for (; count-- > 0; objects_list++) {
@@ -462,7 +484,7 @@ _XDynamicOpenIM(XLCd lcd, Display *display, XrmDatabase rdb,
if (im != (XIM)NULL) {
break;
}
-
+
close_object (objects_list);
}
return (XIM)im;
@@ -494,7 +516,7 @@ _XDynamicRegisterIMInstantiateCallback(
lc_name = lcd->core->name;
- if (_XlcLocaleDirName(lc_dir, BUFSIZE, lc_name) == NULL) return False;
+ if (_XlcLocaleLibDirName(lc_dir, BUFSIZE, lc_name) == NULL) return False;
count = lc_count;
for (; count-- > 0; objects_list++) {
@@ -598,7 +620,7 @@ _XDynamicOpenOM(XLCd lcd, Display *display, XrmDatabase rdb,
lc_name = lcd->core->name;
- if (_XlcLocaleDirName(lc_dir, BUFSIZE, lc_name) == NULL) return (XOM)0;
+ if (_XlcLocaleLibDirName(lc_dir, BUFSIZE, lc_name) == NULL) return (XOM)0;
count = lc_count;
for (; count-- > 0; objects_list++) {
@@ -606,7 +628,7 @@ _XDynamicOpenOM(XLCd lcd, Display *display, XrmDatabase rdb,
strcmp(objects_list->locale_name, lc_name)) continue;
if (!open_object (objects_list, lc_dir))
continue;
-
+
om_openOM = (dynamicIOpenProcp)fetch_symbol(objects_list, objects_list->open);
if (!om_openOM) continue;
om = (*om_openOM)(lcd, display, rdb, res_name, res_class);
diff --git a/nx-X11/lib/X11/XlcGeneric.h b/nx-X11/lib/X11/XlcGeneric.h
index 8fa57b9d4..0c008fdaa 100644
--- a/nx-X11/lib/X11/XlcGeneric.h
+++ b/nx-X11/lib/X11/XlcGeneric.h
@@ -134,9 +134,9 @@ typedef struct _XLCdGenericPart {
} XLCdGenericPart;
typedef struct _XLCdGenericRec {
- XLCdCoreRec core;
+ XLCdCoreRec core;
XLCdPublicPart pub;
- XLCdGenericPart gen;
+ XLCdGenericPart gen;
} XLCdGenericRec, *XLCdGeneric;
extern XLCdMethods _XlcGenericMethods;
diff --git a/nx-X11/lib/X11/XlcPubI.h b/nx-X11/lib/X11/XlcPubI.h
index 48a1dea20..22ac2bdf0 100644
--- a/nx-X11/lib/X11/XlcPubI.h
+++ b/nx-X11/lib/X11/XlcPubI.h
@@ -96,7 +96,7 @@ typedef struct _XLCdPublicPart {
} XLCdPublicPart;
typedef struct _XLCdPublicRec {
- XLCdCoreRec core;
+ XLCdCoreRec core;
XLCdPublicPart pub;
} XLCdPublicRec, *XLCdPublic;
@@ -204,6 +204,12 @@ extern int _XlcResolveI18NPath(
int buf_len
);
+extern char *_XlcLocaleLibDirName(
+ char* /* dir_name */,
+ size_t, /* dir_len */
+ char* /* lc_name */
+);
+
extern char *_XlcLocaleDirName(
char* /* dir_name */,
size_t, /* dir_len */
@@ -232,7 +238,7 @@ _Xsetlocale(
int category,
_Xconst char *name);
#else
-#ifdef __DARWIN__
+#ifdef __APPLE__
extern char *
_Xsetlocale(
int category,
diff --git a/nx-X11/lib/X11/XlcSL.c b/nx-X11/lib/X11/XlcSL.c
index 4dcf28edc..526f677fb 100644
--- a/nx-X11/lib/X11/XlcSL.c
+++ b/nx-X11/lib/X11/XlcSL.c
@@ -1,8 +1,6 @@
/*
Copyright 1985, 1986, 1987, 1991, 1998 The Open Group
-Portions Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
-
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
@@ -14,21 +12,18 @@ permission notice shall be included in all copies or substantial
portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF
-ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
+EVEN IF ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
-Except as contained in this notice, the names of The Open Group and/or
-Sun Microsystems, Inc. shall not be used in advertising or otherwise to
-promote the sale, use or other dealings in this Software without prior
-written authorization from The Open Group and/or Sun Microsystems,
-Inc., as applicable.
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
X Window System is a trademark of The Open Group
@@ -41,6 +36,29 @@ interest in or to any trademark, service mark, logo or trade name of
Sun Microsystems, Inc. or its licensors is granted.
*/
+/*
+ * Copyright 2000 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/nx-X11/lib/X11/Xlcint.h b/nx-X11/lib/X11/Xlcint.h
index db2f75a7b..7b10d8fd7 100644
--- a/nx-X11/lib/X11/Xlcint.h
+++ b/nx-X11/lib/X11/Xlcint.h
@@ -40,31 +40,31 @@ from The Open Group.
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of OMRON, NTT Software, NTT, Open
* Software Foundation, and Sony Corporation not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
+ * or publicity pertaining to distribution of the software without specific,
* written prior permission. OMRON, NTT Software, NTT, Open Software
- * Foundation, and Sony Corporation make no representations about the
- * suitability of this software for any purpose. It is provided "as is"
+ * Foundation, and Sony Corporation make no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
- * OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, AND SONY
- * CORPORATION DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
- * SHALL OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, OR SONY
+ * OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, AND SONY
+ * CORPORATION DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
+ * SHALL OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, OR SONY
* CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
+ *
* Authors: Li Yuhong OMRON Corporation
* Tatsuya Kato NTT Software Corporation
* Hiroshi Kuribayashi OMRON Coproration
* Muneiyoshi Suzuki Nippon Telegraph and Telephone Co.
- *
- * M. Collins OSF
+ *
+ * M. Collins OSF
* Katsuhisa Yano TOSHIBA Corp.
* Makoto Wakamatsu Sony Corporation
* Takashi Fujiwara FUJITSU LIMITED
- */
+ */
#ifndef _XLCINT_H_
@@ -110,7 +110,7 @@ typedef struct {
* and Input Context
*/
typedef struct {
- char *resource_name; /* Resource string */
+ const char *resource_name; /* Resource string */
XrmQuark xrm_name; /* Resource name quark */
int resource_size; /* Size in bytes of data */
long resource_offset; /* Offset from base */
@@ -352,7 +352,7 @@ typedef struct {
} XlcArg, *XlcArgList;
typedef struct _XlcResource {
- char *name;
+ const char *name;
XrmQuark xrm_name;
int size;
int offset;
@@ -434,11 +434,11 @@ typedef char* (*XGetOCValuesProc)(
);
/*
- * X Font Sets are an instantiable object, so we define it, the
+ * X Font Sets are an instantiable object, so we define it, the
* object itself, a method list and data
*/
-/*
+/*
* XFontSet object method list
*/
@@ -596,7 +596,7 @@ typedef struct _XOC {
/*
- * X Input Managers are an instantiable object, so we define it, the
+ * X Input Managers are an instantiable object, so we define it, the
* object itself, a method list and data.
*/
@@ -654,7 +654,7 @@ typedef struct {
/*
- * An X Input Manager (IM). Implementations may need to extend this data
+ * An X Input Manager (IM). Implementations may need to extend this data
* structure to accomodate additional data, state information etc.
*/
typedef struct _XIM {
@@ -665,13 +665,13 @@ typedef struct _XIM {
/*
- * X Input Contexts (IC) are an instantiable object, so we define it, the
+ * X Input Contexts (IC) are an instantiable object, so we define it, the
* object itself, a method list and data for this object
*/
/*
* Input Context method list
- */
+ */
typedef struct {
void (*destroy)(
XIC
@@ -738,7 +738,7 @@ typedef struct {
/*
- * an Input Context. Implementations may need to extend this data
+ * an Input Context. Implementations may need to extend this data
* structure to accomodate additional data, state information etc.
*/
typedef struct _XIC {
@@ -910,6 +910,11 @@ extern void _XlcAddUtf8LocaleConverters(
XLCd lcd
);
+/* Registers GB18030 converters for a GB18030 locale. */
+extern void _XlcAddGB18030LocaleConverters(
+ XLCd lcd
+);
+
/* The default locale loader. Assumes an ASCII encoding. */
extern XLCd _XlcDefaultLoader(
const char* name
diff --git a/nx-X11/lib/X11/imKStoUCS.c b/nx-X11/lib/X11/imKStoUCS.c
index 7c8d97574..5cfce420d 100644
--- a/nx-X11/lib/X11/imKStoUCS.c
+++ b/nx-X11/lib/X11/imKStoUCS.c
@@ -65,7 +65,7 @@ static unsigned short const keysym_to_unicode_590_5fe[] = {
0x06f0, 0x06f1, 0x06f2, 0x06f3, 0x06f4, 0x06f5, 0x06f6, 0x06f7, /* 0x0590-0x0597 */
0x06f8, 0x06f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x0598-0x059f */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x066a, 0x0670, 0x0679, /* 0x05a0-0x05a7 */
-
+
0x067e, 0x0686, 0x0688, 0x0691, 0x060c, 0x0000, 0x06d4, 0x0000, /* 0x05ac-0x05af */
0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667, /* 0x05b0-0x05b7 */
0x0668, 0x0669, 0x0000, 0x061b, 0x0000, 0x0000, 0x0000, 0x061f, /* 0x05b8-0x05bf */
@@ -119,11 +119,11 @@ static unsigned short const keysym_to_unicode_8a4_8fe[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x08b0-0x08b7 */
0x0000, 0x0000, 0x0000, 0x0000, 0x2264, 0x2260, 0x2265, 0x222b, /* 0x08b8-0x08bf */
0x2234, 0x0000, 0x221e, 0x0000, 0x0000, 0x2207, 0x0000, 0x0000, /* 0x08c0-0x08c7 */
- 0x2245, 0x2246, 0x0000, 0x0000, 0x0000, 0x0000, 0x22a2, 0x0000, /* 0x08c8-0x08cf */
+ 0x2245, 0x2246, 0x0000, 0x0000, 0x0000, 0x0000, 0x21d2, 0x0000, /* 0x08c8-0x08cf */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x221a, 0x0000, /* 0x08d0-0x08d7 */
0x0000, 0x0000, 0x2282, 0x2283, 0x2229, 0x222a, 0x2227, 0x2228, /* 0x08d8-0x08df */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x08e0-0x08e7 */
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x08e8-0x08ef */
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2202, /* 0x08e8-0x08ef */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0192, 0x0000, /* 0x08f0-0x08f7 */
0x0000, 0x0000, 0x0000, 0x2190, 0x2191, 0x2192, 0x2193 /* 0x08f8-0x08ff */
};
@@ -205,7 +205,7 @@ static unsigned short keysym_to_unicode_12a1_12fe[] = {
0x0175, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1e6b, /* 0x12f0-0x12f7 */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0177 /* 0x12f0-0x12ff */
};
-
+
static unsigned short const keysym_to_unicode_13bc_13be[] = {
0x0152, 0x0153, 0x0178 /* 0x13b8-0x13bf */
};
@@ -317,6 +317,6 @@ KeySymToUcs4(KeySym keysym)
return keysym_to_unicode_1e9f_1eff[keysym - 0x1e9f];
else if (keysym > 0x209f && keysym < 0x20ad)
return keysym_to_unicode_20a0_20ac[keysym - 0x20a0];
- else
+ else
return 0;
}
diff --git a/nx-X11/lib/X11/lcCT.c b/nx-X11/lib/X11/lcCT.c
index 7e8335f87..d7fbb74cb 100644
--- a/nx-X11/lib/X11/lcCT.c
+++ b/nx-X11/lib/X11/lcCT.c
@@ -51,11 +51,11 @@
* Static representation of a character set that can be used in Compound Text.
*/
typedef struct _CTDataRec {
- const char *name;
- const char *ct_sequence; /* Compound Text encoding, ESC sequence */
+ const char name[19];
+ const char ct_sequence[5]; /* Compound Text encoding, ESC sequence */
} CTDataRec, *CTData;
-static CTDataRec default_ct_data[] =
+static const CTDataRec default_ct_data[] =
{
/* */
/* X11 registry name MIME name ISO-IR ESC sequence */
@@ -123,6 +123,8 @@ static CTDataRec default_ct_data[] =
#endif
/* For use by utf8 -> ctext */
{ "BIG5-0:GLGR", "\033%/2"},
+ { "BIG5HKSCS-0:GLGR", "\033%/2"},
+ { "GBK-0:GLGR", "\033%/2"},
/* used by Emacs, but not backed by ISO-IR */
{ "BIG5-E0:GL", "\033$(0" },
{ "BIG5-E0:GR", "\033$)0" },
@@ -317,7 +319,7 @@ _XlcParseCharSet(
const char *ptr = charset->ct_sequence;
int length;
int char_size;
-
+
if (*ptr == '\0')
return False;
@@ -749,7 +751,7 @@ cttocs(
or stop the current run. */
if (charset) {
if (charset != ch_charset)
- break;
+ break;
} else {
state->charset = charset = ch_charset;
}
@@ -789,7 +791,7 @@ cttocs(
or stop the current run. */
if (charset) {
if (charset != state->charset)
- break;
+ break;
} else {
charset = state->charset;
}
@@ -1095,7 +1097,7 @@ strtocs(
while (side == (*((unsigned char *) src) & 0x80) && length-- > 0)
*dst++ = *src++;
-
+
*from_left -= src - (const char *) *from;
*from = (XPointer) src;
*to_left -= dst - (char *) *to;
@@ -1131,7 +1133,7 @@ cstostr(
|| !((XlcCharSet) args[0] == state->GL_charset
|| (XlcCharSet) args[0] == state->GR_charset))
return -1;
-
+
csptr = *((const char **) from);
string_ptr = *((char **) to);
csstr_len = *from_left;
@@ -1260,10 +1262,10 @@ open_cstostr(
/* =========================== Initialization =========================== */
Bool
-_XlcInitCTInfo()
+_XlcInitCTInfo(void)
{
if (ct_list == NULL) {
- CTData ct_data;
+ const CTDataRec *ct_data;
int num;
XlcCharSet charset;
diff --git a/nx-X11/lib/X11/lcCharSet.c b/nx-X11/lib/X11/lcCharSet.c
index 7f0ef3666..0fa39d869 100644
--- a/nx-X11/lib/X11/lcCharSet.c
+++ b/nx-X11/lib/X11/lcCharSet.c
@@ -48,7 +48,7 @@ _XlcGetCharSet(
{
XlcCharSetList list;
XrmQuark xrm_name;
-
+
xrm_name = XrmStringToQuark(name);
for (list = charset_list; list; list = list->next) {
@@ -69,7 +69,7 @@ _XlcGetCharSetWithSide(
{
XlcCharSetList list;
XrmQuark xrm_encoding_name;
-
+
xrm_encoding_name = XrmStringToQuark(encoding_name);
for (list = charset_list; list; list = list->next) {
@@ -95,7 +95,7 @@ _XlcAddCharSet(
list = (XlcCharSetList) Xmalloc(sizeof(XlcCharSetListRec));
if (list == NULL)
return False;
-
+
list->charset = charset;
list->next = charset_list;
charset_list = list;
@@ -156,7 +156,7 @@ _XlcGetCSValues(XlcCharSet charset, ...)
if (args == (XlcArgList) NULL)
return (char *) NULL;
-
+
ret = get_values(charset, args, num_args);
Xfree(args);
diff --git a/nx-X11/lib/X11/lcConv.c b/nx-X11/lib/X11/lcConv.c
index 00e0ebb98..9797e7ed3 100644
--- a/nx-X11/lib/X11/lcConv.c
+++ b/nx-X11/lib/X11/lcConv.c
@@ -60,7 +60,7 @@ get_converter(
XlcConverterList list, prev = NULL;
for (list = conv_list; list; list = list->next) {
- if (list->from_lcd == from_lcd && list->to_lcd == to_lcd
+ if (list->from_lcd == from_lcd && list->to_lcd == to_lcd
&& list->from_type == from_type && list->to_type == to_type) {
if (prev && prev != conv_list) { /* XXX */
@@ -93,7 +93,7 @@ _XlcSetConverter(
to_type = XrmStringToQuark(to);
for (list = conv_list; list; list = list->next) {
- if (list->from_lcd == from_lcd && list->to_lcd == to_lcd
+ if (list->from_lcd == from_lcd && list->to_lcd == to_lcd
&& list->from_type == from_type && list->to_type == to_type) {
list->converter = converter;
diff --git a/nx-X11/lib/X11/lcDB.c b/nx-X11/lib/X11/lcDB.c
index 229f517e4..1353acfe3 100644
--- a/nx-X11/lib/X11/lcDB.c
+++ b/nx-X11/lib/X11/lcDB.c
@@ -13,7 +13,7 @@
* software without specific, written prior permission.
*
* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS, AND
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS, AND
* NONINFRINGEMENT OF THIRD PARTY RIGHTS, IN NO EVENT SHALL
* IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
@@ -97,10 +97,7 @@ typedef enum {
typedef struct {
Token token; /* token id */
- const char *name; /* token sequence */
int len; /* length of token sequence */
- int (*parse_proc)(const char *str, Token token, Database *db);
- /* parsing procedure */
} TokenTable;
static int f_newline (const char *str, Token token, Database *db);
@@ -114,20 +111,20 @@ static int f_backslash (const char *str, Token token, Database *db);
static int f_numeric (const char *str, Token token, Database *db);
static int f_default (const char *str, Token token, Database *db);
-static TokenTable token_tbl[] = {
- { T_NEWLINE, "\n", 1, f_newline },
- { T_COMMENT, "#", 1, f_comment },
- { T_SEMICOLON, ";", 1, f_semicolon },
- { T_DOUBLE_QUOTE, "\"", 1, f_double_quote },
- { T_LEFT_BRACE, "{", 1, f_left_brace },
- { T_RIGHT_BRACE, "}", 1, f_right_brace },
- { T_SPACE, " ", 1, f_white },
- { T_TAB, "\t", 1, f_white },
- { T_BACKSLASH, "\\", 1, f_backslash },
- { T_NUMERIC_HEX, "\\x", 2, f_numeric },
- { T_NUMERIC_DEC, "\\d", 2, f_numeric },
- { T_NUMERIC_OCT, "\\o", 2, f_numeric },
- { T_DEFAULT, " ", 1, f_default } /* any character */
+static const TokenTable token_tbl[] = {
+ { T_NEWLINE, 1 },
+ { T_COMMENT, 1 },
+ { T_SEMICOLON, 1 },
+ { T_DOUBLE_QUOTE, 1 },
+ { T_LEFT_BRACE, 1 },
+ { T_RIGHT_BRACE, 1 },
+ { T_SPACE, 1 },
+ { T_TAB, 1 },
+ { T_BACKSLASH, 1 },
+ { T_NUMERIC_HEX, 2 },
+ { T_NUMERIC_DEC, 2 },
+ { T_NUMERIC_OCT, 2 },
+ { T_DEFAULT, 1 } /* any character */
};
#define SYM_CR '\r'
@@ -517,7 +514,8 @@ append_value_list (void)
goto err1;
}
if (value != *value_list) {
- int delta, i;
+ int i;
+ ssize_t delta;
delta = value - *value_list;
*value_list = value;
for (i = 1; i < value_num; ++i) {
@@ -551,7 +549,7 @@ append_value_list (void)
return 0;
}
-static int
+static int
construct_name(
char *name,
int size)
@@ -635,6 +633,7 @@ store_to_database(
if (new->name) {
Xfree(new->name);
}
+ Xfree(new);
}
if (parse_info.value) {
if (*parse_info.value) {
@@ -835,7 +834,7 @@ f_double_quote(
len = get_quoted_word(str, wordp);
if (len < 1)
goto err;
- if ((parse_info.bufsize + (int)strlen(wordp) + 1)
+ if ((parse_info.bufsize + (int)strlen(wordp) + 1)
>= parse_info.bufMaxSize) {
if (realloc_parse_info(strlen(wordp)+1) == False) {
goto err;
@@ -897,7 +896,7 @@ f_numeric(
len = get_word(p, wordp);
if (len < 1)
goto err;
- if ((parse_info.bufsize + token_len + (int)strlen(wordp) + 1)
+ if ((parse_info.bufsize + token_len + (int)strlen(wordp) + 1)
>= parse_info.bufMaxSize) {
if (realloc_parse_info(token_len + strlen(wordp) + 1) == False)
goto err;
@@ -974,7 +973,7 @@ f_default(
break;
case S_NAME:
case S_VALUE:
- if ((parse_info.bufsize + (int)strlen(wordp) + 1)
+ if ((parse_info.bufsize + (int)strlen(wordp) + 1)
>= parse_info.bufMaxSize) {
if (realloc_parse_info(strlen(wordp) + 1) == False)
goto err;
@@ -1089,8 +1088,48 @@ CreateDatabase(
}
p = line.str;
while (*p) {
+ int (*parse_proc)(const char *str, Token token, Database *db) = NULL;
+
token = get_token(p);
- len = (*token_tbl[token].parse_proc)(p, token, &db);
+
+ switch (token_tbl[token].token) {
+ case T_NEWLINE:
+ parse_proc = f_newline;
+ break;
+ case T_COMMENT:
+ parse_proc = f_comment;
+ break;
+ case T_SEMICOLON:
+ parse_proc = f_semicolon;
+ break;
+ case T_DOUBLE_QUOTE:
+ parse_proc = f_double_quote;
+ break;
+ case T_LEFT_BRACE:
+ parse_proc = f_left_brace;
+ break;
+ case T_RIGHT_BRACE:
+ parse_proc = f_right_brace;
+ break;
+ case T_SPACE:
+ case T_TAB:
+ parse_proc = f_white;
+ break;
+ case T_BACKSLASH:
+ parse_proc = f_backslash;
+ break;
+ case T_NUMERIC_HEX:
+ case T_NUMERIC_DEC:
+ case T_NUMERIC_OCT:
+ parse_proc = f_numeric;
+ break;
+ case T_DEFAULT:
+ parse_proc = f_default;
+ break;
+ }
+
+ len = parse_proc(p, token, &db);
+
if (len < 1) {
error = 1;
break;
diff --git a/nx-X11/lib/X11/lcGeneric.c b/nx-X11/lib/X11/lcGeneric.c
index 67c8ba030..69ea97db8 100644
--- a/nx-X11/lib/X11/lcGeneric.c
+++ b/nx-X11/lib/X11/lcGeneric.c
@@ -714,7 +714,7 @@ load_generic(
/***** wc_encoding_mask *****/
_XlcGetResource(lcd, "XLC_XLOCALE", "wc_encoding_mask", &value, &num);
if (num > 0) {
- if (string_to_ulong(value[0], &l) == False)
+ if (string_to_ulong(value[0], &l) == False)
goto err;
gen->wc_encode_mask = l;
}
@@ -736,7 +736,7 @@ load_generic(
gen->force_convert_to_mb = True;
else
gen->force_convert_to_mb = False;
-
+
for (i = 0; ; i++) {
CodeSetRec *codeset = NULL;
char cs[16];
@@ -786,7 +786,7 @@ load_generic(
sprintf(name, "%s.%s", cs, "mb_encoding");
_XlcGetResource(lcd, "XLC_XLOCALE", name, &value, &num);
if (num > 0) {
- static struct {
+ static struct {
const char *str;
EncodingType type;
} shifts[] = {
@@ -811,7 +811,7 @@ load_generic(
break;
}
}
- if (strlen (tmp) > sizeof encoding ||
+ if (strlen (tmp) > sizeof encoding ||
string_to_encoding(tmp, encoding) == False)
goto err;
add_parse_list(gen, type, encoding, codeset);
@@ -824,11 +824,11 @@ load_generic(
if (num > 0) {
if (codeset == NULL && (codeset = add_codeset(gen)) == NULL)
goto err;
- if (string_to_ulong(value[0], &l) == False)
+ if (string_to_ulong(value[0], &l) == False)
goto err;
codeset->wc_encoding = l;
}
-
+
/***** codeset.ct_encoding *****/
sprintf(name, "%s.%s", cs, "ct_encoding");
_XlcGetResource(lcd, "XLC_XLOCALE", name, &value, &num);
@@ -948,7 +948,7 @@ load_generic(
/* For VW/UDC end */
}
-
+
read_charset_define(lcd,gen); /* For VW/UDC */
read_segmentconversion(lcd,gen); /* For VW/UDC */
@@ -1005,8 +1005,7 @@ initialize_core(
#endif
static Bool
-initialize(lcd)
- XLCd lcd;
+initialize(XLCd lcd)
{
XLCdPublicMethods superclass = (XLCdPublicMethods) _XlcPublicMethods;
@@ -1029,7 +1028,7 @@ initialize(lcd)
}
/* VW/UDC start 95.01.08 */
-static void
+static void
freeByteM(
CodeSet codeset)
{
@@ -1045,11 +1044,11 @@ freeByteM(
blst[i].byteinfo = NULL;
}
}
- Xfree(codeset->byteM);
+ Xfree(codeset->byteM);
codeset->byteM = NULL;
}
-static void
+static void
freeConversion(
CodeSet codeset)
{
@@ -1076,7 +1075,7 @@ freeConversion(
}
}
-static void
+static void
freeExtdSegment(
CodeSet codeset)
{
@@ -1093,11 +1092,11 @@ freeExtdSegment(
Xfree(ctextseg->area);
ctextseg->area = NULL;
}
- Xfree(codeset->ctextseg);
+ Xfree(codeset->ctextseg);
codeset->ctextseg = NULL;
}
-static void
+static void
freeParseInfo(
CodeSet codeset)
{
@@ -1110,7 +1109,7 @@ freeParseInfo(
Xfree(parse_info->encoding);
parse_info->encoding = NULL;
}
- Xfree(codeset->parse_info);
+ Xfree(codeset->parse_info);
codeset->parse_info = NULL;
}
@@ -1152,7 +1151,7 @@ destroy_SegConv(
seg[i].source_encoding = NULL;
}
if (seg[i].destination_encoding) {
- Xfree(seg[i].destination_encoding);
+ Xfree(seg[i].destination_encoding);
seg[i].destination_encoding = NULL;
}
if (seg[i].conv) {
diff --git a/nx-X11/lib/X11/lcInit.c b/nx-X11/lib/X11/lcInit.c
index fb9fde9f4..ee66b8c92 100644
--- a/nx-X11/lib/X11/lcInit.c
+++ b/nx-X11/lib/X11/lcInit.c
@@ -1,8 +1,6 @@
/*
Copyright 1985, 1986, 1987, 1991, 1998 The Open Group
-Portions Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
-
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
@@ -14,21 +12,18 @@ permission notice shall be included in all copies or substantial
portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF
-ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
+EVEN IF ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
-Except as contained in this notice, the names of The Open Group and/or
-Sun Microsystems, Inc. shall not be used in advertising or otherwise to
-promote the sale, use or other dealings in this Software without prior
-written authorization from The Open Group and/or Sun Microsystems,
-Inc., as applicable.
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
X Window System is a trademark of The Open Group
@@ -42,6 +37,29 @@ Sun Microsystems, Inc. or its licensors is granted.
*/
/*
+ * Copyright 2000 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/*
* Copyright 1992, 1993 by TOSHIBA Corp.
*
* Permission to use, copy, modify, and distribute this software and its
@@ -70,7 +88,7 @@ Sun Microsystems, Inc. or its licensors is granted.
* This is source code modified by FUJITSU LIMITED under the Joint
* Development Agreement for the CDE/Motif PST.
*
- * Modifier: Masayoshi Shimamura FUJITSU LIMITED
+ * Modifier: Masayoshi Shimamura FUJITSU LIMITED
*
*/
@@ -101,7 +119,7 @@ Sun Microsystems, Inc. or its licensors is granted.
*/
void
-_XlcInitLoader()
+_XlcInitLoader(void)
{
#ifdef USE_DYNAMIC_LC
@@ -140,7 +158,7 @@ _XlcInitLoader()
}
void
-_XlcDeInitLoader()
+_XlcDeInitLoader(void)
{
#ifdef USE_DYNAMIC_LC
diff --git a/nx-X11/lib/X11/lcPrTxt.c b/nx-X11/lib/X11/lcPrTxt.c
index 2d68bfb93..b86fb7f5e 100644
--- a/nx-X11/lib/X11/lcPrTxt.c
+++ b/nx-X11/lib/X11/lcPrTxt.c
@@ -79,7 +79,7 @@ copy_list(
if (is_wide_char) {
wchar_t *wc_text, *wstr, **wstr_list;
-
+
wc_text = (wchar_t *) text;
wstr_list = (wchar_t **) list;
@@ -92,7 +92,7 @@ copy_list(
}
} else {
char *mb_text, *str, **str_list;
-
+
mb_text = (char *) text;
str_list = (char **) list;
diff --git a/nx-X11/lib/X11/lcPubWrap.c b/nx-X11/lib/X11/lcPubWrap.c
index 70e93d209..2a5ac08d8 100644
--- a/nx-X11/lib/X11/lcPubWrap.c
+++ b/nx-X11/lib/X11/lcPubWrap.c
@@ -48,7 +48,7 @@ _XGetLCValues(XLCd lcd, ...)
if (args == (XlcArgList) NULL)
return (char *) NULL;
-
+
ret = (*methods->get_values)(lcd, args, num_args);
Xfree(args);
@@ -79,17 +79,17 @@ _XlcCreateLC(
if (lcd->core->name == NULL) {
lcd->core->name = (char*) Xmalloc(strlen(name) + 1);
- if (lcd->core->name == NULL)
+ if (lcd->core->name == NULL)
goto err;
strcpy(lcd->core->name, name);
}
-
+
if (lcd->methods == NULL)
lcd->methods = methods;
if ((*pub_methods->pub.initialize)(lcd) == False)
goto err;
-
+
return lcd;
err:
diff --git a/nx-X11/lib/X11/lcPublic.c b/nx-X11/lib/X11/lcPublic.c
index 8cff046c4..2c02f5fba 100644
--- a/nx-X11/lib/X11/lcPublic.c
+++ b/nx-X11/lib/X11/lcPublic.c
@@ -59,7 +59,7 @@ static XLCdPublicMethodsRec publicMethods = {
default_string,
NULL,
NULL
- },
+ },
{
NULL,
create,
@@ -216,9 +216,9 @@ initialize(
name = lcd->core->name;
#if !defined(X_LOCALE)
- /*
- * _XlMapOSLocaleName will return the same string or a substring
- * of name, so strlen(name) is okay
+ /*
+ * _XlMapOSLocaleName will return the same string or a substring
+ * of name, so strlen(name) is okay
*/
if ((len = strlen(name)) < sizeof sinamebuf)
siname = sinamebuf;
diff --git a/nx-X11/lib/X11/lcStd.c b/nx-X11/lib/X11/lcStd.c
index 8faee0151..87f6b60b3 100644
--- a/nx-X11/lib/X11/lcStd.c
+++ b/nx-X11/lib/X11/lcStd.c
@@ -133,7 +133,7 @@ _Xlcmbstowcs(
if (lcd == NULL)
return -1;
}
-
+
conv = _XlcOpenConverter(lcd, XlcNMultiByte, lcd, XlcNWideChar);
if (conv == NULL)
return -1;
@@ -288,7 +288,7 @@ _Xwcslen(
while (*wstr_ptr)
wstr_ptr++;
-
+
return wstr_ptr - wstr;
}
diff --git a/nx-X11/lib/X11/lcTxtPr.c b/nx-X11/lib/X11/lcTxtPr.c
index 482c49999..e980f0168 100644
--- a/nx-X11/lib/X11/lcTxtPr.c
+++ b/nx-X11/lib/X11/lcTxtPr.c
@@ -91,7 +91,7 @@ _XTextListToTextProperty(
buf_len = get_buf_size(is_wide_char, list, count);
if ((buf = (char *) Xmalloc(buf_len)) == NULL)
return XNoMemory;
-
+
switch (style) {
case XStringStyle:
case XStdICCTextStyle:
@@ -114,7 +114,7 @@ _XTextListToTextProperty(
mb_list = (char **) list;
to = buf;
for (i = 0; i < count && buf_len > 0; i++) {
- if (*mb_list)
+ if (*mb_list)
strcpy(to, *mb_list);
else
*to = '\0';
diff --git a/nx-X11/lib/X11/lcUTF8.c b/nx-X11/lib/X11/lcUTF8.c
index 4377bde40..3e934b713 100644
--- a/nx-X11/lib/X11/lcUTF8.c
+++ b/nx-X11/lib/X11/lcUTF8.c
@@ -1,4 +1,3 @@
-/* $TOG: $ */
/******************************************************************
Copyright 1993 by SunSoft, Inc.
@@ -206,13 +205,13 @@ typedef struct {
} Summary16;
#include "lcUniConv/gb2312.h"
-#include "lcUniConv/gbk.h"
#include "lcUniConv/jisx0208.h"
#include "lcUniConv/jisx0212.h"
#include "lcUniConv/ksc5601.h"
#include "lcUniConv/big5.h"
#include "lcUniConv/big5_emacs.h"
#include "lcUniConv/big5hkscs.h"
+#include "lcUniConv/gbk.h"
static Utf8ConvRec all_charsets[] = {
/* The ISO10646-1/UTF-8 entry occurs twice, once at the beginning
@@ -333,14 +332,20 @@ static Utf8ConvRec all_charsets[] = {
cp1256_mbtowc, cp1256_wctomb
},
{ "BIG5-0", NULLQUARK,
- big5_mbtowc, big5_wctomb
- },
+ big5_mbtowc, big5_wctomb
+ },
{ "BIG5-E0", NULLQUARK,
big5_0_mbtowc, big5_0_wctomb
},
{ "BIG5-E1", NULLQUARK,
big5_1_mbtowc, big5_1_wctomb
},
+ { "GBK-0", NULLQUARK,
+ gbk_mbtowc, gbk_wctomb
+ },
+ { "BIG5HKSCS-0", NULLQUARK,
+ big5hkscs_mbtowc, big5hkscs_wctomb
+ },
/* The ISO10646-1/UTF-8 entry occurs twice, once at the beginning
(for lookup speed), once at the end (as a fallback). */
@@ -1808,6 +1813,515 @@ open_utf8tofcs(
return create_tofontcs_conv(from_lcd, &methods_utf8tocs);
}
+/* ========================== iconv Stuff ================================ */
+
+/* from XlcNCharSet to XlcNMultiByte */
+
+static int
+iconv_cstombs(XlcConv conv, XPointer *from, int *from_left,
+ XPointer *to, int *to_left, XPointer *args, int num_args)
+{
+ XlcCharSet charset;
+ char const *name;
+ Utf8Conv convptr;
+ int i;
+ unsigned char const *src;
+ unsigned char const *srcend;
+ unsigned char *dst;
+ unsigned char *dstend;
+ int unconv_num;
+
+ if (from == NULL || *from == NULL)
+ return 0;
+
+ if (num_args < 1)
+ return -1;
+
+ charset = (XlcCharSet) args[0];
+ name = charset->encoding_name;
+ /* not charset->name because the latter has a ":GL"/":GR" suffix */
+
+ for (convptr = all_charsets, i = all_charsets_count-1; i > 0; convptr++, i--)
+ if (!strcmp(convptr->name, name))
+ break;
+ if (i == 0)
+ return -1;
+
+ src = (unsigned char const *) *from;
+ srcend = src + *from_left;
+ dst = (unsigned char *) *to;
+ dstend = dst + *to_left;
+ unconv_num = 0;
+
+ while (src < srcend) {
+ ucs4_t wc;
+ int consumed;
+ int count;
+
+ consumed = convptr->cstowc(conv, &wc, src, srcend-src);
+ if (consumed == RET_ILSEQ)
+ return -1;
+ if (consumed == RET_TOOFEW(0))
+ break;
+
+ /* Use stdc iconv to convert widechar -> multibyte */
+
+ count = wctomb((char *)dst, wc);
+ if (count == 0)
+ break;
+ if (count == -1) {
+ count = wctomb((char *)dst, BAD_WCHAR);
+ if (count == 0)
+ break;
+ unconv_num++;
+ }
+ src += consumed;
+ dst += count;
+ }
+
+ *from = (XPointer) src;
+ *from_left = srcend - src;
+ *to = (XPointer) dst;
+ *to_left = dstend - dst;
+
+ return unconv_num;
+
+}
+
+static XlcConvMethodsRec iconv_cstombs_methods = {
+ close_converter,
+ iconv_cstombs,
+ NULL
+};
+
+static XlcConv
+open_iconv_cstombs(XLCd from_lcd, const char *from_type, XLCd to_lcd, const char *to_type)
+{
+ lazy_init_all_charsets();
+ return create_conv(from_lcd, &iconv_cstombs_methods);
+}
+
+static int
+iconv_mbstocs(XlcConv conv, XPointer *from, int *from_left,
+ XPointer *to, int *to_left, XPointer *args, int num_args)
+{
+ Utf8Conv *preferred_charsets;
+ XlcCharSet last_charset = NULL;
+ unsigned char const *src;
+ unsigned char const *srcend;
+ unsigned char *dst;
+ unsigned char *dstend;
+ int unconv_num;
+
+ if (from == NULL || *from == NULL)
+ return 0;
+
+ preferred_charsets = (Utf8Conv *) conv->state;
+ src = (unsigned char const *) *from;
+ srcend = src + *from_left;
+ dst = (unsigned char *) *to;
+ dstend = dst + *to_left;
+ unconv_num = 0;
+
+ while (src < srcend && dst < dstend) {
+ Utf8Conv chosen_charset = NULL;
+ XlcSide chosen_side = XlcNONE;
+ wchar_t wc;
+ int consumed;
+ int count;
+
+ /* Uses stdc iconv to convert multibyte -> widechar */
+
+ consumed = mbtowc(&wc, (const char *)src, srcend-src);
+ if (consumed == 0)
+ break;
+ if (consumed == -1) {
+ src++;
+ unconv_num++;
+ continue;
+ }
+
+ count = charset_wctocs(preferred_charsets, &chosen_charset, &chosen_side, conv, dst, wc, dstend-dst);
+
+ if (count == RET_TOOSMALL)
+ break;
+ if (count == RET_ILSEQ) {
+ src += consumed;
+ unconv_num++;
+ continue;
+ }
+
+ if (last_charset == NULL) {
+ last_charset =
+ _XlcGetCharSetWithSide(chosen_charset->name, chosen_side);
+ if (last_charset == NULL) {
+ src += consumed;
+ unconv_num++;
+ continue;
+ }
+ } else {
+ if (!(last_charset->xrm_encoding_name == chosen_charset->xrm_name
+ && (last_charset->side == XlcGLGR
+ || last_charset->side == chosen_side)))
+ break;
+ }
+ src += consumed;
+ dst += count;
+ }
+
+ if (last_charset == NULL)
+ return -1;
+
+ *from = (XPointer) src;
+ *from_left = srcend - src;
+ *to = (XPointer) dst;
+ *to_left = dstend - dst;
+
+ if (num_args >= 1)
+ *((XlcCharSet *)args[0]) = last_charset;
+
+ return unconv_num;
+}
+
+static XlcConvMethodsRec iconv_mbstocs_methods = {
+ close_tocs_converter,
+ iconv_mbstocs,
+ NULL
+};
+
+static XlcConv
+open_iconv_mbstocs(XLCd from_lcd, const char *from_type, XLCd to_lcd, const char *to_type)
+{
+ return create_tocs_conv(from_lcd, &iconv_mbstocs_methods);
+}
+
+/* from XlcNMultiByte to XlcNChar */
+
+static int
+iconv_mbtocs(XlcConv conv, XPointer *from, int *from_left,
+ XPointer *to, int *to_left, XPointer *args, int num_args)
+{
+ Utf8Conv *preferred_charsets;
+ XlcCharSet last_charset = NULL;
+ unsigned char const *src;
+ unsigned char const *srcend;
+ unsigned char *dst;
+ unsigned char *dstend;
+ int unconv_num;
+
+ if (from == NULL || *from == NULL)
+ return 0;
+
+ preferred_charsets = (Utf8Conv *) conv->state;
+ src = (unsigned char const *) *from;
+ srcend = src + *from_left;
+ dst = (unsigned char *) *to;
+ dstend = dst + *to_left;
+ unconv_num = 0;
+
+ while (src < srcend && dst < dstend) {
+ Utf8Conv chosen_charset = NULL;
+ XlcSide chosen_side = XlcNONE;
+ wchar_t wc;
+ int consumed;
+ int count;
+
+ /* Uses stdc iconv to convert multibyte -> widechar */
+
+ consumed = mbtowc(&wc, (const char *)src, srcend-src);
+ if (consumed == 0)
+ break;
+ if (consumed == -1) {
+ src++;
+ unconv_num++;
+ continue;
+ }
+
+ count = charset_wctocs(preferred_charsets, &chosen_charset, &chosen_side, conv, dst, wc, dstend-dst);
+ if (count == RET_TOOSMALL)
+ break;
+ if (count == RET_ILSEQ) {
+ src += consumed;
+ unconv_num++;
+ continue;
+ }
+
+ if (last_charset == NULL) {
+ last_charset =
+ _XlcGetCharSetWithSide(chosen_charset->name, chosen_side);
+ if (last_charset == NULL) {
+ src += consumed;
+ unconv_num++;
+ continue;
+ }
+ } else {
+ if (!(last_charset->xrm_encoding_name == chosen_charset->xrm_name
+ && (last_charset->side == XlcGLGR
+ || last_charset->side == chosen_side)))
+ break;
+ }
+ src += consumed;
+ dst += count;
+ }
+
+ if (last_charset == NULL)
+ return -1;
+
+ *from = (XPointer) src;
+ *from_left = srcend - src;
+ *to = (XPointer) dst;
+ *to_left = dstend - dst;
+
+ if (num_args >= 1)
+ *((XlcCharSet *)args[0]) = last_charset;
+
+ return unconv_num;
+}
+
+static XlcConvMethodsRec iconv_mbtocs_methods = {
+ close_tocs_converter,
+ iconv_mbtocs,
+ NULL
+};
+
+static XlcConv
+open_iconv_mbtocs(XLCd from_lcd, const char *from_type, XLCd to_lcd, const char *to_type)
+{
+ return create_tocs_conv(from_lcd, &iconv_mbtocs_methods );
+}
+
+/* from XlcNMultiByte to XlcNString */
+
+static int
+iconv_mbstostr(XlcConv conv, XPointer *from, int *from_left,
+ XPointer *to, int *to_left, XPointer *args, int num_args)
+{
+ unsigned char const *src;
+ unsigned char const *srcend;
+ unsigned char *dst;
+ unsigned char *dstend;
+ int unconv_num;
+
+ if (from == NULL || *from == NULL)
+ return 0;
+
+ src = (unsigned char const *) *from;
+ srcend = src + *from_left;
+ dst = (unsigned char *) *to;
+ dstend = dst + *to_left;
+ unconv_num = 0;
+
+ while (src < srcend) {
+ unsigned char c;
+ wchar_t wc;
+ int consumed;
+
+ /* Uses stdc iconv to convert multibyte -> widechar */
+
+ consumed = mbtowc(&wc, (const char *)src, srcend-src);
+ if (consumed == 0)
+ break;
+ if (dst == dstend)
+ break;
+ if (consumed == -1) {
+ consumed = 1;
+ c = BAD_CHAR;
+ unconv_num++;
+ } else {
+ if ((wc & ~(wchar_t)0xff) != 0) {
+ c = BAD_CHAR;
+ unconv_num++;
+ } else
+ c = (unsigned char) wc;
+ }
+ *dst++ = c;
+ src += consumed;
+ }
+
+ *from = (XPointer) src;
+ *from_left = srcend - src;
+ *to = (XPointer) dst;
+ *to_left = dstend - dst;
+
+ return unconv_num;
+}
+
+static XlcConvMethodsRec iconv_mbstostr_methods = {
+ close_converter,
+ iconv_mbstostr,
+ NULL
+};
+
+static XlcConv
+open_iconv_mbstostr(XLCd from_lcd, const char *from_type, XLCd to_lcd, const char *to_type)
+{
+ return create_conv(from_lcd, &iconv_mbstostr_methods);
+}
+
+/* from XlcNString to XlcNMultiByte */
+static int
+iconv_strtombs(XlcConv conv, XPointer *from, int *from_left,
+ XPointer *to, int *to_left, XPointer *args, int num_args)
+{
+ unsigned char const *src;
+ unsigned char const *srcend;
+ unsigned char *dst;
+ unsigned char *dstend;
+
+ if (from == NULL || *from == NULL)
+ return 0;
+
+ src = (unsigned char const *) *from;
+ srcend = src + *from_left;
+ dst = (unsigned char *) *to;
+ dstend = dst + *to_left;
+
+ while (src < srcend) {
+ int count = wctomb((char *)dst, *src);
+ if (count < 0)
+ break;
+ dst += count;
+ src++;
+ }
+
+ *from = (XPointer) src;
+ *from_left = srcend - src;
+ *to = (XPointer) dst;
+ *to_left = dstend - dst;
+
+ return 0;
+}
+
+static XlcConvMethodsRec iconv_strtombs_methods= {
+ close_converter,
+ iconv_strtombs,
+ NULL
+};
+
+static XlcConv
+open_iconv_strtombs(XLCd from_lcd, const char *from_type, XLCd to_lcd, const char *to_type)
+{
+ return create_conv(from_lcd, &iconv_strtombs_methods);
+}
+
+/***************************************************************************/
+/* Part II: An iconv locale loader.
+ *
+ *Here we can assume that "multi-byte" is iconv and that `wchar_t' is Unicode.
+ */
+
+/* from XlcNMultiByte to XlcNWideChar */
+static int
+iconv_mbstowcs(XlcConv conv, XPointer *from, int *from_left,
+ XPointer *to, int *to_left, XPointer *args, int num_args)
+{
+ char *src = *((char **) from);
+ wchar_t *dst = *((wchar_t **) to);
+ int src_left = *from_left;
+ int dst_left = *to_left;
+ int length, unconv_num = 0;
+
+ while (src_left > 0 && dst_left > 0) {
+ length = mbtowc(dst, src, src_left);
+
+ if (length > 0) {
+ src += length;
+ src_left -= length;
+ if (dst)
+ dst++;
+ dst_left--;
+ } else if (length < 0) {
+ src++;
+ src_left--;
+ unconv_num++;
+ } else {
+ /* null ? */
+ src++;
+ src_left--;
+ if (dst)
+ *dst++ = L'\0';
+ dst_left--;
+ }
+ }
+
+ *from = (XPointer) src;
+ if (dst)
+ *to = (XPointer) dst;
+ *from_left = src_left;
+ *to_left = dst_left;
+
+ return unconv_num;
+}
+
+static XlcConvMethodsRec iconv_mbstowcs_methods = {
+ close_converter,
+ iconv_mbstowcs,
+ NULL
+} ;
+
+static XlcConv
+open_iconv_mbstowcs(XLCd from_lcd, const char *from_type, XLCd to_lcd, const char *to_type)
+{
+ return create_conv(from_lcd, &iconv_mbstowcs_methods);
+}
+
+static int
+iconv_wcstombs(XlcConv conv, XPointer *from, int *from_left,
+ XPointer *to, int *to_left, XPointer *args, int num_args)
+{
+ wchar_t *src = *((wchar_t **) from);
+ char *dst = *((char **) to);
+ int src_left = *from_left;
+ int dst_left = *to_left;
+ int length, unconv_num = 0;
+
+ while (src_left > 0 && dst_left >= MB_CUR_MAX) {
+ length = wctomb(dst, *src); /* XXX */
+
+ if (length > 0) {
+ src++;
+ src_left--;
+ if (dst)
+ dst += length;
+ dst_left -= length;
+ } else if (length < 0) {
+ src++;
+ src_left--;
+ unconv_num++;
+ }
+ }
+
+ *from = (XPointer) src;
+ if (dst)
+ *to = (XPointer) dst;
+ *from_left = src_left;
+ *to_left = dst_left;
+
+ return unconv_num;
+}
+
+static XlcConvMethodsRec iconv_wcstombs_methods = {
+ close_converter,
+ iconv_wcstombs,
+ NULL
+} ;
+
+static XlcConv
+open_iconv_wcstombs(XLCd from_lcd, const char *from_type, XLCd to_lcd, const char *to_type)
+{
+ return create_conv(from_lcd, &iconv_wcstombs_methods);
+}
+
+static XlcConv
+open_iconv_mbstofcs(
+ XLCd from_lcd,
+ const char *from_type,
+ XLCd to_lcd,
+ const char *to_type)
+{
+ return create_tofontcs_conv(from_lcd, &iconv_mbstocs_methods);
+}
+
/* Registers UTF-8 converters for a UTF-8 locale. */
void
@@ -1843,3 +2357,34 @@ _XlcAddUtf8LocaleConverters(
_XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNFontCharSet, open_utf8tofcs);
_XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNFontCharSet, open_wcstofcs);
}
+
+void
+_XlcAddGB18030LocaleConverters(
+ XLCd lcd)
+{
+
+ /* Register elementary converters. */
+ _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNWideChar, open_iconv_mbstowcs);
+ _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNMultiByte, open_iconv_wcstombs);
+
+ /* Register converters for XlcNCharSet. This implicitly provides
+ * converters from and to XlcNCompoundText. */
+
+ _XlcSetConverter(lcd, XlcNCharSet, lcd, XlcNMultiByte, open_iconv_cstombs);
+ _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNCharSet, open_iconv_mbstocs);
+ _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNChar, open_iconv_mbtocs);
+ _XlcSetConverter(lcd, XlcNString, lcd, XlcNMultiByte, open_iconv_strtombs);
+ _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNString, open_iconv_mbstostr);
+
+ /* Register converters for XlcNFontCharSet */
+ _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNFontCharSet, open_iconv_mbstofcs);
+
+ _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNString, open_wcstostr);
+ _XlcSetConverter(lcd, XlcNString, lcd, XlcNWideChar, open_strtowcs);
+ _XlcSetConverter(lcd, XlcNCharSet, lcd, XlcNWideChar, open_cstowcs);
+ _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNCharSet, open_wcstocs);
+ _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNChar, open_wcstocs1);
+
+ /* Register converters for XlcNFontCharSet */
+ _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNFontCharSet, open_wcstofcs);
+}
diff --git a/nx-X11/lib/X11/lcUtil.c b/nx-X11/lib/X11/lcUtil.c
index f58593009..52a16daea 100644
--- a/nx-X11/lib/X11/lcUtil.c
+++ b/nx-X11/lib/X11/lcUtil.c
@@ -38,7 +38,7 @@
/* Compares two ISO 8859-1 strings, ignoring case of ASCII letters.
Like strcasecmp in an ASCII locale. */
-int
+int
_XlcCompareISOLatin1(
const char *str1,
const char *str2)
@@ -61,7 +61,7 @@ _XlcCompareISOLatin1(
/* Compares two ISO 8859-1 strings, at most len bytes of each, ignoring
case of ASCII letters. Like strncasecmp in an ASCII locale. */
-int
+int
_XlcNCompareISOLatin1(
const char *str1,
const char *str2,
diff --git a/nx-X11/lib/X11/lcWrap.c b/nx-X11/lib/X11/lcWrap.c
index b9f9a99e5..47581f8f8 100644
--- a/nx-X11/lib/X11/lcWrap.c
+++ b/nx-X11/lib/X11/lcWrap.c
@@ -43,15 +43,15 @@ from The Open Group.
* OPEN SOFTWARE FOUNDATION AND TOSHIBA DISCLAIM ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN OR TOSHIBA BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * M. Collins OSF
+ *
+ * M. Collins OSF
*
* Katsuhisa Yano TOSHIBA Corp.
- */
+ */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -94,7 +94,7 @@ XSetLocaleModifiers(
}
Bool
-XSupportsLocale()
+XSupportsLocale(void)
{
return _XlcCurrentLC() != (XLCd)NULL;
}
@@ -152,7 +152,7 @@ _XlcDefaultMapModifiers(
#ifdef WIN32
{
char *s;
- for (s = mods; s = strchr(s, '@'); s++) {
+ for (s = mods; (s = strchr(s, '@')); s++) {
for (s++; *s && *s != '='; s++) {
if (*s == '#') {
*s = '=';
@@ -234,7 +234,7 @@ _XlcAddLoader(
last = loader_list;
while (last->next)
last = last->next;
-
+
loader->next = NULL;
last->next = loader;
}
@@ -258,9 +258,9 @@ _XOpenLC(
if (name == NULL) {
name = setlocale (LC_CTYPE, (char *)NULL);
#if !defined(X_LOCALE)
- /*
- * _XlMapOSLocaleName will return the same string or a substring
- * of name, so strlen(name) is okay
+ /*
+ * _XlMapOSLocaleName will return the same string or a substring
+ * of name, so strlen(name) is okay
*/
if ((len = strlen(name)) >= sizeof sinamebuf) {
siname = Xmalloc (len + 1);
@@ -347,7 +347,7 @@ _XCloseLC(
*/
XLCd
-_XlcCurrentLC()
+_XlcCurrentLC(void)
{
XLCd lcd;
static XLCd last_lcd = NULL;
@@ -356,7 +356,7 @@ _XlcCurrentLC()
if (last_lcd)
_XCloseLC(last_lcd);
-
+
last_lcd = lcd;
return lcd;
@@ -367,10 +367,10 @@ _XrmInitParseInfo(
XPointer *state)
{
XLCd lcd = _XOpenLC((char *) NULL);
-
+
if (lcd == (XLCd) NULL)
return (XrmMethods) NULL;
-
+
return (*lcd->methods->init_parse_info)(lcd, state);
}
@@ -382,7 +382,7 @@ XmbTextPropertyToTextList(
int *count_ret)
{
XLCd lcd = _XlcCurrentLC();
-
+
if (lcd == NULL)
return XLocaleNotSupported;
@@ -398,7 +398,7 @@ XwcTextPropertyToTextList(
int *count_ret)
{
XLCd lcd = _XlcCurrentLC();
-
+
if (lcd == NULL)
return XLocaleNotSupported;
@@ -414,7 +414,7 @@ Xutf8TextPropertyToTextList(
int *count_ret)
{
XLCd lcd = _XlcCurrentLC();
-
+
if (lcd == NULL)
return XLocaleNotSupported;
@@ -431,7 +431,7 @@ XmbTextListToTextProperty(
XTextProperty *text_prop)
{
XLCd lcd = _XlcCurrentLC();
-
+
if (lcd == NULL)
return XLocaleNotSupported;
@@ -448,7 +448,7 @@ XwcTextListToTextProperty(
XTextProperty *text_prop)
{
XLCd lcd = _XlcCurrentLC();
-
+
if (lcd == NULL)
return XLocaleNotSupported;
@@ -465,7 +465,7 @@ Xutf8TextListToTextProperty(
XTextProperty *text_prop)
{
XLCd lcd = _XlcCurrentLC();
-
+
if (lcd == NULL)
return XLocaleNotSupported;
@@ -478,7 +478,7 @@ XwcFreeStringList(
wchar_t **list)
{
XLCd lcd = _XlcCurrentLC();
-
+
if (lcd == NULL)
return;
@@ -486,13 +486,13 @@ XwcFreeStringList(
}
const char *
-XDefaultString()
+XDefaultString(void)
{
XLCd lcd = _XlcCurrentLC();
-
+
if (lcd == NULL)
return (char *) NULL;
-
+
return (*lcd->methods->default_string)(lcd);
}
@@ -553,7 +553,7 @@ _XlcCountVaList(
for (count = 0; va_arg(var, char *); count++)
(void)va_arg(var, XPointer);
-
+
*count_ret = count;
}
@@ -568,7 +568,7 @@ _XlcVaToArgList(
*args_ret = args = (XlcArgList) Xmalloc(sizeof(XlcArg) * count);
if (args == (XlcArgList) NULL)
return;
-
+
for ( ; count-- > 0; args++) {
args->name = va_arg(var, char *);
args->value = va_arg(var, XPointer);
diff --git a/nx-X11/lib/X11/mbWrap.c b/nx-X11/lib/X11/mbWrap.c
index 812b60d80..19f01f656 100644
--- a/nx-X11/lib/X11/mbWrap.c
+++ b/nx-X11/lib/X11/mbWrap.c
@@ -32,7 +32,7 @@ from The Open Group.
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Open Software Foundation
+ * documentation, and that the name of Open Software Foundation
* not be used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission. Open Software
* Foundation makes no representations about the suitability of this
@@ -42,13 +42,13 @@ from The Open Group.
* OPEN SOFTWARE FOUNDATION DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * M. Collins OSF
- */
+ *
+ * M. Collins OSF
+ */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -120,7 +120,7 @@ XmbDrawImageString(
(char *)text, text_len);
}
-int
+int
XmbTextEscapement(
XFontSet font_set,
_Xconst char *text,
@@ -157,7 +157,7 @@ XmbTextPerCharExtents(
XRectangle *max_logical_extents)
{
return (*font_set->methods->mb_extents_per_char)
- (font_set, (char *)text, text_len,
+ (font_set, (char *)text, text_len,
ink_extents_buffer, logical_extents_buffer,
buffer_size, num_chars, max_ink_extents, max_logical_extents);
}
diff --git a/nx-X11/lib/X11/utf8WMProps.c b/nx-X11/lib/X11/utf8WMProps.c
index fd2844d1d..2ac3e390b 100644
--- a/nx-X11/lib/X11/utf8WMProps.c
+++ b/nx-X11/lib/X11/utf8WMProps.c
@@ -1,4 +1,3 @@
-/* $TOG: mbWMProps.c /main/6 1998/02/06 17:44:24 kaleb $ */
/*
Copyright 1991, 1998 The Open Group
diff --git a/nx-X11/lib/X11/utf8Wrap.c b/nx-X11/lib/X11/utf8Wrap.c
index 679cd993e..82967b0b1 100644
--- a/nx-X11/lib/X11/utf8Wrap.c
+++ b/nx-X11/lib/X11/utf8Wrap.c
@@ -1,4 +1,3 @@
-/* $TOG: mbWrap.c /main/7 1998/02/06 17:44:30 kaleb $ */
/*
Copyright 1991, 1998 The Open Group
@@ -33,7 +32,7 @@ from The Open Group.
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Open Software Foundation
+ * documentation, and that the name of Open Software Foundation
* not be used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission. Open Software
* Foundation makes no representations about the suitability of this
@@ -43,13 +42,13 @@ from The Open Group.
* OPEN SOFTWARE FOUNDATION DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * M. Collins OSF
- */
+ *
+ * M. Collins OSF
+ */
/*
* Copyright 2000 by Bruno Haible
*
@@ -143,7 +142,7 @@ Xutf8DrawImageString(
(char *)text, text_len);
}
-int
+int
Xutf8TextEscapement(
XFontSet font_set,
_Xconst char *text,
@@ -180,7 +179,7 @@ Xutf8TextPerCharExtents(
XRectangle *max_logical_extents)
{
return (*font_set->methods->utf8_extents_per_char)
- (font_set, (char *)text, text_len,
+ (font_set, (char *)text, text_len,
ink_extents_buffer, logical_extents_buffer,
buffer_size, num_chars, max_ink_extents, max_logical_extents);
}
diff --git a/nx-X11/lib/X11/wcWrap.c b/nx-X11/lib/X11/wcWrap.c
index 023a7829b..cc3b33f7d 100644
--- a/nx-X11/lib/X11/wcWrap.c
+++ b/nx-X11/lib/X11/wcWrap.c
@@ -43,13 +43,13 @@ from The Open Group.
* OPEN SOFTWARE FOUNDATION DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * M. Collins OSF
- */
+ *
+ * M. Collins OSF
+ */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -120,7 +120,7 @@ XwcDrawImageString(
text, text_len);
}
-int
+int
XwcTextEscapement(
XFontSet font_set,
_Xconst wchar_t *text,
@@ -154,8 +154,8 @@ XwcTextPerCharExtents(
XRectangle *max_ink_extents,
XRectangle *max_logical_extents)
{
- return (*font_set->methods->wc_extents_per_char)
- (font_set, text, text_len,
+ return (*font_set->methods->wc_extents_per_char)
+ (font_set, text, text_len,
ink_extents_buffer, logical_extents_buffer,
buffer_size, num_chars, max_ink_extents, max_logical_extents);
}