diff options
Diffstat (limited to 'src/xlibi18n')
40 files changed, 602 insertions, 1292 deletions
diff --git a/src/xlibi18n/ICWrap.c b/src/xlibi18n/ICWrap.c index fcd2563c..9b635199 100644 --- a/src/xlibi18n/ICWrap.c +++ b/src/xlibi18n/ICWrap.c @@ -64,16 +64,16 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/ICWrap.c,v 1.8 2002/11/25 14:04:53 eich Exp $ */ +/* $XFree86: xc/lib/X11/ICWrap.c,v 1.10 2003/04/25 14:12:38 tsi Exp $ */ #define NEED_EVENTS #include "Xlibint.h" #include "Xlcint.h" static int -_XIMNestedListToNestedList(nlist, list) - XIMArg *nlist; /* This is the new list */ - XIMArg *list; /* The original list */ +_XIMNestedListToNestedList( + XIMArg *nlist, /* This is the new list */ + XIMArg *list) /* The original list */ { register XIMArg *ptr = list; @@ -91,9 +91,9 @@ _XIMNestedListToNestedList(nlist, list) } static void -_XIMCountNestedList(args, total_count) - XIMArg *args; - int *total_count; +_XIMCountNestedList( + XIMArg *args, + int *total_count) { for (; args->name; args++) { if (!strcmp(args->name, XNVaNestedList)) @@ -395,9 +395,9 @@ Xutf8ResetIC(ic) XIC ic; { if (ic->core.im) { - if (*ic->methods->utf8_reset) + if (ic->methods->utf8_reset) return (*ic->methods->utf8_reset)(ic); - else if (*ic->methods->mb_reset) + else if (ic->methods->mb_reset) return (*ic->methods->mb_reset)(ic); } return (char *)NULL; @@ -443,10 +443,10 @@ Xutf8LookupString(ic, ev, buffer, nbytes, keysym, status) Status *status; { if (ic->core.im) { - if (*ic->methods->utf8_lookup_string) + if (ic->methods->utf8_lookup_string) return (*ic->methods->utf8_lookup_string) (ic, ev, buffer, nbytes, keysym, status); - else if (*ic->methods->mb_lookup_string) + else if (ic->methods->mb_lookup_string) return (*ic->methods->mb_lookup_string) (ic, ev, buffer, nbytes, keysym, status); } diff --git a/src/xlibi18n/IMWrap.c b/src/xlibi18n/IMWrap.c index b9f8f60a..59524a4b 100644 --- a/src/xlibi18n/IMWrap.c +++ b/src/xlibi18n/IMWrap.c @@ -57,7 +57,7 @@ from The Open Group. */ -/* $XFree86: xc/lib/X11/IMWrap.c,v 3.8 2001/12/14 19:54:01 dawes Exp $ */ +/* $XFree86: xc/lib/X11/IMWrap.c,v 3.9 2003/11/17 22:20:07 dawes Exp $ */ #include "Xlibint.h" #include "Xlcint.h" @@ -176,7 +176,6 @@ XLocaleOfIM(im) * on-demand input method instantiation. */ Bool -#if NeedFunctionPrototypes XRegisterIMInstantiateCallback( Display *display, XrmDatabase rdb, @@ -184,16 +183,6 @@ XRegisterIMInstantiateCallback( char *res_class, XIDProc callback, XPointer client_data) -#else -XRegisterIMInstantiateCallback( display, rdb, res_name, res_class, callback, - client_data) - Display *display; - XrmDatabase rdb; - char *res_name; - char *res_class; - XIDProc callback; - XPointer client_data; -#endif { XLCd lcd = _XOpenLC( (char *)NULL ); @@ -208,7 +197,6 @@ XRegisterIMInstantiateCallback( display, rdb, res_name, res_class, callback, * Unregister to a input method instantiation callback. */ Bool -#if NeedFunctionPrototypes XUnregisterIMInstantiateCallback( Display *display, XrmDatabase rdb, @@ -216,16 +204,6 @@ XUnregisterIMInstantiateCallback( char *res_class, XIDProc callback, XPointer client_data) -#else -XUnregisterIMInstantiateCallback( display, rdb, res_name, res_class, callback, - client_data ) - Display *display; - XrmDatabase rdb; - char *res_name; - char *res_class; - XIDProc callback; - XPointer client_data; -#endif { XLCd lcd = _XlcCurrentLC(); diff --git a/src/xlibi18n/XDefaultIMIF.c b/src/xlibi18n/XDefaultIMIF.c index bf2e701e..5295abe9 100644 --- a/src/xlibi18n/XDefaultIMIF.c +++ b/src/xlibi18n/XDefaultIMIF.c @@ -41,7 +41,7 @@ interest in or to any trademark, service mark, logo or trade name of Sun Microsystems, Inc. or its licensors is granted. */ -/* $XFree86: xc/lib/X11/XDefaultIMIF.c,v 1.2 2001/11/19 15:33:38 tsi Exp $ */ +/* $XFree86: xc/lib/X11/XDefaultIMIF.c,v 1.4 2003/11/17 22:20:08 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS @@ -74,27 +74,19 @@ typedef struct _StaticXIM { } StaticXIMRec; static Status _CloseIM( -#if NeedFunctionPrototypes XIM -#endif ); static char *_SetIMValues( -#if NeedFunctionPrototypes XIM, XIMArg * -#endif ); static char *_GetIMValues( -#if NeedFunctionPrototypes XIM, XIMArg* -#endif ); static XIC _CreateIC( -#if NeedFunctionPrototypes XIM, XIMArg* -#endif ); static _Xconst XIMMethodsRec local_im_methods = { @@ -107,49 +99,31 @@ static _Xconst XIMMethodsRec local_im_methods = { }; static void _DestroyIC( -#if NeedFunctionPrototypes XIC -#endif ); static void _SetFocus( -#if NeedFunctionPrototypes XIC -#endif ); static void _UnsetFocus( -#if NeedFunctionPrototypes XIC -#endif ); static char* _SetICValues( -#if NeedFunctionPrototypes XIC, XIMArg * -#endif ); static char* _GetICValues( -#if NeedFunctionPrototypes XIC, XIMArg * -#endif ); static char *_MbReset( -#if NeedFunctionPrototypes XIC -#endif ); static wchar_t *_WcReset( -#if NeedFunctionPrototypes XIC -#endif ); static int _MbLookupString( -#if NeedFunctionPrototypes XIC, XKeyEvent *, char *, int, KeySym *, Status * -#endif ); static int _WcLookupString( -#if NeedFunctionPrototypes XIC, XKeyEvent *, wchar_t *, int, KeySym *, Status * -#endif ); static _Xconst XICMethodsRec local_ic_methods = { @@ -167,11 +141,12 @@ static _Xconst XICMethodsRec local_ic_methods = { }; XIM -_XDefaultOpenIM(lcd, dpy, rdb, res_name, res_class) -XLCd lcd; -Display *dpy; -XrmDatabase rdb; -char *res_name, *res_class; +_XDefaultOpenIM( + XLCd lcd, + Display *dpy, + XrmDatabase rdb, + char *res_name, + char *res_class) { StaticXIM im; XIMStaticXIMRec *local_impart; @@ -251,8 +226,7 @@ Error2 : } static Status -_CloseIM(xim) -XIM xim; +_CloseIM(XIM xim) { StaticXIM im = (StaticXIM)xim; _XlcCloseConverter(im->private->ctom_conv); @@ -296,10 +270,7 @@ XIMArg *values; } static char* -_SetICValueData(ic, values, mode) -XIC ic; -XIMArg *values; -XICOp_t mode; +_SetICValueData(XIC ic, XIMArg *values, XICOp_t mode) { XIMArg *p; char *return_name = NULL; @@ -325,10 +296,7 @@ XICOp_t mode; } static char* -_GetICValueData(ic, values, mode) -XIC ic; -XIMArg *values; -XICOp_t mode; +_GetICValueData(XIC ic, XIMArg *values, XICOp_t mode) { XIMArg *p; char *return_name = NULL; @@ -355,9 +323,7 @@ XICOp_t mode; } static XIC -_CreateIC(im, arg) -XIM im; -XIMArg *arg; +_CreateIC(XIM im, XIMArg *arg) { XIC ic; @@ -381,9 +347,8 @@ err_return: return ((XIC)NULL); } -static void -_DestroyIC(ic) -XIC ic; +static void +_DestroyIC(XIC ic) { /*BugId4255571. This Xfree() should be removed because XDestroyIC() still need ic after invoking _DestroyIC() and there is a XFree(ic) at the end of XDestroyIC() already. if(ic) @@ -397,15 +362,12 @@ XIC ic; } static void -_UnsetFocus(ic) -XIC ic; +_UnsetFocus(XIC ic) { } static char* -_SetICValues(ic, args) -XIC ic; -XIMArg *args; +_SetICValues(XIC ic, XIMArg *args) { char *ret = NULL; if (!ic) { @@ -416,9 +378,7 @@ XIMArg *args; } static char* -_GetICValues(ic, args) -XIC ic; -XIMArg *args; +_GetICValues(XIC ic, XIMArg *args) { char *ret = NULL; if (!ic) { @@ -429,27 +389,25 @@ XIMArg *args; } static char * -_MbReset(xic) -XIC xic; +_MbReset(XIC xic) { return(NULL); } static wchar_t * -_WcReset(xic) -XIC xic; +_WcReset(XIC xic) { return(NULL); } static int -_MbLookupString(xic, ev, buffer, bytes, keysym, status) -XIC xic; -XKeyEvent *ev; -char * buffer; -int bytes; -KeySym *keysym; -Status *status; +_MbLookupString( + XIC xic, + XKeyEvent *ev, + char * buffer, + int bytes, + KeySym *keysym, + Status *status) { XComposeStatus NotSupportedYet ; int length; @@ -467,13 +425,13 @@ Status *status; } static int -_WcLookupString(xic, ev, buffer, wlen, keysym, status) -XIC xic; -XKeyEvent *ev; -wchar_t * buffer; -int wlen; -KeySym *keysym; -Status *status; +_WcLookupString( + XIC xic, + XKeyEvent *ev, + wchar_t * buffer, + int wlen, + KeySym *keysym, + Status *status) { XComposeStatus NotSupportedYet ; int length; diff --git a/src/xlibi18n/XDefaultOMIF.c b/src/xlibi18n/XDefaultOMIF.c index 15e6b82c..ce5e4740 100644 --- a/src/xlibi18n/XDefaultOMIF.c +++ b/src/xlibi18n/XDefaultOMIF.c @@ -41,7 +41,7 @@ interest in or to any trademark, service mark, logo or trade name of Sun Microsystems, Inc. or its licensors is granted. */ -/* $XFree86: xc/lib/X11/XDefaultOMIF.c,v 1.3 2002/09/18 17:11:42 tsi Exp $ */ +/* $XFree86: xc/lib/X11/XDefaultOMIF.c,v 1.6 2003/11/17 22:20:09 dawes Exp $ */ #include "Xlibint.h" #include "Xlcint.h" @@ -99,8 +99,8 @@ typedef struct _XOCGenericRec { } XOCGenericRec, *XOCGeneric; static Bool -init_fontset(oc) - XOC oc; +init_fontset( + XOC oc) { XOCGenericPart *gen; FontSet font_set; @@ -123,9 +123,9 @@ init_fontset(oc) } static char * -get_prop_name(dpy, fs) - Display *dpy; - XFontStruct *fs; +get_prop_name( + Display *dpy, + XFontStruct *fs) { unsigned long fp; @@ -136,9 +136,9 @@ get_prop_name(dpy, fs) } static FontData -check_charset(font_set, font_name) - FontSet font_set; - char *font_name; +check_charset( + FontSet font_set, + char *font_name) { FontData font_data; char *last; @@ -165,9 +165,9 @@ check_charset(font_set, font_name) #if 0 /* Unused */ static int -check_fontname(oc, name) -XOC oc; -char *name; +check_fontname( + XOC oc, + char *name) { Display *dpy = oc->core.om->core.display; XOCGenericPart *gen = XOC_GENERIC(oc); @@ -220,8 +220,8 @@ char *name; #endif static Bool -load_font(oc) - XOC oc; +load_font( + XOC oc) { Display *dpy = oc->core.om->core.display; XOCGenericPart *gen = XOC_GENERIC(oc); @@ -238,9 +238,10 @@ load_font(oc) return True; } +#if 0 static Bool -load_font_info(oc) - XOC oc; +load_font_info( + XOC oc) { Display *dpy = oc->core.om->core.display; XOCGenericPart *gen = XOC_GENERIC(oc); @@ -263,10 +264,11 @@ load_font_info(oc) } return True; } +#endif static void -set_fontset_extents(oc) - XOC oc; +set_fontset_extents( + XOC oc) { XRectangle *ink = &oc->core.font_set_extents.max_ink_extent; XRectangle *logical = &oc->core.font_set_extents.max_logical_extent; @@ -293,8 +295,8 @@ set_fontset_extents(oc) } static Bool -init_core_part(oc) - XOC oc; +init_core_part( + XOC oc) { XOCGenericPart *gen = XOC_GENERIC(oc); FontSet font_set; @@ -355,9 +357,9 @@ err: } static char * -get_font_name(oc, pattern) - XOC oc; - char *pattern; +get_font_name( + XOC oc, + char *pattern) { char **list, *name, *prop_name; int count; @@ -388,8 +390,8 @@ get_font_name(oc, pattern) } static int -parse_fontname(oc) - XOC oc; +parse_fontname( + XOC oc) { XOCGenericPart *gen = XOC_GENERIC(oc); FontSet font_set; @@ -550,8 +552,8 @@ err: } static Bool -set_missing_list(oc) - XOC oc; +set_missing_list( + XOC oc) { XOCGenericPart *gen = XOC_GENERIC(oc); FontSet font_set; @@ -592,8 +594,8 @@ set_missing_list(oc) } static Bool -create_fontset(oc) - XOC oc; +create_fontset( + XOC oc) { int found_num; @@ -620,8 +622,8 @@ create_fontset(oc) } static void -destroy_oc(oc) - XOC oc; +destroy_oc( + XOC oc) { Display *dpy = oc->core.om->core.display; XOCGenericPart *gen = XOC_GENERIC(oc); @@ -660,10 +662,10 @@ destroy_oc(oc) } static char * -set_oc_values(oc, args, num_args) - XOC oc; - XlcArgList args; - int num_args; +set_oc_values( + XOC oc, + XlcArgList args, + int num_args) { if (oc->core.resources == NULL) return NULL; @@ -673,10 +675,10 @@ set_oc_values(oc, args, num_args) } static char * -get_oc_values(oc, args, num_args) - XOC oc; - XlcArgList args; - int num_args; +get_oc_values( + XOC oc, + XlcArgList args, + int num_args) { if (oc->core.resources == NULL) return NULL; @@ -686,11 +688,11 @@ get_oc_values(oc, args, num_args) } static Bool -wcs_to_mbs(oc, to, from, length) - XOC oc; - char *to; - _Xconst wchar_t *from; - int length; +wcs_to_mbs( + XOC oc, + char *to, + _Xconst wchar_t *from, + int length) { XlcConv conv = XOC_GENERIC(oc)->wcs_to_cs; XLCd lcd; @@ -714,27 +716,13 @@ wcs_to_mbs(oc, to, from, length) } static int -#if NeedFunctionPrototypes _XmbDefaultTextEscapement(XOC oc, _Xconst char *text, int length) -#else -_XmbDefaultTextEscapement(oc, text, length) - XOC oc; - char *text; - int length; -#endif { return XTextWidth(*oc->core.font_info.font_struct_list, text, length); } static int -#if NeedFunctionPrototypes _XwcDefaultTextEscapement(XOC oc, _Xconst wchar_t *text, int length) -#else -_XwcDefaultTextEscapement(oc, text, length) - XOC oc; - wchar_t *text; - int length; -#endif { DefineLocalBuf; char *buf = AllocLocalBuf(length); @@ -755,17 +743,8 @@ err: } static int -#if NeedFunctionPrototypes _XmbDefaultTextExtents(XOC oc, _Xconst char *text, int length, XRectangle *overall_ink, XRectangle *overall_logical) -#else -_XmbDefaultTextExtents(oc, text, length, overall_ink, overall_logical) - XOC oc; - char *text; - int length; - XRectangle *overall_ink; - XRectangle *overall_logical; -#endif { int direction, logical_ascent, logical_descent; XCharStruct overall; @@ -791,17 +770,8 @@ _XmbDefaultTextExtents(oc, text, length, overall_ink, overall_logical) } static int -#if NeedFunctionPrototypes _XwcDefaultTextExtents(XOC oc, _Xconst wchar_t *text, int length, XRectangle *overall_ink, XRectangle *overall_logical) -#else -_XwcDefaultTextExtents(oc, text, length, overall_ink, overall_logical) - XOC oc; - wchar_t *text; - int length; - XRectangle *overall_ink; - XRectangle *overall_logical; -#endif { DefineLocalBuf; char *buf = AllocLocalBuf(length); @@ -822,25 +792,11 @@ err: } static Status -#if NeedFunctionPrototypes _XmbDefaultTextPerCharExtents(XOC oc, _Xconst char *text, int length, XRectangle *ink_buf, XRectangle *logical_buf, int buf_size, int *num_chars, XRectangle *overall_ink, XRectangle *overall_logical) -#else -_XmbDefaultTextPerCharExtents(oc, text, length, ink_buf, logical_buf, buf_size, - num_chars, overall_ink, overall_logical) - XOC oc; - char *text; - int length; - XRectangle *ink_buf; - XRectangle *logical_buf; - int buf_size; - int *num_chars; - XRectangle *overall_ink; - XRectangle *overall_logical; -#endif { XFontStruct *font = *oc->core.font_info.font_struct_list; XCharStruct *def, *cs, overall; @@ -905,25 +861,11 @@ _XmbDefaultTextPerCharExtents(oc, text, length, ink_buf, logical_buf, buf_size, } static Status -#if NeedFunctionPrototypes _XwcDefaultTextPerCharExtents(XOC oc, _Xconst wchar_t *text, int length, XRectangle *ink_buf, XRectangle *logical_buf, int buf_size, int *num_chars, XRectangle *overall_ink, XRectangle *overall_logical) -#else -_XwcDefaultTextPerCharExtents(oc, text, length, ink_buf, logical_buf, buf_size, - num_chars, overall_ink, overall_logical) - XOC oc; - wchar_t *text; - int length; - XRectangle *ink_buf; - XRectangle *logical_buf; - int buf_size; - int *num_chars; - XRectangle *overall_ink; - XRectangle *overall_logical; -#endif { DefineLocalBuf; char *buf = AllocLocalBuf(length); @@ -946,19 +888,8 @@ err: } static int -#if NeedFunctionPrototypes _XmbDefaultDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y, _Xconst char *text, int length) -#else -_XmbDefaultDrawString(dpy, d, oc, gc, x, y, text, length) - Display *dpy; - Drawable d; - XOC oc; - GC gc; - int x, y; - char *text; - int length; -#endif { XFontStruct *font = *oc->core.font_info.font_struct_list; @@ -969,19 +900,8 @@ _XmbDefaultDrawString(dpy, d, oc, gc, x, y, text, length) } static int -#if NeedFunctionPrototypes _XwcDefaultDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y, _Xconst wchar_t *text, int length) -#else -_XwcDefaultDrawString(dpy, d, oc, gc, x, y, text, length) - Display *dpy; - Drawable d; - XOC oc; - GC gc; - int x, y; - wchar_t *text; - int length; -#endif { DefineLocalBuf; char *buf = AllocLocalBuf(length); @@ -1002,38 +922,16 @@ err: } static void -#if NeedFunctionPrototypes _XmbDefaultDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y, _Xconst char *text, int length) -#else -_XmbDefaultDrawImageString(dpy, d, oc, gc, x, y, text, length) - Display *dpy; - Drawable d; - XOC oc; - GC gc; - int x, y; - char *text; - int length; -#endif { XSetFont(dpy, gc, (*oc->core.font_info.font_struct_list)->fid); XDrawImageString(dpy, d, gc, x, y, text, length); } static void -#if NeedFunctionPrototypes _XwcDefaultDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y, _Xconst wchar_t *text, int length) -#else -_XwcDefaultDrawImageString(dpy, d, oc, gc, x, y, text, length) - Display *dpy; - Drawable d; - XOC oc; - GC gc; - int x, y; - wchar_t *text; - int length; -#endif { DefineLocalBuf; char *buf = AllocLocalBuf(length); @@ -1086,10 +984,10 @@ static XlcResource oc_resources[] = { }; static XOC -create_oc(om, args, num_args) - XOM om; - XlcArgList args; - int num_args; +create_oc( + XOM om, + XlcArgList args, + int num_args) { XOC oc; @@ -1127,8 +1025,8 @@ err: } static Status -close_om(om) - XOM om; +close_om( + XOM om) { XOMGenericPart *gen = XOM_GENERIC(om); OMData data; @@ -1164,10 +1062,10 @@ close_om(om) } static char * -set_om_values(om, args, num_args) - XOM om; - XlcArgList args; - int num_args; +set_om_values( + XOM om, + XlcArgList args, + int num_args) { if (om->core.resources == NULL) return NULL; @@ -1177,10 +1075,10 @@ set_om_values(om, args, num_args) } static char * -get_om_values(om, args, num_args) - XOM om; - XlcArgList args; - int num_args; +get_om_values( + XOM om, + XlcArgList args, + int num_args) { if (om->core.resources == NULL) return NULL; @@ -1208,8 +1106,8 @@ static XlcResource om_resources[] = { }; static OMData -add_data(om) - XOM om; +add_data( + XOM om) { XOMGenericPart *gen = XOM_GENERIC(om); OMData new; @@ -1238,8 +1136,8 @@ static _Xconst char *supported_charset_list[] = { }; static Bool -init_om(om) - XOM om; +init_om( + XOM om) { XOMGenericPart *gen = XOM_GENERIC(om); OMData data; @@ -1320,17 +1218,8 @@ supported_charset_list[]. } XOM -#if NeedFunctionPrototypes _XDefaultOpenOM(XLCd lcd, Display *dpy, XrmDatabase rdb, _Xconst char *res_name, _Xconst char *res_class) -#else -_XDefaultOpenOM(lcd, dpy, rdb, res_name, res_class) -XLCd lcd; -Display *dpy; -XrmDatabase rdb; -char *res_name; -char *res_class; -#endif { XOM om; diff --git a/src/xlibi18n/XimImSw.h b/src/xlibi18n/XimImSw.h index eac27843..00e5ef3b 100644 --- a/src/xlibi18n/XimImSw.h +++ b/src/xlibi18n/XimImSw.h @@ -26,25 +26,20 @@ PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ +/* $XFree86: xc/lib/X11/XimImSw.h,v 1.2 2003/11/17 22:20:10 dawes Exp $ */ #ifndef _XIMIMSW_H #define _XIMIMSW_H typedef struct { Bool (*checkprocessing)( -#if NeedNestedPrototypes Xim im -#endif ); Bool (*im_open)( -#if NeedNestedPrototypes Xim im -#endif ); void (*im_free)( -#if NeedNestedPrototypes Xim im -#endif ); } XimImsportSW; diff --git a/src/xlibi18n/XimThai.h b/src/xlibi18n/XimThai.h index a53ce627..0e75e82c 100644 --- a/src/xlibi18n/XimThai.h +++ b/src/xlibi18n/XimThai.h @@ -45,7 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/XimThai.h,v 1.5 2001/12/14 19:54:08 dawes Exp $ */ +/* $XFree86: xc/lib/X11/XimThai.h,v 1.6 2003/04/17 02:39:56 dawes Exp $ */ /* **++ @@ -109,96 +109,4 @@ SOFTWARE. #define NOISC 255 /* No ISC */ -/* Function prototypes (thaisub.c) */ - -Private -int THAI_chtype ( /* returns classification of a char */ -#if NeedFunctionPrototypes - unsigned char ch -#endif -); - -Private -int THAI_chlevel ( /* returns the display level */ -#if NeedFunctionPrototypes - unsigned char ch -#endif -); - -Private -Bool THAI_isdead ( /* return True if char is non-spacing */ -#if NeedFunctionPrototypes - unsigned char ch -#endif -); - -Private -Bool THAI_iscons ( /* return True if char is consonant */ -#if NeedFunctionPrototypes - unsigned char ch -#endif -); - -Private -Bool THAI_isvowel ( /* return True if char is vowel */ -#if NeedFunctionPrototypes - unsigned char ch -#endif -); - -Private -Bool THAI_istone ( /* return True if char is tonemark */ -#if NeedFunctionPrototypes - unsigned char ch -#endif -); - -Private -Bool THAI_iscomposible ( -#if NeedFunctionPrototypes - unsigned char follow_ch, - unsigned char lead_ch -#endif -); - -Private -Bool THAI_isaccepted ( -#if NeedFunctionPrototypes - unsigned char follow_ch, - unsigned char lead_ch, - unsigned char isc_mode -#endif -); - -#if 0 -Private -void THAI_apply_write_rules ( -#if NeedFunctionPrototypes - unsigned char *instr, - unsigned char *outstr, - unsigned char insert_ch, - int *num_insert_ch -#endif -); - -Private -int THAI_find_chtype ( -#if NeedFunctionPrototypes - unsigned char *instr, - int chtype -#endif -); -#endif - -Private -int THAI_apply_scm ( -#if NeedFunctionPrototypes - unsigned char *instr, - unsigned char *outstr, - unsigned char spec_ch, - int num_sp, - unsigned char insert_ch -#endif -); - #endif /* _XIMTHAI_H_ */ diff --git a/src/xlibi18n/XimTrInt.h b/src/xlibi18n/XimTrInt.h index b10898b3..9bdcba7c 100644 --- a/src/xlibi18n/XimTrInt.h +++ b/src/xlibi18n/XimTrInt.h @@ -28,21 +28,18 @@ OR PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ +/* $XFree86: xc/lib/X11/XimTrInt.h,v 1.2 2003/11/17 22:20:10 dawes Exp $ */ #ifndef _XIMTRINT_H #define _XIMTRINT_H -#if NeedFunctionPrototypes #include "Ximint.h" -#endif typedef struct { char *transportname; Bool (*config)( -#if NeedFunctionPrototypes Xim, char * -#endif ); } TransportSW; @@ -53,19 +50,15 @@ extern TransportSW _XimTransportRec[]; */ extern Bool _XimXConf( -#if NeedFunctionPrototypes Xim im, char *address -#endif ); #if defined(TCPCONN) || defined(UNIXCONN) || defined(DNETCONN) || defined(STREAMSCONN) extern Bool _XimTransConf( -#if NeedFunctionPrototypes Xim im, char *address -#endif ); #endif diff --git a/src/xlibi18n/XimTrX.h b/src/xlibi18n/XimTrX.h index 489a0e3c..b269766a 100644 --- a/src/xlibi18n/XimTrX.h +++ b/src/xlibi18n/XimTrX.h @@ -28,6 +28,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ +/* $XFree86: xc/lib/X11/XimTrX.h,v 1.2 2003/11/17 22:20:10 dawes Exp $ */ #ifndef _XIMTRX_H #define _XIMTRX_H @@ -36,9 +37,7 @@ typedef struct _XIntrCallbackRec *XIntrCallbackPtr; typedef struct _XIntrCallbackRec { Bool (*func)( -#if NeedNestedPrototypes Xim, INT16, XPointer, XPointer -#endif ); XPointer call_data; XIntrCallbackPtr next; diff --git a/src/xlibi18n/XimTrans.h b/src/xlibi18n/XimTrans.h index 6914190e..03119cd0 100644 --- a/src/xlibi18n/XimTrans.h +++ b/src/xlibi18n/XimTrans.h @@ -28,6 +28,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. fujiwara@a80.tech.yk.fujitsu.co.jp ******************************************************************/ +/* $XFree86: xc/lib/X11/XimTrans.h,v 1.4 2003/11/17 22:20:10 dawes Exp $ */ #ifndef _XIMTRANS_H #define _XIMTRANS_H @@ -36,9 +37,7 @@ typedef struct _TransIntrCallbackRec *TransIntrCallbackPtr; typedef struct _TransIntrCallbackRec { Bool (*func)( -#if NeedNestedPrototypes Xim, INT16, XPointer, XPointer -#endif ); XPointer call_data; TransIntrCallbackPtr next; @@ -58,70 +57,67 @@ typedef struct { * Prototypes */ +extern Bool _XimTransRegisterDispatcher( + Xim im, + Bool (*callback)( + Xim, INT16, XPointer, XPointer + ), + XPointer call_data +); + + extern Bool _XimTransIntrCallback( -#if NeedFunctionPrototypes Xim im, Bool (*callback)( -#if NeedNestedPrototypes Xim, INT16, XPointer, XPointer -#endif ), XPointer call_data -#endif +); + +extern Bool _XimTransCallDispatcher( + Xim im, + INT16 len, + XPointer data ); extern void _XimFreeTransIntrCallback( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimTransIntrCallbackCheck( -#if NeedFunctionPrototypes Xim im, INT16 len, XPointer data -#endif ); extern Bool _XimTransFilterWaitEvent( -#if NeedFunctionPrototypes Display *d, Window w, XEvent *ev, XPointer arg -#endif ); extern void _XimTransInternalConnection( -#if NeedFunctionPrototypes Display *d, int fd, XPointer arg -#endif ); extern Bool _XimTransWrite( -#if NeedFunctionPrototypes Xim im, INT16 len, XPointer data -#endif ); extern Bool _XimTransRead( -#if NeedFunctionPrototypes Xim im, XPointer recv_buf, int buf_len, int *ret_len -#endif ); extern void _XimTransFlush( -#if NeedFunctionPrototypes Xim im -#endif ); #endif /* _XIMTRANS__H */ diff --git a/src/xlibi18n/Ximint.h b/src/xlibi18n/Ximint.h index c7f917c5..a54a68af 100644 --- a/src/xlibi18n/Ximint.h +++ b/src/xlibi18n/Ximint.h @@ -30,7 +30,7 @@ PERFORMANCE OF THIS SOFTWARE. makoto@sm.sony.co.jp ******************************************************************/ -/* $XFree86: xc/lib/X11/Ximint.h,v 3.10 2001/07/25 15:04:44 dawes Exp $ */ +/* $XFree86: xc/lib/X11/Ximint.h,v 3.14 2003/11/17 22:20:10 dawes Exp $ */ #ifndef _XIMINT_H #define _XIMINT_H @@ -185,274 +185,201 @@ typedef struct _XimDefICValues { */ XPointer _XimGetLocaleCode ( -#if NeedFunctionPrototypes const char *encoding_name -#endif ); int _XimGetCharCode ( -#if NeedFunctionPrototypes XPointer conv, KeySym keysym, unsigned char *buf, int nbytes -#endif ); unsigned int KeySymToUcs4 ( -#if NeedFunctionPrototypes KeySym keysym -#endif ); extern Bool _XimSetIMResourceList( -#if NeedFunctionPrototypes XIMResourceList *res_list, unsigned int *list_num -#endif ); extern Bool _XimSetICResourceList( -#if NeedFunctionPrototypes XIMResourceList *res_list, unsigned int *list_num -#endif ); extern Bool _XimSetInnerIMResourceList( -#if NeedFunctionPrototypes XIMResourceList *res_list, unsigned int *list_num -#endif ); extern Bool _XimSetInnerICResourceList( -#if NeedFunctionPrototypes XIMResourceList *res_list, unsigned int *list_num -#endif ); -extern Bool cw_XimCheckCreateICValues( -#if NeedFunctionPrototypes +extern Bool _XimCheckCreateICValues( XIMResourceList res_list, unsigned int list_num -#endif ); extern XIMResourceList _XimGetResourceListRec( -#if NeedFunctionPrototypes XIMResourceList res_list, unsigned int list_num, char *name -#endif ); extern void _XimSetIMMode( -#if NeedFunctionPrototypes XIMResourceList res_list, unsigned int list_num -#endif ); extern void _XimSetICMode( -#if NeedFunctionPrototypes XIMResourceList res_list, unsigned int list_num, XIMStyle style -#endif ); extern int _XimCheckIMMode( -#if NeedFunctionPrototypes XIMResourceList res_list, unsigned long mode -#endif ); extern int _XimCheckICMode( -#if NeedFunctionPrototypes XIMResourceList res_list, unsigned long mode -#endif ); extern Bool _XimSetLocalIMDefaults( -#if NeedFunctionPrototypes Xim im, XPointer top, XIMResourceList res_list, unsigned int list_num -#endif ); extern Bool _XimSetICDefaults( -#if NeedFunctionPrototypes Xic ic, XPointer top, unsigned long mode, XIMResourceList res_list, unsigned int list_num -#endif ); extern Bool _XimEncodeLocalIMAttr( -#if NeedFunctionPrototypes XIMResourceList res, XPointer top, XPointer val -#endif ); extern Bool _XimEncodeLocalICAttr( -#if NeedFunctionPrototypes Xic ic, XIMResourceList res, XPointer top, XIMArg *arg, unsigned long mode -#endif ); extern Bool _XimCheckLocalInputStyle( -#if NeedFunctionPrototypes Xic ic, XPointer top, XIMArg *values, XIMStyles *styles, XIMResourceList res_list, unsigned int list_num -#endif ); extern Bool _XimDecodeLocalIMAttr( -#if NeedFunctionPrototypes XIMResourceList res, XPointer top, XPointer val -#endif ); extern Bool _XimDecodeLocalICAttr( -#if NeedFunctionPrototypes XIMResourceList res, XPointer top, XPointer val, unsigned long mode -#endif ); extern void _XimGetCurrentIMValues( -#if NeedFunctionPrototypes Xim im, XimDefIMValues *im_values -#endif ); extern void _XimSetCurrentIMValues( -#if NeedFunctionPrototypes Xim im, XimDefIMValues *im_values -#endif ); extern void _XimGetCurrentICValues( -#if NeedFunctionPrototypes Xic ic, XimDefICValues *ic_values -#endif ); extern void _XimSetCurrentICValues( -#if NeedFunctionPrototypes Xic ic, XimDefICValues *ic_values -#endif ); extern void _XimInitialResourceInfo( -#if NeedFunctionPrototypes void -#endif ); extern void _XimParseStringFile( -#if NeedFunctionPrototypes FILE *fp, - DefTree **ptop -#endif + Xim im ); extern Bool _XimCheckIfLocalProcessing( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimCheckIfThaiProcessing( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimLocalOpenIM( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimThaiOpenIM( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimProtoOpenIM( -#if NeedFunctionPrototypes Xim im -#endif ); extern void _XimLocalIMFree( -#if NeedFunctionPrototypes Xim im -#endif ); extern void _XimThaiIMFree( -#if NeedFunctionPrototypes Xim im -#endif ); extern void _XimProtoIMFree( -#if NeedFunctionPrototypes Xim im -#endif ); extern char * _XimSetIMValueData( -#if NeedFunctionPrototypes Xim im, XPointer top, XIMArg *arg, XIMResourceList res_list, unsigned int list_num -#endif ); extern char * _XimGetIMValueData( -#if NeedFunctionPrototypes Xim im, XPointer top, XIMArg *arg, XIMResourceList res_list, unsigned int list_num -#endif ); extern char * _XimSetICValueData( -#if NeedFunctionPrototypes Xic ic, XPointer top, XIMResourceList res_list, @@ -460,68 +387,50 @@ extern char * _XimSetICValueData( XIMArg *arg, unsigned long mode, Bool flag -#endif ); extern char * _XimGetICValueData( -#if NeedFunctionPrototypes Xic ic, XPointer top, XIMResourceList res_list, unsigned int list_num, XIMArg *arg, unsigned long mode -#endif ); extern char * _XimLocalSetIMValues( -#if NeedFunctionPrototypes XIM im, XIMArg *arg -#endif ); extern char * _XimLocalGetIMValues( -#if NeedFunctionPrototypes XIM im, XIMArg *arg -#endif ); extern XIC _XimLocalCreateIC( -#if NeedFunctionPrototypes XIM im, XIMArg *arg -#endif ); extern Bool _XimDispatchInit( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimGetAttributeID( -#if NeedFunctionPrototypes Xim im, CARD16 *buf -#endif ); extern Bool _XimExtension( -#if NeedFunctionPrototypes Xim im -#endif ); extern void _XimDestroyIMStructureList( -#if NeedFunctionPrototypes Xim im -#endif ); extern char * _XimMakeIMAttrIDList( -#if NeedFunctionPrototypes Xim im, XIMResourceList res_list, unsigned int res_num, @@ -529,11 +438,9 @@ extern char * _XimMakeIMAttrIDList( CARD16 *buf, INT16 *len, unsigned long mode -#endif ); extern char * _XimMakeICAttrIDList( -#if NeedFunctionPrototypes Xic ic, XIMResourceList res_list, unsigned int res_num, @@ -541,11 +448,9 @@ extern char * _XimMakeICAttrIDList( CARD16 *idList, INT16 *num, unsigned long mode -#endif ); extern char * _XimDecodeIMATTRIBUTE( -#if NeedFunctionPrototypes Xim im, XIMResourceList res_list, unsigned int res_num, @@ -553,11 +458,9 @@ extern char * _XimDecodeIMATTRIBUTE( INT16 buf_len, XIMArg *arg, BITMASK32 mode -#endif ); extern char * _XimDecodeICATTRIBUTE( -#if NeedFunctionPrototypes Xic ic, XIMResourceList res_list, unsigned int res_num, @@ -565,30 +468,32 @@ extern char * _XimDecodeICATTRIBUTE( INT16 buf_len, XIMArg *arg, BITMASK32 mode -#endif ); extern Bool _XimRegProtoIntrCallback( -#if NeedFunctionPrototypes Xim im, CARD16 major_code, CARD16 minor_code, Bool (*proc)( -#if NeedNestedPrototypes Xim, INT16, XPointer, XPointer -#endif ), XPointer call_data -#endif ); extern Bool _XimErrorCallback( -#if NeedFunctionPrototypes Xim im, INT16 len, XPointer data, XPointer call_data -#endif +); + +extern Bool _XimError( + Xim im, + Xic ic, + CARD16 error_code, + INT16 detail_length, + CARD16 type, + char *detail ); extern Bool _XimError( @@ -603,120 +508,89 @@ extern Bool _XimError( ); extern Bool _XimRegisterTriggerKeysCallback( -#if NeedFunctionPrototypes Xim im, INT16 len, XPointer data, XPointer call_data -#endif ); extern Bool _XimSetEventMaskCallback( -#if NeedFunctionPrototypes Xim im, INT16 len, XPointer data, XPointer call_data -#endif ); extern Bool _XimForwardEventCallback( -#if NeedFunctionPrototypes Xim im, INT16 len, XPointer data, XPointer call_data -#endif ); extern Bool _XimCommitCallback( -#if NeedFunctionPrototypes Xim im, INT16 len, XPointer data, XPointer call_data -#endif ); extern Bool _XimSyncCallback( -#if NeedFunctionPrototypes Xim im, INT16 len, XPointer data, XPointer call_data -#endif ); extern void _XimFreeProtoIntrCallback( -#if NeedFunctionPrototypes Xim im -#endif ); extern XIC _XimProtoCreateIC( -#if NeedFunctionPrototypes XIM im, XIMArg *arg -#endif ); extern void _XimRegisterServerFilter( -#if NeedFunctionPrototypes Xim im -#endif ); extern void _XimUnregisterServerFilter( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimTriggerNotify( -#if NeedFunctionPrototypes Xim im, Xic ic, int mode, CARD32 idx -#endif ); extern Bool _XimProcSyncReply( -#if NeedFunctionPrototypes Xim im, Xic ic -#endif ); extern void _XimSendSetFocus( -#if NeedFunctionPrototypes Xim im, Xic ic -#endif ); extern Bool _XimForwardEvent( -#if NeedFunctionPrototypes Xic ic, XEvent *ev, Bool sync -#endif ); extern void _XimFreeRemakeArg( -#if NeedFunctionPrototypes XIMArg *arg -#endif ); extern void _XimServerDestroy( -#if NeedFunctionPrototypes Xim im -#endif ); extern char * _XimEncodeIMATTRIBUTE( -#if NeedFunctionPrototypes Xim im, XIMResourceList res_list, unsigned int res_num, @@ -727,11 +601,9 @@ extern char * _XimEncodeIMATTRIBUTE( int *ret_len, XPointer top, unsigned long mode -#endif ); extern char * _XimEncodeICATTRIBUTE( -#if NeedFunctionPrototypes Xic ic, XIMResourceList res_list, unsigned int res_num, @@ -743,41 +615,43 @@ extern char * _XimEncodeICATTRIBUTE( XPointer top, BITMASK32 *flag, unsigned long mode -#endif ); #ifdef EXT_MOVE extern Bool _XimExtenMove( -#if NeedFunctionPrototypes Xim im, Xic ic, CARD32 flag, CARD16 *buf, INT16 length -#endif ); #endif extern int _Ximctstombs( -#if NeedFunctionPrototypes XIM im, char *from, int from_len, char *to, int to_len, Status *state -#endif ); extern int _Ximctstowcs( -#if NeedFunctionPrototypes XIM im, char *from, int from_len, wchar_t *to, int to_len, Status *state -#endif +); + +extern int _Ximctstoutf8( + XIM im, + char *from, + int from_len, + char *to, + int to_len, + Status *state ); extern int _Ximctstoutf8( @@ -792,25 +666,35 @@ extern int _Ximctstoutf8( ); extern int _XimLcctstombs( -#if NeedFunctionPrototypes XIM im, char *from, int from_len, char *to, int to_len, Status *state -#endif ); extern int _XimLcctstowcs( -#if NeedFunctionPrototypes XIM im, char *from, int from_len, wchar_t *to, int to_len, Status *state -#endif +); + +extern int _XimLcctstoutf8( + XIM im, + char *from, + int from_len, + char *to, + int to_len, + Status *state +); + +extern int _XimCheckDataSize( + XPointer buf, + int len ); extern int _XimLcctstoutf8( @@ -825,41 +709,42 @@ extern int _XimLcctstoutf8( ); extern void _XimSetHeader( -#if NeedFunctionPrototypes XPointer buf, CARD8 major_opcode, CARD8 minor_opcode, INT16 *len -#endif ); extern Bool _XimSync( -#if NeedFunctionPrototypes Xim im, Xic ic -#endif ); extern int _XimProtoMbLookupString( -#if NeedFunctionPrototypes XIC xic, XKeyEvent *ev, char *buffer, int bytes, KeySym *keysym, Status *state -#endif ); extern int _XimProtoWcLookupString( -#if NeedFunctionPrototypes XIC xic, XKeyEvent *ev, wchar_t *buffer, int bytes, KeySym *keysym, Status *state -#endif +); + +extern int _XimProtoUtf8LookupString( + XIC xic, + XKeyEvent *ev, + char *buffer, + int bytes, + KeySym *keysym, + Status *state ); extern int _XimProtoUtf8LookupString( @@ -874,69 +759,62 @@ extern int _XimProtoUtf8LookupString( ); extern void _XimRegisterFilter( -#if NeedFunctionPrototypes Xic ic -#endif ); extern void _XimUnregisterFilter( -#if NeedFunctionPrototypes Xic ic -#endif ); extern void _XimReregisterFilter( -#if NeedFunctionPrototypes Xic ic -#endif ); extern Status _XimProtoEventToWire( -#if NeedFunctionPrototypes XEvent *re, xEvent *event, Bool sw -#endif ); extern Bool _XimProtoWireToEvent( -#if NeedFunctionPrototypes XEvent *re, xEvent *event, Bool sw -#endif ); #ifdef EXT_FORWARD extern Bool _XimExtForwardKeyEvent( -#if NeedFunctionPrototypes Xic ic, XKeyEvent *ev, Bool sync -#endif ); #endif extern int _XimLookupMBText( -#if NeedFunctionPrototypes Xic ic, XKeyEvent *event, char *buffer, int nbytes, KeySym *keysym, XComposeStatus *status -#endif ); extern int _XimLookupWCText( -#if NeedFunctionPrototypes Xic ic, XKeyEvent *event, wchar_t *buffer, int nbytes, KeySym *keysym, XComposeStatus *status -#endif +); + +extern int _XimLookupUTF8Text( + Xic ic, + XKeyEvent *event, + char *buffer, + int nbytes, + KeySym *keysym, + XComposeStatus *status ); extern int _XimLookupUTF8Text( @@ -951,26 +829,19 @@ extern int _XimLookupUTF8Text( ); extern EVENTMASK _XimGetWindowEventmask( -#if NeedFunctionPrototypes Xic ic -#endif ); extern Xic _XimICOfXICID( -#if NeedFunctionPrototypes Xim im, XICID icid -#endif ); extern void _XimResetIMInstantiateCallback( -#if NeedFunctionPrototypes Xim xim -#endif ); extern Bool _XimRegisterIMInstantiateCallback( -#if NeedFunctionPrototypes XLCd lcd, Display *display, XrmDatabase rdb, @@ -978,11 +849,9 @@ extern Bool _XimRegisterIMInstantiateCallback( char *res_class, XIDProc callback, XPointer client_data -#endif ); extern Bool _XimUnRegisterIMInstantiateCallback( -#if NeedFunctionPrototypes XLCd lcd, Display *display, XrmDatabase rdb, @@ -990,156 +859,124 @@ extern Bool _XimUnRegisterIMInstantiateCallback( char *res_class, XIDProc callback, XPointer client_data -#endif ); extern void _XimFreeCommitInfo( -#if NeedFunctionPrototypes Xic ic -#endif ); extern Bool _XimConnect( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimShutdown( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimWrite( -#if NeedFunctionPrototypes Xim im, INT16 len, XPointer data -#endif ); extern Bool _XimRead( -#if NeedFunctionPrototypes Xim im, INT16 *len, XPointer data, int data_len, Bool (*predicate)( -#if NeedNestedPrototypes Xim, INT16, XPointer, XPointer -#endif ), XPointer arg -#endif ); extern Bool _XimIntrCallback( -#if NeedFunctionPrototypes Xim im, Bool (*callback)( -#if NeedNestedPrototypes Xim, INT16, XPointer, XPointer -#endif ), XPointer call_data -#endif ); extern void _XimFlush( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimFilterWaitEvent( -#if NeedFunctionPrototypes Xim im -#endif ); extern void _XimProcError( -#if NeedFunctionPrototypes Xim im, Xic ic, XPointer data -#endif ); #ifdef EXT_MOVE extern CARD32 _XimExtenArgCheck( -#if NeedFunctionProtoTypes XIMArg *arg -#endif ); #endif extern Bool _XimCbDispatch( -#if NeedFunctionPrototypes Xim im, INT16 len, XPointer data, XPointer call_data -#endif ); extern Bool _XimLocalFilter( -#if NeedFunctionPrototypes Display *d, Window w, XEvent *ev, XPointer client_data -#endif ); extern XIMResourceList _XimGetResourceListRecByQuark( -#if NeedFunctionPrototypes XIMResourceList res_list, unsigned int list_num, XrmQuark quark -#endif ); extern Bool _XimReconnectModeCreateIC( -#if NeedFunctionPrototypes Xic ic -#endif ); extern char *_XimLocalSetICValues( -#if NeedFunctionPrototypes XIC ic, XIMArg *values -#endif ); extern char * _XimLocalGetICValues( -#if NeedFunctionPrototypes XIC ic, XIMArg *values -#endif ); extern int _XimLocalMbLookupString( -#if NeedFunctionPrototypes XIC ic, XKeyEvent *ev, char *buffer, int bytes, KeySym *keysym, Status *status -#endif ); extern int _XimLocalWcLookupString( -#if NeedFunctionPrototypes XIC ic, XKeyEvent *ev, wchar_t *buffer, int bytes, KeySym *keysym, Status *status -#endif +); + +extern int _XimLocalUtf8LookupString( + XIC ic, + XKeyEvent *ev, + char *buffer, + int bytes, + KeySym *keysym, + Status *status ); extern int _XimLocalUtf8LookupString( @@ -1154,60 +991,43 @@ extern int _XimLocalUtf8LookupString( ); extern Bool _XimThaiFilter( -#if NeedFunctionPrototypes Display *d, Window w, XEvent *ev, XPointer client_data -#endif ); extern XIC _XimThaiCreateIC( -#if NeedFunctionPrototypes XIM im, XIMArg *values -#endif ); extern Status _XimThaiCloseIM( -#if NeedFunctionPrototypes XIM xim -#endif ); #ifdef XIM_CONNECTABLE extern void _XimSetProtoResource( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimConnectServer( -#if NeedFunctionPrototypes Xim im -#endif ); extern Bool _XimDelayModeSetAttr( -#if NeedFunctionPrototypes Xim im -#endif ); extern void _XimServerReconectableDestroy( -#if NeedFunctionPrototypes void -#endif ); extern Bool _XimReCreateIC( -#if NeedFunctionPrototypes Xic ic -#endif ); extern Bool _XimEncodeSavedIMATTRIBUTE( -#if NeedFunctionPrototypes Xim im, XIMResourceList res_list, unsigned int res_num, @@ -1217,11 +1037,9 @@ extern Bool _XimEncodeSavedIMATTRIBUTE( int *ret_len, XPointer top, unsigned long mode -#endif ); extern Bool _XimEncodeSavedICATTRIBUTE( -#if NeedFunctionPrototypes Xic ic, XIMResourceList res_list, unsigned int res_num, @@ -1231,8 +1049,20 @@ extern Bool _XimEncodeSavedICATTRIBUTE( int *ret_len, XPointer top, unsigned long mode -#endif ); #endif +extern Public Bool +_XimRegisterDispatcher( + Xim im, + Bool (*callback)( + Xim, INT16, XPointer, XPointer + ), + XPointer call_data); + +extern Public Bool +_XimRespSyncReply( + Xic ic, + BITMASK16 mode); + #endif /* _XIMINT_H */ diff --git a/src/xlibi18n/XimintP.h b/src/xlibi18n/XimintP.h index b56fe172..38c4ed67 100644 --- a/src/xlibi18n/XimintP.h +++ b/src/xlibi18n/XimintP.h @@ -35,7 +35,7 @@ PERFORMANCE OF THIS SOFTWARE. miyamoto@jrd.dec.com ******************************************************************/ -/* $XFree86: xc/lib/X11/XimintP.h,v 1.7 2001/01/17 19:41:49 dawes Exp $ */ +/* $XFree86: xc/lib/X11/XimintP.h,v 1.8 2003/11/17 22:20:10 dawes Exp $ */ #ifndef _XIMINTP_H #define _XIMINTP_H @@ -47,9 +47,7 @@ PERFORMANCE OF THIS SOFTWARE. * for protocol layer callback function */ typedef Bool (*XimProtoIntrProc)( -#if NeedFunctionPrototypes Xim, INT16, XPointer, XPointer -#endif ); typedef struct _XimProtoIntrRec { XimProtoIntrProc func; @@ -63,39 +61,25 @@ typedef struct _XimProtoIntrRec { * for transport layer methods */ typedef Bool (*XimTransConnectProc)( -#if NeedFunctionPrototypes Xim -#endif ); typedef Bool (*XimTransShutdownProc)( -#if NeedFunctionPrototypes Xim -#endif ); typedef Bool (*XimTransWriteProc)( -#if NeedFunctionPrototypes Xim, INT16, XPointer -#endif ); typedef Bool (*XimTransReadProc)( -#if NeedFunctionPrototypes Xim, XPointer, int, int * -#endif ); typedef void (*XimTransFlushProc)( -#if NeedFunctionPrototypes Xim -#endif ); typedef Bool (*XimTransRegDispatcher)( -#if NeedNestedPrototypes Xim, Bool (*)(Xim, INT16, XPointer, XPointer), XPointer -#endif ); typedef Bool (*XimTransCallDispatcher)( -#if NeedFunctionPrototypes Xim, INT16, XPointer -#endif ); /* diff --git a/src/xlibi18n/XlcDL.c b/src/xlibi18n/XlcDL.c index 126cbff2..24200f57 100644 --- a/src/xlibi18n/XlcDL.c +++ b/src/xlibi18n/XlcDL.c @@ -41,7 +41,7 @@ interest in or to any trademark, service mark, logo or trade name of Sun Microsystems, Inc. or its licensors is granted. */ -/* $XFree86: xc/lib/X11/XlcDL.c,v 1.9.2.1 2003/03/11 23:18:49 herrb Exp $ */ +/* $XFree86: xc/lib/X11/XlcDL.c,v 1.13 2003/11/17 22:20:10 dawes Exp $ */ #include <stdio.h> #if defined(hpux) @@ -55,18 +55,15 @@ Sun Microsystems, Inc. or its licensors is granted. #include "XlcPublic.h" #include "XlcPubI.h" -#ifdef _LP64 -# if defined(__sparcv9) -# define _MACH64_NAME "sparcv9" -# elif defined(__ia64__) -# undef MACH64_NAME -# else -# error "Unknown architecture" -# endif /* defined(__sparcv9) */ -# ifdef _MACH64_NAME +#if defined(_LP64) && defined(__sparcv9) +# define _MACH64_NAME "sparcv9" +#else +# undef _MACH64_NAME +#endif /* defined(_LP64) && defined(__sparcv9) */ + +#ifdef _MACH64_NAME # define _MACH64_NAME_LEN (sizeof (_MACH64_NAME) - 1) -# endif -#endif /* _LP64 */ +#endif #define XI18N_DLREL 2 @@ -102,10 +99,7 @@ static XI18NObjectsListRec *xi18n_objects_list = NULL; static int lc_count = 0; static int -parse_line(line, argv, argsize) -char *line; -char **argv; -int argsize; +parse_line(char *line, char **argv, int argsize) { int argc = 0; char *p = line; @@ -162,9 +156,7 @@ try_both_dlsym (void *handle, char *name) #endif static void -resolve_object(path, lc_name) -char *path; -char *lc_name; +resolve_object(char *path, const char *lc_name) { char filename[BUFSIZ]; FILE *fp; @@ -235,9 +227,7 @@ Limit the length of path to prevent stack buffer corruption. } static char* -__lc_path(dl_name, lc_dir) -const char *dl_name; -const char *lc_dir; +__lc_path(const char *dl_name, const char *lc_dir) { char *path; size_t len; @@ -313,9 +303,9 @@ const char *lc_dir; * in XLCd */ static Bool -open_object (object, lc_dir) - XI18NObjectsList object; - char *lc_dir; +open_object( + XI18NObjectsList object, + char *lc_dir) { char *path; @@ -339,9 +329,9 @@ open_object (object, lc_dir) } static void * -fetch_symbol (object, symbol) - XI18NObjectsList object; - char *symbol; +fetch_symbol( + XI18NObjectsList object, + char *symbol) { void *result = NULL; #if defined(hpux) @@ -374,8 +364,7 @@ fetch_symbol (object, symbol) } static void -close_object (object) - XI18NObjectsList object; +close_object(XI18NObjectsList object) { object->refcount--; if (object->refcount == 0) @@ -390,16 +379,13 @@ close_object (object) } +typedef XLCd (*dynamicLoadProc)(const char *); + XLCd -#if NeedFunctionPrototypes _XlcDynamicLoad(const char *lc_name) -#else -_XlcDynamicLoad(lc_name) - const char *lc_name; -#endif { XLCd lcd = (XLCd)NULL; - XLCd (*lc_loader)() = (XLCd(*)())NULL; + dynamicLoadProc lc_loader = (dynamicLoadProc)NULL; int count; XI18NObjectsList objects_list; char lc_dir[BUFSIZE]; @@ -419,7 +405,7 @@ _XlcDynamicLoad(lc_name) if (!open_object (objects_list, lc_dir)) continue; - lc_loader = (XLCd(*)())fetch_symbol (objects_list, objects_list->open); + lc_loader = (dynamicLoadProc)fetch_symbol (objects_list, objects_list->open); if (!lc_loader) continue; lcd = (*lc_loader)(lc_name); if (lcd != (XLCd)NULL) { @@ -431,22 +417,17 @@ _XlcDynamicLoad(lc_name) return (XLCd)lcd; } + +typedef XIM (*dynamicOpenProcp)(XLCd, Display *, XrmDatabase, char *, char *); + static XIM -#if NeedFunctionPrototypes _XDynamicOpenIM(XLCd lcd, Display *display, XrmDatabase rdb, char *res_name, char *res_class) -#else -_XDynamicOpenIM(lcd, display, rdb, res_name, res_class) -XLCd lcd; -Display *display; -XrmDatabase rdb; -char *res_name, *res_class; -#endif { XIM im = (XIM)NULL; char lc_dir[BUFSIZE]; char *lc_name; - XIM (*im_openIM)() = (XIM(*)())NULL; + dynamicOpenProcp im_openIM = (dynamicOpenProcp)NULL; int count; XI18NObjectsList objects_list = xi18n_objects_list; @@ -462,7 +443,7 @@ char *res_name, *res_class; if (!open_object (objects_list, lc_dir)) continue; - im_openIM = (XIM(*)())fetch_symbol(objects_list, objects_list->open); + im_openIM = (dynamicOpenProcp)fetch_symbol(objects_list, objects_list->open); if (!im_openIM) continue; im = (*im_openIM)(lcd, display, rdb, res_name, res_class); if (im != (XIM)NULL) { @@ -474,20 +455,22 @@ char *res_name, *res_class; return (XIM)im; } +typedef Bool (*dynamicRegisterCBProcp)( + XLCd, Display *, XrmDatabase, char *, char *, XIDProc, XPointer); + static Bool -_XDynamicRegisterIMInstantiateCallback(lcd, display, rdb, - res_name, res_class, - callback, client_data) -XLCd lcd; -Display *display; -XrmDatabase rdb; -char *res_name, *res_class; -XIMProc callback; -XPointer *client_data; +_XDynamicRegisterIMInstantiateCallback( + XLCd lcd, + Display *display, + XrmDatabase rdb, + char *res_name, + char *res_class, + XIDProc callback, + XPointer client_data) { char lc_dir[BUFSIZE]; char *lc_name; - Bool (*im_registerIM)() = (Bool(*)())NULL; + dynamicRegisterCBProcp im_registerIM = (dynamicRegisterCBProcp)NULL; Bool ret_flag = False; int count; XI18NObjectsList objects_list = xi18n_objects_list; @@ -507,7 +490,7 @@ XPointer *client_data; if (!open_object (objects_list, lc_dir)) continue; - im_registerIM = (Bool(*)())fetch_symbol(objects_list, + im_registerIM = (dynamicRegisterCBProcp)fetch_symbol(objects_list, objects_list->im_register); if (!im_registerIM) continue; ret_flag = (*im_registerIM)(lcd, display, rdb, @@ -520,20 +503,22 @@ XPointer *client_data; return (Bool)ret_flag; } +typedef Bool (*dynamicUnregisterProcp)( + XLCd, Display *, XrmDatabase, char *, char *, XIDProc, XPointer); + static Bool -_XDynamicUnRegisterIMInstantiateCallback(lcd, display, rdb, - res_name, res_class, - callback, client_data) -XLCd lcd; -Display *display; -XrmDatabase rdb; -char *res_name, *res_class; -XIMProc callback; -XPointer *client_data; +_XDynamicUnRegisterIMInstantiateCallback( + XLCd lcd, + Display *display, + XrmDatabase rdb, + char *res_name, + char *res_class, + XIDProc callback, + XPointer client_data) { char lc_dir[BUFSIZE]; char *lc_name; - Bool (*im_unregisterIM)() = (Bool(*)())NULL; + dynamicUnregisterProcp im_unregisterIM = (dynamicUnregisterProcp)NULL; Bool ret_flag = False; int count; XI18NObjectsList objects_list = xi18n_objects_list; @@ -553,7 +538,7 @@ XPointer *client_data; if (!objects_list->refcount) /* Must already be opened */ continue; - im_unregisterIM = (Bool(*)())fetch_symbol(objects_list, + im_unregisterIM = (dynamicUnregisterProcp)fetch_symbol(objects_list, objects_list->im_unregister); if (!im_unregisterIM) continue; @@ -569,12 +554,7 @@ XPointer *client_data; } Bool -#if NeedFunctionPrototypes _XInitDynamicIM(XLCd lcd) -#else -_XInitDynamicIM(lcd) -XLCd lcd; -#endif { if(lcd == (XLCd)NULL) return False; @@ -584,24 +564,19 @@ XLCd lcd; return True; } + +typedef XOM (*dynamicIOpenProcp)( + XLCd, Display *, XrmDatabase, _Xconst char *, _Xconst char *); + static XOM -#if NeedFunctionPrototypes _XDynamicOpenOM(XLCd lcd, Display *display, XrmDatabase rdb, _Xconst char *res_name, _Xconst char *res_class) -#else -_XDynamicOpenOM(lcd, display, rdb, res_name, res_class) -XLCd lcd; -Display *display; -XrmDatabase rdb; -char *res_name; -char *res_class; -#endif { XOM om = (XOM)NULL; int count; char lc_dir[BUFSIZE]; char *lc_name; - XOM (*om_openOM)() = (XOM(*)())NULL; + dynamicIOpenProcp om_openOM = (dynamicIOpenProcp)NULL; XI18NObjectsList objects_list = xi18n_objects_list; #if defined(hpux) int getsyms_cnt, i; @@ -619,7 +594,7 @@ char *res_class; if (!open_object (objects_list, lc_dir)) continue; - om_openOM = (XOM(*)())fetch_symbol(objects_list, objects_list->open); + om_openOM = (dynamicIOpenProcp)fetch_symbol(objects_list, objects_list->open); if (!om_openOM) continue; om = (*om_openOM)(lcd, display, rdb, res_name, res_class); if (om != (XOM)NULL) { @@ -631,12 +606,7 @@ char *res_class; } Bool -#if NeedFunctionPrototypes _XInitDynamicOM(XLCd lcd) -#else -_XInitDynamicOM(lcd) - XLCd lcd; -#endif { if(lcd == (XLCd)NULL) return False; diff --git a/src/xlibi18n/XlcGeneric.h b/src/xlibi18n/XlcGeneric.h index a762917e..45dd66f9 100644 --- a/src/xlibi18n/XlcGeneric.h +++ b/src/xlibi18n/XlcGeneric.h @@ -31,7 +31,7 @@ * Modifier: Takanori Tateno FUJITSU LIMITED * */ -/* $XFree86: xc/lib/X11/XlcGeneric.h,v 1.4 2001/07/25 15:04:44 dawes Exp $ */ +/* $XFree86: xc/lib/X11/XlcGeneric.h,v 1.5 2003/04/13 19:22:19 dawes Exp $ */ #ifndef _XLCGENERIC_H_ #define _XLCGENERIC_H_ @@ -143,4 +143,22 @@ typedef struct _XLCdGenericRec { extern XLCdMethods _XlcGenericMethods; +extern FontScope +_XlcParse_scopemaps( + const char *str, + int *size); +extern void +_XlcDbg_printValue( + const char *str, + char **value, + int num); + +extern XIM +_XDefaultOpenIM( + XLCd lcd, + Display *dpy, + XrmDatabase rdb, + char *res_name, + char *res_class); + #endif /* _XLCGENERIC_H_ */ diff --git a/src/xlibi18n/XlcPubI.h b/src/xlibi18n/XlcPubI.h index 0fbe337a..0a29dd48 100644 --- a/src/xlibi18n/XlcPubI.h +++ b/src/xlibi18n/XlcPubI.h @@ -23,7 +23,7 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/XlcPubI.h,v 3.9.6.1 2003/03/11 23:18:49 herrb Exp $ */ +/* $XFree86: xc/lib/X11/XlcPubI.h,v 3.14 2003/11/17 22:20:10 dawes Exp $ */ #ifndef _XLCPUBLICI_H_ #define _XLCPUBLICI_H_ @@ -165,43 +165,35 @@ extern int _Xutf8TextPropertyToTextList( ); extern int _XmbTextListToTextProperty( -#if NeedFunctionPrototypes XLCd /* lcd */, Display* /* dpy */, - char** /* list */, + wchar_t** /* list */, int /* count */, XICCEncodingStyle /* style */, XTextProperty* /* text_prop */ -#endif ); extern int _XwcTextListToTextProperty( -#if NeedFunctionPrototypes XLCd /* lcd */, Display* /* dpy */, - wchar_t** /* list */, + char** /* list */, int /* count */, XICCEncodingStyle /* style */, XTextProperty* /* text_prop */ -#endif ); extern int _Xutf8TextListToTextProperty( -#if NeedFunctionPrototypes XLCd /* lcd */, Display* /* dpy */, char** /* list */, int /* count */, XICCEncodingStyle /* style */, XTextProperty* /* text_prop */ -#endif ); extern void _XwcFreeStringList( -#if NeedFunctionPrototypes XLCd /* lcd */, wchar_t** /* list */ -#endif ); extern int _XlcResolveLocaleName( @@ -215,11 +207,9 @@ extern int _XlcResolveI18NPath( ); extern char *_XlcLocaleDirName( -#if NeedFunctionPrototypes char* /* dir_name */, size_t, /* dir_len */ char* /* lc_name */ -#endif ); extern XPointer _XlcCreateLocaleDataBase( @@ -238,6 +228,68 @@ extern void _XlcGetLocaleDataBase( int* /* count */ ); +#ifdef X_LOCALE +extern char * +_Xsetlocale( + int category, + _Xconst char *name); +#else +extern char *_XlcMapOSLocaleName( + char *osname, + char *siname); +#endif + +extern int +_Xmbstoutf8( + char *ustr, + const char *str, + int len); +extern int +_Xlcmbstoutf8( + XLCd lcd, + char *ustr, + const char *str, + int len); +extern int +_Xmbstowcs( + wchar_t *wstr, + char *str, + int len); +extern int +_Xlcwcstombs( + XLCd lcd, + char *str, + wchar_t *wstr, + int len); +extern int +_Xlcmbstowcs( + XLCd lcd, + wchar_t *wstr, + char *str, + int len); +extern int +_Xwcstombs( + char *str, + wchar_t *wstr, + int len); +extern int +_Xlcmbtowc( + XLCd lcd, + wchar_t *wstr, + char *str, + int len); +extern int +_Xlcwctomb( + XLCd lcd, + char *str, + wchar_t wc); + + + +extern XPointer +_Utf8GetConvByName( + const char *name); + _XFUNCPROTOEND #endif /* _XLCPUBLICI_H_ */ diff --git a/src/xlibi18n/XlcPublic.h b/src/xlibi18n/XlcPublic.h index dc866703..72df4c8e 100644 --- a/src/xlibi18n/XlcPublic.h +++ b/src/xlibi18n/XlcPublic.h @@ -31,7 +31,7 @@ * Modifier: Takanori Tateno FUJITSU LIMITED * */ -/* $XFree86: xc/lib/X11/XlcPublic.h,v 1.9 2001/01/17 19:41:49 dawes Exp $ */ +/* $XFree86: xc/lib/X11/XlcPublic.h,v 1.12 2003/11/17 22:20:10 dawes Exp $ */ /* * Most of this API is documented in i18n/Framework.PS */ @@ -140,10 +140,8 @@ extern Bool _XlcAddCharSet( Return NULL if successful, otherwise the name of the first argument specifiying a nonexistent attribute. */ extern char *_XlcGetCSValues( -#if NeedVarargsPrototypes XlcCharSet charset, ... -#endif ); _XFUNCPROTOEND @@ -177,13 +175,10 @@ typedef XlcConv (*XlcOpenConverterProc)( ); typedef void (*XlcCloseConverterProc)( -#if NeedFunctionPrototypes XlcConv /* conv */ -#endif ); typedef int (*XlcConvertProc)( -#if NeedFunctionPrototypes XlcConv /* conv */, XPointer* /* from */, int* /* from_left */, @@ -191,13 +186,10 @@ typedef int (*XlcConvertProc)( int* /* to_left */, XPointer* /* args */, int /* num_args */ -#endif ); typedef void (*XlcResetConverterProc)( -#if NeedFunctionPrototypes XlcConv /* conv */ -#endif ); typedef struct _XlcConvMethodsRec{ @@ -230,22 +222,24 @@ typedef struct _XlcConvRec { _XFUNCPROTOBEGIN extern Bool _XInitOM( -#if NeedFunctionPrototypes XLCd /* lcd */ -#endif ); extern Bool _XInitIM( -#if NeedFunctionPrototypes XLCd /* lcd */ -#endif +); + +extern XIM _XimOpenIM( + XLCd /* lcd */, + Display * /* dpy */, + XrmDatabase /* rdb */, + char * /* res_name */, + char * /* res_class */ ); extern char *_XGetLCValues( -#if NeedVarargsPrototypes XLCd /* lcd */, ... -#endif ); extern XlcConv _XlcOpenConverter( @@ -295,18 +289,18 @@ extern char *_XlcFileName( ); extern int _Xwcslen( -#if NeedFunctionPrototypes wchar_t* /* wstr */ -#endif ); extern wchar_t *_Xwcscpy( -#if NeedFunctionPrototypes wchar_t* /* wstr1 */, wchar_t* /* wstr2 */ -#endif ); +extern wchar_t *_Xwcsncpy(wchar_t *wstr1, wchar_t *wstr2, int len); +extern int _Xwcscmp(wchar_t *wstr1, wchar_t *wstr2); +extern int _Xwcsncmp(wchar_t *wstr1, wchar_t *wstr2, int len); + /* Compares two ISO 8859-1 strings, ignoring case of ASCII letters. Like strcasecmp in an ASCII locale. */ extern int _XlcCompareISOLatin1( @@ -322,6 +316,11 @@ extern int _XlcNCompareISOLatin1( int len ); +extern XOM +_XDefaultOpenOM( + XLCd lcd, Display *dpy, XrmDatabase rdb, + _Xconst char *res_name, _Xconst char *res_class); + _XFUNCPROTOEND #endif /* _XLCPUBLIC_H_ */ diff --git a/src/xlibi18n/XlcSL.c b/src/xlibi18n/XlcSL.c index 12391b1d..c3f00056 100644 --- a/src/xlibi18n/XlcSL.c +++ b/src/xlibi18n/XlcSL.c @@ -41,14 +41,13 @@ interest in or to any trademark, service mark, logo or trade name of Sun Microsystems, Inc. or its licensors is granted. */ +/* $XFree86: xc/lib/X11/XlcSL.c,v 1.2 2003/11/17 22:20:10 dawes Exp $ */ #include "Xlibint.h" #include "Xlcint.h" extern XIM _XDefaultOpenIM( -#if NeedNestedPrototypes XLCd, Display *, XrmDatabase, char *, char * -#endif ); Bool @@ -65,9 +64,7 @@ XLCd lcd; } extern XOM _XDefaultOpenOM( -#if NeedFunctionPrototypes XLCd, Display*, XrmDatabase, _Xconst char*, _Xconst char* -#endif ); Bool diff --git a/src/xlibi18n/Xlcint.h b/src/xlibi18n/Xlcint.h index a216dba6..427a7a07 100644 --- a/src/xlibi18n/Xlcint.h +++ b/src/xlibi18n/Xlcint.h @@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/Xlcint.h,v 3.14 2002/11/01 13:43:31 alanh Exp $ */ +/* $XFree86: xc/lib/X11/Xlcint.h,v 3.17 2003/11/17 22:20:10 dawes Exp $ */ /* * Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation, @@ -79,12 +79,10 @@ from The Open Group. #include <stdarg.h> typedef Bool (*XFilterEventProc)( -#if NeedFunctionPrototypes Display* /* display */, Window /* window */, XEvent* /* event */, XPointer /* client_data */ -#endif ); typedef struct _XIMFilter { @@ -221,41 +219,32 @@ typedef struct _XLCd *XLCd; /* need forward reference */ */ typedef void (*XCloseLCProc)( -#if NeedFunctionPrototypes XLCd /* lcd */ -#endif ); typedef char* (*XlcMapModifiersProc)( -#if NeedFunctionPrototypes XLCd /* lcd */, _Xconst char* /* user_mods */, _Xconst char* /* prog_mods */ -#endif ); typedef XOM (*XOpenOMProc)( -#if NeedFunctionPrototypes XLCd /* lcd */, Display* /* display */, XrmDatabase /* rdb */, _Xconst char* /* res_name */, _Xconst char* /* res_class */ -#endif ); typedef XIM (*XOpenIMProc)( -#if NeedFunctionPrototypes XLCd /* lcd */, Display* /* display */, XrmDatabase /* rdb */, char* /* res_name */, char* /* res_class */ -#endif ); typedef Bool (*XRegisterIMInstantiateCBProc)( -#if NeedFunctionPrototypes XLCd /* lcd */, Display* /* display */, XrmDatabase /* rdb */, @@ -263,11 +252,9 @@ typedef Bool (*XRegisterIMInstantiateCBProc)( char* /* res_class */, XIDProc /* callback */, XPointer /* client_data */ -#endif ); typedef Bool (*XUnregisterIMInstantiateCBProc)( -#if NeedFunctionPrototypes XLCd /* lcd */, Display* /* display */, XrmDatabase /* rdb */, @@ -275,14 +262,11 @@ typedef Bool (*XUnregisterIMInstantiateCBProc)( char* /* res_class */, XIDProc /* callback */, XPointer /* client_data */ -#endif ); typedef XrmMethods (*XrmInitParseInfoProc)( -#if NeedFunctionPrototypes XLCd /* lcd */, XPointer* /* state */ -#endif ); typedef int (*XmbTextPropertyToTextListProc)( @@ -386,33 +370,25 @@ typedef struct _XlcResource { #define XlcNumber(arr) (sizeof(arr) / sizeof(arr[0])) typedef Status (*XCloseOMProc)( -#if NeedFunctionPrototypes XOM /* om */ -#endif ); typedef char* (*XSetOMValuesProc)( -#if NeedFunctionPrototypes XOM /* om */, XlcArgList /* args */, int /* num_args */ -#endif ); typedef char* (*XGetOMValuesProc)( -#if NeedFunctionPrototypes XOM /* om */, XlcArgList /* args */, int /* num_args */ -#endif ); typedef XOC (*XCreateOCProc)( -#if NeedFunctionPrototypes XOM /* om */, XlcArgList /* args */, int /* num_args */ -#endif ); typedef struct _XOMMethodsRec { @@ -444,25 +420,19 @@ typedef struct _XOM { } XOMRec; typedef void (*XDestroyOCProc)( -#if NeedFunctionPrototypes XOC /* oc */ -#endif ); typedef char* (*XSetOCValuesProc)( -#if NeedFunctionPrototypes XOC /* oc */, XlcArgList /* args */, int /* num_args */ -#endif ); typedef char* (*XGetOCValuesProc)( -#if NeedFunctionPrototypes XOC /* oc */, XlcArgList /* args */, int /* num_args */ -#endif ); /* @@ -475,25 +445,20 @@ typedef char* (*XGetOCValuesProc)( */ typedef int (*XmbTextEscapementProc)( -#if NeedFunctionPrototypes XFontSet /* font_set */, _Xconst char* /* text */, int /* text_len */ -#endif ); typedef int (*XmbTextExtentsProc)( -#if NeedFunctionPrototypes XFontSet /* font_set */, _Xconst char* /* text */, int /* text_len */, XRectangle* /* overall_ink_extents */, XRectangle* /* overall_logical_extents */ -#endif ); typedef Status (*XmbTextPerCharExtentsProc)( -#if NeedFunctionPrototypes XFontSet /* font_set */, _Xconst char* /* text */, int /* text_len */, @@ -503,11 +468,9 @@ typedef Status (*XmbTextPerCharExtentsProc)( int* /* num_chars */, XRectangle* /* max_ink_extents */, XRectangle* /* max_logical_extents */ -#endif ); typedef int (*XmbDrawStringProc)( -#if NeedFunctionPrototypes Display* /* display */, Drawable /* drawable */, XFontSet /* font_set */, @@ -516,11 +479,9 @@ typedef int (*XmbDrawStringProc)( int /* y */, _Xconst char* /* text */, int /* text_len */ -#endif ); typedef void (*XmbDrawImageStringProc)( -#if NeedFunctionPrototypes Display* /* display */, Drawable /* drawable */, XFontSet /* font_set */, @@ -529,29 +490,23 @@ typedef void (*XmbDrawImageStringProc)( int /* y */, _Xconst char* /* text */, int /* text_len */ -#endif ); typedef int (*XwcTextEscapementProc)( -#if NeedFunctionPrototypes XFontSet /* font_set */, _Xconst wchar_t* /* text */, int /* text_len */ -#endif ); typedef int (*XwcTextExtentsProc)( -#if NeedFunctionPrototypes XFontSet /* font_set */, _Xconst wchar_t* /* text */, int /* text_len */, XRectangle* /* overall_ink_extents */, XRectangle* /* overall_logical_extents */ -#endif ); typedef Status (*XwcTextPerCharExtentsProc)( -#if NeedFunctionPrototypes XFontSet /* font_set */, _Xconst wchar_t* /* text */, int /* text_len */, @@ -561,11 +516,9 @@ typedef Status (*XwcTextPerCharExtentsProc)( int* /* num_chars */, XRectangle* /* max_ink_extents */, XRectangle* /* max_logical_extents */ -#endif ); typedef int (*XwcDrawStringProc)( -#if NeedFunctionPrototypes Display* /* display */, Drawable /* drawable */, XFontSet /* font_set */, @@ -574,11 +527,9 @@ typedef int (*XwcDrawStringProc)( int /* y */, _Xconst wchar_t* /* text */, int /* text_len */ -#endif ); typedef void (*XwcDrawImageStringProc)( -#if NeedFunctionPrototypes Display* /* display */, Drawable /* drawable */, XFontSet /* font_set */, @@ -587,7 +538,6 @@ typedef void (*XwcDrawImageStringProc)( int /* y */, _Xconst wchar_t* /* text */, int /* text_len */ -#endif ); typedef struct { @@ -647,12 +597,6 @@ typedef struct _XOC { } XOCRec; -/* current Ultrix compiler gets horribly confused */ -#if defined(FUNCPROTO) && defined(ultrix) -#undef NeedFunctionPrototypes -#endif - - /* * X Input Managers are an instantiable object, so we define it, the * object itself, a method list and data. @@ -663,34 +607,25 @@ typedef struct _XOC { */ typedef struct { Status (*close)( -#if NeedFunctionPrototypes XIM -#endif ); char* (*set_values)( -#if NeedFunctionPrototypes XIM, XIMArg* -#endif ); char* (*get_values)( -#if NeedFunctionPrototypes XIM, XIMArg* -#endif ); XIC (*create_ic)( -#if NeedFunctionPrototypes XIM, XIMArg* -#endif ); int (*ctstombs)( -#if NeedFunctionPrototypes XIM, char*, int, char*, int, Status * -#endif ); int (*ctstowcs)( -#if NeedFunctionPrototypes XIM, char*, int, wchar_t*, int, Status * -#endif + ); + int (*ctstoutf8)( + XIM, char*, int, char*, int, Status * ); int (*ctstoutf8)( #if NeedFunctionPrototypes @@ -746,39 +681,28 @@ typedef struct _XIM { */ typedef struct { void (*destroy)( -#if NeedFunctionPrototypes XIC -#endif ); void (*set_focus)( -#if NeedFunctionPrototypes XIC -#endif ); void (*unset_focus)( -#if NeedFunctionPrototypes XIC -#endif ); char* (*set_values)( -#if NeedFunctionPrototypes XIC, XIMArg* -#endif ); char* (*get_values)( -#if NeedFunctionPrototypes XIC, XIMArg* -#endif ); char* (*mb_reset)( -#if NeedFunctionPrototypes XIC -#endif ); wchar_t* (*wc_reset)( -#if NeedFunctionPrototypes XIC -#endif + ); + char* (*utf8_reset)( + XIC ); char* (*utf8_reset)( #if NeedFunctionPrototypes @@ -786,14 +710,13 @@ typedef struct { #endif ); int (*mb_lookup_string)( -#if NeedFunctionPrototypes XIC, XKeyEvent*, char*, int, KeySym*, Status* -#endif ); int (*wc_lookup_string)( -#if NeedFunctionPrototypes XIC, XKeyEvent*, wchar_t*, int, KeySym*, Status* -#endif + ); + int (*utf8_lookup_string)( + XIC, XKeyEvent*, char*, int, KeySym*, Status* ); int (*utf8_lookup_string)( #if NeedFunctionPrototypes @@ -840,10 +763,6 @@ typedef struct _XIC { XICCoreRec core; /* data of this IC */ } XICRec; -/* current Ultrix compiler gets horribly confused */ -#if !defined(NeedFunctionPrototypes) && defined(FUNCPROTO) -#define NeedFunctionPrototypes 1 -#endif /* If the argument 'name' is appropriate for this loader, it instantiates an XLCd object with appropriate locale methods and returns it. May return @@ -855,7 +774,7 @@ typedef XLCd (*XLCdLoadProc)( _XFUNCPROTOBEGIN extern XLCd _XOpenLC( - const char* name + char* name ); extern void _XCloseLC( @@ -876,25 +795,19 @@ extern char *_XlcDefaultMapModifiers( ); extern void _XIMCompileResourceList( -#if NeedFunctionPrototypes XIMResourceList /* res */, unsigned int /* num_res */ -#endif ); extern void _XCopyToArg( -#if NeedFunctionPrototypes XPointer /* src */, XPointer* /* dst */, unsigned int /* size */ -#endif ); extern char ** _XParseBaseFontNameList( -#if NeedFunctionPrototypes char* /* str */, int* /* num */ -#endif ); extern XrmMethods _XrmInitParseInfo( @@ -902,54 +815,42 @@ extern XrmMethods _XrmInitParseInfo( ); extern void _XRegisterFilterByMask( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* window */, unsigned long /* event_mask */, Bool (*)( -#if NeedNestedPrototypes Display* /* display */, Window /* window */, XEvent* /* event */, XPointer /* client_data */ -#endif ) /* filter */, XPointer /* client_data */ -#endif ); extern void _XRegisterFilterByType( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* window */, int /* start_type */, int /* end_type */, Bool (*)( -#if NeedNestedPrototypes Display* /* display */, Window /* window */, XEvent* /* event */, XPointer /* client_data */ -#endif ) /* filter */, XPointer /* client_data */ -#endif ); extern void _XUnregisterFilter( -#if NeedFunctionPrototypes Display* /* dpy */, Window /* window */, Bool (*)( -#if NeedNestedPrototypes Display* /* display */, Window /* window */, XEvent* /* event */, XPointer /* client_data */ -#endif ) /* filter */, XPointer /* client_data */ -#endif ); extern void _XlcCountVaList( @@ -963,6 +864,19 @@ extern void _XlcVaToArgList( XlcArgList* args_return ); + +extern void _XlcCopyFromArg( + char * src, + char * dst, + int size +); + +extern void _XlcCopyToArg( + char * src, + char ** dst, + int size +); + extern void _XlcCompileResourceList( XlcResourceList resources, int num_resources diff --git a/src/xlibi18n/imKStoUCS.c b/src/xlibi18n/imKStoUCS.c index 693db4a9..56ec7e2b 100644 --- a/src/xlibi18n/imKStoUCS.c +++ b/src/xlibi18n/imKStoUCS.c @@ -1,6 +1,7 @@ -/* $XFree86: xc/lib/X11/imKStoUCS.c,v 1.2 2001/07/25 15:04:45 dawes Exp $ */ +/* $XFree86: xc/lib/X11/imKStoUCS.c,v 1.5 2003/11/17 22:20:11 dawes Exp $ */ #include "Xlibint.h" +#include "Ximint.h" static unsigned short const keysym_to_unicode_1a1_1ff[] = { 0x0104, 0x02d8, 0x0141, 0x0000, 0x013d, 0x015a, 0x0000, /* 0x01a0-0x01a7 */ @@ -233,8 +234,8 @@ static unsigned short keysym_to_unicode_15d0_15f6[] = { static unsigned short keysym_to_unicode_16a0_16f6[] = { 0x0000, 0x0000, 0xf0a2, 0x1e8a, 0x0000, 0xf0a5, 0x012c, 0xf0a7, /* 0x16a0-0x16a7 */ 0xf0a8, 0x01b5, 0x01e6, 0x0000, 0x0000, 0x0000, 0x0000, 0x019f, /* 0x16a8-0x16af */ - 0x0000, 0x017e, 0xf0b2, 0x1e8b, 0x01d1, 0xf0b5, 0x012d, 0xf0b7, /* 0x16b0-0x16b7 */ - 0xf0b8, 0x01b6, 0x01e7, 0x01d2, 0x0000, 0x0000, 0x0000, 0x0275, /* 0x16b8-0x16bf */ + 0x0000, 0x0000, 0xf0b2, 0x1e8b, 0x01d1, 0xf0b5, 0x012d, 0xf0b7, /* 0x16b0-0x16b7 */ + 0xf0b8, 0x01b6, 0x01e7, 0x0000, 0x0000, 0x01d2, 0x0000, 0x0275, /* 0x16b8-0x16bf */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x018f, 0x0000, /* 0x16c0-0x16c7 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x16c8-0x16cf */ 0x0000, 0x1e36, 0xf0d2, 0xf0d3, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x16d0-0x16d7 */ @@ -266,12 +267,7 @@ static unsigned short const keysym_to_unicode_20a0_20ac[] = { }; unsigned int -#if NeedFunctionPrototypes KeySymToUcs4(KeySym keysym) -#else -KeySymToUcs4(keysym) - KeySym keysym; -#endif { /* 'Unicode keysym' */ if ((keysym & 0xff000000) == 0x01000000) @@ -316,7 +312,7 @@ KeySymToUcs4(keysym) else if (keysym > 0x169f && keysym < 0x16f7) return keysym_to_unicode_16a0_16f6[keysym - 0x16a0]; else if (keysym > 0x1e9e && keysym < 0x1f00) - return keysym_to_unicode_1e9f_1eff[keysym - 0x1ea0]; + return keysym_to_unicode_1e9f_1eff[keysym - 0x1e9f]; else if (keysym > 0x209f && keysym < 0x20ad) return keysym_to_unicode_20a0_20ac[keysym - 0x20a0]; else diff --git a/src/xlibi18n/lcCT.c b/src/xlibi18n/lcCT.c index fcaca229..cae3f6f7 100644 --- a/src/xlibi18n/lcCT.c +++ b/src/xlibi18n/lcCT.c @@ -36,7 +36,7 @@ * Modifier: Ivan Pascal The XFree86 Project * Modifier: Bruno Haible The XFree86 Project */ -/* $XFree86: xc/lib/X11/lcCT.c,v 3.27 2002/10/08 23:31:35 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcCT.c,v 3.28 2003/08/04 10:32:20 eich Exp $ */ #include "Xlibint.h" #include "XlcPubI.h" @@ -116,8 +116,10 @@ static CTDataRec default_ct_data[] = defined in XLC_LOCALE files, using "\033%/1" or "\033%/2". */ /* Backward compatibility with XFree86 3.x */ +#if 1 { "ISO8859-14:GR", "\033%/1" }, { "ISO8859-15:GR", "\033%/1" }, +#endif /* For use by utf8 -> ctext */ { "BIG5-0:GLGR", "\033%/2"}, /* used by Emacs, but not backed by ISO-IR */ @@ -400,7 +402,7 @@ typedef struct _CTInfoRec { * at runtime through _XlcAddCT. */ static CTInfo ct_list = NULL; -static CTInfo *ct_list_end = &ct_list; +static CTInfo ct_list_end = NULL; /* * Returns a Compound Text info record for an ESC sequence. @@ -534,8 +536,12 @@ _XlcAddCT( /* Insert it at the end. If there are duplicates CTinfo entries for the same XlcCharSet, we want the first (standard) one to override the second (user defined) one. */ - ct_info->next = *ct_list_end; - *ct_list_end = ct_info; + ct_info->next = NULL; + if (ct_list_end) + ct_list_end->next = ct_info; + else + ct_list = ct_info; + ct_list_end = ct_info; } else { if (existing_info->charset != charset /* We have a conflict, with one exception: JISX0208.1983-0 and diff --git a/src/xlibi18n/lcDB.c b/src/xlibi18n/lcDB.c index 8e12a699..4a88ea3c 100644 --- a/src/xlibi18n/lcDB.c +++ b/src/xlibi18n/lcDB.c @@ -28,7 +28,7 @@ * This is source code modified by FUJITSU LIMITED under the Joint * Development Agreement for the CDE/Motif PST. */ -/* $XFree86: xc/lib/X11/lcDB.c,v 3.15 2002/05/31 18:45:42 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcDB.c,v 3.16 2003/05/27 22:26:26 tsi Exp $ */ @@ -126,8 +126,7 @@ static TokenTable token_tbl[] = { { 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 */ - {0} + { T_DEFAULT, " ", 1, f_default } /* any character */ }; #define SYM_CR '\r' diff --git a/src/xlibi18n/lcFile.c b/src/xlibi18n/lcFile.c index d94045d7..5ef493b0 100644 --- a/src/xlibi18n/lcFile.c +++ b/src/xlibi18n/lcFile.c @@ -23,7 +23,7 @@ * SOFTWARE. * */ -/* $XFree86: xc/lib/X11/lcFile.c,v 3.30.2.1 2003/03/11 23:18:49 herrb Exp $ */ +/* $XFree86: xc/lib/X11/lcFile.c,v 3.33 2003/07/16 01:38:26 dawes Exp $ */ #include <stdlib.h> #include <stdio.h> @@ -31,9 +31,17 @@ #include "Xlibint.h" #include "XlcPubI.h" #include <X11/Xos.h> +#if 0 +#include <unistd.h> /* in theory delivers getresuid/gid prototypes, + * in practice only the Linux syscall wrapper is there. */ +#endif + /************************************************************************/ +#ifdef __UNIXOS2__ +# define seteuid setuid +#endif #define iscomment(ch) ((ch) == '#' || (ch) == '\0') #if defined(WIN32) #define isreadable(f) (_XAccessFile(f)) @@ -109,6 +117,41 @@ parse_line( return argc; } +#ifdef __UNIXOS2__ + +/* fg021216: entries in locale files are separated by colons while under + OS/2, path entries are separated by semicolon, so we need two functions */ + +static int +parse_line1( + char *line, + char **argv, + int argsize) +{ + int argc = 0; + char *p = line; + + while (argc < argsize) { + while (isspace(*p)) { + ++p; + } + if (*p == '\0') { + break; + } + argv[argc++] = p; + while (*p != ';' && *p != '\n' && *p != '\0') { + ++p; + } + if (*p == '\0') { + break; + } + *p++ = '\0'; + } + + return argc; +} +#endif /* __UNIXOS2__ */ + /* Splits a colon separated list of directories, and returns the constituent paths (without trailing slash). At most argsize constituents are stored at argv[0..argsize-1]. The number of stored constituents is returned. */ @@ -121,7 +164,11 @@ _XlcParsePath( char *p = path; int n, i; +#ifndef __UNIXOS2__ n = parse_line(path, argv, argsize); +#else + n = parse_line1(path, argv, argsize); +#endif for (i = 0; i < n; ++i) { int len; p = argv[i]; diff --git a/src/xlibi18n/lcGeneric.c b/src/xlibi18n/lcGeneric.c index 06d370d8..8eaf498a 100644 --- a/src/xlibi18n/lcGeneric.c +++ b/src/xlibi18n/lcGeneric.c @@ -28,7 +28,7 @@ * This is source code modified by FUJITSU LIMITED under the Joint * Development Agreement for the CDE/Motif PST. */ -/* $XFree86: xc/lib/X11/lcGeneric.c,v 3.17 2003/02/03 22:11:58 paulo Exp $ */ +/* $XFree86: xc/lib/X11/lcGeneric.c,v 3.20 2003/09/24 02:43:12 dawes Exp $ */ #include <stdio.h> #include "Xlibint.h" @@ -787,7 +787,7 @@ load_generic( if (num > 0) { static struct { const char *str; - int type; + EncodingType type; } shifts[] = { {"<SS>", E_SS}, {"<LSL>", E_LSL}, @@ -801,7 +801,7 @@ load_generic( for ( ; num-- > 0; value++) { char encoding[256]; char *tmp = *value; - int type = E_SS; /* for BC */ + EncodingType type = E_SS; /* for BC */ for (j = 0; shifts[j].str; j++) { if (!_XlcNCompareISOLatin1(tmp, shifts[j].str, strlen(shifts[j].str))) { @@ -868,7 +868,7 @@ load_generic( /* For VW/UDC */ /***** 3.4.2 byteM (1 <= M <= length)*****/ for (M=1; M-1 < codeset->length; M++) { - long start,end; + unsigned long start,end; ByteInfo tmpb; sprintf(name,"%s.%s%d",cs,"byte",M); @@ -992,8 +992,8 @@ err: super_class's initialize method() */ static Bool -initialize_core(lcd) - XLCd lcd; +initialize_core( + XLCd lcd) { _XInitDynamicOM(lcd); diff --git a/src/xlibi18n/lcPrTxt.c b/src/xlibi18n/lcPrTxt.c index 8998ff21..9078b9be 100644 --- a/src/xlibi18n/lcPrTxt.c +++ b/src/xlibi18n/lcPrTxt.c @@ -23,7 +23,7 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/lcPrTxt.c,v 1.8 2002/06/03 22:36:00 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcPrTxt.c,v 1.10 2003/05/29 13:22:51 pascal Exp $ */ #include "Xlibint.h" #include "XlcPubI.h" @@ -154,7 +154,6 @@ _XTextPropertyToTextList( buf_len = text_prop->nitems * 6 + 1; else buf_len = text_prop->nitems * XLC_PUBLIC(lcd, mb_cur_max) + 1; - buf = (XPointer) Xmalloc(buf_len); } buf = (XPointer) Xmalloc(buf_len); if (buf == NULL) @@ -213,7 +212,8 @@ _XTextPropertyToTextList( to++; to_left--; } - _XlcResetConverter(conv); + if (! do_strcpy) + _XlcResetConverter(conv); } else str_ptr++; diff --git a/src/xlibi18n/lcPublic.c b/src/xlibi18n/lcPublic.c index 853ed8f7..80459d6e 100644 --- a/src/xlibi18n/lcPublic.c +++ b/src/xlibi18n/lcPublic.c @@ -23,7 +23,7 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/lcPublic.c,v 1.11 2001/11/16 00:52:28 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcPublic.c,v 1.12 2003/04/13 19:22:21 dawes Exp $ */ #include <stdio.h> #include "Xlibint.h" @@ -206,7 +206,6 @@ initialize( int len; char sinamebuf[256]; char* siname; - char *_XlcMapOSLocaleName(); #endif _XlcInitCTInfo(); diff --git a/src/xlibi18n/lcStd.c b/src/xlibi18n/lcStd.c index 9a07bbb4..b8e5ae4c 100644 --- a/src/xlibi18n/lcStd.c +++ b/src/xlibi18n/lcStd.c @@ -23,17 +23,17 @@ * Author: Katsuhisa Yano TOSHIBA Corp. * mopi@osa.ilab.toshiba.co.jp */ -/* $XFree86: xc/lib/X11/lcStd.c,v 1.5 2001/01/17 19:41:55 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcStd.c,v 1.7 2003/04/17 02:06:32 dawes Exp $ */ #include "Xlibint.h" #include "XlcPubI.h" int -_Xlcmbtowc(lcd, wstr, str, len) - XLCd lcd; - wchar_t *wstr; - char *str; - int len; +_Xlcmbtowc( + XLCd lcd, + wchar_t *wstr, + char *str, + int len) { static XLCd last_lcd = NULL; static XlcConv conv = NULL; @@ -74,10 +74,10 @@ _Xlcmbtowc(lcd, wstr, str, len) } int -_Xlcwctomb(lcd, str, wc) - XLCd lcd; - char *str; - wchar_t wc; +_Xlcwctomb( + XLCd lcd, + char *str, + wchar_t wc) { static XLCd last_lcd = NULL; static XlcConv conv = NULL; @@ -117,11 +117,11 @@ _Xlcwctomb(lcd, str, wc) } int -_Xlcmbstowcs(lcd, wstr, str, len) - XLCd lcd; - wchar_t *wstr; - char *str; - int len; +_Xlcmbstowcs( + XLCd lcd, + wchar_t *wstr, + char *str, + int len) { XlcConv conv; XPointer from, to; @@ -156,11 +156,11 @@ _Xlcmbstowcs(lcd, wstr, str, len) } int -_Xlcwcstombs(lcd, str, wstr, len) - XLCd lcd; - char *str; - wchar_t *wstr; - int len; +_Xlcwcstombs( + XLCd lcd, + char *str, + wchar_t *wstr, + int len) { XlcConv conv; XPointer from, to; @@ -196,61 +196,63 @@ _Xlcwcstombs(lcd, str, wstr, len) int -_Xmbtowc(wstr, str, len) - wchar_t *wstr; +_Xmbtowc( + wchar_t *wstr, #ifdef ISC - char const *str; - size_t len; + char const *str, + size_t len #else - char *str; - int len; + char *str, + int len #endif + ) { return _Xlcmbtowc((XLCd) NULL, wstr, str, len); } int -_Xmblen(str, len) +_Xmblen( #ifdef ISC - char const *str; - size_t len; + char const *str, + size_t len #else - char *str; - int len; + char *str, + int len #endif + ) { return _Xmbtowc((wchar_t *) NULL, str, len); } int -_Xwctomb(str, wc) - char *str; - wchar_t wc; +_Xwctomb( + char *str, + wchar_t wc) { return _Xlcwctomb((XLCd) NULL, str, wc); } int -_Xmbstowcs(wstr, str, len) - wchar_t *wstr; - char *str; - int len; +_Xmbstowcs( + wchar_t *wstr, + char *str, + int len) { return _Xlcmbstowcs((XLCd) NULL, wstr, str, len); } int -_Xwcstombs(str, wstr, len) - char *str; - wchar_t *wstr; - int len; +_Xwcstombs( + char *str, + wchar_t *wstr, + int len) { return _Xlcwcstombs((XLCd) NULL, str, wstr, len); } wchar_t * -_Xwcscpy(wstr1, wstr2) - register wchar_t *wstr1, *wstr2; +_Xwcscpy( + register wchar_t *wstr1, register wchar_t *wstr2) { wchar_t *wstr_tmp = wstr1; @@ -261,9 +263,9 @@ _Xwcscpy(wstr1, wstr2) } wchar_t * -_Xwcsncpy(wstr1, wstr2, len) - register wchar_t *wstr1, *wstr2; - register int len; +_Xwcsncpy( + register wchar_t *wstr1, register wchar_t *wstr2, + register int len) { wchar_t *wstr_tmp = wstr1; @@ -278,8 +280,8 @@ _Xwcsncpy(wstr1, wstr2, len) } int -_Xwcslen(wstr) - register wchar_t *wstr; +_Xwcslen( + register wchar_t *wstr) { register wchar_t *wstr_ptr = wstr; @@ -290,8 +292,8 @@ _Xwcslen(wstr) } int -_Xwcscmp(wstr1, wstr2) - register wchar_t *wstr1, *wstr2; +_Xwcscmp( + register wchar_t *wstr1, register wchar_t *wstr2) { for ( ; *wstr1 && *wstr2; wstr1++, wstr2++) if (*wstr1 != *wstr2) @@ -301,9 +303,9 @@ _Xwcscmp(wstr1, wstr2) } int -_Xwcsncmp(wstr1, wstr2, len) - register wchar_t *wstr1, *wstr2; - register int len; +_Xwcsncmp( + register wchar_t *wstr1, register wchar_t *wstr2, + register int len) { for ( ; *wstr1 && *wstr2 && len > 0; wstr1++, wstr2++, len--) if (*wstr1 != *wstr2) @@ -317,11 +319,11 @@ _Xwcsncmp(wstr1, wstr2, len) int -_Xlcmbstoutf8(lcd, ustr, str, len) - XLCd lcd; - char *ustr; - const char *str; - int len; +_Xlcmbstoutf8( + XLCd lcd, + char *ustr, + const char *str, + int len) { XlcConv conv; XPointer from, to; @@ -356,10 +358,10 @@ _Xlcmbstoutf8(lcd, ustr, str, len) } int -_Xmbstoutf8(ustr, str, len) - char *ustr; - const char *str; - int len; +_Xmbstoutf8( + char *ustr, + const char *str, + int len) { return _Xlcmbstoutf8((XLCd) NULL, ustr, str, len); } diff --git a/src/xlibi18n/lcUTF8.c b/src/xlibi18n/lcUTF8.c index 1f40704f..cc51c30e 100644 --- a/src/xlibi18n/lcUTF8.c +++ b/src/xlibi18n/lcUTF8.c @@ -24,7 +24,7 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/X11/lcUTF8.c,v 1.15 2002/10/08 23:31:36 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcUTF8.c,v 1.16 2003/11/17 22:20:12 dawes Exp $ */ /* * This file contains: @@ -129,16 +129,8 @@ typedef unsigned int ucs4_t; typedef struct _Utf8ConvRec { const char *name; XrmQuark xrm_name; -#if NeedFunctionPrototypes int (* cstowc) (XlcConv, ucs4_t *, unsigned char const *, int); -#else - int (* cstowc) (); -#endif -#if NeedFunctionPrototypes int (* wctocs) (XlcConv, unsigned char *, ucs4_t, int); -#else - int (* wctocs) (); -#endif } Utf8ConvRec, *Utf8Conv; /* diff --git a/src/xlibi18n/lcUniConv/README b/src/xlibi18n/lcUniConv/README index 844f090b..6ce59c7b 100644 --- a/src/xlibi18n/lcUniConv/README +++ b/src/xlibi18n/lcUniConv/README @@ -1,3 +1,5 @@ +$XFree86: xc/lib/X11/lcUniConv/README,v 1.3 2003/10/24 15:34:01 tsi Exp $ + The files in this directory are taken from the libiconv-1.1 package. The *.h files were generated from tables (mostly from ftp.unicode.org) using @@ -6,5 +8,5 @@ optimizations were applied by hand. If you find a bug in these files, instead of modifying them in XFree86 and let it diverge from libiconv, please notify the libiconv maintainer -(currently <haible@clisp.cons.org>) so he can fix both in synch. +(currently <bruno@clisp.org>) so he can fix both in synch. diff --git a/src/xlibi18n/lcUniConv/armscii_8.h b/src/xlibi18n/lcUniConv/armscii_8.h index 32b4e9c5..6f8c10c6 100644 --- a/src/xlibi18n/lcUniConv/armscii_8.h +++ b/src/xlibi18n/lcUniConv/armscii_8.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/X11/lcUniConv/armscii_8.h,v 1.3 2000/11/29 17:40:28 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcUniConv/armscii_8.h,v 1.4 2003/07/15 17:33:45 pascal Exp $ */ /* * ARMSCII-8 @@ -6,8 +6,8 @@ static const unsigned short armscii_8_2uni[96] = { /* 0xa0 */ - 0x00a0, 0x2741, 0x00a7, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab, - 0x2014, 0x002e, 0x055d, 0x002c, 0x002d, 0x055f, 0x2026, 0x055c, + 0x00a0, 0xfffd, 0x0587, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab, + 0x2014, 0x002e, 0x055d, 0x002c, 0x002d, 0x058a, 0x2026, 0x055c, /* 0xb0 */ 0x055b, 0x055e, 0x0531, 0x0561, 0x0532, 0x0562, 0x0533, 0x0563, 0x0534, 0x0564, 0x0535, 0x0565, 0x0536, 0x0566, 0x0537, 0x0567, @@ -22,26 +22,32 @@ static const unsigned short armscii_8_2uni[96] = { 0x054c, 0x057c, 0x054d, 0x057d, 0x054e, 0x057e, 0x054f, 0x057f, /* 0xf0 */ 0x0550, 0x0580, 0x0551, 0x0581, 0x0552, 0x0582, 0x0553, 0x0583, - 0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x2019, 0x0027, + 0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x055a, 0xfffd, }; static int armscii_8_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n) { unsigned char c = *s; - if (c < 0xa0) + if (c < 0xa0) { *pwc = (ucs4_t) c; - else - *pwc = (ucs4_t) armscii_8_2uni[c-0xa0]; - return 1; + return 1; + } + else { + unsigned short wc = armscii_8_2uni[c-0xa0]; + if (wc != 0xfffd) { + *pwc = (ucs4_t) wc; + return 1; + } + } + return RET_ILSEQ; } -static const unsigned char armscii_8_page00[16] = { - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0xff, /* 0x20-0x27 */ +static const unsigned char armscii_8_page00[8] = { 0xa5, 0xa4, 0x2a, 0x2b, 0xab, 0xac, 0xa9, 0x2f, /* 0x28-0x2f */ }; static const unsigned char armscii_8_page00_1[32] = { - 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, /* 0xa0-0xa7 */ + 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ @@ -52,17 +58,17 @@ static const unsigned char armscii_8_page05[96] = { 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde, /* 0x40-0x47 */ 0xe0, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xec, 0xee, /* 0x48-0x4f */ 0xf0, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0x00, /* 0x50-0x57 */ - 0x00, 0x00, 0x00, 0xb0, 0xaf, 0xaa, 0xb1, 0xad, /* 0x58-0x5f */ + 0x00, 0x00, 0xfe, 0xb0, 0xaf, 0xaa, 0xb1, 0x00, /* 0x58-0x5f */ 0x00, 0xb3, 0xb5, 0xb7, 0xb9, 0xbb, 0xbd, 0xbf, /* 0x60-0x67 */ 0xc1, 0xc3, 0xc5, 0xc7, 0xc9, 0xcb, 0xcd, 0xcf, /* 0x68-0x6f */ 0xd1, 0xd3, 0xd5, 0xd7, 0xd9, 0xdb, 0xdd, 0xdf, /* 0x70-0x77 */ 0xe1, 0xe3, 0xe5, 0xe7, 0xe9, 0xeb, 0xed, 0xef, /* 0x78-0x7f */ - 0xf1, 0xf3, 0xf5, 0xf7, 0xf9, 0xfb, 0xfd, 0x00, /* 0x80-0x87 */ - 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0xf1, 0xf3, 0xf5, 0xf7, 0xf9, 0xfb, 0xfd, 0xa2, /* 0x80-0x87 */ + 0x00, 0xa3, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ }; static const unsigned char armscii_8_page20[24] = { 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, /* 0x10-0x17 */ - 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0x00, /* 0x20-0x27 */ }; @@ -70,12 +76,12 @@ static int armscii_8_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) { unsigned char c = 0; - if (wc < 0x0020) { + if (wc < 0x0028) { *r = wc; return 1; } - else if (wc >= 0x0020 && wc < 0x0030) - c = armscii_8_page00[wc-0x0020]; + else if (wc >= 0x0028 && wc < 0x0030) + c = armscii_8_page00[wc-0x0028]; else if (wc >= 0x0030 && wc < 0x00a0) c = wc; else if (wc >= 0x00a0 && wc < 0x00c0) @@ -84,8 +90,6 @@ armscii_8_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) c = armscii_8_page05[wc-0x0530]; else if (wc >= 0x2010 && wc < 0x2028) c = armscii_8_page20[wc-0x2010]; - else if (wc == 0x2741) - c = 0xa1; if (c != 0) { *r = c; return 1; diff --git a/src/xlibi18n/lcUniConv/big5.h b/src/xlibi18n/lcUniConv/big5.h index 83e5f400..deff8669 100644 --- a/src/xlibi18n/lcUniConv/big5.h +++ b/src/xlibi18n/lcUniConv/big5.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/X11/lcUniConv/big5.h,v 1.1 2000/11/28 18:50:03 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcUniConv/big5.h,v 1.2 2003/05/27 22:26:28 tsi Exp $ */ /* * BIG5 @@ -4103,7 +4103,7 @@ big5_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) { if (n >= 2) { const Summary16 *summary = NULL; - if (wc >= 0x0000 && wc < 0x0100) + if (wc < 0x0100) summary = &big5_uni2indx_page00[(wc>>4)]; else if (wc >= 0x0200 && wc < 0x0460) summary = &big5_uni2indx_page02[(wc>>4)-0x020]; diff --git a/src/xlibi18n/lcUniConv/gb2312.h b/src/xlibi18n/lcUniConv/gb2312.h index 7337e0b5..3c0c3598 100644 --- a/src/xlibi18n/lcUniConv/gb2312.h +++ b/src/xlibi18n/lcUniConv/gb2312.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/X11/lcUniConv/gb2312.h,v 1.4 2001/08/09 19:14:07 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcUniConv/gb2312.h,v 1.5 2003/05/27 22:26:29 tsi Exp $ */ /* * GB2312.1980-0 @@ -2518,7 +2518,7 @@ gb2312_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) { if (n >= 2) { const Summary16 *summary = NULL; - if (wc >= 0x0000 && wc < 0x0460) + if (wc < 0x0460) summary = &gb2312_uni2indx_page00[(wc>>4)]; else if (wc >= 0x2000 && wc < 0x2650) summary = &gb2312_uni2indx_page20[(wc>>4)-0x200]; diff --git a/src/xlibi18n/lcUniConv/iso8859_16.h b/src/xlibi18n/lcUniConv/iso8859_16.h index 3efe2ffe..5b3f870f 100644 --- a/src/xlibi18n/lcUniConv/iso8859_16.h +++ b/src/xlibi18n/lcUniConv/iso8859_16.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/X11/lcUniConv/iso8859_16.h,v 1.3 2000/11/29 17:40:31 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcUniConv/iso8859_16.h,v 1.4 2003/07/15 17:33:45 pascal Exp $ */ /* * ISO-8859-16 @@ -6,8 +6,8 @@ static const unsigned short iso8859_16_2uni[96] = { /* 0xa0 */ - 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x00ab, 0x0160, 0x00a7, - 0x0161, 0x00a9, 0x0218, 0x201e, 0x0179, 0x00ad, 0x017a, 0x017b, + 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7, + 0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b, /* 0xb0 */ 0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7, 0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c, @@ -38,7 +38,7 @@ iso8859_16_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n) static const unsigned char iso8859_16_page00[224] = { 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */ - 0x00, 0xa9, 0x00, 0xa5, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0xa9, 0x00, 0xab, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ 0xb0, 0xb1, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0xc6, 0xc7, /* 0xc0-0xc7 */ @@ -71,7 +71,7 @@ static const unsigned char iso8859_16_page02[8] = { 0xaa, 0xba, 0xde, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ }; static const unsigned char iso8859_16_page20[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, 0xab, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, 0xa5, 0x00, /* 0x18-0x1f */ }; static int diff --git a/src/xlibi18n/lcUniConv/jisx0208.h b/src/xlibi18n/lcUniConv/jisx0208.h index ea075471..9c080522 100644 --- a/src/xlibi18n/lcUniConv/jisx0208.h +++ b/src/xlibi18n/lcUniConv/jisx0208.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/X11/lcUniConv/jisx0208.h,v 1.5 2001/11/21 21:20:56 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcUniConv/jisx0208.h,v 1.6 2003/05/27 22:26:31 tsi Exp $ */ /* * JISX0208.1990-0 @@ -2360,7 +2360,7 @@ jisx0208_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) { if (n >= 2) { const Summary16 *summary = NULL; - if (wc >= 0x0000 && wc < 0x0100) + if (wc < 0x0100) summary = &jisx0208_uni2indx_page00[(wc>>4)]; else if (wc >= 0x0300 && wc < 0x0460) summary = &jisx0208_uni2indx_page03[(wc>>4)-0x030]; diff --git a/src/xlibi18n/lcUniConv/jisx0212.h b/src/xlibi18n/lcUniConv/jisx0212.h index 3b7e6dc0..a4857b9b 100644 --- a/src/xlibi18n/lcUniConv/jisx0212.h +++ b/src/xlibi18n/lcUniConv/jisx0212.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/X11/lcUniConv/jisx0212.h,v 1.4 2001/08/09 19:14:08 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcUniConv/jisx0212.h,v 1.5 2003/05/27 22:26:31 tsi Exp $ */ /* * JISX0212.1990-0 @@ -2135,7 +2135,7 @@ jisx0212_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) { if (n >= 2) { const Summary16 *summary = NULL; - if (wc >= 0x0000 && wc < 0x0460) + if (wc < 0x0460) summary = &jisx0212_uni2indx_page00[(wc>>4)]; else if (wc >= 0x2100 && wc < 0x2130) summary = &jisx0212_uni2indx_page21[(wc>>4)-0x210]; diff --git a/src/xlibi18n/lcUniConv/ksc5601.h b/src/xlibi18n/lcUniConv/ksc5601.h index c7dab1eb..62ac66d7 100644 --- a/src/xlibi18n/lcUniConv/ksc5601.h +++ b/src/xlibi18n/lcUniConv/ksc5601.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/X11/lcUniConv/ksc5601.h,v 1.4 2001/08/09 19:14:09 dawes Exp $ */ +/* $XFree86: xc/lib/X11/lcUniConv/ksc5601.h,v 1.5 2003/05/27 22:26:34 tsi Exp $ */ /* * KSC5601.1987-0 @@ -2966,7 +2966,7 @@ ksc5601_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) { if (n >= 2) { const Summary16 *summary = NULL; - if (wc >= 0x0000 && wc < 0x0460) + if (wc < 0x0460) summary = &ksc5601_uni2indx_page00[(wc>>4)]; else if (wc >= 0x2000 && wc < 0x2670) summary = &ksc5601_uni2indx_page20[(wc>>4)-0x200]; diff --git a/src/xlibi18n/lcWrap.c b/src/xlibi18n/lcWrap.c index 373c436a..ef203420 100644 --- a/src/xlibi18n/lcWrap.c +++ b/src/xlibi18n/lcWrap.c @@ -53,7 +53,7 @@ from The Open Group. * * Katsuhisa Yano TOSHIBA Corp. */ -/* $XFree86: xc/lib/X11/lcWrap.c,v 3.14 2002/11/01 13:43:31 alanh Exp $ */ +/* $XFree86: xc/lib/X11/lcWrap.c,v 3.16 2003/04/17 02:06:32 dawes Exp $ */ #include <stdlib.h> #include "Xlibint.h" @@ -64,6 +64,7 @@ from The Open Group. #undef close #endif #include <X11/Xutil.h> +#include "XlcPubI.h" #ifdef XTHREADS LockInfoPtr _Xi18n_lock; @@ -242,7 +243,7 @@ _XlcAddLoader( XLCd _XOpenLC( - const char *name) + char *name) { XLCd lcd; XlcLoaderList loader; @@ -251,7 +252,6 @@ _XOpenLC( int len; char sinamebuf[256]; char* siname = sinamebuf; - char *_XlcMapOSLocaleName(); #endif if (name == NULL) { diff --git a/src/xlibi18n/mbWMProps.c b/src/xlibi18n/mbWMProps.c index 642f3936..637ffeed 100644 --- a/src/xlibi18n/mbWMProps.c +++ b/src/xlibi18n/mbWMProps.c @@ -26,15 +26,15 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/lib/X11/mbWMProps.c,v 1.5 2001/12/14 19:54:10 dawes Exp $ */ +/* $XFree86: xc/lib/X11/mbWMProps.c,v 1.6 2003/11/17 22:20:12 dawes Exp $ */ #include <X11/Xlibint.h> #include <X11/Xutil.h> #include <X11/Xatom.h> #include <X11/Xlocale.h> -#if NeedFunctionPrototypes -void XmbSetWMProperties ( +void +XmbSetWMProperties ( Display *dpy, Window w, _Xconst char *windowName, @@ -44,19 +44,6 @@ void XmbSetWMProperties ( XSizeHints *sizeHints, XWMHints *wmHints, XClassHint *classHints) -#else -void XmbSetWMProperties (dpy, w, windowName, iconName, argv, argc, sizeHints, - wmHints, classHints) - Display *dpy; - Window w; /* window to decorate */ - _Xconst char *windowName; /* name of application */ - _Xconst char *iconName; /* name string for icon */ - char **argv; /* command line */ - int argc; /* size of command line */ - XSizeHints *sizeHints; /* size hints for window in its normal state */ - XWMHints *wmHints; /* miscelaneous window manager hints */ - XClassHint *classHints; /* resource name and class */ -#endif { XTextProperty wname, iname; XTextProperty *wprop = NULL; diff --git a/src/xlibi18n/mbWrap.c b/src/xlibi18n/mbWrap.c index 97181fdd..c9868961 100644 --- a/src/xlibi18n/mbWrap.c +++ b/src/xlibi18n/mbWrap.c @@ -50,7 +50,7 @@ from The Open Group. * * M. Collins OSF */ -/* $XFree86: xc/lib/X11/mbWrap.c,v 1.6 2001/12/14 19:54:10 dawes Exp $ */ +/* $XFree86: xc/lib/X11/mbWrap.c,v 1.7 2003/11/17 22:20:12 dawes Exp $ */ #include "Xlibint.h" #include "Xlcint.h" @@ -67,14 +67,14 @@ XmbDrawText( int nitems) #else void -XmbDrawText(dpy, d, gc, x, y, text_items, nitems) - Display *dpy; - Drawable d; - GC gc; - int x, y; - XmbTextItem *text_items; - int nitems; -#endif +XmbDrawText( + Display *dpy, + Drawable d, + GC gc, + int x, + int y, + XmbTextItem *text_items, + int nitems) { register XFontSet fs = NULL; register XmbTextItem *p = text_items; @@ -99,7 +99,6 @@ XmbDrawText(dpy, d, gc, x, y, text_items, nitems) } } -#if NeedFunctionPrototypes void XmbDrawString( Display *dpy, @@ -110,24 +109,12 @@ XmbDrawString( int y, _Xconst char *text, int text_len) -#else -void -XmbDrawString(dpy, d, font_set, gc, x, y, text, text_len) - Display *dpy; - Drawable d; - XFontSet font_set; - GC gc; - int x, y; - _Xconst char *text; - int text_len; -#endif { (void)(*font_set->methods->mb_draw_string) (dpy, d, font_set, gc, x, y, (char *)text, text_len); } -#if NeedFunctionPrototypes void XmbDrawImageString( Display *dpy, @@ -138,41 +125,21 @@ XmbDrawImageString( int y, _Xconst char *text, int text_len) -#else -void -XmbDrawImageString(dpy, d, font_set, gc, x, y, text, text_len) - Display *dpy; - Drawable d; - XFontSet font_set; - GC gc; - int x, y; - _Xconst char *text; - int text_len; -#endif { (*font_set->methods->mb_draw_image_string) (dpy, d, font_set, gc, x, y, (char *)text, text_len); } -#if NeedFunctionPrototypes int XmbTextEscapement( XFontSet font_set, _Xconst char *text, int text_len) -#else -int -XmbTextEscapement(font_set, text, text_len) - XFontSet font_set; - _Xconst char *text; - int text_len; -#endif { return (*font_set->methods->mb_escapement) (font_set, (char *)text, text_len); } -#if NeedFunctionPrototypes int XmbTextExtents( XFontSet font_set, @@ -180,16 +147,6 @@ XmbTextExtents( int text_len, XRectangle *overall_ink_extents, XRectangle *overall_logical_extents) -#else -int -XmbTextExtents(font_set, text, text_len, - overall_ink_extents, overall_logical_extents) - XFontSet font_set; - _Xconst char *text; - int text_len; - XRectangle *overall_ink_extents; - XRectangle *overall_logical_extents; -#endif { return (*font_set->methods->mb_extents) (font_set, (char *)text, text_len, @@ -197,7 +154,6 @@ XmbTextExtents(font_set, text, text_len, overall_logical_extents); } -#if NeedFunctionPrototypes Status XmbTextPerCharExtents( XFontSet font_set, @@ -209,22 +165,6 @@ XmbTextPerCharExtents( int *num_chars, XRectangle *max_ink_extents, XRectangle *max_logical_extents) -#else -Status -XmbTextPerCharExtents(font_set, text, text_len, - ink_extents_buffer, logical_extents_buffer, - buffer_size, num_chars, - max_ink_extents, max_logical_extents) - XFontSet font_set; - _Xconst char *text; - int text_len; - XRectangle *ink_extents_buffer; - XRectangle *logical_extents_buffer; - int buffer_size; - int *num_chars; - XRectangle *max_ink_extents; - XRectangle *max_logical_extents; -#endif { return (*font_set->methods->mb_extents_per_char) (font_set, (char *)text, text_len, diff --git a/src/xlibi18n/utf8WMProps.c b/src/xlibi18n/utf8WMProps.c index bed38584..11a224d0 100644 --- a/src/xlibi18n/utf8WMProps.c +++ b/src/xlibi18n/utf8WMProps.c @@ -48,15 +48,15 @@ from The Open Group. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE * OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/lib/X11/utf8WMProps.c,v 1.2 2001/12/14 19:54:11 dawes Exp $ */ +/* $XFree86: xc/lib/X11/utf8WMProps.c,v 1.3 2003/11/17 22:20:12 dawes Exp $ */ #include <X11/Xlibint.h> #include <X11/Xutil.h> #include <X11/Xatom.h> #include <X11/Xlocale.h> -#if NeedFunctionPrototypes -void Xutf8SetWMProperties ( +void +Xutf8SetWMProperties ( Display *dpy, Window w, _Xconst char *windowName, @@ -66,19 +66,6 @@ void Xutf8SetWMProperties ( XSizeHints *sizeHints, XWMHints *wmHints, XClassHint *classHints) -#else -void Xutf8SetWMProperties (dpy, w, windowName, iconName, argv, argc, sizeHints, - wmHints, classHints) - Display *dpy; - Window w; /* window to decorate */ - _Xconst char *windowName; /* name of application */ - _Xconst char *iconName; /* name string for icon */ - char **argv; /* command line */ - int argc; /* size of command line */ - XSizeHints *sizeHints; /* size hints for window in its normal state */ - XWMHints *wmHints; /* miscelaneous window manager hints */ - XClassHint *classHints; /* resource name and class */ -#endif { XTextProperty wname, iname; XTextProperty *wprop = NULL; diff --git a/src/xlibi18n/utf8Wrap.c b/src/xlibi18n/utf8Wrap.c index bde4647b..70cc8a6e 100644 --- a/src/xlibi18n/utf8Wrap.c +++ b/src/xlibi18n/utf8Wrap.c @@ -72,12 +72,11 @@ from The Open Group. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE * OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/lib/X11/utf8Wrap.c,v 1.3 2001/12/14 19:54:11 dawes Exp $ */ +/* $XFree86: xc/lib/X11/utf8Wrap.c,v 1.4 2003/11/17 22:20:12 dawes Exp $ */ #include "Xlibint.h" #include "Xlcint.h" -#if NeedFunctionPrototypes void Xutf8DrawText( Display *dpy, @@ -87,16 +86,6 @@ Xutf8DrawText( int y, XmbTextItem *text_items, int nitems) -#else -void -Xutf8DrawText(dpy, d, gc, x, y, text_items, nitems) - Display *dpy; - Drawable d; - GC gc; - int x, y; - XmbTextItem *text_items; - int nitems; -#endif { register XFontSet fs = NULL; register XmbTextItem *p = text_items; @@ -121,7 +110,6 @@ Xutf8DrawText(dpy, d, gc, x, y, text_items, nitems) } } -#if NeedFunctionPrototypes void Xutf8DrawString( Display *dpy, @@ -132,24 +120,12 @@ Xutf8DrawString( int y, _Xconst char *text, int text_len) -#else -void -Xutf8DrawString(dpy, d, font_set, gc, x, y, text, text_len) - Display *dpy; - Drawable d; - XFontSet font_set; - GC gc; - int x, y; - _Xconst char *text; - int text_len; -#endif { (void)(*font_set->methods->utf8_draw_string) (dpy, d, font_set, gc, x, y, (char *)text, text_len); } -#if NeedFunctionPrototypes void Xutf8DrawImageString( Display *dpy, @@ -160,41 +136,21 @@ Xutf8DrawImageString( int y, _Xconst char *text, int text_len) -#else -void -Xutf8DrawImageString(dpy, d, font_set, gc, x, y, text, text_len) - Display *dpy; - Drawable d; - XFontSet font_set; - GC gc; - int x, y; - _Xconst char *text; - int text_len; -#endif { (*font_set->methods->utf8_draw_image_string) (dpy, d, font_set, gc, x, y, (char *)text, text_len); } -#if NeedFunctionPrototypes int Xutf8TextEscapement( XFontSet font_set, _Xconst char *text, int text_len) -#else -int -Xutf8TextEscapement(font_set, text, text_len) - XFontSet font_set; - _Xconst char *text; - int text_len; -#endif { return (*font_set->methods->utf8_escapement) (font_set, (char *)text, text_len); } -#if NeedFunctionPrototypes int Xutf8TextExtents( XFontSet font_set, @@ -202,16 +158,6 @@ Xutf8TextExtents( int text_len, XRectangle *overall_ink_extents, XRectangle *overall_logical_extents) -#else -int -Xutf8TextExtents(font_set, text, text_len, - overall_ink_extents, overall_logical_extents) - XFontSet font_set; - _Xconst char *text; - int text_len; - XRectangle *overall_ink_extents; - XRectangle *overall_logical_extents; -#endif { return (*font_set->methods->utf8_extents) (font_set, (char *)text, text_len, @@ -219,7 +165,6 @@ Xutf8TextExtents(font_set, text, text_len, overall_logical_extents); } -#if NeedFunctionPrototypes Status Xutf8TextPerCharExtents( XFontSet font_set, @@ -231,22 +176,6 @@ Xutf8TextPerCharExtents( int *num_chars, XRectangle *max_ink_extents, XRectangle *max_logical_extents) -#else -Status -Xutf8TextPerCharExtents(font_set, text, text_len, - ink_extents_buffer, logical_extents_buffer, - buffer_size, num_chars, - max_ink_extents, max_logical_extents) - XFontSet font_set; - _Xconst char *text; - int text_len; - XRectangle *ink_extents_buffer; - XRectangle *logical_extents_buffer; - int buffer_size; - int *num_chars; - XRectangle *max_ink_extents; - XRectangle *max_logical_extents; -#endif { return (*font_set->methods->utf8_extents_per_char) (font_set, (char *)text, text_len, diff --git a/src/xlibi18n/wcWrap.c b/src/xlibi18n/wcWrap.c index 0f1a5ee8..23ebd904 100644 --- a/src/xlibi18n/wcWrap.c +++ b/src/xlibi18n/wcWrap.c @@ -51,7 +51,7 @@ from The Open Group. * * M. Collins OSF */ -/* $XFree86: xc/lib/X11/wcWrap.c,v 1.6 2001/12/14 19:54:11 dawes Exp $ */ +/* $XFree86: xc/lib/X11/wcWrap.c,v 1.7 2003/11/17 22:20:12 dawes Exp $ */ #include "Xlibint.h" #include "Xlcint.h" @@ -68,14 +68,14 @@ XwcDrawText( int nitems) #else void -XwcDrawText(dpy, d, gc, x, y, text_items, nitems) - Display *dpy; - Drawable d; - GC gc; - int x, y; - XwcTextItem *text_items; - int nitems; -#endif +XwcDrawText( + Display *dpy, + Drawable d, + GC gc, + int x, + int y, + XwcTextItem *text_items, + int nitems) { register XFontSet fs = NULL; register XwcTextItem *p = text_items; @@ -100,7 +100,6 @@ XwcDrawText(dpy, d, gc, x, y, text_items, nitems) } } -#if NeedFunctionPrototypes void XwcDrawString( Display *dpy, @@ -111,23 +110,11 @@ XwcDrawString( int y, _Xconst wchar_t *text, int text_len) -#else -void -XwcDrawString(dpy, d, font_set, gc, x, y, text, text_len) - Display *dpy; - Drawable d; - XFontSet font_set; - GC gc; - int x, y; - _Xconst wchar_t *text; - int text_len; -#endif { (void)(*font_set->methods->wc_draw_string) (dpy, d, font_set, gc, x, y, text, text_len); } -#if NeedFunctionPrototypes void XwcDrawImageString( Display *dpy, @@ -138,40 +125,20 @@ XwcDrawImageString( int y, _Xconst wchar_t *text, int text_len) -#else -void -XwcDrawImageString(dpy, d, font_set, gc, x, y, text, text_len) - Display *dpy; - Drawable d; - XFontSet font_set; - GC gc; - int x, y; - _Xconst wchar_t *text; - int text_len; -#endif { (*font_set->methods->wc_draw_image_string) (dpy, d, font_set, gc, x, y, text, text_len); } -#if NeedFunctionPrototypes int XwcTextEscapement( XFontSet font_set, _Xconst wchar_t *text, int text_len) -#else -int -XwcTextEscapement(font_set, text, text_len) - XFontSet font_set; - _Xconst wchar_t *text; - int text_len; -#endif { return (*font_set->methods->wc_escapement) (font_set, text, text_len); } -#if NeedFunctionPrototypes int XwcTextExtents( XFontSet font_set, @@ -179,23 +146,12 @@ XwcTextExtents( int text_len, XRectangle *overall_ink_extents, XRectangle *overall_logical_extents) -#else -int -XwcTextExtents(font_set, text, text_len, - overall_ink_extents, overall_logical_extents) - XFontSet font_set; - _Xconst wchar_t *text; - int text_len; - XRectangle *overall_ink_extents; - XRectangle *overall_logical_extents; -#endif { return (*font_set->methods->wc_extents) (font_set, text, text_len, overall_ink_extents, overall_logical_extents); } -#if NeedFunctionPrototypes Status XwcTextPerCharExtents( XFontSet font_set, @@ -207,22 +163,6 @@ XwcTextPerCharExtents( int *num_chars, XRectangle *max_ink_extents, XRectangle *max_logical_extents) -#else -Status -XwcTextPerCharExtents(font_set, text, text_len, - ink_extents_buffer, logical_extents_buffer, - buffer_size, num_chars, - max_ink_extents, max_logical_extents) - XFontSet font_set; - _Xconst wchar_t *text; - int text_len; - XRectangle *ink_extents_buffer; - XRectangle *logical_extents_buffer; - int buffer_size; - int *num_chars; - XRectangle *max_ink_extents; - XRectangle *max_logical_extents; -#endif { return (*font_set->methods->wc_extents_per_char) (font_set, text, text_len, |