1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
6 <!-- lifted from troff+ms+XMan by doclifter -->
10 <title>X Session Management Library</title>
11 <subtitle>X Consortium Standard</subtitle>
12 <releaseinfo>X Version 11, Release 6.4</releaseinfo>
15 <firstname>Ralph</firstname><surname>Mor</surname>
18 <corpname>X Consortium Standard</corpname>
20 <year>1993</year><year>1994</year>
21 <holder>X Consortium</holder>
23 <releaseinfo>Version 1.0</releaseinfo>
24 <affiliation><orgname>X Consortium</orgname></affiliation>
25 <productnumber>X Version 11, Release 7</productnumber>
29 Permission is hereby granted, free of charge, to any person obtaining
30 a copy of this software and associated documentation files (the
31 “Software”), to deal in the Software without restriction,
32 including without limitation the rights to use, copy, modify, merge,
33 publish, distribute, sublicense, and/or sell copies of the Software,
34 and to permit persons to whom the Software is furnished to do so,
35 subject to the following conditions:
39 The above copyright notice and this permission notice shall be
40 included in all copies or substantial portions of the Software.
44 THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF
45 ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
46 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
47 AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR
48 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
49 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
50 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
54 Except as contained in this notice, the name of the X Consortium shall
55 not be used in advertising or otherwise to promote the sale, use or
56 other dealings in this Software without prior written authorization
57 from the X Consortium.
61 X Window System is a trademark of The Open Group.
67 <chapter id="overview_of_session_management">
68 <title>Overview of Session Management</title>
72 The purpose of the X Session Management Protocol (<acronym>XSMP</acronym>)
73 is to provide a uniform mechanism for users to save and restore their
74 sessions. A <firstterm>session</firstterm> is a group of clients,
75 each of which has a particular state. The session is controlled by a
76 network service called the <firstterm>session manager</firstterm>.
77 The session manager issues commands to its clients on behalf of the
78 user. These commands may cause clients to save their state or to
79 terminate. It is expected that the client will save its state in such
80 a way that the client can be restarted at a later time and resume its
81 operation as if it had never been terminated. A client's state might
82 include information about the file currently being edited, the current
83 position of the insertion point within the file, or the start of an
84 uncommitted transaction. The means by which clients are restarted is
85 unspecified by this protocol.
89 For purposes of this protocol, a <firstterm>client</firstterm> of the
90 session manager is defined as a connection to the session manager. A
91 client is typically, though not necessarily, a process running an
92 application program connected to an X display. However, a client may
93 be connected to more than one X display or not be connected to any X
99 <chapter id='the_session_management_library'>
100 <title>The Session Management Library</title>
103 The Session Management Library (<abbrev>SMlib</abbrev>) is a low-level
104 "C" language interface to XSMP. It is expected that higher level
105 toolkits, such as Xt, will hide many of the details of session
106 management from clients. Higher level toolkits might also be developed
107 for session managers to use, but no such effort is currently under way.
112 SMlib has two parts to it:
113 <itemizedlist mark='bullet'>
114 <listitem><para>One set of functions for clients that want to be part of a session</para></listitem>
115 <listitem><para>One set of functions for session managers to call</para></listitem>
120 Some applications will use both sets of functions and act as
121 <firstterm>nested session managers</firstterm>. That is, they will be
122 both a session manager and a client of another session. An example is
123 a mail program that could start a text editor for editing the text of
124 a mail message. The mail program is part of a regular session and, at
125 the same time, is also acting as a session manager to the editor.
129 Clients initialize by connecting to the session manager and obtaining
130 a <firstterm>client-ID</firstterm> that uniquely identifies them in
131 the session. The session manager maintains a list of properties for
132 each client in the session. These properties describe the client's
133 environment and, most importantly, describe how the client can be
134 restarted (via an <property>SmRestartCommand</property>). Clients are
135 expected to save their state in such a way as to allow multiple
136 instantiations of themselves to be managed independently. For
137 example, clients may use their client-ID as part of a filename in
138 which to store the state for a particular instantiation. The
139 client-ID should be saved as part of the <property>SmRestartCommand</property>
140 so that the client will retain the same ID after it is restarted.
144 Once the client initializes itself with the session manager, it must
145 be ready to respond to messages from the session manager. For
146 example, it might be asked to save its state or to terminate. In the
147 case of a shutdown, the session manager might give each client a
148 chance to interact with the user and cancel the shutdown.
152 <chapter id='understanding_smlibs_dependence_on_ice'>
153 <title>Understanding SMlib's Dependence on ICE</title>
156 The X Session Management Protocol is layered on top of the
157 Inter-Client Exchange (<acronym>ICE</acronym>) Protocol. The ICE
158 protocol is designed to multiplex several protocols over a single
159 connection. As a result, working with SMlib requires a little
160 knowledge of how the ICE library works.
164 The ICE library utilizes callbacks to process messages. When a client
165 detects that there is data to read on an ICE connection, it should
166 call the <function>IceProcessMessages</function> function.
167 <function>IceProcessMessages</function> will read the message header
168 and look at the major opcode in order to determine which protocol the
169 message was intended for. The appropriate protocol library will then
170 be triggered to unpack the message and hand it off to the client via a
175 The main point to be aware of is that an application using SMlib must
176 have some code that detects when there is data to read on an ICE
177 connection. This can be done via a <function>select</function> call
178 on the file descriptor for the ICE connection, but more
179 typically, <function>XtAppAddInput</function> will be used to register
180 a callback that will invoke <function>IceProcessMessages</function>
181 each time there is data to read on the ICE connection.
185 To further complicate things, knowing which file descriptors to
186 call <function>select</function> on requires an understanding of how
187 ICE connections are created. On the client side, a call must be made
188 to <function>SmcOpenConnection</function> in order to open a connection
189 with a session manager. <function>SmcOpenConnection</function> will
190 internally makea call into <function>IceOpenConnection</function>
191 which will, in turn, determine if an ICE connection already exists
192 between the client and session manager. Most likely, a connection
193 will not already exist and a new ICE connection will be created. The
194 main point to be aware of is that, on the client side, it is not
195 obvious when ICE connections get created or destroyed, because
196 connections are shared when possible. To deal with this, the ICE
197 library lets the application register watch procedures that will be
198 invoked each time an ICE connection is opened or closed. These watch
199 procedures could be used to add or remove ICE file descriptors from
200 the list of descriptors to call <function>select</function> on.
204 On the session manager side, things work a bit differently. The
205 session manager has complete control over the creation of ICE
206 connections. The session manager has to first
207 call <function>IceListenForConnections</function> in order to start
208 listening for connections from clients. Once a connection attempt is
209 detected, <function>IceAcceptConnection</function> must be called, and
210 the session manager can simply add the new ICE file descriptor to the
211 list of descriptors to call <function>select</function> on.
216 For further information on the library functions related to ICE connections,
217 see the <citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
222 <chapter id='header_files_and_library_name'>
223 <title>Header Files and Library Name</title>
226 Applications (both session managers and clients) should include the
227 header file <<filename class='headerfile'>X11/SM/SMlib.h</filename>>.
228 This header file defines all of the SMlib data structures and function
229 prototypes. <filename class='headerfile'>SMlib.h</filename> includes the
230 header file <<filename class='headerfile'>X11/SM/SM.h</filename>>,
231 which defines all of the SMlib constants.
235 Because SMlib is dependent on ICE, applications should link against
236 SMlib and ICElib by using
237 <quote><option>-lSM</option> <option>-lICE</option></quote>.
241 <chapter id='session_management_client'>
242 <title>Session Management Client (<acronym>Smc</acronym>) Functions</title>
245 This section discusses how Session Management clients:
246 <itemizedlist mark='bullet'>
247 <listitem><para>Connect to the Session Manager</para></listitem>
248 <listitem><para>Close the connection</para></listitem>
249 <listitem><para>Modify callbacks</para></listitem>
250 <listitem><para>Set, delete, and retrieve Session Manager properties</para></listitem>
251 <listitem><para>Interact with the user</para></listitem>
252 <listitem><para>Request a “Save Yourself”</para></listitem>
253 <listitem><para>Request a “Save Yourself Phase 2”</para></listitem>
254 <listitem><para>Complete a “Save Yourself”</para></listitem>
255 <listitem><para>Use Smc informational functions</para></listitem>
256 <listitem><para>Handle Errors</para></listitem>
260 <sect1 id='connecting_to_the_session_manager'>
261 <title>Connecting to the Session Manager</title>
264 To open a connection with a session manager,
265 use <function>SmcOpenConnection</function>
270 <funcdef>SmcConn <function>SmcOpenConnection</function></funcdef>
271 <paramdef>char *<parameter>network_ids_list</parameter></paramdef>
272 <paramdef>SmPointer <parameter>context</parameter></paramdef>
273 <paramdef>int <parameter>xsmp_major_rev</parameter></paramdef>
274 <paramdef>int <parameter>xsmp_minor_rev</parameter></paramdef>
275 <paramdef>unsigned long <parameter>mask</parameter></paramdef>
276 <paramdef>SmcCallbacks *<parameter>callbacks</parameter></paramdef>
277 <paramdef>char *<parameter>previous_id</parameter></paramdef>
278 <paramdef>char **<parameter>client_id_ret</parameter></paramdef>
279 <paramdef>int <parameter>error_length</parameter></paramdef>
280 <paramdef>char *<parameter>error_string_ret</parameter></paramdef>
284 <variablelist remap='IP'>
286 <term><parameter>network_ids_list</parameter></term>
287 <listitem><para>Specifies the network ID(s) of the session manager.</para></listitem>
290 <term><parameter>context</parameter></term>
292 A pointer to an opaque object or <constant>NULL</constant>. Used to determine
293 if an ICE connection can be shared
294 (see <link linkend='context_sharing'>below</link>).
298 <term><parameter>xsmp_major_rev</parameter></term>
300 The highest major version of the XSMP the application supports.
304 <term><parameter>xsmp_minor_rev</parameter></term>
306 The highest minor version of the XSMP the application supports (for
307 the specified <parameter>xsmp_major_rev</parameter>).
311 <term><parameter>mask</parameter></term>
312 <listitem><para>A mask indicating which callbacks to register.</para></listitem>
315 <term><parameter>callbacks</parameter></term>
317 The callbacks to register. These callbacks are used to respond to
318 messages from the session manager.
322 <term><parameter>previous_id</parameter></term>
323 <listitem><para>The client ID from the previous session.</para></listitem>
326 <term><parameter>client_id_ret</parameter></term>
327 <listitem><para>The client ID for the current session is returned.</para></listitem>
330 <term><parameter>error_length</parameter></term>
331 <listitem><para>Length of the <parameter>error_string_ret</parameter> argument passed in.</para></listitem>
334 <term><parameter>error_string_ret</parameter></term>
336 Returns a null-terminated error message, if any.
337 The <parameter>error_string_ret</parameter> argument points to user supplied
338 memory. No more than <parameter>error_length</parameter> bytes are used.
344 The <parameter>network_ids_list</parameter> argument is a
345 null-terminated string containing a list of network IDs for the session
346 manager, separated by commas. If <parameter>network_ids_list</parameter>
347 is <constant>NULL</constant>, the value of
348 the <envar>SESSION_MANAGER</envar> environment variable will be used.
349 Each network ID has the following format:
351 <informaltable pgwide='0' frame='none'>
352 <tgroup cols='3' align='center'>
353 <colspec colname='c1'/>
354 <colspec colname='c2'/>
355 <colspec colname='c3'/>
358 <entry align='left'></entry>
359 <entry align='left'><literal>tcp/</literal><parameter><hostname></parameter><literal>:</literal><parameter><portnumber></parameter></entry>
360 <entry align='left'>or</entry>
363 <entry align='left'></entry>
364 <entry align='left'><literal>decnet/</literal><parameter><hostname></parameter><literal>::</literal><parameter><objname></parameter></entry>
365 <entry align='left'>or</entry>
368 <entry align='left'></entry>
369 <entry align='left'><literal>local/</literal><parameter><hostname></parameter><literal>:</literal><parameter><path></parameter></entry>
370 <entry align='left'></entry>
378 An attempt will be made to use the first network ID. If that fails,
379 an attempt will be made using the second network ID, and so on.
383 After the connection is established, <function>SmcOpenConnection</function>
384 registers the client with the session manager. If the client is being
385 restarted from a previous session, <parameter>previous_id</parameter>
386 should contain a null terminated string representing the client ID from the
387 previous session. If the client is first joining the session,
388 <parameter>previous_id</parameter> should be set to <constant>NULL</constant>.
389 If <parameter>previous_id</parameter> is specified but is determined
390 to be invalid by the session manager, SMlib will re-register the
391 client with <parameter>previous_id</parameter> set to <constant>NULL</constant>.
395 If <function>SmcOpenConnection</function> succeeds, it returns an
396 opaque connection pointer of type <function>SmcConn</function> and the
397 <parameter>client_id_ret</parameter> argument contains the client ID to be
398 used for this session. The <parameter>client_id_ret</parameter> should be
399 freed with a call to <function>free</function> when no longer needed. On
400 failure, <function>SmcOpenConnection</function> returns
401 <constant>NULL</constant>, and the reason for failure is returned in
402 <parameter>error_string_ret</parameter>.
406 Note that SMlib uses the ICE protocol to establish a connection with
407 the session manager. If an ICE connection already exists between the
408 client and session manager, it might be possible for the same ICE
409 connection to be used for session management.
412 <para id='context_sharing'>
413 The context argument indicates how willing the client is to share the
414 ICE connection with other protocols. If context is <constant>NULL</constant>,
415 then the caller is always willing to share the connection. If context is not
416 <constant>NULL</constant>, then the caller is not willing to use a previously
417 opened ICE connection that has a different non-<constant>NULL</constant>
418 context associated with it.
422 As previously discussed
423 (<link linkend='understanding_smlibs_dependence_on_ice'>section 3,
424 “Understanding SMlib's Dependence on ICE”</link>), the
425 client will have to keep track of when ICE connections are created or
426 destroyed (using <function>IceAddConnectionWatch</function>
427 and <function>IceRemoveConnectionWatch</function> and will have to
428 call <function>IceProcessMessages</function> each time
429 a <function>select</function> shows that there is data to read on an
430 ICE connection. For further information, see the
431 <citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
436 The callbacks argument contains a set of callbacks used to respond to
437 session manager events. The mask argument specifies which callbacks
438 are set. All of the callbacks specified in this version of SMlib are
439 mandatory. The mask argument is necessary in order to maintain
440 backwards compatibility in future versions of the library.
444 The following values may be ORed together to obtain a
445 <parameter>mask</parameter> value:
447 <simplelist type='vert'>
448 <member><constant>SmcSaveYourselfProcMask</constant></member>
449 <member><constant>SmcDieProcMask</constant></member>
450 <member><constant>SmcSaveCompleteProcMask</constant></member>
451 <member><constant>SmcShutdownCancelledProcMask</constant></member>
456 For each callback, the client can register a pointer to client data.
457 When SMlib invokes the callback, it will pass the client data pointer.
460 <!-- .ne 4 IGNORED -->
466 SmcSaveYourselfProc callback;
467 SmPointer client_data;
472 SmPointer client_data;
476 SmcSaveCompleteProc callback;
477 SmPointer client_data;
481 SmcShutdownCancelledProc callback;
482 SmPointer client_data;
483 } shutdown_cancelled;
488 <sect2 id='the_save_yourself_callback'>
489 <title>The Save Yourself Callback</title>
492 The Save Yourself callback is of type <function>SmcSaveYourselfProc</function>
497 <funcdef>typedef void (*<function>SaveYourselfProc</function>)</funcdef>
498 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
499 <paramdef>SmcConn <parameter>client_data</parameter></paramdef>
500 <paramdef>int <parameter>save_type</parameter></paramdef>
501 <paramdef>Bool <parameter>shutdown</parameter></paramdef>
502 <paramdef>int <parameter>interact_style</parameter></paramdef>
503 <paramdef>Bool <parameter>fast</parameter></paramdef>
507 <variablelist remap='IP'>
509 <term><parameter>smc_conn</parameter></term>
510 <listitem><para>The session management connection object.</para></listitem>
513 <term><parameter>client_data</parameter></term>
514 <listitem><para>Client data specified when the callback was registered.</para></listitem>
517 <term><parameter>save_type</parameter></term>
518 <listitem><para>Specifies the type of information that should be saved.</para></listitem>
521 <term><parameter>shut_down</parameter></term>
522 <listitem><para>Specifies if a shutdown is taking place.</para></listitem>
525 <term><parameter>interact_style</parameter></term>
526 <listitem><para>The type of interaction allowed with the user.</para></listitem>
529 <term><parameter>fast</parameter></term>
530 <listitem><para>if <symbol>True</symbol>, then client should save its state as quickly as possible.</para></listitem>
535 The session manager sends a “Save Yourself” message to a
536 client either to checkpoint it or just before termination so that it
537 can save its state. The client responds with zero or more calls
538 to <function>SmcSetProperties</function> to update the properties
539 indicating how to restart the client. When all the properties have
540 been set, the client calls <function>SmcSaveYourselfDone</function>
544 If <parameter>interact_style</parameter> is
545 <constant>SmInteractStyleNone</constant> the
546 client must not interact with the user while saving state.
547 If <parameter>interact_style</parameter> is
548 <constant>SmInteractStyleErrors</constant> the
549 client may interact with the user only if an error condition arises.
550 If <parameter>interact_style</parameter> is
551 <constant>SmInteractStyleAny</constant> then the
552 client may interact with the user for any purpose. Because only one
553 client can interact with the user at a time, the client must
554 call <function>SmcInteractRequest</function> and wait for an
555 “Interact” message from the session manager. When the
556 client is done interacting with the user, it
557 calls <function>SmcInteractDone</function> The client may only
558 call <function>SmcInteractRequest</function> after it receives a
559 “Save Yourself” message and before it
560 calls <function>SmcSaveYourselfDone</function>
564 If <parameter>save_type</parameter> is <constant>SmSaveLocal</constant> the
565 client must update the properties to reflect its current state. Specifically,
566 it should save enough information to restore the state as seen by the
567 user of this client. It should not affect the state as seen by other users.
568 If <parameter>save_type</parameter> is <constant>SmSaveGlobal</constant>
569 the user wants the client to commit all of its data to permanent, globally
571 If <parameter>save_type</parameter> is <constant>SmSaveBoth</constant>
572 the client should do both of these (it should first commit the data to
573 permanent storage before updating its properties).
577 Some examples are as follows:
579 <itemizedlist mark='bullet'>
581 If a word processor were sent a “Save Yourself” with a
582 type of <constant>SmSaveLocal</constant> it could create a temporary
583 file that included the current contents of the file, the location of
584 the cursor, and other aspects of the current editing session. It
585 would then update its <property>SmRestartCommand</property> property with
586 enough information to find this temporary file.
589 If a word processor were sent a “Save Yourself” with a
590 type of <constant>SmSaveGlobal</constant> it would simply save the
591 currently edited file.
594 If a word processor were sent a “Save Yourself” with a
595 type of <constant>SmSaveBoth</constant> it would first save the
596 currently edited file. It would then create a temporary file with
597 information such as the current position of the cursor and what file
598 is being edited. Finally, it would update its
599 <property>SmRestartCommand</property> property with enough information
600 to find the temporary file.
606 The <parameter>shutdown</parameter> argument specifies whether the
607 system is being shut down.
608 The interaction is different depending on whether or not shutdown is
609 set. If not shutting down, the client should save its state and wait
610 for a “Save Complete” message. If shutting down, the
611 client must save state and then prevent interaction until it receives
612 either a “Die” or a “Shutdown Cancelled.”
616 The <parameter>fast</parameter> argument specifies that the client
617 should save its state as quickly as possible. For example, if the
618 session manager knows that power is about to fail, it would
619 set <parameter>fast</parameter> to <constant>True</constant>.
623 <sect2 id='the_die_callback'>
624 <title>The Die Callback</title>
627 The Die callback is of type <function>SmcDieProc</function>
632 <funcdef>typedef void (*<function>SmcDieProc</function>)</funcdef>
633 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
634 <paramdef>SmcConn <parameter>client_data</parameter></paramdef>
638 <variablelist remap='IP'>
640 <term><parameter>smc_conn</parameter></term>
641 <listitem><para>The session management connection object.</para></listitem>
644 <term><parameter>client_data</parameter></term>
645 <listitem><para>Client data specified when the callback was registered.</para></listitem>
651 The session manager sends a “Die” message to a client when
652 it wants it to die. The client should respond by calling
653 <function>SmcCloseConnection</function>. A session manager that
654 behaves properly will send a “Save Yourself” message
655 before the “Die” message.
659 <sect2 id='the_save_complete_callback'>
660 <title>The Save Complete Callback</title>
663 The Save Complete callback is of type <function>SmcSaveCompleteProc</function>
668 <funcdef>typedef void (*<function>SmcSaveCompleteProc</function>)</funcdef>
669 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
670 <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
674 <variablelist remap='IP'>
676 <term><parameter>smc_conn</parameter></term>
677 <listitem><para>The session management connection object.</para></listitem>
680 <term><parameter>client_data</parameter></term>
681 <listitem><para>Client data specified when the callback was registered.</para></listitem>
687 <sect2 id='the_shutdown_cancelled_callback'>
688 <title>The Shutdown Cancelled Callback</title>
691 The Shutdown Cancelled callback is of type
692 <function>SmcShutdownCancelledProc</function>
697 <funcdef>typedef void (*<function>SmcShutdownCancelledProc</function>)</funcdef>
698 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
699 <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
703 <variablelist remap='IP'>
705 <term><parameter>smc_conn</parameter></term>
706 <listitem><para>The session management connection object.</para></listitem>
709 <term><parameter>client_data</parameter></term>
710 <listitem><para>Client data specified when the callback was registered.</para></listitem>
715 The session manager sends a “Shutdown Cancelled” message
716 when the user cancelled the shutdown during an interaction
717 (see <link linkend='interacting_with_the_user'>section 5.5,
718 “Interacting With the User”</link>). The client can now
719 continue as if the shutdown had never happened. If the client has not
720 called <function>SmcSaveYourselfDone</function> yet, it can either
721 abort the save and then call <function>SmcSaveYourselfDone</function>
722 with the success argument set to <constant>False</constant> or it can
723 continue with the save and then call <function>SmcSaveYourselfDone</function>
724 with the <parameter>success</parameter> argument set to reflect the outcome
730 <sect1 id='closing_the_connection'><title>Closing the Connection</title>
733 To close a connection with a session manager,
734 use <function>SmcCloseConnection</function>
739 <funcdef>SmcCloseStatus <function>SmcCloseConnection</function></funcdef>
740 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
741 <paramdef>int <parameter>count</parameter></paramdef>
742 <paramdef>char **<parameter>reason_msgs</parameter></paramdef>
745 <variablelist remap='IP'>
747 <term><parameter>smc_conn</parameter></term>
748 <listitem><para>The session management connection object.</para></listitem>
751 <term><parameter>count</parameter></term>
752 <listitem><para>The number of reasons for closing the connection.</para></listitem>
755 <term><parameter>reason_msgs</parameter></term>
756 <listitem><para>The reasons for closing the connection.</para></listitem>
761 The <parameter>reason_msgs</parameter> argument will most likely be
762 <constant>NULL</constant> if resignation is expected by the client.
763 Otherwise, it contains a list of null-terminated Compound Text strings
764 representing the reason for termination. The session manager should
765 display these reason messages to the user.
769 Note that SMlib used the ICE protocol to establish a connection with
770 the session manager, and various protocols other than session
771 management may be active on the ICE connection.
772 When <function>SmcCloseConnection</function> is called, the ICE
773 connection will be closed only if all protocols have been shutdown on
774 the connection. Check the ICElib standard
775 for <function>IceAddConnectionWatch</function>
776 and <function>IceRemoveConnectionWatch</function> to learn how to set
777 up a callback to be invoked each time an ICE connection is opened or
778 closed. Typically this callback adds/removes the ICE file descriptor
779 from the list of active descriptors to call <function>select</function> on
780 (or calls <function>XtAppAddInput</function> or
781 <function>XtRemoveInput</function>).
786 <function>SmcCloseConnection</function> returns one of the following values:
788 <itemizedlist mark='bullet'>
790 <constant>SmcClosedNow</constant> - the ICE connection was closed at
791 this time, the watch procedures were invoked, and the connection was freed.
794 <constant>SmcClosedASAP</constant> - an IO error had occurred on the
795 connection, but <function>SmcCloseConnection</function> is being
796 called within a nested <function>IceProcessMessages</function> The
797 watch procedures have been invoked at this time, but the connection
798 will be freed as soon as possible (when the nesting level reaches zero
799 and <function>IceProcessMessages</function> returns a status
800 of <function>IceProcessMessagesConnectionClosed</function>
803 <constant>SmcConnectionInUse</constant> - the connection was not closed at
804 this time, because it is being used by other active protocols.
811 <sect1 id='modifying_callbacks'>
812 <title>Modifying Callbacks</title>
815 To modify callbacks set up in <function>SmcOpenConnection</function>
816 use <function>SmcModifyCallbacks</function>
821 <funcdef>void <function>SmcModifyCallbacks</function></funcdef>
822 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
823 <paramdef>unsigned long <parameter>mask</parameter></paramdef>
824 <paramdef>SmcCallbacks *<parameter>callbacks</parameter></paramdef>
827 <variablelist remap='IP'>
829 <term><parameter>smc_conn</parameter></term>
830 <listitem><para>The session management connection object.</para></listitem>
833 <term><parameter>mask</parameter></term>
834 <listitem><para>A mask indicating which callbacks to modify.</para></listitem>
837 <term><parameter>callbacks</parameter></term>
838 <listitem><para>The new callbacks.</para></listitem>
843 When specifying a value for the <parameter>mask</parameter> argument,
844 the following values may be ORed together:
846 <simplelist type='vert'>
847 <member><constant>SmcSaveYourselfProcMask</constant></member>
848 <member><constant>SmcDieProcMask</constant></member>
849 <member><constant>SmcSaveCompleteProcMask</constant></member>
850 <member><constant>SmcShutdownCancelledProcMask</constant></member>
855 <sect1 id='setting_deleting_and_retrieving_session_management_properties'>
856 <title>Setting, Deleting, and Retrieving Session Management Properties</title>
859 To set session management properties for this client,
860 use <function>SmcSetProperties</function>
865 <funcdef>void <function>SmcSetProperties</function></funcdef>
866 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
867 <paramdef>int <parameter>num_props</parameter></paramdef>
868 <paramdef>SmProp **<parameter>props</parameter></paramdef>
872 <variablelist remap='IP'>
874 <term><parameter>smc_conn</parameter></term>
875 <listitem><para>The session management connection object.</para></listitem>
878 <term><parameter>num_props</parameter></term>
879 <listitem><para>The number of properties.</para></listitem>
882 <term><parameter>props</parameter></term>
883 <listitem><para>The list of properties to set.</para></listitem>
889 The properties are specified as an array of property pointers.
890 Previously set property values may be over-written using
891 the <function>SmcSetProperties</function> function. Note that the
892 session manager is not expected to restore property values when the
893 session is restarted. Because of this, clients should not try to use
894 the session manager as a database for storing application specific state.
898 For a description of session management properties and
899 the <structname>SmProp</structname> structure,
900 see <link linkend='session_management_properties'>section 7,
901 “Session Management Properties.”</link>
906 To delete properties previously set by the client,
907 use <function>SmcDeleteProperties</function>
912 <funcdef>void <function>SmcDeleteProperties</function></funcdef>
913 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
914 <paramdef>int <parameter>num_props</parameter></paramdef>
915 <paramdef>char **<parameter>prop_names</parameter></paramdef>
918 <variablelist remap='IP'>
920 <term><parameter>smc_conn</parameter></term>
921 <listitem><para>The session management connection object.</para></listitem>
924 <term><parameter>num_props</parameter></term>
925 <listitem><para>The number of properties.</para></listitem>
928 <term><parameter>prop_names</parameter></term>
929 <listitem><para>The list of properties to set.</para></listitem>
934 To get properties previously stored by the client,
935 use <function>SmcGetProperties</function>
940 <funcdef>Status <function>SmcGetProperties</function></funcdef>
941 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
942 <paramdef>SmcPropReplyProc <parameter>prop_reply_proc</parameter></paramdef>
943 <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
947 <variablelist remap='IP'>
949 <term><parameter>smc_conn</parameter></term>
950 <listitem><para>The session management connection object.</para></listitem>
953 <term><parameter>prop_reply_proc</parameter></term>
954 <listitem><para>The callback to be invoked when the properties reply comes back.</para></listitem>
957 <term><parameter>client_data</parameter></term>
958 <listitem><para>This pointer to client data will be passed to the <function>SmcPropReplyProc</function> callback.</para></listitem>
963 The return value of <function>SmcGetProperties</function> is zero for
964 failure and a positive value for success.
968 Note that the library does not block until the properties reply comes
969 back. Rather, a callback of type <function>SmcPropReplyProc</function>
970 is invoked when the data is ready.
975 <funcdef>typedef void (*<function>SmcPropReplyProc</function>)</funcdef>
976 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
977 <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
978 <paramdef>int <parameter>num_props</parameter></paramdef>
979 <paramdef>SmProp **<parameter>props</parameter></paramdef>
983 <variablelist remap='IP'>
985 <term><parameter>smc_conn</parameter></term>
986 <listitem><para>The session management connection object.</para></listitem>
989 <term><parameter>client_data</parameter></term>
990 <listitem><para>This pointer to client data will be passed to the <function>SmcPropReplyProc</function> callback.</para></listitem>
993 <term><parameter>num_props</parameter></term>
994 <listitem><para>The number of properties returned.</para></listitem>
997 <term><parameter>props</parameter></term>
998 <listitem><para>The list of properties returned.</para></listitem>
1003 To free each property, use <function>SmFreeProperty</function>
1004 (see <link linkend='freeing_data'>section 8, “Freeing
1005 Data”</link>). To free the actual array of pointers,
1006 use <function>free</function>
1010 <sect1 id='interacting_with_the_user'>
1011 <title>Interacting With the User</title>
1014 After receiving a “Save Yourself” message with an
1015 <parameter>interact_style</parameter> of
1016 <constant>SmInteractStyleErrors</constant>
1017 or <constant>SmInteractStyleAny</constant> the client may choose to
1018 interact with the user. Because only one client can interact with the
1019 user at a time, the client must call <function>SmcInteractRequest</function>
1020 and wait for an “Interact” message from the session manager.
1025 <funcdef>Status <function>SmcInteractRequest</function></funcdef>
1026 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1027 <paramdef>int <parameter>dialog_type</parameter></paramdef>
1028 <paramdef>SmcInteractProc <parameter>interact_proc</parameter></paramdef>
1029 <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
1033 <variablelist remap='IP'>
1035 <term><parameter>smc_conn</parameter></term>
1036 <listitem><para>The session management connection object.</para></listitem>
1039 <term><parameter>dialog_type</parameter></term>
1040 <listitem><para>The type of dialog the client wishes to present to the user.</para></listitem>
1043 <term><parameter>interact_proc</parameter></term>
1044 <listitem><para>The callback to be invoked when the “Interact” message arrives from the session manager.</para></listitem>
1047 <term><parameter>client_data</parameter></term>
1049 This pointer to client data will be passed to
1050 the <function>SmcInteractProc</function> callback when the
1051 “Interact” message arrives.
1057 The return value of <function>SmcInteractRequest</function> is zero
1058 for failure and a positive value for success.
1062 The <parameter>dialog_type</parameter> argument specifies
1063 either <constant>SmDialogError</constant> indicating that the client
1064 wants to start an error dialog, or <constant>SmDialogNormal</constant>
1065 meaning that the client wishes to start a nonerror dialog.
1069 Note that if a shutdown is in progress, the user may have the option
1070 of cancelling the shutdown. If the shutdown is cancelled, the clients
1071 that have not interacted yet with the user will receive a
1072 “Shutdown Cancelled” message instead of the
1073 “Interact” message.
1077 The <function>SmcInteractProc</function> callback will be invoked when
1078 the “Interact” message arrives from the session manager.
1083 <funcdef>typedef void (*<function>SmcInteractProc</function>)</funcdef>
1084 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1085 <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
1089 <variablelist remap='IP'>
1091 <term><parameter>smc_conn</parameter></term>
1092 <listitem><para>The session management connection object.</para></listitem>
1095 <term><parameter>client_data</parameter></term>
1096 <listitem><para>Client data specified when the callback was registered.</para></listitem>
1101 After interacting with the user (in response to an “Interact”
1102 message), you should call <function>SmcInteractDone</function>
1107 <funcdef>void <function>SmcInteractDone</function></funcdef>
1108 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1109 <paramdef>Bool <parameter>cancel_shutdown</parameter></paramdef>
1113 <variablelist remap='IP'>
1115 <term><parameter>smc_conn</parameter></term>
1116 <listitem><para>The session management connection object.</para></listitem>
1119 <term><parameter>cancel_shutdown</parameter></term>
1120 <listitem><para>If <constant>True</constant>, indicates that the user requests that the entire shutdown be cancelled.</para></listitem>
1124 The <parameter>cancel_shutdown</parameter> argument may only be
1125 <constant>True</constant> if the corresponding “Save Yourself”
1126 specified <constant>True</constant> for shutdown
1127 and <constant>SmInteractStyleErrors</constant>
1128 or <constant>SmInteractStyleAny</constant> for
1129 the <parameter>interact_style</parameter>.
1133 <sect1 id='requesting_a_save_yourself'>
1134 <title>Requesting a Save Yourself</title>
1137 To request a checkpoint from the session manager,
1138 use <function>SmcRequestSaveYourself</function>
1143 <funcdef>void <function>SmcRequestSaveYourself</function></funcdef>
1144 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1145 <paramdef>int <parameter>save_type</parameter></paramdef>
1146 <paramdef>Bool <parameter>shutdown</parameter></paramdef>
1147 <paramdef>int <parameter>interact_style</parameter></paramdef>
1148 <paramdef>Bool <parameter>fast</parameter></paramdef>
1149 <paramdef>Bool <parameter>global</parameter></paramdef>
1154 <variablelist remap='IP'>
1156 <term><parameter>smc_conn</parameter></term>
1157 <listitem><para>The session management connection object.</para></listitem>
1160 <term><parameter>save_type</parameter></term>
1161 <listitem><para>Specifies the type of information that should be saved.</para></listitem>
1164 <term><parameter>shutdown</parameter></term>
1165 <listitem><para>Specifies if a shutdown is taking place.</para></listitem>
1168 <term><parameter>interact_style</parameter></term>
1169 <listitem><para>The type of interaction allowed with the user.</para></listitem>
1172 <term><parameter>fast</parameter></term>
1173 <listitem><para>If <constant>True</constant> the client should save its state as quickly as possible.</para></listitem>
1176 <term><parameter>global</parameter></term>
1177 <listitem><para>Controls who gets the “Save Yourself.”</para></listitem>
1182 The <parameter>save_type</parameter>, <parameter>shutdown</parameter>,
1183 <parameter>interact_style</parameter>, and <parameter>fast</parameter>
1184 arguments are discussed in more detail in
1185 <link linkend='the_save_yourself_callback'>section 5.1.1,
1186 “The Save Yourself Callback.”</link>
1190 If <parameter>global</parameter> is set to <constant>True</constant> then
1191 the resulting “Save Yourself” should be sent to all clients in the
1192 session. For example, a vendor of a Uninterruptible Power Supply
1193 (<acronym>UPS</acronym>) might include a Session Management client
1194 that would monitor the status of the UPS and generate a fast shutdown
1195 if the power is about to be lost.
1199 If global is set to <constant>False</constant> then the “Save
1200 Yourself” should only be sent to the client that requested it.
1204 <sect1 id='requesting_a_save_yourself_phase_2'>
1205 <title>Requesting a Save Yourself Phase 2</title>
1208 In response to a “Save Yourself”, the client may request to be
1209 informed when all the other clients are quiescent so that it can save their
1210 state. To do so, use <function>SmcRequestSaveYourselfPhase2</function>
1215 <funcdef>Status <function>SmcRequestSaveYourselfPhase2</function></funcdef>
1216 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1217 <paramdef>SmcSaveYourselfPhase2Proc <parameter>save_yourself_phase2_proc</parameter></paramdef>
1218 <paramdef>SmPointer <parameter>client_data</parameter></paramdef>
1222 <variablelist remap='IP'>
1224 <term><parameter>smc_conn</parameter></term>
1225 <listitem><para>The session management connection object.</para></listitem>
1228 <term><parameter>save_type_phase2_proc</parameter></term>
1229 <listitem><para>The callback to be invoked when the “Save Yourself Phase 2” message arrives from the session manager.</para></listitem>
1232 <term><parameter>client_data</parameter></term>
1233 <listitem><para>This pointer to client data will be passed to the <function>SmcSaveYourselfPhase2Proc</function> callback when the “Save Yourself Phase 2” message arrives.</para></listitem>
1238 The return value of <function>SmcRequestSaveYourselfPhase2</function>
1239 is zero for failure and a positive value for success.
1243 This request is needed by clients that manage other clients (for
1244 example, window managers, workspace managers, and so on). The manager
1245 must make sure that all of the clients that are being managed are in
1246 an idle state so that their state can be saved.
1250 <sect1 id='completing_a_save_yourself'>
1251 <title>Completing a Save Yourself</title>
1254 After saving state in response to a “Save Yourself”
1255 message, you should call <function>SmcSaveYourselfDone</function>
1260 <funcdef>void <function>SmcSaveYourselfDone</function></funcdef>
1261 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1262 <paramdef>Bool <parameter>success</parameter></paramdef>
1266 <variablelist remap='IP'>
1268 <term><parameter>smc_conn</parameter></term>
1269 <listitem><para>The session management connection object.</para></listitem>
1272 <term><parameter>success</parameter></term>
1273 <listitem><para>If <constant>True</constant> the “Save Yourself” operation was completed successfully.</para></listitem>
1278 Before calling <function>SmcSaveYourselfDone</function> the client
1279 must have set each required property at least once since the client
1280 registered with the session manager.
1284 <sect1 id='using_smc_informational_functions'>
1285 <title>Using Smc Informational Functions</title>
1289 <funcdef>int <function>SmcProtocolVersion</function></funcdef>
1290 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1295 <function>SmcProtocolVersion</function> returns the major version of
1296 the session management protocol associated with this session.
1302 <funcdef>int <function>SmcProtocolRevision</function></funcdef>
1303 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1308 <function>SmcProtocolRevision</function> returns the minor version of
1309 the session management protocol associated with this session.
1314 <funcdef>char *<function>SmcVendor</function></funcdef>
1315 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1320 <function>SmcVendor</function> returns a string that provides some
1321 identification of the owner of the session manager. The string should
1322 be freed with a call to <function>free</function>
1327 <funcdef>char *<function>SmcRelease</function></funcdef>
1328 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1333 <function>SmcRelease</function> returns a string that provides the
1334 release number of the session manager. The string should be freed
1335 with a call to <function>free</function>
1340 <funcdef>char *<function>SmcClientID</function></funcdef>
1341 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1346 <function>SmcClientID</function> returns a null-terminated string for
1347 the client ID associated with this connection. This information was
1348 also returned in <function>SmcOpenConnection</function> (it is
1349 provided here for convenience). Call <function>free</function> on
1350 this pointer when the client ID is no longer needed.
1355 <funcdef>IceConn <function>SmcGetIceConnection</function></funcdef>
1356 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1361 <function>SmcGetIceConnection</function> returns the ICE connection
1362 object associated with this session management connection object. The
1363 ICE connection object can be used to get some additional information
1364 about the connection. Some of the more useful functions which can be
1365 used on the IceConn are <function>IceConnectionNumber</function>,
1366 <function>IceConnectionString</function>,
1367 <function>IceLastSentSequenceNumber</function>,
1368 <function>IceLastReceivedSequenceNumber</function>,
1369 and <function>IcePing</function>. For further information, see
1370 the <citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
1375 <sect1 id='error_handling'>
1376 <title>Error Handling</title>
1379 If the client receives an unexpected protocol error from the session
1380 manager, an error handler is invoked by SMlib. A default error
1381 handler exists that simply prints the error message
1382 to <varname>stderr</varname> and exits if the severity of the error
1383 is fatal. The client can change this error handler by calling
1384 the <function>SmcSetErrorHandler</function> function.
1389 <funcdef>SmcErrorHandler <function>SmcSetErrorHandler</function></funcdef>
1390 <paramdef>SmcErrorHandler <parameter>handler</parameter></paramdef>
1395 The error handler. You should pass <constant>NULL</constant> to
1396 restore the default handler.
1401 <function>SmcSetErrorHandler</function> returns the previous error handler.
1405 The <function>SmcErrorHandler</function> has the following type:
1410 <funcdef>typedef void (*<function>SmcErrorHandler</function>)</funcdef>
1411 <paramdef>SmcConn <parameter>smc_conn</parameter></paramdef>
1412 <paramdef>Bool <parameter>swap</parameter></paramdef>
1413 <paramdef>int <parameter>offending_minor_opcode</parameter></paramdef>
1414 <paramdef>unsigned long <parameter>offending_sequence_num</parameter></paramdef>
1415 <paramdef>int <parameter>error_class</parameter></paramdef>
1416 <paramdef>int <parameter>severity</parameter></paramdef>
1417 <paramdef>IcePointer <parameter>values</parameter></paramdef>
1421 <variablelist remap='IP'>
1423 <term><parameter>smc_conn</parameter></term>
1424 <listitem><para>The session management connection object.</para></listitem>
1427 <term><parameter>swap</parameter></term>
1428 <listitem><para>A flag that indicates if the specified values need byte swapping.</para></listitem>
1431 <term><parameter>offending_minor_opcode</parameter></term>
1432 <listitem><para>The minor opcode of the offending message.</para></listitem>
1435 <term><parameter>offending_sequence_num</parameter></term>
1436 <listitem><para>The sequence number of the offending message.</para></listitem>
1439 <term><parameter>error_class</parameter></term>
1440 <listitem><para>The error class of the offending message.</para></listitem>
1443 <term><parameter>severity</parameter></term>
1444 <listitem><para><constant>IceCanContinue</constant>,
1445 <constant>IceFatalToProtocol</constant>, or
1446 <constant>IceFatalToConnection</constant>
1450 <term><parameter>values</parameter></term>
1451 <listitem><para>Any additional error values specific to the minor opcode and class.</para></listitem>
1456 Note that this error handler is invoked for protocol related errors.
1457 To install an error handler to be invoked when an IO error occurs, use
1458 <function>IceSetIOErrorHandler</function> For further information, see
1459 the <citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
1465 <chapter id='session_management_server'>
1466 <title>Session Management Server (<acronym>Sms</acronym>) Functions</title>
1469 This section discusses how Session Management servers:
1471 <itemizedlist mark='bullet'>
1472 <listitem><para>Initialize the library</para></listitem>
1473 <listitem><para>Register the client</para></listitem>
1474 <listitem><para>Send a “Save Yourself” message</para></listitem>
1475 <listitem><para>Send a “Save Yourself Phase 2” message</para></listitem>
1476 <listitem><para>Send an “Interact” message</para></listitem>
1477 <listitem><para>Send a “Save Complete” message</para></listitem>
1478 <listitem><para>Send a “Die” message</para></listitem>
1479 <listitem><para>Cancel a shutdown</para></listitem>
1480 <listitem><para>Return properties</para></listitem>
1481 <listitem><para>Ping a client</para></listitem>
1482 <listitem><para>Clean up after a client disconnects</para></listitem>
1483 <listitem><para>Use Sms informational functions</para></listitem>
1484 <listitem><para>Handle errors</para></listitem>
1488 <sect1 id='initializing_the_library'>
1489 <title>Initializing the Library</title>
1492 <function>SmsInitialize</function> is the first SMlib function that
1493 should be called by a session manager. It provides information about
1494 the session manager and registers a callback that will be invoked each
1495 time a new client connects to the session manager.
1500 <funcdef>Status <function>SmsInitialize</function></funcdef>
1501 <paramdef>char *<parameter>vendor</parameter></paramdef>
1502 <paramdef>char *<parameter>release</parameter></paramdef>
1503 <paramdef>SmsNewClientProc <parameter>new_client_proc</parameter></paramdef>
1504 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
1505 <paramdef>IceHostBasedAuthProc <parameter>host_based_auth_proc</parameter></paramdef>
1506 <paramdef>int <parameter>error_length</parameter></paramdef>
1507 <paramdef>char *<parameter>error_string_ret</parameter></paramdef>
1513 <variablelist remap='IP'>
1515 <term><parameter>vendor</parameter></term>
1516 <listitem><para>A string specifying the session manager vendor.</para></listitem>
1519 <term><parameter>release</parameter></term>
1520 <listitem><para>A string specifying the session manager release number.</para></listitem>
1523 <term><parameter>new_client_proc</parameter></term>
1524 <listitem><para>Callback to be invoked each time a new client connects to the session manager.</para></listitem>
1527 <term><parameter>manager_data</parameter></term>
1528 <listitem><para>When the <function>SmsNewClientProc</function> callback is invoked, this pointer to manager data will be passed.</para></listitem>
1531 <term><parameter>host_based_auth_proc</parameter></term>
1532 <listitem><para>Host based authentication callback.</para></listitem>
1535 <term><parameter>error_length</parameter></term>
1536 <listitem><para>Length of the <parameter>error_string_ret</parameter> argument passed in.</para></listitem>
1539 <term><parameter>error_string_ret</parameter></term>
1541 Returns a null-terminated error message, if any.
1542 The <parameter>error_string_ret</parameter> points to user supplied memory.
1543 No more than <parameter>error_length</parameter> bytes are used.
1549 After the <function>SmsInitialize</function> function is called, the
1550 session manager should call the <function>IceListenForConnections</function>
1551 function to listen for new connections. Afterwards, each time a
1552 client connects, the session manager should
1553 call <function>IceAcceptConnection</function>
1557 See <link linkend='authentication_of_clients'>section 9,
1558 “Authentication of Clients,”</link> for more details on
1559 authentication (including host based authentication). Also see
1560 the <citetitle pubwork='article'>Inter-Client Exchange
1561 Library</citetitle> standard for further details on listening for and
1562 accepting ICE connections.
1566 Each time a new client connects to the session manager,
1567 the <function>SmsNewClientProc</function> callback is invoked. The
1568 session manager obtains a new opaque connection object that it should
1569 use for all future interaction with the client. At this time, the
1570 session manager must also register a set of callbacks to respond to
1571 the different messages that the client might send.
1576 <funcdef>typedef Status (*<function>SmsNewClientProc</function>)</funcdef>
1577 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
1578 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
1579 <paramdef>unsigned long *<parameter>mask_ret</parameter></paramdef>
1580 <paramdef>SmsCallbacks *<parameter>callbacks_ret</parameter></paramdef>
1581 <paramdef>char **<parameter>failure_reason_ret</parameter></paramdef>
1585 <variablelist remap='IP'>
1587 <term><parameter>sms_conn</parameter></term>
1588 <listitem><para>A new opaque connection object.</para></listitem>
1591 <term><parameter>manager_data</parameter></term>
1592 <listitem><para>Manager data specified when the callback was registered.</para></listitem>
1595 <term><parameter>mask_ret</parameter></term>
1596 <listitem><para>On return, indicates which callbacks were set by the session manager.</para></listitem>
1599 <term><parameter>callbacks_ret</parameter></term>
1600 <listitem><para>On return, contains the callbacks registered by the session manager.</para></listitem>
1603 <term><parameter>failure_reason_ret</parameter></term>
1604 <listitem><para>Failure reason returned.</para></listitem>
1609 If a failure occurs, the <function>SmsNewClientProc</function> should
1610 return a zero status as well as allocate and return a failure reason
1611 string in <parameter>failure_reason_ret</parameter>.
1612 SMlib will be responsible for freeing this memory.
1616 The session manager must register a set of callbacks to respond to
1617 client events. The <parameter>mask_ret</parameter> argument specifies
1618 which callbacks are set. All of the callbacks specified in this version of
1619 SMlib are mandatory. The <parameter>mask_ret</parameter> argument is
1620 necessary in order to maintain backwards compatibility in future versions
1625 The following values may be ORed together to obtain a mask value:
1627 <simplelist type='vert'>
1628 <member><constant>SmsRegisterClientProcMask</constant></member>
1629 <member><constant>SmsInteractRequestProcMask</constant></member>
1630 <member><constant>SmsInteractDoneProcMask</constant></member>
1631 <member><constant>SmsSaveYourselfRequestProcMask</constant></member>
1632 <member><constant>SmsSaveYourselfP2RequestProcMask</constant></member>
1633 <member><constant>SmsSaveYourselfDoneProcMask</constant></member>
1634 <member><constant>SmsCloseConnectionProcMask</constant></member>
1635 <member><constant>SmsSetPropertiesProcMask</constant></member>
1636 <member><constant>SmsDeletePropertiesProcMask</constant></member>
1637 <member><constant>SmsGetPropertiesProcMask</constant></member>
1642 For each callback, the session manager can register a pointer to
1643 manager data specific to that callback. This pointer will be passed
1644 to the callback when it is invoked by SMlib.
1650 SmsRegisterClientProc callback;
1651 SmPointer manager_data;
1655 SmsInteractRequestProc callback;
1656 SmPointer manager_data;
1660 SmsInteractDoneProc callback;
1661 SmPointer manager_data;
1665 SmsSaveYourselfRequestProc callback;
1666 SmPointer manager_data;
1667 } save_yourself_request;
1670 SmsSaveYourselfPhase2RequestProc callback;
1671 SmPointer manager_data;
1672 } save_yourself_phase2_request;
1675 SmsSaveYourselfDoneProc callback;
1676 SmPointer manager_data;
1677 } save_yourself_done;
1680 SmsCloseConnectionProc callback;
1681 SmPointer manager_data;
1685 SmsSetPropertiesProc callback;
1686 SmPointer manager_data;
1690 SmsDeletePropertiesProc callback;
1691 SmPointer manager_data;
1692 } delete_properties;
1695 SmsGetPropertiesProc callback;
1696 SmPointer manager_data;
1702 <sect2 id='the_register_client_callback'>
1703 <title>The Register Client Callback</title>
1706 The Register Client callback is the first callback that will be
1707 invoked after the client connects to the session manager. Its type
1708 is <function>SmsRegisterClientProc</function>
1713 <funcdef>typedef Status (*<function>SmsRegisterClientProc</function>)</funcdef>
1714 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
1715 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
1716 <paramdef>char *<parameter>previous_id</parameter></paramdef>
1720 <variablelist remap='IP'>
1722 <term><parameter>sms_conn</parameter></term>
1723 <listitem><para>The session management connection object.</para></listitem>
1726 <term><parameter>manager_data</parameter></term>
1727 <listitem><para>Manager data specified when the callback was registered.</para></listitem>
1730 <term><parameter>previous_id</parameter></term>
1731 <listitem><para>The client ID from the previous session.</para></listitem>
1736 Before any further interaction takes place with the client, the client
1737 must be registered with the session manager.
1741 If the client is being restarted from a previous session,
1742 <parameter>previous_id</parameter> will contain a null-terminated string
1743 representing the client ID from the previous session.
1744 Call <function>free</function> on the <parameter>previous_id</parameter>
1745 pointer when it is no longer needed. If the client is first joining the
1746 session, <parameter>previous_id</parameter> will be <constant>NULL</constant>.
1750 If <parameter>previous_id</parameter> is invalid, the session manager should
1751 not register the client at this time. This callback should return a status
1752 of zero, which will cause an error message to be sent to the client. The
1753 client should re-register with previous_id set to <constant>NULL</constant>.
1757 Otherwise, the session manager should register the client with a unique
1758 client ID by calling the <function>SmsRegisterClientReply</function>
1759 function (to be discussed shortly), and the
1760 <function>SmsRegisterClientProc</function> callback should return a
1765 <sect2 id='the_interact_request_callback'>
1766 <title>The Interact Request Callback</title>
1769 The Interact Request callback is of
1770 type <function>SmsInteractRequestProc</function>
1775 <funcdef>typedef void (*<function>SmsInteractRequestProc</function>)</funcdef>
1776 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
1777 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
1778 <paramdef>int <parameter>dialog_type</parameter></paramdef>
1782 <variablelist remap='IP'>
1784 <term><parameter>sms_conn</parameter></term>
1785 <listitem><para>The session management connection object.</para></listitem>
1788 <term><parameter>manager_data</parameter></term>
1789 <listitem><para>Manager data specified when the callback was registered.</para></listitem>
1792 <term><parameter>dialog_type</parameter></term>
1793 <listitem><para>The type of dialog the client wishes to present to the user.</para></listitem>
1798 When a client receives a “Save Yourself” message with an
1799 <parameter>interact_style</parameter> of
1800 <constant>SmInteractStyleErrors</constant>
1801 or <constant>SmInteractStyleAny</constant> the client may choose to
1802 interact with the user. Because only one client can interact with the
1803 user at a time, the client must request to interact with the user.
1804 The session manager should keep a queue of all clients wishing to
1805 interact. It should send an “Interact” message to one
1806 client at a time and wait for an “Interact Done” message
1807 before continuing with the next client.
1811 The <parameter>dialog_type</parameter> argument specifies
1812 either <constant>SmDialogError</constant> indicating that the client
1813 wants to start an error dialog, or <constant>SmDialogNormal</constant>
1814 meaning that the client wishes to start a nonerror dialog.
1818 If a shutdown is in progress, the user may have the option of
1819 cancelling the shutdown. If the shutdown is cancelled (specified in
1820 the “Interact Done” message), the session manager should
1821 send a “Shutdown Cancelled” message to each client that
1822 requested to interact.
1826 <sect2 id='the_interact_done_callback'>
1827 <title>The Interact Done Callback</title>
1830 When the client is done interacting with the user,
1831 the <function>SmsInteractDoneProc</function> callback will be invoked.
1836 <funcdef>typedef void (*<function>SmsInteractDoneProc</function>)</funcdef>
1837 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
1838 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
1839 <paramdef>Bool <parameter>cancel_shutdown</parameter></paramdef>
1843 <variablelist remap='IP'>
1845 <term><parameter>sms_conn</parameter></term>
1846 <listitem><para>The session management connection object.</para></listitem>
1849 <term><parameter>manager_data</parameter></term>
1850 <listitem><para>Manager data specified when the callback was registered.</para></listitem>
1853 <term><parameter>cancel_shutdown</parameter></term>
1854 <listitem><para>Specifies if the user requests that the entire shutdown be cancelled.</para></listitem>
1859 Note that the shutdown can be cancelled only if the corresponding
1860 “Save Yourself” specified <constant>True</constant> for
1861 shutdown and <constant>SmInteractStyleErrors</constant>
1862 or <constant>SmInteractStyleAny</constant> for the
1863 <parameter>interact_style</parameter>.
1868 <sect2 id='the_save_yourself_request_callback'>
1869 <title>The Save Yourself Request Callback</title>
1872 The Save Yourself Request callback is of
1873 type <function>SmsSaveYourselfRequestProc</function>
1878 <funcdef>typedef void (*<function>SaveYourselfRequestProc</function>)</funcdef>
1879 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
1880 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
1881 <paramdef>int <parameter>save_type</parameter></paramdef>
1882 <paramdef>Bool <parameter>shutdown</parameter></paramdef>
1883 <paramdef>int <parameter>interact_style</parameter></paramdef>
1884 <paramdef>Bool <parameter>fast</parameter></paramdef>
1885 <paramdef>Bool <parameter>global</parameter></paramdef>
1889 <variablelist remap='IP'>
1891 <term><parameter>sms_conn</parameter></term>
1892 <listitem><para>The session management connection object.</para></listitem>
1895 <term><parameter>manager_data</parameter></term>
1896 <listitem><para>Manager data specified when the callback was registered.</para></listitem>
1899 <term><parameter>save_type</parameter></term>
1900 <listitem><para>Specifies the type of information that should be saved.</para></listitem>
1903 <term><parameter>shutdown</parameter></term>
1904 <listitem><para>Specifies if a shutdown is taking place.</para></listitem>
1907 <term><parameter>interact_style</parameter></term>
1908 <listitem><para>The type of interaction allowed with the user.</para></listitem>
1911 <term><parameter>fast</parameter></term>
1912 <listitem><para>If <constant>True</constant> the client should save its state as quickly as possible.</para></listitem>
1915 <term><parameter>global</parameter></term>
1916 <listitem><para>Controls who gets the “Save Yourself.”</para></listitem>
1921 The Save Yourself Request prompts the session manager to initiate a
1922 checkpoint or shutdown. For information on the
1923 <parameter>save_type</parameter>, <parameter>shutdown</parameter>,
1924 <parameter>interact_style</parameter>, and <parameter>fast</parameter>
1925 arguments, see <link linkend='sending_a_save_yourself_message'>section 6.3,
1926 “Sending a Save Yourself Message.”</link>
1930 If <parameter>global</parameter> is set to <constant>True</constant> then the
1931 resulting “Save Yourself” should be sent to all applications.
1932 If <parameter>global</parameter> is set to <constant>False</constant> then the
1933 “Save Yourself” should only be sent to the client that requested it.
1937 <sect2 id='the_save_yourself_phase_2_request_callback'>
1938 <title>The Save Yourself Phase 2 Request Callback</title>
1941 The Save Yourself Phase 2 Request callback is of
1942 type <function>SmsSaveYourselfPhase2RequestProc</function>
1947 <funcdef>typedef void (*<function>SmsSaveYourselfPhase2RequestProc</function>)</funcdef>
1948 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
1949 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
1953 <variablelist remap='IP'>
1955 <term><parameter>sms_conn</parameter></term>
1956 <listitem><para>The session management connection object.</para></listitem>
1959 <term><parameter>manager_data</parameter></term>
1960 <listitem><para>Manager data specified when the callback was registered.</para></listitem>
1965 This request is sent by clients that manage other clients (for
1966 example, window managers, workspace managers, and so on). Such
1967 managers must make sure that all of the clients that are being managed
1968 are in an idle state so that their state can be saved.
1972 <sect2 id='the_save_yourself_done_callback'>
1973 <title>The Save Yourself Done Callback</title>
1976 When the client is done saving its state in response to a
1977 “Save Yourself” message,
1978 the <function>SmsSaveYourselfDoneProc</function> will be invoked.
1983 <funcdef>typedef void (*<function>SaveYourselfDoneProc</function>)</funcdef>
1984 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
1985 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
1986 <paramdef>Bool <parameter>success</parameter></paramdef>
1990 <variablelist remap='IP'>
1992 <term><parameter>sms_conn</parameter></term>
1993 <listitem><para>The session management connection object.</para></listitem>
1996 <term><parameter>manager_data</parameter></term>
1997 <listitem><para>Manager data specified when the callback was registered.</para></listitem>
2000 <term><parameter>success</parameter></term>
2001 <listitem><para>If <constant>True</constant> the Save Yourself operation was completed successfully.</para></listitem>
2006 Before the “Save Yourself Done” was sent, the client must
2007 have set each required property at least once since it registered with
2008 the session manager.
2012 <sect2 id='the_connection_closed_callback'>
2013 <title>The Connection Closed Callback</title>
2016 If the client properly terminates (that is, it
2017 calls <function>SmcCloseConnection</function>,
2018 the <function>SmsCloseConnectionProc</function> callback is invoked.
2023 <funcdef>typedef void (*<function>SmsCloseConnectionProc</function>)</funcdef>
2024 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2025 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
2026 <paramdef>int <parameter>count</parameter></paramdef>
2027 <paramdef>char **<parameter>reason_msgs</parameter></paramdef>
2031 <variablelist remap='IP'>
2033 <term><parameter>sms_conn</parameter></term>
2034 <listitem><para>The session management connection object.</para></listitem>
2037 <term><parameter>manager_data</parameter></term>
2038 <listitem><para>Manager data specified when the callback was registered.</para></listitem>
2041 <term><parameter>count</parameter></term>
2042 <listitem><para>The number of reason messages.</para></listitem>
2045 <term><parameter>reason_msgs</parameter></term>
2046 <listitem><para>The reasons for closing the connection.</para></listitem>
2051 The <parameter>reason_msgs</parameter> argument will most likely
2052 be <constant>NULL</constant> and the <parameter>count</parameter>
2053 argument zero (0) if resignation is expected by the user. Otherwise,
2054 it contains a list of null-terminated Compound Text strings
2055 representing the reason for termination. The session manager should
2056 display these reason messages to the user.
2060 Call <function>SmFreeReasons</function> to free the reason messages.
2061 For further information, see
2062 <link linkend='freeing_data'>section 8, “Freeing Data”</link>
2066 <sect2 id='the_set_properties_callback'>
2067 <title>The Set Properties Callback</title>
2070 When the client sets session management properties,
2071 the <function>SmsSetPropertiesProc</function> callback will be invoked.
2076 <funcdef>typedef void (*<function>SmsSetPropertiesProc</function>)</funcdef>
2077 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2078 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
2079 <paramdef>int <parameter>num_props</parameter></paramdef>
2080 <paramdef>SmProp **<parameter>props</parameter></paramdef>
2084 <variablelist remap='IP'>
2086 <term><parameter>sms_conn</parameter></term>
2087 <listitem><para>The session management connection object.</para></listitem>
2090 <term><parameter>manager_data</parameter></term>
2091 <listitem><para>Manager data specified when the callback was registered.</para></listitem>
2094 <term><parameter>num_props</parameter></term>
2095 <listitem><para>The number of properties.</para></listitem>
2098 <term><parameter>props</parameter></term>
2099 <listitem><para>The list of properties to set.</para></listitem>
2104 The properties are specified as an array of property pointers. For a
2105 description of session management properties and
2106 the <structname>SmProp</structname> structure,
2107 see <link linkend='session_management_properties'>section 7,
2108 “Session Management Properties.”</link>
2112 Previously set property values may be over-written. Some properties
2113 have predefined semantics. The session manager is required to store
2114 nonpredefined properties.
2118 To free each property, use <function>SmFreeProperty</function>.
2119 For further information, see <link linkend='freeing_data'>section 8,
2120 “Freeing Data”</link> You should free the actual array of
2121 pointers with a call to <function>free</function>
2125 <sect2 id='the_delete_properties_callback'>
2126 <title>The Delete Properties Callback</title>
2129 When the client deletes session management properties,
2130 the <function>SmsDeletePropertiesProc</function> callback will be invoked.
2135 <funcdef>typedef void (*<function>SmsDeletePropertiesProc</function>)</funcdef>
2136 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2137 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
2138 <paramdef>int <parameter>num_props</parameter></paramdef>
2139 <paramdef>char **<parameter>prop_names</parameter></paramdef>
2143 <variablelist remap='IP'>
2145 <term><parameter>sms_conn</parameter></term>
2146 <listitem><para>The session management connection object.</para></listitem>
2149 <term><parameter>manager_data</parameter></term>
2150 <listitem><para>Manager data specified when the callback was registered.</para></listitem>
2153 <term><parameter>num_props</parameter></term>
2154 <listitem><para>The number of properties.</para></listitem>
2157 <term><parameter>prop_names</parameter></term>
2158 <listitem><para>The list of properties to delete.</para></listitem>
2163 The properties are specified as an array of strings. For a
2164 description of session management properties and
2165 the <structname>SmProp</structname> structure,
2166 see <link linkend='session_management_properties'>section 7,
2167 “Session Management Properties.”</link>
2171 <sect2 id='the_get_properties_callback'>
2172 <title>The Get Properties Callback</title>
2175 The <function>SmsGetPropertiesProc</function> callback is invoked when
2176 the client wants to retrieve properties it set.
2181 <funcdef>typedef void (*<function>SmsGetPropertiesProc</function>)</funcdef>
2182 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2183 <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
2187 <variablelist remap='IP'>
2189 <term><parameter>sms_conn</parameter></term>
2190 <listitem><para>The session management connection object.</para></listitem>
2193 <term><parameter>manager_data</parameter></term>
2194 <listitem><para>Manager data specified when the callback was registered.</para></listitem>
2199 The session manager should respond by
2200 calling <function>SmsReturnProperties</function>.
2201 All of the properties set for this client should be returned.
2206 <sect1 id='registering_the_client'>
2207 <title>Registering the Client</title>
2210 To register a client (in response to
2211 a <function>SmsRegisterClientProc</function> callback),
2212 use <function>SmsRegisterClientReply</function>.
2217 <funcdef>Status <function>SmsRegisterClientReply</function></funcdef>
2218 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2219 <paramdef>char *<parameter>client_id</parameter></paramdef>
2223 <variablelist remap='IP'>
2225 <term><parameter>sms_conn</parameter></term>
2226 <listitem><para>The session management connection object.</para></listitem>
2229 <term><parameter>client_id</parameter></term>
2230 <listitem><para>A null-terminated string representing a unique client ID.</para></listitem>
2235 The return value of <function>SmsRegisterClientReply</function> is
2236 zero for failure and a positive value for success. Failure will occur
2237 if SMlib can not allocate memory to hold a copy of the client ID for
2238 it's own internal needs.
2242 If a non-<constant>NULL</constant> <parameter>previous_id</parameter> was
2243 specified when the client registered itself, <parameter>client_id</parameter>
2244 should be identical to <parameter>previous_id</parameter>.
2248 Otherwise, <parameter>client_id</parameter> should be a unique ID freshly
2249 generated by the session manager. In addition, the session manager should
2250 send a “Save Yourself” message with
2251 <parameter>type</parameter> = <constant>Local</constant>,
2252 <parameter>shutdown</parameter> = <constant>False</constant>,
2253 <parameter>interact-style</parameter> = <constant>None</constant>,
2254 and <parameter>fast</parameter> = <constant>False</constant>
2255 immediately after registering the client.
2259 Note that once a client ID has been assigned to the client, the client
2260 keeps this ID indefinitely. If the client is terminated and
2261 restarted, it will be reassigned the same ID. It is desirable to be
2262 able to pass client IDs around from machine to machine, from user to
2263 user, and from session manager to session manager, while retaining the
2264 identity of the client. This, combined with the indefinite
2265 persistence of client IDs, means that client IDs need to be globally
2270 You should call the <function>SmsGenerateClientID</function> function
2271 to generate a globally unique client ID.
2276 <funcdef>char *<function>SmsGenerateClientID</function></funcdef>
2277 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2281 <variablelist remap='IP'>
2283 <term><parameter>sms_conn</parameter></term>
2284 <listitem><para>The session management connection object.</para></listitem>
2290 <constant>NULL</constant> will be returned if the ID could not be generated.
2291 Otherwise, the return value of the function is the client ID.
2292 It should be freed with a call to <function>free</function> when
2297 <sect1 id='sending_a_save_yourself_message'>
2298 <title>Sending a Save Yourself Message</title>
2301 To send a “Save Yourself” to a client,
2302 use <function>SmsSaveYourself</function>.
2307 <funcdef>void <function>SmsSaveYourself</function></funcdef>
2308 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2309 <paramdef>int <parameter>save_type</parameter></paramdef>
2310 <paramdef>Bool <parameter>shutdown</parameter></paramdef>
2311 <paramdef>int <parameter>interact_style</parameter></paramdef>
2312 <paramdef>Bool <parameter>fast</parameter></paramdef>
2316 <variablelist remap='IP'>
2318 <term><parameter>sms_conn</parameter></term>
2319 <listitem><para>The session management connection object.</para></listitem>
2322 <term><parameter>save_type</parameter></term>
2323 <listitem><para>Specifies the type of information that should be saved.</para></listitem>
2326 <term><parameter>shutdown</parameter></term>
2327 <listitem><para>Specifies if a shutdown is taking place.</para></listitem>
2330 <term><parameter>interact_style</parameter></term>
2331 <listitem><para>The type of interaction allowed with the user.</para></listitem>
2334 <term><parameter>fast</parameter></term>
2335 <listitem><para>If <constant>True</constant> the client should save its state as quickly as possible.</para></listitem>
2341 The session manager sends a “Save Yourself” message to a
2342 client either to checkpoint it or just before termination so that it
2343 can save its state. The client responds with zero or more “Set
2344 Properties” messages to update the properties indicating how to
2345 restart the client. When all the properties have been set, the client
2346 sends a “Save Yourself Done” message.
2350 If <parameter>interact_style</parameter>
2351 is <constant>SmInteractStyleNone</constant> the
2352 client must not interact with the user while saving state.
2353 If <parameter>interact_style</parameter>
2354 is <constant>SmInteractStyleErrors</constant> the
2355 client may interact with the user only if an error condition arises.
2356 If <parameter>interact_style</parameter>
2357 is <constant>SmInteractStyleAny</constant> then the
2358 client may interact with the user for any purpose. The client must
2359 send an “Interact Request” message and wait for an
2360 “Interact” message from the session manager before it can
2361 interact with the user. When the client is done interacting with the
2362 user, it should send an “Interact Done” message. The
2363 “Interact Request” message can be sent any time after a
2364 “Save Yourself” and before a “Save Yourself
2369 If <parameter>save_type</parameter> is <constant>SmSaveLocal</constant>
2370 the client must update the properties to reflect its current state.
2371 Specifically, it should save enough information to restore the state as
2372 seen by the user of this client. It should not affect the state as seen
2374 If <parameter>save_type</parameter> is <constant>SmSaveGlobal</constant>
2375 the user wants the client to commit all of its data to permanent, globally
2377 If <parameter>save_type</parameter> is <constant>SmSaveBoth</constant>
2378 the client should do both of these (it should first commit the data to
2379 permanent storage before updating its properties).
2383 The <parameter>shutdown</parameter> argument specifies whether the session
2384 is being shut down. The interaction is different depending on whether or not
2385 shutdown is set. If not shutting down, then the client can save and
2386 resume normal operation. If shutting down, the client must save and
2387 then must prevent interaction until it receives either a
2388 “Die” or a “Shutdown Cancelled,” because
2389 anything the user does after the save will be lost.
2393 The <parameter>fast</parameter> argument specifies that the client should
2394 save its state as quickly as possible. For example, if the session manager
2395 knows that power is about to fail, it should set <parameter>fast</parameter>
2396 to <constant>True</constant>.
2400 <sect1 id='sending_a_save_yourself_phase_2_message'>
2401 <title>Sending a Save Yourself Phase 2 Message</title>
2404 In order to send a “Save Yourself Phase 2” message to a
2405 client, use <function>SmsSaveYourselfPhase2</function>
2410 <funcdef>void <function>SmsSaveYourselfPhase2</function></funcdef>
2411 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2415 <variablelist remap='IP'>
2417 <term><parameter>sms_conn</parameter></term>
2418 <listitem><para>The session management connection object.</para></listitem>
2423 The session manager sends this message to a client that has previously
2424 sent a “Save Yourself Phase 2 Request” message. This
2425 message informs the client that all other clients are in a fixed state
2426 and this client can save state that is associated with other clients.
2430 <sect1 id='sending_an_interact_message'>
2431 <title>Sending an Interact Message</title>
2434 To send an “Interact” message to a client,
2435 use <function>SmsInteract</function>.
2440 <funcdef>void <function>SmsInteract</function></funcdef>
2441 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2445 <variablelist remap='IP'>
2447 <term><parameter>sms_conn</parameter></term>
2448 <listitem><para>The session management connection object.</para></listitem>
2453 The “Interact” message grants the client the privilege of
2454 interacting with the user. When the client is done interacting with
2455 the user, it must send an “Interact Done” message to the
2460 <sect1 id='sending_a_save_complete_message'>
2461 <title>Sending a Save Complete Message</title>
2464 To send a “Save Complete” message to a client,
2465 use <function>SmsSaveComplete</function>.
2470 <funcdef>void <function>SmsSaveComplete</function></funcdef>
2471 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2475 <variablelist remap='IP'>
2477 <term><parameter>sms_conn</parameter></term>
2478 <listitem><para>The session management connection object.</para></listitem>
2483 The session manager sends this message when it is done with a
2484 checkpoint. The client is then free to change its state.
2488 <sect1 id='sending_a_die_message'>
2489 <title>Sending a Die Message</title>
2492 To send a “Die” message to a client,
2493 use <function>SmsDie</function>.
2498 <funcdef>void <function>SmsDie</function></funcdef>
2499 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2503 <variablelist remap='IP'>
2505 <term><parameter>sms_conn</parameter></term>
2506 <listitem><para>The session management connection object.</para></listitem>
2511 Before the session manager terminates, it should wait for a
2512 “Connection Closed” message from each client that it sent
2513 a “Die” message to, timing out appropriately.
2517 <sect1 id='cancelling_a_shutdown'>
2518 <title>Cancelling a Shutdown</title>
2521 To cancel a shutdown, use <function>SmsShutdownCancelled</function>.
2526 <funcdef>void <function>SmsShutdownCancelled</function></funcdef>
2527 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2531 <variablelist remap='IP'>
2533 <term><parameter>sms_conn</parameter></term>
2534 <listitem><para>The session management connection object.</para></listitem>
2539 The client can now continue as if the shutdown had never happened. If
2540 the client has not sent a “Save Yourself Done” message
2541 yet, it can either abort the save and send a “Save Yourself
2542 Done” with the success argument set to <constant>False</constant>
2543 or it can continue with the save and send a “Save Yourself Done”
2544 with the <parameter>success</parameter> argument set to reflect the outcome
2548 <!-- aaaaaaaaaaaaaaaaa -->
2550 <sect1 id='returning_properties'>
2551 <title>Returning Properties</title>
2554 In response to a “Get Properties” message, the session
2555 manager should call <function>SmsReturnProperties</function>.
2560 <funcdef>void <function>SmsReturnProperties</function></funcdef>
2561 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2562 <paramdef>int <parameter>num_props</parameter></paramdef>
2563 <paramdef>SmProp **<parameter>props</parameter></paramdef>
2567 <variablelist remap='IP'>
2569 <term><parameter>sms_conn</parameter></term>
2570 <listitem><para>The session management connection object.</para></listitem>
2573 <term><parameter>num_props</parameter></term>
2574 <listitem><para>The number of properties.</para></listitem>
2577 <term><parameter>props</parameter></term>
2578 <listitem><para>The list of properties to return to the client.</para></listitem>
2583 The properties are returned as an array of property pointers. For a
2584 description of session management properties and
2585 the <structname>SmProp</structname> structure,
2586 see <link linkend='session_management_properties'>section 7,
2587 “Session Management Properties.”</link>
2591 <sect1 id='pinging_a_client'>
2592 <title>Pinging a Client</title>
2595 To check that a client is still alive, you should use
2596 the <function>IcePing</function> function provided by the ICE library.
2597 To do so, the ICE connection must be obtained using
2598 the <function>SmsGetIceConnection</function>
2599 (see <link linkend='using_sms_informational_functions'>section 6.12,
2600 “Using Sms Informational Functions”</link>).
2606 <funcdef>void <function>IcePing</function></funcdef>
2607 <paramdef>IceConn <parameter>ice_conn</parameter></paramdef>
2608 <paramdef>IcePingReplyProc <parameter>ping_reply_proc</parameter></paramdef>
2609 <paramdef>IcePointer <parameter>client_data</parameter></paramdef>
2613 <variablelist remap='IP'>
2615 <term><parameter>ice_conn</parameter></term>
2616 <listitem><para>A valid ICE connection object.</para></listitem>
2619 <term><parameter>ping_reply_proc</parameter></term>
2620 <listitem><para>The callback to invoke when the Ping reply arrives.</para></listitem>
2623 <term><parameter>client_data</parameter></term>
2624 <listitem><para>This pointer will be passed to the <function>IcePingReplyProc</function> callback.</para></listitem>
2630 When the Ping reply is ready (if ever),
2631 the <function>IcePingReplyProc</function> callback will be invoked. A
2632 session manager should have some sort of timeout period, after which
2633 it assumes the client has unexpectedly died.
2638 <funcdef>typedef void (*<function>IcePingReplyProc</function>)</funcdef>
2639 <paramdef>IceConn <parameter>ice_conn</parameter></paramdef>
2640 <paramdef>IcePointer <parameter>client_data</parameter></paramdef>
2644 <variablelist remap='IP'>
2646 <term><parameter>ice_conn</parameter></term>
2647 <listitem><para>A valid ICE connection object.</para></listitem>
2650 <term><parameter>client_data</parameter></term>
2651 <listitem><para>The client data specified in the call to <function>IcePing</function></para></listitem>
2657 <sect1 id='cleaning_up_after_a_client_disconnects'>
2658 <title>Cleaning Up After a Client Disconnects</title>
2661 When the session manager receives a “Connection Closed”
2662 message or otherwise detects that the client aborted the connection,
2663 it should call the <function>SmsCleanUp</function> function in order
2664 to free up the connection object.
2669 <funcdef>void <function>SmsCleanUp</function></funcdef>
2670 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2674 <variablelist remap='IP'>
2676 <term><parameter>sms_conn</parameter></term>
2677 <listitem><para>The session management connection object.</para></listitem>
2683 <sect1 id='using_sms_informational_functions'>
2684 <title>Using Sms Informational Functions</title>
2688 <funcdef>int <function>SmsProtocolVersion</function></funcdef>
2689 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2694 <function>SmsProtocolVersion</function> returns the major version of
2695 the session management protocol associated with this session.
2700 <funcdef>int <function>SmsProtocolRevision</function></funcdef>
2701 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2706 <function>SmsProtocolRevision</function> returns the minor version of
2707 the session management protocol associated with this session.
2712 <funcdef>char *<function>SmsClientID</function></funcdef>
2713 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2718 <function>SmsClientID</function> returns a null-terminated string for
2719 the client ID associated with this connection. You should
2720 call <function>free</function> on this pointer when the client ID is
2726 To obtain the host name of a client,
2727 use <function>SmsClientHostName</function>.
2728 This host name will be needed to restart the client.
2733 <funcdef>char *<function>SmsClientHostName</function></funcdef>
2734 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2739 The string returned is of the form
2740 <parameter>protocol</parameter><literal>/</literal><parameter>hostname</parameter>,
2741 where <parameter>protocol</parameter> is one of
2742 {<literal>tcp</literal>, <literal>decnet</literal>, <literal>local</literal>}.
2743 You should call <function>free</function> on the string returned when
2744 it is no longer needed.
2749 <funcdef>IceConn <function>SmsGetIceConnection</function></funcdef>
2750 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2755 <function>SmsGetIceConnection</function> returns the ICE connection
2756 object associated with this session management connection object. The
2757 ICE connection object can be used to get some additional information
2758 about the connection. Some of the more useful functions which can be
2759 used on the IceConn are <function>IceConnectionNumber</function>
2760 and <function>IceLastSequenceNumber</function>.
2761 For further information, see the
2762 <citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
2767 <sect1 id='error_handling2'>
2768 <title>Error Handling</title>
2771 If the session manager receives an unexpected protocol error from a
2772 client, an error handler is invoked by SMlib. A default error handler
2773 exists which simply prints the error message (it does not exit). The
2774 session manager can change this error handler by
2775 calling <function>SmsSetErrorHandler</function>.
2780 <funcdef>SmsErrorHandler <function>SmsSetErrorHandler</function></funcdef>
2781 <paramdef>SmsErrorHandler <parameter>handler</parameter></paramdef>
2786 The error handler. You should pass <constant>NULL</constant>
2787 to restore the default handler.
2791 <function>SmsSetErrorHandler</function> returns the previous error handler.
2792 The <function>SmsErrorHandler</function> has the following type:
2797 <funcdef>typedef void (*<function>SmsErrorHandler</function>)</funcdef>
2798 <paramdef>SmsConn <parameter>sms_conn</parameter></paramdef>
2799 <paramdef>Bool <parameter>swap</parameter></paramdef>
2800 <paramdef>int <parameter>offending_minor_opcode</parameter></paramdef>
2801 <paramdef>unsigned long <parameter>offending_sequence_num</parameter></paramdef>
2802 <paramdef>int <parameter>error_class</parameter></paramdef>
2803 <paramdef>int <parameter>severity</parameter></paramdef>
2804 <paramdef>IcePointer <parameter>values</parameter></paramdef>
2808 <variablelist remap='IP'>
2810 <term><parameter>sms_conn</parameter></term>
2811 <listitem><para>The session management connection object.</para></listitem>
2814 <term><parameter>swap</parameter></term>
2815 <listitem><para>A flag which indicates if the specified values need byte swapping.</para></listitem>
2818 <term><parameter>offending_minor_opcode</parameter></term>
2819 <listitem><para>The minor opcode of the offending message.</para></listitem>
2822 <term><parameter>offending_sequence_num</parameter></term>
2823 <listitem><para>The sequence number of the offending message.</para></listitem>
2826 <term><parameter>error_class</parameter></term>
2827 <listitem><para>The error class of the offending message.</para></listitem>
2830 <term><parameter>severity</parameter></term>
2832 <constant>IceCanContinue</constant>,
2833 <constant>IceFatalToProtocol</constant>, or
2834 <constant>IceFatalToConnection</constant>
2838 <term><parameter>values</parameter></term>
2839 <listitem><para>Any additional error values specific to the minor opcode and class.</para></listitem>
2844 Note that this error handler is invoked for protocol related errors.
2845 To install an error handler to be invoked when an IO error occurs,
2846 use <function>IceSetIOErrorHandler</function>.
2847 For further information, see the
2848 <citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
2854 <chapter id='session_management_properties'>
2855 <title>Session Management Properties</title>
2858 Each property is defined by the <structname>SmProp</structname> structure:
2862 char *name; /* name of property */
2863 char *type; /* type of property */
2864 int num_vals; /* number of values */
2865 SmPropValue *vals; /* the list of values */
2869 int length; /* the length of the value */
2870 SmPointer value; /* the value */
2876 The X Session Management Protocol defines a list of predefined
2877 properties, several of which are required to be set by the client.
2878 The following table specifies the predefined properties and indicates
2879 which ones are required. Each property has a type associated with it.
2883 A type of <type>SmCARD8</type> indicates that there is a single 1-byte value.
2884 A type of <type>SmARRAY8</type> indicates that there is a single array of bytes.
2885 A type of <type>SmLISTofARRAY8</type> indicates that there is a list of array of
2889 <informaltable pgwide='0' frame='none'>
2890 <tgroup cols='4' align='center'>
2891 <colspec colname='c1'/>
2892 <colspec colname='c2'/>
2893 <colspec colname='c3'/>
2894 <colspec colname='c4'/>
2897 <entry align='left'>Name</entry>
2898 <entry align='left'>Type</entry>
2899 <entry align='left'><acronym>POSIX</acronym> Type</entry>
2900 <entry align='center'>Required</entry>
2905 <entry align='left'><property>SmCloneCommand</property></entry>
2906 <entry align='left'>OS-specific</entry>
2907 <entry align='left'><type>SmLISTofARRAY8</type></entry>
2908 <entry align='center'>Yes</entry>
2911 <entry align='left'><property>SmCurrentDirectory</property></entry>
2912 <entry align='left'>OS-specific</entry>
2913 <entry align='left'><type>SmARRAY8</type></entry>
2914 <entry align='center'>No</entry>
2917 <entry align='left'><property>SmDiscardCommand</property></entry>
2918 <entry align='left'>OS-specific</entry>
2919 <entry align='left'><type>SmLISTofARRAY8</type></entry>
2920 <entry align='center'>No*</entry>
2923 <entry align='left'><property>SmEnvironment</property></entry>
2924 <entry align='left'>OS-specific</entry>
2925 <entry align='left'><type>SmLISTofARRAY8</type></entry>
2926 <entry align='center'>No</entry>
2929 <entry align='left'><property>SmProcessID</property></entry>
2930 <entry align='left'>OS-specific</entry>
2931 <entry align='left'><type>SmARRAY8</type></entry>
2932 <entry align='center'>No</entry>
2935 <entry align='left'><property>SmProgram</property></entry>
2936 <entry align='left'>OS-specific</entry>
2937 <entry align='left'><type>SmARRAY8</type></entry>
2938 <entry align='center'>Yes</entry>
2941 <entry align='left'><property>SmRestartCommand</property></entry>
2942 <entry align='left'>OS-specific</entry>
2943 <entry align='left'><type>SmLISTofARRAY8</type></entry>
2944 <entry align='center'>Yes</entry>
2947 <entry align='left'><property>SmResignCommand</property></entry>
2948 <entry align='left'>OS-specific</entry>
2949 <entry align='left'><type>SmLISTofARRAY8</type></entry>
2950 <entry align='center'>No</entry>
2953 <entry align='left'><property>SmRestartStyleHint</property></entry>
2954 <entry align='left'><type>SmCARD8</type></entry>
2955 <entry align='left'><type>SmCARD8</type></entry>
2956 <entry align='center'>No</entry>
2959 <entry align='left'><property>SmShutdownCommand</property></entry>
2960 <entry align='left'>OS-specific</entry>
2961 <entry align='left'><type>SmLISTofARRAY8</type></entry>
2962 <entry align='center'>No</entry>
2965 <entry align='left'><property>SmUserID</property></entry>
2966 <entry align='left'><type>SmARRAY8</type></entry>
2967 <entry align='left'><type>SmARRAY8</type></entry>
2968 <entry align='center'>Yes</entry>
2975 * Required if any state is stored in an external repository (for
2976 example, state file).
2979 <itemizedlist mark='bullet'>
2980 <listitem><para><property>SmCloneCommand</property></para>
2982 This is like the <property>SmRestartCommand</property>, except it restarts a
2983 copy of the application. The only difference is that the application does not
2984 supply its client ID at register time. On <acronym>POSIX</acronym> systems,
2985 this should be of type <type>SmLISTofARRAY8</type>.
2987 <listitem><para><property>SmCurrentDirectory</property></para>
2989 On <acronym>POSIX</acronym>-based systems, this specifies the value of the
2990 current directory that needs to be set up prior to starting the
2991 <property>SmProgram</property> and should of type <type>SmARRAY8</type>.
2993 <listitem><para><property>SmDiscardCommand</property></para>
2995 The discard command contains a command that when delivered to the host
2996 that the client is running on (determined from the connection), will
2997 cause it to discard any information about the current state. If this
2998 command is not specified, the Session Manager will assume that all of
2999 the client's state is encoded in the <property>SmRestartCommand</property>.
3000 On <acronym>POSIX</acronym> systems, the type should be
3001 <type>SmLISTofARRAY8</type>.
3003 <listitem><para><property>SmEnvironment</property></para>
3005 On <acronym>POSIX</acronym> based systems, this will be of type
3006 <type>SmLISTofARRAY8</type>, where the <type>ARRAY8</type>s alternate between
3007 environment variable name and environment variable value.
3009 <listitem><para><property>SmProcessID</property></para>
3011 This specifies an OS-specific identifier for the process.
3012 On <acronym>POSIX</acronym> systems, this should contain the return value
3013 of <function>getpid</function> turned into a Latin-1 (decimal) string.
3015 <listitem><para><property>SmProgram</property></para>
3017 This is the name of the program that is running. On <acronym>POSIX</acronym>
3018 systems, this should be first parameter passed to <function>execve</function>
3019 and should be of type <type>SmARRAY8</type>.
3021 <listitem><para><property>SmRestartCommand</property></para>
3023 The restart command contains a command that, when delivered to the
3024 host that the client is running on (determined from the connection),
3025 will cause the client to restart in its current state.
3026 On <acronym>POSIX</acronym>-based systems, this is of
3027 type <type>SmLISTofARRAY8</type>, and each of the elements in
3028 the array represents an element in the <varname>argv</varname>
3029 array. This restart command should ensure that the client restarts
3030 with the specified client-ID.
3032 <listitem><para><property>SmResignCommand</property></para>
3034 A client that sets the <property>SmRestartStyleHint</property>
3035 to <constant>SmRestartAnyway</constant> uses this property to specify a
3036 command that undoes the effect of the client and removes any saved state.
3037 As an example, consider a user that runs <command>xmodmap</command> which
3038 registers with the Session Manager,
3039 sets <property>SmRestartStyleHint</property>
3040 to <constant>SmRestartAnyway</constant>, and then
3041 terminates. To allow the Session Manager (at the user's request) to
3042 undo this, <command>xmodmap</command> would register a
3043 <property>SmResignCommand</property> that undoes the effects of
3044 the <command>xmodmap</command>.
3046 <listitem><para><property>SmRestartStyleHint</property></para>
3048 If the <property>SmRestartStyleHint</property> is present, it will contain the
3049 style of restarting the client prefers. If this style is not specified,
3050 <constant>SmRestartIfRunning</constant> is assumed.
3051 The possible values are as follows:
3053 <informaltable pgwide='0' frame='none'>
3054 <tgroup cols='2' align='center'>
3055 <colspec colname='c1'/>
3056 <colspec colname='c2'/>
3059 <entry align='left'>Name</entry>
3060 <entry align='right'>Value</entry>
3065 <entry align='left'><constant>SmRestartIfRunning</constant></entry>
3066 <entry align='right'>0</entry>
3069 <entry align='left'><constant>SmRestartAnyway</constant></entry>
3070 <entry align='right'>1</entry>
3073 <entry align='left'><constant>SmRestartImmediately</constant></entry>
3074 <entry align='right'>2</entry>
3077 <entry align='left'><constant>SmRestartNever</constant></entry>
3078 <entry align='right'>3</entry>
3086 The <constant>SmRestartIfRunning</constant> style is used in the usual case.
3087 The client should be restarted in the next session if it was running at
3088 the end of the current session.
3092 The <constant>SmRestartAnyway</constant> style is used to tell the Session
3093 Manager that the application should be restarted in the next session even if
3094 it exits before the current session is terminated. It should be noted that
3095 this is only a hint and the Session Manager will follow the policies
3096 specified by its users in determining what applications to restart.
3100 A client that uses <constant>SmRestartAnyway</constant> should also set the
3101 <property>SmResignCommand</property> and <property>SmShutdownCommand</property>
3102 properties to commands that undo the state of the client after it exits.
3106 The SmRestartImmediately style is like SmRestartAnyway, but, in addition, the client is meant to run continuously. If the client exits, the Session Manager should try to restart it in the current session.
3110 <constant>SmRestartNever</constant> style specifies that the client does not
3111 wish to be restarted in the next session.
3114 <listitem><para><property>SmShutdownCommand</property></para>
3116 This command is executed at shutdown time to clean up after a client
3117 that is no longer running but retained its state by setting
3118 <property>SmRestartStyleHint</property> to
3119 <constant>SmRestartAnyway</constant>. The client must not remove any saved
3120 state as the client is still part of the session. As an
3121 example, consider a client that turns on a camera at start up time.
3122 This client then exits. At session shutdown, the user wants the
3123 camera turned off. This client would set the
3124 <property>SmRestartStyleHint</property> to
3125 <constant>SmRestartAnyway</constant> and would register
3126 a <property>SmShutdownCommand</property> that would turn off the camera.
3128 <listitem><para><property>SmUserID</property></para>
3130 Specifies the user ID. On <acronym>POSIX</acronym>-based systems, this will
3131 contain the user's name (the <structfield>pw_name</structfield> member of
3132 <structname>struct passwd</structname>).
3137 <chapter id='freeing_data'>
3138 <title>Freeing Data</title>
3141 To free an individual property, use <function>SmFreeProperty</function>
3146 <funcdef>void <function>SmFreeProperty</function></funcdef>
3147 <paramdef>SmProp *<parameter>prop</parameter></paramdef>
3151 <variablelist remap='IP'>
3153 <term><parameter>prop</parameter></term>
3154 <listitem><para>The property to free.</para></listitem>
3159 To free the reason strings from
3160 the <function>SmsCloseConnectionProc</function> callback,
3161 use <function>SmFreeReasons</function>
3166 <funcdef>void <function>SmFreeReasons</function></funcdef>
3167 <paramdef>int <parameter>count</parameter></paramdef>
3168 <paramdef>char **<parameter>reasons</parameter></paramdef>
3172 <variablelist remap='IP'>
3174 <term><parameter>count</parameter></term>
3175 <listitem><para>The number of reason strings.</para></listitem>
3178 <term><parameter>reasons</parameter></term>
3179 <listitem><para>The list of reason strings to free.</para></listitem>
3184 <chapter id='authentication_of_clients'>
3185 <title>Authentication of Clients</title>
3188 As stated earlier, the session management protocol is layered on top
3189 of ICE. Authentication occurs at two levels in the ICE protocol:
3191 <itemizedlist mark='bullet'>
3192 <listitem><para>The first is when an ICE connection is opened.</para></listitem>
3193 <listitem><para>The second is when a Protocol Setup occurs on an ICE connection.</para></listitem>
3198 The authentication methods that are available are
3199 implementation-dependent (that is., dependent on the ICElib and SMlib
3200 implementations in use). For further information, see the
3201 <citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
3206 <chapter id='working_in_a_multithreaded_environment'>
3207 <title>Working in a Multi-Threaded Environment</title>
3210 To declare that multiple threads in an application will be using SMlib
3211 (or any other library layered on top of ICElib), you should
3212 call <function>IceInitThreads</function>.
3213 For further information, see the
3214 <citetitle pubwork='article'>Inter-Client Exchange Library</citetitle>
3219 <chapter id='acknowledgements'>
3220 <title>Acknowledgements</title>
3223 Thanks to the following people for their participation in the
3224 X Session Management design: Jordan Brown, Ellis Cohen, Donna Converse,
3225 Stephen Gildea, Vania Joloboff, Stuart Marks, Bob Scheifler, Ralph Swick,