Revert "dtudcfonted, dtudcexch: delete from repository"
[oweals/cde.git] / cde / programs / dtudcfonted / libfal / _fallcDynamic.c
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
39 #ifndef XLOCALEDIR
40 #define XLOCALEDIR "/usr/lib/X11/locale"
41 #endif
42
43 #define LCLIBNAME    "xi18n.so"
44
45 extern void *dlopen();
46 extern void *dlsym();
47 extern int dlclose();
48 extern char *dlerror();
49
50 #define LAZY       1
51 #define NOW        2
52 #define GLOBAL     0x100
53
54 XLCd
55 _fallcDynamicLoader(name)
56     char *name;
57 {
58     char libpath[1024];
59     XLCdMethods _fallcGenericMethods;
60     XLCd lcd;
61     void *nlshandler;
62
63     sprintf(libpath,"%s/%s/%s",
64                 XLOCALEDIR,name,LCLIBNAME);
65     nlshandler = dlopen(libpath,LAZY);
66     _fallcGenericMethods = (XLCdMethods)dlsym(nlshandler,
67                                 "genericMethods");
68     lcd = _fallcCreateLC(name,_fallcGenericMethods);
69
70
71     return lcd;
72 }
73 #endif /* USE_DYNAMIC_LOADER */