_fallcDynamic.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: _fallcDynamic.c /main/3 1996/05/08 19:00:37 drk $ */
  24. /* lcDynamic.c 1.1 - Fujitsu source for CDEnext 95/12/07 10:56:55 */
  25. /*
  26. * Copyright 1995 by FUJITSU LIMITED
  27. * This is source code modified by FUJITSU LIMITED under the Joint
  28. * Development Agreement for the CDEnext PST.
  29. * This is unpublished proprietry source code of FUJITSU LIMITED
  30. *
  31. * Modifier: Takanori Tateno FUJITSU LIMITED
  32. *
  33. */
  34. #include <stdio.h>
  35. #include <string.h>
  36. #include "_fallibint.h"
  37. #ifdef USE_DYNAMIC_LOADER
  38. #ifndef XLOCALEDIR
  39. #define XLOCALEDIR "/usr/lib/X11/locale"
  40. #endif
  41. #define LCLIBNAME "xi18n.so"
  42. extern void *dlopen();
  43. extern void *dlsym();
  44. extern int dlclose();
  45. extern char *dlerror();
  46. #define LAZY 1
  47. #define NOW 2
  48. #define GLOBAL 0x100
  49. XLCd
  50. _fallcDynamicLoader(char *name)
  51. {
  52. char libpath[1024];
  53. XLCdMethods _fallcGenericMethods;
  54. XLCd lcd;
  55. void *nlshandler;
  56. sprintf(libpath,"%s/%s/%s",
  57. XLOCALEDIR,name,LCLIBNAME);
  58. nlshandler = dlopen(libpath,LAZY);
  59. _fallcGenericMethods = (XLCdMethods)dlsym(nlshandler,
  60. "genericMethods");
  61. lcd = _fallcCreateLC(name,_fallcGenericMethods);
  62. return lcd;
  63. }
  64. #endif /* USE_DYNAMIC_LOADER */