2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
23 /* $XConsortium: findsym.c /main/5 1995/11/09 09:32:59 rswiston $ */
25 /* Copyright (c) 1991, 1992 UNIX System Laboratories, Inc. */
26 /* All Rights Reserved */
28 /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
29 /* UNIX System Laboratories, Inc. */
30 /* The copyright notice above does not evidence any */
31 /* actual or intended publication of such source code. */
34 #include <sys/types.h>
42 /* from ksh93/include/ast/shell.h */
43 extern void **sh_getliblist(void);
56 * This function is currently only used to locate a widget class record,
57 * as requested by a DtLoadWidget request. In the future, if the exksh
58 * commands are ever added back in, then it will also need to be able
59 * to locate any arbitrary symbol.
78 if ((liblist = sh_getliblist()) == NULL)
83 if (addr = dlsym(liblist[i], str))
84 return((unsigned long)addr);
90 if ((shl_findsym(&handle, str, TYPE_PROCEDURE, &found)) == 0)
91 return((unsigned long) found);
92 if ((shl_findsym(&handle, str, TYPE_DATA, &found)) == 0)
93 return((unsigned long) found);
95 if ((shl_findsym(&handle, str, TYPE_PROCEDURE, &found)) == 0)
96 return((unsigned long) found);
97 if ((shl_findsym(&handle, str, TYPE_DATA, &found)) == 0)
98 return((unsigned long) found);