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 librararies 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: SunDtHelp.c /main/6 1996/08/22 10:39:25 rswiston $
25 * (c) Copyright 1996 Digital Equipment Corporation.
26 * (c) Copyright 1996 Hewlett-Packard Company.
27 * (c) Copyright 1996 International Business Machines Corp.
28 * (c) Copyright 1996 Sun Microsystems, Inc.
29 * (c) Copyright 1996 Novell, Inc.
30 * (c) Copyright 1996 FUJITSU LIMITED.
31 * (c) Copyright 1996 Hitachi.
37 * RESTRICTED CONFIDENTIAL INFORMATION:
39 * The information in this document is subject to special
40 * restrictions in a confidential disclosure agreement bertween
41 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
42 * document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
43 * Sun's specific written approval. This documment and all copies
44 * and derivative works thereof must be returned or destroyed at
47 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
55 #include "DtSvcLock.h"
57 #pragma weak DtCreateHelpDialog = _DtCreateHelpDialog
58 #pragma weak DtCreateHelpQuickDialog = _DtCreateHelpQuickDialog
59 #pragma weak DtHelpQuickDialogGetChild = _DtHelpQuickDialogGetChild
60 #pragma weak DtHelpReturnSelectedWidgetId = _DtHelpReturnSelectedWidgetId
62 typedef Widget (*SUNWWidgetProc)();
63 typedef int (*SUNWIntProc)();
65 typedef struct _SUNWHelpProcList {
66 SUNWWidgetProc DtCreateHelpDialogSym;
67 SUNWWidgetProc DtCreateHelpQuickDialogSym;
68 SUNWWidgetProc DtHelpQuickDialogGetChildSym;
69 SUNWIntProc DtHelpReturnSelectedWidgetIdSym;
72 static SUNWHelpProcList *pmySUNWProcList = NULL;
74 int SUNWDtHelpdlopen()
76 void *libDtHelpHandle = NULL;
79 pmySUNWProcList = (SUNWHelpProcList *)malloc(sizeof(SUNWHelpProcList));
80 libDtHelpHandle = dlopen("libDtHelp.so.1", RTLD_LAZY | RTLD_GLOBAL);
81 if (libDtHelpHandle == NULL) {
84 my_err_msg = dlerror();
85 printf("%s\n", my_err_msg);
86 _DtSvcProcessUnlock();
89 pmySUNWProcList->DtCreateHelpDialogSym = (SUNWWidgetProc)
90 dlsym(libDtHelpHandle, "DtCreateHelpDialog");
91 pmySUNWProcList->DtCreateHelpQuickDialogSym = (SUNWWidgetProc)
92 dlsym(libDtHelpHandle, "DtCreateHelpQuickDialog");
93 pmySUNWProcList->DtHelpQuickDialogGetChildSym = (SUNWWidgetProc)
94 dlsym(libDtHelpHandle, "DtHelpQuickDialogGetChild");
95 pmySUNWProcList->DtHelpReturnSelectedWidgetIdSym = (SUNWIntProc)
96 dlsym(libDtHelpHandle, "DtHelpReturnSelectedWidgetId");
98 _DtSvcProcessUnlock();
102 Widget _DtCreateHelpDialog(
111 status = pmySUNWProcList || SUNWDtHelpdlopen();
112 _DtSvcProcessUnlock();
117 return ((*pmySUNWProcList->DtCreateHelpDialogSym)(parent, name, al, ac));
120 Widget _DtCreateHelpQuickDialog(
129 status = pmySUNWProcList || SUNWDtHelpdlopen();
130 _DtSvcProcessUnlock();
135 return ((*pmySUNWProcList->DtCreateHelpQuickDialogSym)(parent, name, al, ac));
138 Widget _DtHelpQuickDialogGetChild(
140 unsigned char child )
145 status = pmySUNWProcList || SUNWDtHelpdlopen();
146 _DtSvcProcessUnlock();
151 return ((*pmySUNWProcList->DtHelpQuickDialogGetChildSym)(widget, child));
154 int _DtHelpReturnSelectedWidgetId(
162 status = pmySUNWProcList || SUNWDtHelpdlopen();
163 _DtSvcProcessUnlock();
168 return ((*pmySUNWProcList->DtHelpReturnSelectedWidgetIdSym)(parent, cursor,