Build with debug symbols enabled.
[oweals/cde.git] / cde / lib / DtSvc / DtUtil2 / Service.h
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 librararies 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 /*
24  * File:         Service.h $XConsortium: Service.h /main/3 1995/10/26 15:27:03 rswiston $
25  * Language:     C
26  *
27  * (C) Copyright 1993, Hewlett-Packard, all rights reserved.
28  *
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.                                *
33  */
34
35 #ifndef _Dt_Service_h
36 #define _Dt_Service_h
37
38 /************* DATA TYPES *****************************************/
39
40 /* Many of the data types are standard DT types. */
41 #include <Dt/DataTypes.h>
42
43 /* Built on ICCC-based messaging library */
44 #include <Dt/Msg.h>
45
46 /* Specific messaging data types */
47 typedef struct _DtSvcHandle *   DtSvcHandle;
48 typedef DtMsgContext            DtSvcMsgContext;
49
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"
55
56 /************* CALLBACK PROTOTYPES ******************************
57  */
58
59 typedef void (*DtSvcReceiveProc) ();
60 /*
61     DtSvcHandle service,
62     DtSvcMsgContext     reply_context,
63     Pointer             client_data,
64     String *            message_fields,
65     int                 num_fields);
66 */
67 /*
68  *  service             A handle for the service.
69  *
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.
73  *
74  *  client_data         A pointer to the data that was specified when
75  *                      the callback was registered.
76  *
77  *  message_fields      A pointer to an array of strings that is the
78  *                      contents of the request. (See note 2.)
79  *
80  *  num_fields          The number of fields in the message_fields 
81  *                      array.
82  */
83
84 typedef void (*DtSvcMessageProc) ();
85 /*
86     DtSvcHandle service,
87     Pointer             client_data,
88     String *            message_fields,
89     int                 num_fields);
90 */
91 /*
92  *  service             A handle for the service.
93  *
94  *  client_data         A pointer to the data that was specified when
95  *                      the callback was registered.
96  *
97  *  message_fields      A pointer to an array of strings that is the
98  *                      contents of the message. (See note 2.)
99  *
100  *  num_fields          The number of fields in the message_fields 
101  *                      array.
102  */
103
104 typedef void (*DtSvcStatusProc) ();
105 /*
106     DtSvcHandle service,
107     int                 status,
108     Pointer             client_data);
109 */
110 /*
111  *  service             Handle to the service whose status is being
112  *                      reported.
113  *
114  *  status              The status of the service being started.
115  *
116  *  client_data         Pointer to the data that was registered when
117  *                      the callback was registered.
118  */
119
120 /************* CONSTANTS ******************************************
121  */
122
123 /* The following are types of reply messages.
124  */
125
126 #define DT_SVC_SUCCESS           1      /* The request succeeded. */
127
128 #define DT_SVC_FAIL             -1      /* The service failed to carry
129                                          * out the request.
130                                          */
131
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.
137                                          */
138
139 /* The following are types of status.
140  */
141
142 #define DT_SVC_START             1      /* The service was started. */
143
144 #define DT_SVC_NO_START -1      /* The service failed to start.
145                                          */
146
147 #define DT_SVC_LOST             -2      /* The service was lost. Another
148                                            provider took over ownership
149                                            for this service. */
150
151 #endif /*_Dt_Service_h*/
152 /* Do not add anything after this endif. */