if(getsyms_cnt > 0) { free(symbols); } #else im_openIM = (XIM(*)())try_both_dlsym(objects_list->dl_module, objects_list->open);
im_openIM = (XIM(*)())fetch_symbol(objects_list, objects_list->open);
_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 *path;  char lc_dir[BUFSIZE];  char *lc_name;  XIM (*im_openIM)() = (XIM(*)())NULL;  int count;  XI18NObjectsList objects_list = xi18n_objects_list;#if defined(hpux)  int getsyms_cnt, i;  struct shl_symbol *symbols;#endif  lc_name = lcd->core->name;  if (_XlcLocaleDirName(lc_dir, lc_name) == NULL) return (XIM)0;  count = lc_count;  for (; count-- > 0; objects_list++) {    if (objects_list->type != XIM_OBJECT ||	strcmp(objects_list->locale_name, lc_name)) continue;    if (!objects_list->dl_module) {      path = __lc_path(objects_list->dl_name, lc_dir);#if defined(hpux)      objects_list->dl_module = shl_load(path, BIND_DEFERRED, 0L);#else      objects_list->dl_module = dlopen(path, RTLD_LAZY);#endif      Xfree(path);      if (!objects_list->dl_module) continue;    }#if defined(hpux)    getsyms_cnt = shl_getsymbols(objects_list->dl_module, TYPE_PROCEDURE,	EXPORT_SYMBOLS, malloc, &symbols);    for(i=0; i<getsyms_cnt; i++) {	if(!strcmp(symbols[i].name, objects_list->open)) {	    im_openIM = symbols[i].value;	    break;	}     }    if(getsyms_cnt > 0) {	free(symbols);    }#else    im_openIM = (XIM(*)())try_both_dlsym(objects_list->dl_module,					 objects_list->open);    if (!im_openIM) continue;#endif    im = (*im_openIM)(lcd, display, rdb, res_name, res_class);    if (im != (XIM)NULL) {      break;    }    im_openIM = 0;#if defined(hpux)    shl_unload(objects_list->dl_module);#else    dlclose(objects_list->dl_module);#endif    objects_list->dl_module = NULL;  }  return (XIM)im;}