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: CmdInv.h /main/6 1996/01/23 10:41:03 barstow $ */
24 /***************************************************************************
27 * Description: Public header for the command invocation system.
30 ** (c) Copyright 1993, 1994 Hewlett-Packard Company
31 ** (c) Copyright 1993, 1994 International Business Machines Corp.
32 ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
33 ** (c) Copyright 1993, 1994 Novell, Inc.
34 ***************************************************************************/
40 #include <Dt/Message.h>
43 /******************************************************************************
45 * DtCmdInvExecuteProc - This type is is used to define the parameters
46 * needed in the callback functions for success and failure notification
47 * of a Command Invoker execution call.
49 *****************************************************************************/
51 typedef void (*DtCmdInvExecuteProc) (
52 char *message, /* NULL if the request is successful.
53 * Otherwise an error message. */
57 /******************************************************************************
59 * Function: void _DtInitializeCommandInvoker (
62 * char *applicationClass,
63 * DtSvcReceiveProc reloadDBHandler,
64 * XtAppContext appContext)
68 * display - The X server display connection.
70 * toolClass - The BMS tool class of the client.
72 * applicationClass - The application class of the client (see
73 * XtInitialize). This is needed to add the
74 * Command Invoker's resources to the client's
77 * reloadDBHandler - Function to be called if a RELOAD-TYPES-DB
78 * request is made. If the client does not read
79 * DT action and/or filetype databases, NULL must
82 * appContext - The client's application context. Must be NULL
83 * if the client does not use an application
88 * This function allows a client to internalize the functionality
89 * of the DT "Command Invoker". By using this library and the
90 * Action Library, requests for the Command Invoker will be done
91 * internally instead of sending a request to a separate Command
94 * For local execution, the "fork" and "execvp" system calls are
95 * used. For remote execution, the "SPCD" is used.
97 *****************************************************************************/
100 _DtInitializeCommandInvoker(
103 char *applicationClass,
104 DtSvcReceiveProc reloadDBHandler,
105 XtAppContext appContext);
107 /******************************************************************************
109 * Function: void _DtCommandInvokerExecute (
110 * char *request_name,
111 * char *context_host,
113 * char *context_file,
114 * char *exec_parameters,
117 * DtCmdInvExecProc success_proc,
118 * void *success_data,
119 * DtCmdInvExecProc failure_proc,
120 * void *failure_data)
124 * request_name - The request name (defined in "CommandM.h").
126 * context_host - Name of the host where request is executed from. If
127 * NULL, the "exec_host" parameter is used. Note: this
128 * should not be confused with execution host, described
131 * context_dir - Directory where the request should be executed. If
132 * NULL, the HOME directory is used.
134 * context_file - Not currently used by the Command Invoker.
136 * exec_parameters - Command Invoker execution parameters. See External
137 * Specification for more information.
138 * If set to NULL, "-" is used.
140 * exec_host - Name of the host where the request is executed.
142 * exec_string - The command line to execute.
144 * success_proc - The function to be invoked if the request is
145 * successfully executed.
147 * success_data - Client data for successful execution.
149 * failure_proc - The function to be invoked if an attempt to exeucte
152 * failure_data - Client data for unsuccessful execution.
156 * This function allows a client to use the DT "Command Invoker"
157 * Library for its' process execution. This function is intended
158 * for processes which do not use the Action Library.
160 * For local execution, the "fork" and "execvp" system calls are
161 * used. For remote execution, the "SPCD" is used.
165 * This function must be preceeded by a call to
166 * "_DtInitializeCommandInvoker".
168 *****************************************************************************/
171 _DtCommandInvokerExecute(
176 char *exec_parameters,
179 DtCmdInvExecuteProc success_proc,
181 DtCmdInvExecuteProc failure_proc,
184 extern SPC_Channel_Ptr _DtSPCOpen( char *hostname,
186 char *errorMessage); /* MODIFIED */
188 extern int _DtSPCSpawn(
193 SPC_Channel_Ptr chan,
197 char *errorMessage); /* MODIFIED */
199 #endif /* _CmdInv_h */