dtfile: remove register keyword
[oweals/cde.git] / cde / programs / dtsession / SmXSMP.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 libraries 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  * (c) Copyright 1995 Digital Equipment Corporation.
25  * (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
26  * (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
27  * (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
28  * (c) Copyright 1993, 1994, 1995 Novell, Inc. 
29  * (c) Copyright 1995 FUJITSU LIMITED.
30  * (c) Copyright 1995 Hitachi.
31  *
32  * $XConsortium: SmXSMP.h /main/16 1996/02/13 11:02:37 barstow $
33  */
34
35 /*************************************<+>*************************************
36  *****************************************************************************
37  **
38  **  File:        SmXSMP.h
39  **
40  **  Project:     DT Session Manager (dtsession)
41  **
42  *****************************************************************************
43  *************************************<+>*************************************/
44 #ifndef _smxsmp_h
45 #define _smxsmp_h
46
47 #include <X11/Intrinsic.h>
48 #include <X11/SM/SMlib.h>
49 #include <X11/ICE/ICEutil.h>
50
51 /*
52  * Constants for the Save_Session ToolTalk message
53  */
54 #define DEFAULT_SAVE_TYPE               SmSaveGlobal
55 #define DEFAULT_SHUTDOWN                False
56 #define DEFAULT_INTERACT_STYLE          SmInteractStyleAny
57 #define DEFAULT_FAST                    True
58 #define DEFAULT_GLOBAL                  True
59
60
61 typedef struct _PropertyRec {
62         SmProp                  prop;
63         struct _PropertyRec     *next;
64 } PropertyRec, *PropertyRecPtr;
65
66 typedef struct _ClientRec {
67         SmsConn                 smConn;
68         IceConn                 iceConn;
69         char                    * clientId;
70         char                    * clientHost;
71         int                     restartHint;
72         int                     screenNum;
73         PropertyRecPtr          props;
74         Boolean                 active;
75         Boolean                 saveYourselfDone;
76         Boolean                 saveYourselfP2Requested;
77         Boolean                 interactRequested;
78         struct _ClientRec       * next;
79 } ClientRec, *ClientRecPtr;
80
81 typedef struct {
82         Boolean                 global;
83         Boolean                 shutdown;
84         Boolean                 clientInteracting;
85         Boolean                 inProgress;
86         Boolean                 doneSuccess;
87         Boolean                 saveComplete;
88         Boolean                 shutdownCanceled;
89         int                     interactStyle;
90         int                     interactCount;
91         int                     numClientIds;
92         char                    * clientIds;
93         int                     * workspaceNums;
94         ClientRecPtr            interactClient;
95 } SaveStateRec;
96
97 typedef struct _XSMPClientDBRec {
98         char                    * clientId;
99         char                    * clientHost;
100         char                    * program;
101         char                    * cwd;
102         int                     screenNum;
103         char                    ** restartCommand;
104         char                    ** cloneCommand;
105         char                    ** discardCommand;
106         char                    ** environment;
107         int                     restartHint;
108         struct _XSMPClientDBRec * next;
109 } XSMPClientDBRec, *XSMPClientDBRecPtr;
110
111 typedef struct _ProxyClientDBRec {
112         char                    * clientHost;
113         char                    ** command;
114         int                     screenNum;
115 } ProxyClientDBRec, *ProxyClientDBRecPtr;
116
117 typedef struct {
118         IceListenObj            * listenObjs;
119         int                     numTransports;
120         IceAuthDataEntry        * authDataEntries;
121         SaveStateRec            saveState;
122         XSMPClientDBRecPtr      xsmpDbList;
123         char                    * dbVersion;
124         char                    * dbSessionId;
125 } XSMPSettings, *XSMPSettingPtr;
126
127 /*
128  * Failure modes during the initializatin of XSMP
129  */
130 typedef enum {
131         XSMP_FAILURE_SMS_INITIALIZE,
132         XSMP_FAILURE_ICE_LISTEN,
133         XSMP_FAILURE_AUTHENTICATION,
134         XSMP_FAILURE_ICE_ADD_WATCH,
135         XSMP_FAILURE_ICE_COMPOSE_IDS,
136         XSMP_FAILURE_MALLOC
137 } XSMPFailure;
138
139 /*
140  * Public variable declarations
141  */
142 extern XSMPSettings             smXSMP;
143 extern ClientRecPtr             connectedList;
144
145 extern char                     SM_SESSION_MANAGER[];
146 extern char                     SM_VENDOR_NAME[];
147 extern char                     SM_RELEASE_NAME[];
148 extern char                     SM_CLIENT_ID[];
149 extern Atom                     XaSmClientId;
150
151 /*
152  * Public function declarations
153  */
154 extern Boolean InitXSMP ( );
155
156 void SaveYourselfReqProc (
157         SmsConn                 smsConn,
158         SmPointer               managerData,
159         int                     saveType,
160         Bool                    shutdown,
161         int                     interactStyle,
162         Bool                    fast,
163         Bool                    global);
164
165 void CloseDownClient (
166         ClientRecPtr            client );
167
168 void XSMPExit ();
169
170 #endif /*_smxsmp_h*/