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
24 * File: Service.h $XConsortium: Service.h /main/3 1995/10/26 15:27:03 rswiston $
27 * (C) Copyright 1993, Hewlett-Packard, all rights reserved.
29 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
30 * (c) Copyright 1993, 1994 International Business Machines Corp. *
31 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
32 * (c) Copyright 1993, 1994 Novell, Inc. *
38 /************* DATA TYPES *****************************************/
40 /* Many of the data types are standard DT types. */
41 #include <Dt/DataTypes.h>
43 /* Built on ICCC-based messaging library */
46 /* Specific messaging data types */
47 typedef struct _DtSvcHandle * DtSvcHandle;
48 typedef DtMsgContext DtSvcMsgContext;
50 /************* MESSAGE DEFINITIONS *********************************/
51 #define DT_SVC_MSG_SUCCESS "SUCCESS"
52 #define DT_SVC_MSG_FAIL "FAIL"
53 #define DT_SVC_MSG_REQUEST "REQUEST"
54 #define DT_SVC_MSG_NOTIFY "NOTIFY"
56 /************* CALLBACK PROTOTYPES ******************************
59 typedef void (*DtSvcReceiveProc) ();
62 DtSvcMsgContext reply_context,
64 String * message_fields,
68 * service A handle for the service.
70 * reply_context Opaque context information for the request that
71 * was received. This data is needed when
72 * generating a reply to a request.
74 * client_data A pointer to the data that was specified when
75 * the callback was registered.
77 * message_fields A pointer to an array of strings that is the
78 * contents of the request. (See note 2.)
80 * num_fields The number of fields in the message_fields
84 typedef void (*DtSvcMessageProc) ();
88 String * message_fields,
92 * service A handle for the service.
94 * client_data A pointer to the data that was specified when
95 * the callback was registered.
97 * message_fields A pointer to an array of strings that is the
98 * contents of the message. (See note 2.)
100 * num_fields The number of fields in the message_fields
104 typedef void (*DtSvcStatusProc) ();
108 Pointer client_data);
111 * service Handle to the service whose status is being
114 * status The status of the service being started.
116 * client_data Pointer to the data that was registered when
117 * the callback was registered.
120 /************* CONSTANTS ******************************************
123 /* The following are types of reply messages.
126 #define DT_SVC_SUCCESS 1 /* The request succeeded. */
128 #define DT_SVC_FAIL -1 /* The service failed to carry
132 #define DT_SVC_DELIVERY_FAIL -2 /* The request could not be
133 * delivered to the service for
134 * some reason. For example,
135 * the service may not be running
136 * and cannot be invoked.
139 /* The following are types of status.
142 #define DT_SVC_START 1 /* The service was started. */
144 #define DT_SVC_NO_START -1 /* The service failed to start.
147 #define DT_SVC_LOST -2 /* The service was lost. Another
148 provider took over ownership
151 #endif /*_Dt_Service_h*/
152 /* Do not add anything after this endif. */