XIMStyle	input_style; int		i, j;
XIMStyle	input_style = 0; Boolean	found;
static void OpenIM(ve)    XawVendorShellExtPart * ve;{    char	*p, modifiers[32];    XIM		xim = NULL;    XIMStyles	*xim_styles;    XIMStyle	input_style;    int		i, j;    if (ve->im.open_im == False) return;    ve->im.xim = NULL;    if (ve->im.im_list_num <= 0) {	if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)	    xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL);    } else {	for (i = 0; i < ve->im.im_list_num; i++) {	    strcpy(modifiers, "@im=");	    strncat(modifiers, ve->im.im_list[i], sizeof(modifiers) - 5/*strlen("@im=")*/);	    if ((p = XSetLocaleModifiers(modifiers)) != NULL && *p &&		(xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL)) != NULL)		break;	}    }    if (xim == NULL) {	if ((p = XSetLocaleModifiers("")) != NULL) {	    xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL);	}    }    if (xim == NULL) {	XtAppWarning(XtWidgetToApplicationContext(ve->parent),	    "Input Method Open Failed");	return;    }    if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL)	|| !xim_styles) {	XtAppWarning(XtWidgetToApplicationContext(ve->parent), 	    "input method doesn't support any style");	XCloseIM(xim);	return;    }    for (j = 0; j < ve->ic.ic_list_num; j++) {	input_style = GetInputStyleOfIM(ve->ic.ic_list[j]);	if (input_style == (XIMStyle)0) continue;	for (i = 0; (unsigned short)i < xim_styles->count_styles; i++) {	    if (input_style == xim_styles->supported_styles[i]) {		ve->ic.input_style = input_style;		SetErrCnxt(ve->parent, xim);/*		_XipSetIOErrorHandler(IOErrorHandler); */		ve->im.xim = xim;		XFree(xim_styles);		return;	    }	}    }    XCloseIM(xim);    XtAppWarning(XtWidgetToApplicationContext(ve->parent),	"input method doesn't support my input style");    XFree(xim_styles);}