/usr/share/doc/libsm-dev/SMlib.html is in libsm-doc 2:1.2.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>X Session Management Library</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><style xmlns="" type="text/css">/*
* Copyright (c) 2011 Gaetan Nadon
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/*
* Shared stylesheet for X.Org documentation translated to HTML format
* http://www.sagehill.net/docbookxsl/UsingCSS.html
* http://www.w3schools.com/css/default.asp
* https://addons.mozilla.org/en-US/firefox/addon/web-developer/developers
* https://addons.mozilla.org/en-US/firefox/addon/font-finder/
*/
/*
* The sans-serif fonts are considered more legible on a computer screen
* http://dry.sailingissues.com/linux-equivalents-verdana-arial.html
*
*/
body {
font-family: "Bitstream Vera Sans", "DejaVu Sans", Tahoma, Geneva, Arial, Sans-serif;
/* In support of using "em" font size unit, the w3c recommended method */
font-size: 100%;
}
/*
* Selection: all elements requiring mono spaced fonts.
*
* The family names attempt to match the proportionally spaced font
* family names such that the same font name is used for both.
* We'd like to use Bitstream, for example, in both proportionally and
* mono spaced font text.
*/
.command,
.errorcode,
.errorname,
.errortype,
.filename,
.funcsynopsis,
.function,
.parameter,
.programlisting,
.property,
.screen,
.structname,
.symbol,
.synopsis,
.type
{
font-family: "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Courier, "Liberation Mono", Monospace;
}
/*
* Books have a title page, a preface, some chapters and appendices,
* a glossary, an index and a bibliography, in that order.
*
* An Article has no preface and no chapters. It has sections, appendices,
* a glossary, an index and a bibliography.
*/
/*
* Selection: book main title and subtitle
*/
div.book>div.titlepage h1.title,
div.book>div.titlepage h2.subtitle {
text-align: center;
}
/*
* Selection: article main title and subtitle
*/
div.article>div.titlepage h2.title,
div.article>div.titlepage h3.subtitle,
div.article>div.sect1>div.titlepage h2.title,
div.article>div.section>div.titlepage h2.title {
text-align: center;
}
/*
* Selection: various types of authors and collaborators, individuals or corporate
*
* These authors are not always contained inside an authorgroup.
* They can be contained inside a lot of different parent types where they might
* not be centered.
* Reducing the margin at the bottom makes a visual separation between authors
* We specify here the ones on the title page, others may be added based on merit.
*/
div.titlepage .authorgroup,
div.titlepage .author,
div.titlepage .collab,
div.titlepage .corpauthor,
div.titlepage .corpcredit,
div.titlepage .editor,
div.titlepage .othercredit {
text-align: center;
margin-bottom: 0.25em;
}
/*
* Selection: the affiliation of various types of authors and collaborators,
* individuals or corporate.
*/
div.titlepage .affiliation {
text-align: center;
}
/*
* Selection: product release information (X Version 11, Release 7)
*
* The releaseinfo element can be contained inside a lot of different parent
* types where it might not be centered.
* We specify here the one on the title page, others may be added based on merit.
*/
div.titlepage p.releaseinfo {
font-weight: bold;
text-align: center;
}
/*
* Selection: publishing date
*/
div.titlepage .pubdate {
text-align: center;
}
/*
* The legal notices are displayed in smaller sized fonts
* Justification is only supported in IE and therefore not requested.
*
*/
.legalnotice {
font-size: small;
font-style: italic;
}
/*
* Selection: book or article main ToC title
* A paragraph is generated for the title rather than a level 2 heading.
* We do not want to select chapters sub table of contents, only the main one
*/
div.book>div.toc>p,
div.article>div.toc>p {
font-size: 1.5em;
text-align: center;
}
/*
* Selection: major sections of a book or an article
*
* Unlike books, articles do not have a titlepage element for appendix.
* Using the selector "div.titlepage h2.title" would be too general.
*/
div.book>div.preface>div.titlepage h2.title,
div.book>div.chapter>div.titlepage h2.title,
div.article>div.sect1>div.titlepage h2.title,
div.article>div.section>div.titlepage h2.title,
div.book>div.appendix>div.titlepage h2.title,
div.article>div.appendix h2.title,
div.glossary>div.titlepage h2.title,
div.index>div.titlepage h2.title,
div.bibliography>div.titlepage h2.title {
/* Add a border top over the major parts, just like printed books */
/* The Gray color is already used for the ruler over the main ToC. */
border-top-style: solid;
border-top-width: 2px;
border-top-color: Gray;
/* Put some space between the border and the title */
padding-top: 0.2em;
text-align: center;
}
/*
* A Screen is a verbatim environment for displaying text that the user might
* see on a computer terminal. It is often used to display the results of a command.
*
* http://www.css3.info/preview/rounded-border/
*/
.screen {
background: #e0ffff;
border-width: 1px;
border-style: solid;
border-color: #B0C4DE;
border-radius: 1.0em;
/* Browser's vendor properties prior to CSS 3 */
-moz-border-radius: 1.0em;
-webkit-border-radius: 1.0em;
-khtml-border-radius: 1.0em;
margin-left: 1.0em;
margin-right: 1.0em;
padding: 0.5em;
}
/*
* Emphasis program listings with a light shade of gray similar to what
* DocBook XSL guide does: http://www.sagehill.net/docbookxsl/ProgramListings.html
* Found many C API docs on the web using like shades of gray.
*/
.programlisting {
background: #F4F4F4;
border-width: 1px;
border-style: solid;
border-color: Gray;
padding: 0.5em;
}
/*
* Emphasis functions synopsis using a darker shade of gray.
* Add a border such that it stands out more.
* Set the padding so the text does not touch the border.
*/
.funcsynopsis, .synopsis {
background: #e6e6fa;
border-width: 1px;
border-style: solid;
border-color: Gray;
clear: both;
margin: 0.5em;
padding: 0.25em;
}
/*
* Selection: paragraphs inside synopsis
*
* Removes the default browser margin, let the container set the padding.
* Paragraphs are not always used in synopsis
*/
.funcsynopsis p,
.synopsis p {
margin: 0;
padding: 0;
}
/*
* Selection: variable lists, informal tables and tables
*
* Note the parameter name "variablelist.as.table" in xorg-xhtml.xsl
* A table with rows and columns is constructed inside div.variablelist
*
* Set the left margin so it is indented to the right
* Display informal tables with single line borders
*/
table {
margin-left: 0.5em;
border-collapse: collapse;
}
/*
* Selection: paragraphs inside tables
*
* Removes the default browser margin, let the container set the padding.
* Paragraphs are not always used in tables
*/
td p {
margin: 0;
padding: 0;
}
/*
* Add some space between the left and right column.
* The vertical alignment helps the reader associate a term
* with a multi-line definition.
*/
td, th {
padding-left: 1.0em;
padding-right: 1.0em;
vertical-align: top;
}
.warning {
border: 1px solid red;
background: #FFFF66;
padding-left: 0.5em;
}
</style></head><body><div class="book" title="X Session Management Library"><div class="titlepage"><div><div><h1 class="title"><a id="SMlib"></a>X Session Management Library</h1></div><div><h2 class="subtitle">X Consortium Standard</h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Ralph</span> <span class="surname">Mor</span></h3><div class="affiliation"><span class="orgname">X Consortium<br /></span></div></div></div></div><div><p class="releaseinfo">X Version 11, Release 7.6</p></div><div><p class="releaseinfo">Version 1.0</p></div><div><p class="copyright">Copyright © 1993, 1994 X Consortium</p></div><div><div class="legalnotice" title="Legal Notice"><a id="idp2824448"></a><p>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
</p><p>
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
</p><p>
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</p><p>
Except as contained in this notice, the name of the X Consortium shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from the X Consortium.
</p><p>
X Window System is a trademark of The Open Group.
</p></div></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="chapter"><a href="#Overview_of_Session_Management">1. Overview of Session Management</a></span></dt><dt><span class="chapter"><a href="#The_Session_Management_Library">2. The Session Management Library</a></span></dt><dt><span class="chapter"><a href="#Understanding_SMlibs_Dependence_on_ICE">3. Understanding SMlib's Dependence on ICE</a></span></dt><dt><span class="chapter"><a href="#Header_Files_and_Library_Name">4. Header Files and Library Name</a></span></dt><dt><span class="chapter"><a href="#Session_Management_Client_Smc_Functions">5. Session Management Client (<acronym class="acronym">Smc</acronym>) Functions</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Connecting_to_the_Session_Manager">Connecting to the Session Manager</a></span></dt><dd><dl><dt><span class="sect2"><a href="#The_Save_Yourself_Callback">The Save Yourself Callback</a></span></dt><dt><span class="sect2"><a href="#The_Die_Callback">The Die Callback</a></span></dt><dt><span class="sect2"><a href="#The_Save_Complete_Callback">The Save Complete Callback</a></span></dt><dt><span class="sect2"><a href="#The_Shutdown_Cancelled_Callback">The Shutdown Cancelled Callback</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Closing_the_Connection">Closing the Connection</a></span></dt><dt><span class="sect1"><a href="#Modifying_Callbacks">Modifying Callbacks</a></span></dt><dt><span class="sect1"><a href="#Setting_Deleting_and_Retrieving_Session_Management_Properties">Setting, Deleting, and Retrieving Session Management Properties</a></span></dt><dt><span class="sect1"><a href="#Interacting_With_the_User">Interacting With the User</a></span></dt><dt><span class="sect1"><a href="#Requesting_a_Save_Yourself">Requesting a Save Yourself</a></span></dt><dt><span class="sect1"><a href="#Requesting_a_Save_Yourself_Phase_2_2">Requesting a Save Yourself Phase 2</a></span></dt><dt><span class="sect1"><a href="#Completing_a_Save_Yourself">Completing a Save Yourself</a></span></dt><dt><span class="sect1"><a href="#Using_Smc_Informational_Functions">Using Smc Informational Functions</a></span></dt><dt><span class="sect1"><a href="#Error_Handling">Error Handling</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Session_Management_Server_Sms_Functions">6. Session Management Server (<acronym class="acronym">Sms</acronym>) Functions</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Initializing_the_Library">Initializing the Library</a></span></dt><dd><dl><dt><span class="sect2"><a href="#The_Register_Client_Callback">The Register Client Callback</a></span></dt><dt><span class="sect2"><a href="#The_Interact_Request_Callback">The Interact Request Callback</a></span></dt><dt><span class="sect2"><a href="#The_Interact_Done_Callback">The Interact Done Callback</a></span></dt><dt><span class="sect2"><a href="#The_Save_Yourself_Request_Callback">The Save Yourself Request Callback</a></span></dt><dt><span class="sect2"><a href="#The_Save_Yourself_Phase_2_Request_Callback">The Save Yourself Phase 2 Request Callback</a></span></dt><dt><span class="sect2"><a href="#The_Save_Yourself_Done_Callback">The Save Yourself Done Callback</a></span></dt><dt><span class="sect2"><a href="#The_Connection_Closed_Callback">The Connection Closed Callback</a></span></dt><dt><span class="sect2"><a href="#The_Set_Properties_Callback">The Set Properties Callback</a></span></dt><dt><span class="sect2"><a href="#The_Delete_Properties_Callback">The Delete Properties Callback</a></span></dt><dt><span class="sect2"><a href="#The_Get_Properties_Callback">The Get Properties Callback</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Registering_the_Client">Registering the Client</a></span></dt><dt><span class="sect1"><a href="#Sending_a_Save_Yourself_Message">Sending a Save Yourself Message</a></span></dt><dt><span class="sect1"><a href="#Sending_a_Save_Yourself_Phase_2_Message">Sending a Save Yourself Phase 2 Message</a></span></dt><dt><span class="sect1"><a href="#Sending_an_Interact_Message">Sending an Interact Message</a></span></dt><dt><span class="sect1"><a href="#Sending_a_Save_Complete_Message">Sending a Save Complete Message</a></span></dt><dt><span class="sect1"><a href="#Sending_a_Die_Message">Sending a Die Message</a></span></dt><dt><span class="sect1"><a href="#Cancelling_a_Shutdown">Cancelling a Shutdown</a></span></dt><dt><span class="sect1"><a href="#Returning_Properties">Returning Properties</a></span></dt><dt><span class="sect1"><a href="#Pinging_a_Client">Pinging a Client</a></span></dt><dt><span class="sect1"><a href="#Cleaning_Up_After_a_Client_Disconnects">Cleaning Up After a Client Disconnects</a></span></dt><dt><span class="sect1"><a href="#Using_Sms_Informational_Functions">Using Sms Informational Functions</a></span></dt><dt><span class="sect1"><a href="#Error_Handling_2">Error Handling</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Session_Management_Properties">7. Session Management Properties</a></span></dt><dt><span class="chapter"><a href="#Freeing_Data">8. Freeing Data</a></span></dt><dt><span class="chapter"><a href="#Authentication_of_Clients">9. Authentication of Clients</a></span></dt><dt><span class="chapter"><a href="#Working_in_a_Multi_Threaded_Environment">10. Working in a Multi-Threaded Environment</a></span></dt><dt><span class="chapter"><a href="#Acknowledgements">11. Acknowledgements</a></span></dt></dl></div><div class="chapter" title="Chapter 1. Overview of Session Management"><div class="titlepage"><div><div><h2 class="title"><a id="Overview_of_Session_Management"></a>Chapter 1. Overview of Session Management</h2></div></div></div><div class="abstract" title="Abstract"><div class="titlepage"></div><p>
The purpose of the X Session Management Protocol (<acronym class="acronym">XSMP</acronym>)
is to provide a uniform mechanism for users to save and restore their
sessions. A <em class="firstterm">session</em> is a group of clients,
each of which has a particular state. The session is controlled by a
network service called the <em class="firstterm">session manager</em>.
The session manager issues commands to its clients on behalf of the
user. These commands may cause clients to save their state or to
terminate. It is expected that the client will save its state in such
a way that the client can be restarted at a later time and resume its
operation as if it had never been terminated. A client's state might
include information about the file currently being edited, the current
position of the insertion point within the file, or the start of an
uncommitted transaction. The means by which clients are restarted is
unspecified by this protocol.
</p><p>
For purposes of this protocol, a <em class="firstterm">client</em> of the
session manager is defined as a connection to the session manager. A
client is typically, though not necessarily, a process running an
application program connected to an X display. However, a client may
be connected to more than one X display or not be connected to any X
displays at all.
</p></div></div><div class="chapter" title="Chapter 2. The Session Management Library"><div class="titlepage"><div><div><h2 class="title"><a id="The_Session_Management_Library"></a>Chapter 2. The Session Management Library</h2></div></div></div><div class="abstract" title="Abstract"><div class="titlepage"></div><p>
The Session Management Library (<abbr class="abbrev">SMlib</abbr>) is a low-level
"C" language interface to XSMP. It is expected that higher level
toolkits, such as Xt, will hide many of the details of session
management from clients. Higher level toolkits might also be developed
for session managers to use, but no such effort is currently under way.
</p></div><p>
SMlib has two parts to it:
</p><div class="itemizedlist"><ul class="itemizedlist" type="bullet"><li class="listitem" style="list-style-type: disc"><p>One set of functions for clients that want to be part of a session</p></li><li class="listitem" style="list-style-type: disc"><p>One set of functions for session managers to call</p></li></ul></div><p>
</p><p>
Some applications will use both sets of functions and act as
<em class="firstterm">nested session managers</em>. That is, they will be
both a session manager and a client of another session. An example is
a mail program that could start a text editor for editing the text of
a mail message. The mail program is part of a regular session and, at
the same time, is also acting as a session manager to the editor.
</p><p>
Clients initialize by connecting to the session manager and obtaining
a <em class="firstterm">client-ID</em> that uniquely identifies them in
the session. The session manager maintains a list of properties for
each client in the session. These properties describe the client's
environment and, most importantly, describe how the client can be
restarted (via an <span class="property">SmRestartCommand</span>). Clients are
expected to save their state in such a way as to allow multiple
instantiations of themselves to be managed independently. For
example, clients may use their client-ID as part of a filename in
which to store the state for a particular instantiation. The
client-ID should be saved as part of the <span class="property">SmRestartCommand</span>
so that the client will retain the same ID after it is restarted.
</p><p>
Once the client initializes itself with the session manager, it must
be ready to respond to messages from the session manager. For
example, it might be asked to save its state or to terminate. In the
case of a shutdown, the session manager might give each client a
chance to interact with the user and cancel the shutdown.
</p></div><div class="chapter" title="Chapter 3. Understanding SMlib's Dependence on ICE"><div class="titlepage"><div><div><h2 class="title"><a id="Understanding_SMlibs_Dependence_on_ICE"></a>Chapter 3. Understanding SMlib's Dependence on ICE</h2></div></div></div><p>
The X Session Management Protocol is layered on top of the
Inter-Client Exchange (<acronym class="acronym">ICE</acronym>) Protocol. The ICE
protocol is designed to multiplex several protocols over a single
connection. As a result, working with SMlib requires a little
knowledge of how the ICE library works.
</p><p>
The ICE library utilizes callbacks to process messages. When a client
detects that there is data to read on an ICE connection, it should
call the <span class="olink"><code class="function">IceProcessMessages</code></span> function.
<span class="olink"><code class="function">IceProcessMessages</code></span> will read the message header
and look at the major opcode in order to determine which protocol the
message was intended for. The appropriate protocol library will then
be triggered to unpack the message and hand it off to the client via a
callback.
</p><p>
The main point to be aware of is that an application using SMlib must
have some code that detects when there is data to read on an ICE
connection. This can be done via a <code class="function">select</code> call
on the file descriptor for the ICE connection, but more
typically, <code class="function">XtAppAddInput</code> will be used to register
a callback that will invoke <span class="olink"><code class="function">IceProcessMessages</code></span>
each time there is data to read on the ICE connection.
</p><p>
To further complicate things, knowing which file descriptors to
call <code class="function">select</code> on requires an understanding of how
ICE connections are created. On the client side, a call must be made
to <a class="xref" href="#SmcOpenConnection"><code class="function">SmcOpenConnection</code></a> in order to open a connection
with a session manager. <a class="xref" href="#SmcOpenConnection"><code class="function">SmcOpenConnection</code></a> will
internally makea call into <span class="olink"><code class="function">IceOpenConnection</code></span>
which will, in turn, determine if an ICE connection already exists
between the client and session manager. Most likely, a connection
will not already exist and a new ICE connection will be created. The
main point to be aware of is that, on the client side, it is not
obvious when ICE connections get created or destroyed, because
connections are shared when possible. To deal with this, the ICE
library lets the application register watch procedures that will be
invoked each time an ICE connection is opened or closed. These watch
procedures could be used to add or remove ICE file descriptors from
the list of descriptors to call <code class="function">select</code> on.
</p><p>
On the session manager side, things work a bit differently. The
session manager has complete control over the creation of ICE
connections. The session manager has to first
call <span class="olink"><code class="function">IceListenForConnections</code></span> in order to start
listening for connections from clients. Once a connection attempt is
detected, <span class="olink"><code class="function">IceAcceptConnection</code></span> must be called, and
the session manager can simply add the new ICE file descriptor to the
list of descriptors to call <code class="function">select</code> on.
</p><p>
For further information on the library functions related to ICE connections,
see the “<span class="citetitle">Inter-Client Exchange Library</span>”
standard.
</p></div><div class="chapter" title="Chapter 4. Header Files and Library Name"><div class="titlepage"><div><div><h2 class="title"><a id="Header_Files_and_Library_Name"></a>Chapter 4. Header Files and Library Name</h2></div></div></div><p>
Applications (both session managers and clients) should include the
header file <<code class="filename">X11/SM/SMlib.h</code>>.
This header file defines all of the SMlib data structures and function
prototypes. <code class="filename">SMlib.h</code> includes the
header file <<code class="filename">X11/SM/SM.h</code>>,
which defines all of the SMlib constants.
</p><p>
Because SMlib is dependent on ICE, applications should link against
SMlib and ICElib by using
<span class="quote">“<span class="quote"><code class="option">-lSM</code> <code class="option">-lICE</code></span>”</span>.
</p></div><div class="chapter" title="Chapter 5. Session Management Client (Smc) Functions"><div class="titlepage"><div><div><h2 class="title"><a id="Session_Management_Client_Smc_Functions"></a>Chapter 5. Session Management Client (<acronym class="acronym">Smc</acronym>) Functions</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Connecting_to_the_Session_Manager">Connecting to the Session Manager</a></span></dt><dd><dl><dt><span class="sect2"><a href="#The_Save_Yourself_Callback">The Save Yourself Callback</a></span></dt><dt><span class="sect2"><a href="#The_Die_Callback">The Die Callback</a></span></dt><dt><span class="sect2"><a href="#The_Save_Complete_Callback">The Save Complete Callback</a></span></dt><dt><span class="sect2"><a href="#The_Shutdown_Cancelled_Callback">The Shutdown Cancelled Callback</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Closing_the_Connection">Closing the Connection</a></span></dt><dt><span class="sect1"><a href="#Modifying_Callbacks">Modifying Callbacks</a></span></dt><dt><span class="sect1"><a href="#Setting_Deleting_and_Retrieving_Session_Management_Properties">Setting, Deleting, and Retrieving Session Management Properties</a></span></dt><dt><span class="sect1"><a href="#Interacting_With_the_User">Interacting With the User</a></span></dt><dt><span class="sect1"><a href="#Requesting_a_Save_Yourself">Requesting a Save Yourself</a></span></dt><dt><span class="sect1"><a href="#Requesting_a_Save_Yourself_Phase_2_2">Requesting a Save Yourself Phase 2</a></span></dt><dt><span class="sect1"><a href="#Completing_a_Save_Yourself">Completing a Save Yourself</a></span></dt><dt><span class="sect1"><a href="#Using_Smc_Informational_Functions">Using Smc Informational Functions</a></span></dt><dt><span class="sect1"><a href="#Error_Handling">Error Handling</a></span></dt></dl></div><p>
This section discusses how Session Management clients:
</p><div class="itemizedlist"><ul class="itemizedlist" type="bullet"><li class="listitem" style="list-style-type: disc"><p>Connect to the Session Manager</p></li><li class="listitem" style="list-style-type: disc"><p>Close the connection</p></li><li class="listitem" style="list-style-type: disc"><p>Modify callbacks</p></li><li class="listitem" style="list-style-type: disc"><p>Set, delete, and retrieve Session Manager properties</p></li><li class="listitem" style="list-style-type: disc"><p>Interact with the user</p></li><li class="listitem" style="list-style-type: disc"><p>Request a “Save Yourself”</p></li><li class="listitem" style="list-style-type: disc"><p>Request a “Save Yourself Phase 2”</p></li><li class="listitem" style="list-style-type: disc"><p>Complete a “Save Yourself”</p></li><li class="listitem" style="list-style-type: disc"><p>Use Smc informational functions</p></li><li class="listitem" style="list-style-type: disc"><p>Handle Errors</p></li></ul></div><p>
</p><div class="sect1" title="Connecting to the Session Manager"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Connecting_to_the_Session_Manager"></a>Connecting to the Session Manager</h2></div></div></div><p>
To open a connection with a session manager,
use <a class="xref" href="#SmcOpenConnection"><code class="function">SmcOpenConnection</code></a>
</p><div class="funcsynopsis"><a id="SmcOpenConnection"></a><p><code class="funcdef">SmcConn <strong>fsfuncSmcOpenConnection</strong>(</code>char *<var class="pdparam">network_ids_list</var>, SmPointer <var class="pdparam">context</var>, int <var class="pdparam">xsmp_major_rev</var>, int <var class="pdparam">xsmp_minor_rev</var>, unsigned long <var class="pdparam">mask</var>, SmcCallbacks *<var class="pdparam">callbacks</var>, char *<var class="pdparam">previous_id</var>, char **<var class="pdparam">client_id_ret</var>, int <var class="pdparam">error_length</var>, char *<var class="pdparam">error_string_ret</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>network_ids_list</code></em></span></p></td><td><p>Specifies the network ID(s) of the session manager.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>context</code></em></span></p></td><td><p>
A pointer to an opaque object or <code class="constant">NULL</code>. Used to determine
if an ICE connection can be shared
(see <a class="link" href="#context_sharing">below</a>).
</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>xsmp_major_rev</code></em></span></p></td><td><p>
The highest major version of the XSMP the application supports.
</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>xsmp_minor_rev</code></em></span></p></td><td><p>
The highest minor version of the XSMP the application supports (for
the specified <em class="parameter"><code>xsmp_major_rev</code></em>).
</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>mask</code></em></span></p></td><td><p>A mask indicating which callbacks to register.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>callbacks</code></em></span></p></td><td><p>
The callbacks to register. These callbacks are used to respond to
messages from the session manager.
</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>previous_id</code></em></span></p></td><td><p>The client ID from the previous session.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_id_ret</code></em></span></p></td><td><p>The client ID for the current session is returned.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>error_length</code></em></span></p></td><td><p>Length of the <em class="parameter"><code>error_string_ret</code></em> argument passed in.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>error_string_ret</code></em></span></p></td><td><p>
Returns a null-terminated error message, if any.
The <em class="parameter"><code>error_string_ret</code></em> argument points to user supplied
memory. No more than <em class="parameter"><code>error_length</code></em> bytes are used.
</p></td></tr></tbody></table></div><p>
The <em class="parameter"><code>network_ids_list</code></em> argument is a
null-terminated string containing a list of network IDs for the session
manager, separated by commas. If <em class="parameter"><code>network_ids_list</code></em>
is <code class="constant">NULL</code>, the value of
the <code class="envar">SESSION_MANAGER</code> environment variable will be used.
Each network ID has the following format:
</p><div class="informaltable"><table border="0"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><tbody><tr><td align="left"><code class="literal">tcp/</code><em class="parameter"><code><hostname></code></em><code class="literal">:</code><em class="parameter"><code><portnumber></code></em></td><td align="left">or</td></tr><tr><td align="left"><code class="literal">decnet/</code><em class="parameter"><code><hostname></code></em><code class="literal">::</code><em class="parameter"><code><objname></code></em></td><td align="left">or</td></tr><tr><td align="left"><code class="literal">local/</code><em class="parameter"><code><hostname></code></em><code class="literal">:</code><em class="parameter"><code><path></code></em></td><td align="left"> </td></tr></tbody></table></div><p>
</p><p>
An attempt will be made to use the first network ID. If that fails,
an attempt will be made using the second network ID, and so on.
</p><p>
After the connection is established, <a class="xref" href="#SmcOpenConnection"><code class="function">SmcOpenConnection</code></a>
registers the client with the session manager. If the client is being
restarted from a previous session, <em class="parameter"><code>previous_id</code></em>
should contain a null terminated string representing the client ID from the
previous session. If the client is first joining the session,
<em class="parameter"><code>previous_id</code></em> should be set to <code class="constant">NULL</code>.
If <em class="parameter"><code>previous_id</code></em> is specified but is determined
to be invalid by the session manager, SMlib will re-register the
client with <em class="parameter"><code>previous_id</code></em> set to <code class="constant">NULL</code>.
</p><p>
If <a class="xref" href="#SmcOpenConnection"><code class="function">SmcOpenConnection</code></a> succeeds, it returns an
opaque connection pointer of type <code class="function">SmcConn</code> and the
<em class="parameter"><code>client_id_ret</code></em> argument contains the client ID to be
used for this session. The <em class="parameter"><code>client_id_ret</code></em> should be
freed with a call to <code class="function">free</code> when no longer needed. On
failure, <a class="xref" href="#SmcOpenConnection"><code class="function">SmcOpenConnection</code></a> returns
<code class="constant">NULL</code>, and the reason for failure is returned in
<em class="parameter"><code>error_string_ret</code></em>.
</p><p>
Note that SMlib uses the ICE protocol to establish a connection with
the session manager. If an ICE connection already exists between the
client and session manager, it might be possible for the same ICE
connection to be used for session management.
</p><p><a id="context_sharing"></a>
The context argument indicates how willing the client is to share the
ICE connection with other protocols. If context is <code class="constant">NULL</code>,
then the caller is always willing to share the connection. If context is not
<code class="constant">NULL</code>, then the caller is not willing to use a previously
opened ICE connection that has a different non-<code class="constant">NULL</code>
context associated with it.
</p><p>
As previously discussed
(<a class="link" href="#Understanding_SMlibs_Dependence_on_ICE" title="Chapter 3. Understanding SMlib's Dependence on ICE">section 3,
“Understanding SMlib's Dependence on ICE”</a>), the
client will have to keep track of when ICE connections are created or
destroyed (using <span class="olink"><code class="function">IceAddConnectionWatch</code></span>
and <span class="olink"><code class="function">IceRemoveConnectionWatch</code></span> and will have to
call <span class="olink"><code class="function">IceProcessMessages</code></span> each time
a <code class="function">select</code> shows that there is data to read on an
ICE connection. For further information, see the
“<span class="citetitle">Inter-Client Exchange Library</span>”
standard.
</p><p>
The callbacks argument contains a set of callbacks used to respond to
session manager events. The mask argument specifies which callbacks
are set. All of the callbacks specified in this version of SMlib are
mandatory. The mask argument is necessary in order to maintain
backwards compatibility in future versions of the library.
</p><p>
The following values may be ORed together to obtain a
<em class="parameter"><code>mask</code></em> value:
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="constant">SmcSaveYourselfProcMask</code></td></tr><tr><td><code class="constant">SmcDieProcMask</code></td></tr><tr><td><code class="constant">SmcSaveCompleteProcMask</code></td></tr><tr><td><code class="constant">SmcShutdownCancelledProcMask</code></td></tr></table><p>
</p><p>
For each callback, the client can register a pointer to client data.
When SMlib invokes the callback, it will pass the client data pointer.
</p><pre class="synopsis">
typedef struct {
struct {
SmcSaveYourselfProc callback;
SmPointer client_data;
} save_yourself;
struct {
SmcDieProc callback;
SmPointer client_data;
} die;
struct {
SmcSaveCompleteProc callback;
SmPointer client_data;
} save_complete;
struct {
SmcShutdownCancelledProc callback;
SmPointer client_data;
} shutdown_cancelled;
} SmcCallbacks;
</pre><div class="sect2" title="The Save Yourself Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Save_Yourself_Callback"></a>The Save Yourself Callback</h3></div></div></div><p>
The Save Yourself callback is of type <code class="function">SmcSaveYourselfProc</code>
</p><div class="funcsynopsis"><a id="SaveYourselfProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSaveYourselfProc</strong>)(</code>SmcConn <var class="pdparam">smc_conn</var>, SmcConn <var class="pdparam">client_data</var>, int <var class="pdparam">save_type</var>, Bool <var class="pdparam">shutdown</var>, int <var class="pdparam">interact_style</var>, Bool <var class="pdparam">fast</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_data</code></em></span></p></td><td><p>Client data specified when the callback was registered.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>save_type</code></em></span></p></td><td><p>Specifies the type of information that should be saved.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>shut_down</code></em></span></p></td><td><p>Specifies if a shutdown is taking place.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>interact_style</code></em></span></p></td><td><p>The type of interaction allowed with the user.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>fast</code></em></span></p></td><td><p>if <span class="symbol">True</span>, then client should save its state as quickly as possible.</p></td></tr></tbody></table></div><p>
The session manager sends a “Save Yourself” message to a
client either to checkpoint it or just before termination so that it
can save its state. The client responds with zero or more calls
to <a class="xref" href="#SmcSetProperties"><code class="function">SmcSetProperties</code></a> to update the properties
indicating how to restart the client. When all the properties have
been set, the client calls <a class="xref" href="#SmcSaveYourselfDone"><code class="function">SmcSaveYourselfDone</code></a>
</p><p>
If <em class="parameter"><code>interact_style</code></em> is
<code class="constant">SmInteractStyleNone</code> the
client must not interact with the user while saving state.
If <em class="parameter"><code>interact_style</code></em> is
<code class="constant">SmInteractStyleErrors</code> the
client may interact with the user only if an error condition arises.
If <em class="parameter"><code>interact_style</code></em> is
<code class="constant">SmInteractStyleAny</code> then the
client may interact with the user for any purpose. Because only one
client can interact with the user at a time, the client must
call <a class="xref" href="#SmcInteractRequest"><code class="function">SmcInteractRequest</code></a> and wait for an
“Interact” message from the session manager. When the
client is done interacting with the user, it
calls <a class="xref" href="#SmcInteractDone"><code class="function">SmcInteractDone</code></a> The client may only
call <a class="xref" href="#SmcInteractRequest"><code class="function">SmcInteractRequest</code></a> after it receives a
“Save Yourself” message and before it
calls <a class="xref" href="#SmcSaveYourselfDone"><code class="function">SmcSaveYourselfDone</code></a>
</p><p>
If <em class="parameter"><code>save_type</code></em> is <code class="constant">SmSaveLocal</code> the
client must update the properties to reflect its current state. Specifically,
it should save enough information to restore the state as seen by the
user of this client. It should not affect the state as seen by other users.
If <em class="parameter"><code>save_type</code></em> is <code class="constant">SmSaveGlobal</code>
the user wants the client to commit all of its data to permanent, globally
accessible storage.
If <em class="parameter"><code>save_type</code></em> is <code class="constant">SmSaveBoth</code>
the client should do both of these (it should first commit the data to
permanent storage before updating its properties).
</p><p>
Some examples are as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" type="bullet"><li class="listitem" style="list-style-type: disc"><p>
If a word processor were sent a “Save Yourself” with a
type of <code class="constant">SmSaveLocal</code> it could create a temporary
file that included the current contents of the file, the location of
the cursor, and other aspects of the current editing session. It
would then update its <span class="property">SmRestartCommand</span> property with
enough information to find this temporary file.
</p></li><li class="listitem" style="list-style-type: disc"><p>
If a word processor were sent a “Save Yourself” with a
type of <code class="constant">SmSaveGlobal</code> it would simply save the
currently edited file.
</p></li><li class="listitem" style="list-style-type: disc"><p>
If a word processor were sent a “Save Yourself” with a
type of <code class="constant">SmSaveBoth</code> it would first save the
currently edited file. It would then create a temporary file with
information such as the current position of the cursor and what file
is being edited. Finally, it would update its
<span class="property">SmRestartCommand</span> property with enough information
to find the temporary file.
</p></li></ul></div><p>
</p><p>
The <em class="parameter"><code>shutdown</code></em> argument specifies whether the
system is being shut down.
The interaction is different depending on whether or not shutdown is
set. If not shutting down, the client should save its state and wait
for a “Save Complete” message. If shutting down, the
client must save state and then prevent interaction until it receives
either a “Die” or a “Shutdown Cancelled.”
</p><p>
The <em class="parameter"><code>fast</code></em> argument specifies that the client
should save its state as quickly as possible. For example, if the
session manager knows that power is about to fail, it would
set <em class="parameter"><code>fast</code></em> to <code class="constant">True</code>.
</p></div><div class="sect2" title="The Die Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Die_Callback"></a>The Die Callback</h3></div></div></div><p>
The Die callback is of type <a class="xref" href="#SmcDieProc"><code class="function">SmcDieProc</code></a>
</p><div class="funcsynopsis"><a id="SmcDieProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmcDieProc</strong>)(</code>SmcConn <var class="pdparam">smc_conn</var>, SmcConn <var class="pdparam">client_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_data</code></em></span></p></td><td><p>Client data specified when the callback was registered.</p></td></tr></tbody></table></div><p>
The session manager sends a “Die” message to a client when
it wants it to die. The client should respond by calling
<a class="xref" href="#SmcCloseConnection"><code class="function">SmcCloseConnection</code></a>. A session manager that
behaves properly will send a “Save Yourself” message
before the “Die” message.
</p></div><div class="sect2" title="The Save Complete Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Save_Complete_Callback"></a>The Save Complete Callback</h3></div></div></div><p>
The Save Complete callback is of type <a class="xref" href="#SmcSaveCompleteProc"><code class="function">SmcSaveCompleteProc</code></a>
</p><div class="funcsynopsis"><a id="SmcSaveCompleteProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmcSaveCompleteProc</strong>)(</code>SmcConn <var class="pdparam">smc_conn</var>, SmPointer <var class="pdparam">client_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_data</code></em></span></p></td><td><p>Client data specified when the callback was registered.</p></td></tr></tbody></table></div></div><div class="sect2" title="The Shutdown Cancelled Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Shutdown_Cancelled_Callback"></a>The Shutdown Cancelled Callback</h3></div></div></div><p>
The Shutdown Cancelled callback is of type
<a class="xref" href="#SmcShutdownCancelledProc"><code class="function">SmcShutdownCancelledProc</code></a>
</p><div class="funcsynopsis"><a id="SmcShutdownCancelledProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmcShutdownCancelledProc</strong>)(</code>SmcConn <var class="pdparam">smc_conn</var>, SmPointer <var class="pdparam">client_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_data</code></em></span></p></td><td><p>Client data specified when the callback was registered.</p></td></tr></tbody></table></div><p>
The session manager sends a “Shutdown Cancelled” message
when the user cancelled the shutdown during an interaction
(see <a class="link" href="#Interacting_With_the_User" title="Interacting With the User">section 5.5,
“Interacting With the User”</a>). The client can now
continue as if the shutdown had never happened. If the client has not
called <a class="xref" href="#SmcSaveYourselfDone"><code class="function">SmcSaveYourselfDone</code></a> yet, it can either
abort the save and then call <a class="xref" href="#SmcSaveYourselfDone"><code class="function">SmcSaveYourselfDone</code></a>
with the success argument set to <code class="constant">False</code> or it can
continue with the save and then call <a class="xref" href="#SmcSaveYourselfDone"><code class="function">SmcSaveYourselfDone</code></a>
with the <em class="parameter"><code>success</code></em> argument set to reflect the outcome
of the save.
</p></div></div><div class="sect1" title="Closing the Connection"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Closing_the_Connection"></a>Closing the Connection</h2></div></div></div><p>
To close a connection with a session manager,
use <a class="xref" href="#SmcCloseConnection"><code class="function">SmcCloseConnection</code></a>
</p><div class="funcsynopsis"><a id="SmcCloseConnection"></a><p><code class="funcdef">SmcCloseStatus <strong>fsfuncSmcCloseConnection</strong>(</code>SmcConn <var class="pdparam">smc_conn</var>, int <var class="pdparam">count</var>, char **<var class="pdparam">reason_msgs</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>count</code></em></span></p></td><td><p>The number of reasons for closing the connection.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>reason_msgs</code></em></span></p></td><td><p>The reasons for closing the connection.</p></td></tr></tbody></table></div><p>
The <em class="parameter"><code>reason_msgs</code></em> argument will most likely be
<code class="constant">NULL</code> if resignation is expected by the client.
Otherwise, it contains a list of null-terminated Compound Text strings
representing the reason for termination. The session manager should
display these reason messages to the user.
</p><p>
Note that SMlib used the ICE protocol to establish a connection with
the session manager, and various protocols other than session
management may be active on the ICE connection.
When <a class="xref" href="#SmcCloseConnection"><code class="function">SmcCloseConnection</code></a> is called, the ICE
connection will be closed only if all protocols have been shutdown on
the connection. Check the ICElib standard
for <span class="olink"><code class="function">IceAddConnectionWatch</code></span>
and <span class="olink"><code class="function">IceRemoveConnectionWatch</code></span> to learn how to set
up a callback to be invoked each time an ICE connection is opened or
closed. Typically this callback adds/removes the ICE file descriptor
from the list of active descriptors to call <code class="function">select</code> on
(or calls <code class="function">XtAppAddInput</code> or
<code class="function">XtRemoveInput</code>).
</p><p>
<a class="xref" href="#SmcCloseConnection"><code class="function">SmcCloseConnection</code></a> returns one of the following values:
</p><div class="itemizedlist"><ul class="itemizedlist" type="bullet"><li class="listitem" style="list-style-type: disc"><p>
<code class="constant">SmcClosedNow</code> - the ICE connection was closed at
this time, the watch procedures were invoked, and the connection was freed.
</p></li><li class="listitem" style="list-style-type: disc"><p>
<code class="constant">SmcClosedASAP</code> - an IO error had occurred on the
connection, but <a class="xref" href="#SmcCloseConnection"><code class="function">SmcCloseConnection</code></a> is being
called within a nested <span class="olink"><code class="function">IceProcessMessages</code></span> The
watch procedures have been invoked at this time, but the connection
will be freed as soon as possible (when the nesting level reaches zero
and <span class="olink"><code class="function">IceProcessMessages</code></span> returns a status
of <code class="function">IceProcessMessagesConnectionClosed</code>
</p></li><li class="listitem" style="list-style-type: disc"><p>
<code class="constant">SmcConnectionInUse</code> - the connection was not closed at
this time, because it is being used by other active protocols.
</p></li></ul></div><p>
</p></div><div class="sect1" title="Modifying Callbacks"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Modifying_Callbacks"></a>Modifying Callbacks</h2></div></div></div><p>
To modify callbacks set up in <a class="xref" href="#SmcOpenConnection"><code class="function">SmcOpenConnection</code></a>
use <a class="xref" href="#SmcModifyCallbacks"><code class="function">SmcModifyCallbacks</code></a>
</p><div class="funcsynopsis"><a id="SmcModifyCallbacks"></a><p><code class="funcdef">void <strong>fsfuncSmcModifyCallbacks</strong>(</code>SmcConn <var class="pdparam">smc_conn</var>, unsigned long <var class="pdparam">mask</var>, SmcCallbacks *<var class="pdparam">callbacks</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>mask</code></em></span></p></td><td><p>A mask indicating which callbacks to modify.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>callbacks</code></em></span></p></td><td><p>The new callbacks.</p></td></tr></tbody></table></div><p>
When specifying a value for the <em class="parameter"><code>mask</code></em> argument,
the following values may be ORed together:
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="constant">SmcSaveYourselfProcMask</code></td></tr><tr><td><code class="constant">SmcDieProcMask</code></td></tr><tr><td><code class="constant">SmcSaveCompleteProcMask</code></td></tr><tr><td><code class="constant">SmcShutdownCancelledProcMask</code></td></tr></table><p>
</p></div><div class="sect1" title="Setting, Deleting, and Retrieving Session Management Properties"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Setting_Deleting_and_Retrieving_Session_Management_Properties"></a>Setting, Deleting, and Retrieving Session Management Properties</h2></div></div></div><p>
To set session management properties for this client,
use <a class="xref" href="#SmcSetProperties"><code class="function">SmcSetProperties</code></a>
</p><div class="funcsynopsis"><a id="SmcSetProperties"></a><p><code class="funcdef">void <strong>fsfuncSmcSetProperties</strong>(</code>SmcConn <var class="pdparam">smc_conn</var>, int <var class="pdparam">num_props</var>, SmProp **<var class="pdparam">props</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>num_props</code></em></span></p></td><td><p>The number of properties.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>props</code></em></span></p></td><td><p>The list of properties to set.</p></td></tr></tbody></table></div><p>
The properties are specified as an array of property pointers.
Previously set property values may be over-written using
the <a class="xref" href="#SmcSetProperties"><code class="function">SmcSetProperties</code></a> function. Note that the
session manager is not expected to restore property values when the
session is restarted. Because of this, clients should not try to use
the session manager as a database for storing application specific state.
</p><p>
For a description of session management properties and
the <span class="structname">SmProp</span> structure,
see <a class="link" href="#Session_Management_Properties" title="Chapter 7. Session Management Properties">section 7,
“Session Management Properties.”</a>
</p><p>
To delete properties previously set by the client,
use <a class="xref" href="#SmcDeleteProperties"><code class="function">SmcDeleteProperties</code></a>
</p><div class="funcsynopsis"><a id="SmcDeleteProperties"></a><p><code class="funcdef">void <strong>fsfuncSmcDeleteProperties</strong>(</code>SmcConn <var class="pdparam">smc_conn</var>, int <var class="pdparam">num_props</var>, char **<var class="pdparam">prop_names</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>num_props</code></em></span></p></td><td><p>The number of properties.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>prop_names</code></em></span></p></td><td><p>The list of properties to set.</p></td></tr></tbody></table></div><p>
To get properties previously stored by the client,
use <a class="xref" href="#SmcGetProperties"><code class="function">SmcGetProperties</code></a>
</p><div class="funcsynopsis"><a id="SmcGetProperties"></a><p><code class="funcdef">Status <strong>fsfuncSmcGetProperties</strong>(</code>SmcConn <var class="pdparam">smc_conn</var>, SmcPropReplyProc <var class="pdparam">prop_reply_proc</var>, SmPointer <var class="pdparam">client_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>prop_reply_proc</code></em></span></p></td><td><p>The callback to be invoked when the properties reply comes back.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_data</code></em></span></p></td><td><p>This pointer to client data will be passed to the <a class="xref" href="#SmcPropReplyProc"><code class="function">SmcPropReplyProc</code></a> callback.</p></td></tr></tbody></table></div><p>
The return value of <a class="xref" href="#SmcGetProperties"><code class="function">SmcGetProperties</code></a> is zero for
failure and a positive value for success.
</p><p>
Note that the library does not block until the properties reply comes
back. Rather, a callback of type <a class="xref" href="#SmcPropReplyProc"><code class="function">SmcPropReplyProc</code></a>
is invoked when the data is ready.
</p><div class="funcsynopsis"><a id="SmcPropReplyProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmcPropReplyProc</strong>)(</code>SmcConn <var class="pdparam">smc_conn</var>, SmPointer <var class="pdparam">client_data</var>, int <var class="pdparam">num_props</var>, SmProp **<var class="pdparam">props</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_data</code></em></span></p></td><td><p>This pointer to client data will be passed to the <a class="xref" href="#SmcPropReplyProc"><code class="function">SmcPropReplyProc</code></a> callback.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>num_props</code></em></span></p></td><td><p>The number of properties returned.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>props</code></em></span></p></td><td><p>The list of properties returned.</p></td></tr></tbody></table></div><p>
To free each property, use <a class="xref" href="#SmFreeProperty"><code class="function">SmFreeProperty</code></a>
(see <a class="link" href="#Freeing_Data" title="Chapter 8. Freeing Data">section 8, “Freeing
Data”</a>). To free the actual array of pointers,
use <code class="function">free</code>
</p></div><div class="sect1" title="Interacting With the User"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Interacting_With_the_User"></a>Interacting With the User</h2></div></div></div><p>
After receiving a “Save Yourself” message with an
<em class="parameter"><code>interact_style</code></em> of
<code class="constant">SmInteractStyleErrors</code>
or <code class="constant">SmInteractStyleAny</code> the client may choose to
interact with the user. Because only one client can interact with the
user at a time, the client must call <a class="xref" href="#SmcInteractRequest"><code class="function">SmcInteractRequest</code></a>
and wait for an “Interact” message from the session manager.
</p><div class="funcsynopsis"><a id="SmcInteractRequest"></a><p><code class="funcdef">Status <strong>fsfuncSmcInteractRequest</strong>(</code>SmcConn <var class="pdparam">smc_conn</var>, int <var class="pdparam">dialog_type</var>, SmcInteractProc <var class="pdparam">interact_proc</var>, SmPointer <var class="pdparam">client_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>dialog_type</code></em></span></p></td><td><p>The type of dialog the client wishes to present to the user.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>interact_proc</code></em></span></p></td><td><p>The callback to be invoked when the “Interact” message arrives from the session manager.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_data</code></em></span></p></td><td><p>
This pointer to client data will be passed to
the <a class="xref" href="#SmcInteractProc"><code class="function">SmcInteractProc</code></a> callback when the
“Interact” message arrives.
</p></td></tr></tbody></table></div><p>
The return value of <a class="xref" href="#SmcInteractRequest"><code class="function">SmcInteractRequest</code></a> is zero
for failure and a positive value for success.
</p><p>
The <em class="parameter"><code>dialog_type</code></em> argument specifies
either <code class="constant">SmDialogError</code> indicating that the client
wants to start an error dialog, or <code class="constant">SmDialogNormal</code>
meaning that the client wishes to start a nonerror dialog.
</p><p>
Note that if a shutdown is in progress, the user may have the option
of cancelling the shutdown. If the shutdown is cancelled, the clients
that have not interacted yet with the user will receive a
“Shutdown Cancelled” message instead of the
“Interact” message.
</p><p>
The <a class="xref" href="#SmcInteractProc"><code class="function">SmcInteractProc</code></a> callback will be invoked when
the “Interact” message arrives from the session manager.
</p><div class="funcsynopsis"><a id="SmcInteractProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmcInteractProc</strong>)(</code>SmcConn <var class="pdparam">smc_conn</var>, SmPointer <var class="pdparam">client_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_data</code></em></span></p></td><td><p>Client data specified when the callback was registered.</p></td></tr></tbody></table></div><p>
After interacting with the user (in response to an “Interact”
message), you should call <a class="xref" href="#SmcInteractDone"><code class="function">SmcInteractDone</code></a>
</p><div class="funcsynopsis"><a id="SmcInteractDone"></a><p><code class="funcdef">void <strong>fsfuncSmcInteractDone</strong>(</code>SmcConn <var class="pdparam">smc_conn</var>, Bool <var class="pdparam">cancel_shutdown</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>cancel_shutdown</code></em></span></p></td><td><p>If <code class="constant">True</code>, indicates that the user requests that the entire shutdown be cancelled.</p></td></tr></tbody></table></div><p>
The <em class="parameter"><code>cancel_shutdown</code></em> argument may only be
<code class="constant">True</code> if the corresponding “Save Yourself”
specified <code class="constant">True</code> for shutdown
and <code class="constant">SmInteractStyleErrors</code>
or <code class="constant">SmInteractStyleAny</code> for
the <em class="parameter"><code>interact_style</code></em>.
</p></div><div class="sect1" title="Requesting a Save Yourself"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Requesting_a_Save_Yourself"></a>Requesting a Save Yourself</h2></div></div></div><p>
To request a checkpoint from the session manager,
use <a class="xref" href="#SmcRequestSaveYourself"><code class="function">SmcRequestSaveYourself</code></a>
</p><div class="funcsynopsis"><a id="SmcRequestSaveYourself"></a><p><code class="funcdef">void <strong>fsfuncSmcRequestSaveYourself</strong>(</code>SmcConn <var class="pdparam">smc_conn</var>, int <var class="pdparam">save_type</var>, Bool <var class="pdparam">shutdown</var>, int <var class="pdparam">interact_style</var>, Bool <var class="pdparam">fast</var>, Bool <var class="pdparam">global</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>save_type</code></em></span></p></td><td><p>Specifies the type of information that should be saved.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>shutdown</code></em></span></p></td><td><p>Specifies if a shutdown is taking place.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>interact_style</code></em></span></p></td><td><p>The type of interaction allowed with the user.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>fast</code></em></span></p></td><td><p>If <code class="constant">True</code> the client should save its state as quickly as possible.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>global</code></em></span></p></td><td><p>Controls who gets the “Save Yourself.”</p></td></tr></tbody></table></div><p>
The <em class="parameter"><code>save_type</code></em>, <em class="parameter"><code>shutdown</code></em>,
<em class="parameter"><code>interact_style</code></em>, and <em class="parameter"><code>fast</code></em>
arguments are discussed in more detail in
<a class="link" href="#The_Save_Yourself_Callback" title="The Save Yourself Callback">section 5.1.1,
“The Save Yourself Callback.”</a>
</p><p>
If <em class="parameter"><code>global</code></em> is set to <code class="constant">True</code> then
the resulting “Save Yourself” should be sent to all clients in the
session. For example, a vendor of a Uninterruptible Power Supply
(<acronym class="acronym">UPS</acronym>) might include a Session Management client
that would monitor the status of the UPS and generate a fast shutdown
if the power is about to be lost.
</p><p>
If global is set to <code class="constant">False</code> then the “Save
Yourself” should only be sent to the client that requested it.
</p></div><div class="sect1" title="Requesting a Save Yourself Phase 2"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Requesting_a_Save_Yourself_Phase_2_2"></a>Requesting a Save Yourself Phase 2</h2></div></div></div><p>
In response to a “Save Yourself”, the client may request to be
informed when all the other clients are quiescent so that it can save their
state. To do so, use <a class="xref" href="#SmcRequestSaveYourselfPhase2"><code class="function">SmcRequestSaveYourselfPhase2</code></a>
</p><div class="funcsynopsis"><a id="SmcRequestSaveYourselfPhase2"></a><p><code class="funcdef">Status <strong>fsfuncSmcRequestSaveYourselfPhase2</strong>(</code>SmcConn <var class="pdparam">smc_conn</var>, SmcSaveYourselfPhase2Proc <var class="pdparam">save_yourself_phase2_proc</var>, SmPointer <var class="pdparam">client_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>save_type_phase2_proc</code></em></span></p></td><td><p>The callback to be invoked when the “Save Yourself Phase 2” message arrives from the session manager.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_data</code></em></span></p></td><td><p>This pointer to client data will be passed to the <code class="function">SmcSaveYourselfPhase2Proc</code> callback when the “Save Yourself Phase 2” message arrives.</p></td></tr></tbody></table></div><p>
The return value of <a class="xref" href="#SmcRequestSaveYourselfPhase2"><code class="function">SmcRequestSaveYourselfPhase2</code></a>
is zero for failure and a positive value for success.
</p><p>
This request is needed by clients that manage other clients (for
example, window managers, workspace managers, and so on). The manager
must make sure that all of the clients that are being managed are in
an idle state so that their state can be saved.
</p></div><div class="sect1" title="Completing a Save Yourself"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Completing_a_Save_Yourself"></a>Completing a Save Yourself</h2></div></div></div><p>
After saving state in response to a “Save Yourself”
message, you should call <a class="xref" href="#SmcSaveYourselfDone"><code class="function">SmcSaveYourselfDone</code></a>
</p><div class="funcsynopsis"><a id="SmcSaveYourselfDone"></a><p><code class="funcdef">void <strong>fsfuncSmcSaveYourselfDone</strong>(</code>SmcConn <var class="pdparam">smc_conn</var>, Bool <var class="pdparam">success</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>success</code></em></span></p></td><td><p>If <code class="constant">True</code> the “Save Yourself” operation was completed successfully.</p></td></tr></tbody></table></div><p>
Before calling <a class="xref" href="#SmcSaveYourselfDone"><code class="function">SmcSaveYourselfDone</code></a> the client
must have set each required property at least once since the client
registered with the session manager.
</p></div><div class="sect1" title="Using Smc Informational Functions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Using_Smc_Informational_Functions"></a>Using Smc Informational Functions</h2></div></div></div><div class="funcsynopsis"><a id="SmcProtocolVersion"></a><p><code class="funcdef">int <strong>fsfuncSmcProtocolVersion</strong>(</code>SmcConn <var class="pdparam">smc_conn</var><code>)</code>;</p></div><p>
<a class="xref" href="#SmcProtocolVersion"><code class="function">SmcProtocolVersion</code></a> returns the major version of
the session management protocol associated with this session.
</p><div class="funcsynopsis"><a id="SmcProtocolRevision"></a><p><code class="funcdef">int <strong>fsfuncSmcProtocolRevision</strong>(</code>SmcConn <var class="pdparam">smc_conn</var><code>)</code>;</p></div><p>
<a class="xref" href="#SmcProtocolRevision"><code class="function">SmcProtocolRevision</code></a> returns the minor version of
the session management protocol associated with this session.
</p><div class="funcsynopsis"><a id="SmcVendor"></a><p><code class="funcdef">char *<strong>fsfuncSmcVendor</strong>(</code>SmcConn <var class="pdparam">smc_conn</var><code>)</code>;</p></div><p>
<a class="xref" href="#SmcVendor"><code class="function">SmcVendor</code></a> returns a string that provides some
identification of the owner of the session manager. The string should
be freed with a call to <code class="function">free</code>
</p><div class="funcsynopsis"><a id="SmcRelease"></a><p><code class="funcdef">char *<strong>fsfuncSmcRelease</strong>(</code>SmcConn <var class="pdparam">smc_conn</var><code>)</code>;</p></div><p>
<a class="xref" href="#SmcRelease"><code class="function">SmcRelease</code></a> returns a string that provides the
release number of the session manager. The string should be freed
with a call to <code class="function">free</code>
</p><div class="funcsynopsis"><a id="SmcClientID"></a><p><code class="funcdef">char *<strong>fsfuncSmcClientID</strong>(</code>SmcConn <var class="pdparam">smc_conn</var><code>)</code>;</p></div><p>
<a class="xref" href="#SmcClientID"><code class="function">SmcClientID</code></a> returns a null-terminated string for
the client ID associated with this connection. This information was
also returned in <a class="xref" href="#SmcOpenConnection"><code class="function">SmcOpenConnection</code></a> (it is
provided here for convenience). Call <code class="function">free</code> on
this pointer when the client ID is no longer needed.
</p><div class="funcsynopsis"><a id="SmcGetIceConnection"></a><p><code class="funcdef">IceConn <strong>fsfuncSmcGetIceConnection</strong>(</code>SmcConn <var class="pdparam">smc_conn</var><code>)</code>;</p></div><p>
<a class="xref" href="#SmcGetIceConnection"><code class="function">SmcGetIceConnection</code></a> returns the ICE connection
object associated with this session management connection object. The
ICE connection object can be used to get some additional information
about the connection. Some of the more useful functions which can be
used on the IceConn are <code class="function">IceConnectionNumber</code>,
<code class="function">IceConnectionString</code>,
<span class="olink"><code class="function">IceLastSentSequenceNumber</code></span>,
<code class="function">IceLastReceivedSequenceNumber</code>,
and <span class="olink"><code class="function">IcePing</code></span>. For further information, see
the “<span class="citetitle">Inter-Client Exchange Library</span>”
standard.
</p></div><div class="sect1" title="Error Handling"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Error_Handling"></a>Error Handling</h2></div></div></div><p>
If the client receives an unexpected protocol error from the session
manager, an error handler is invoked by SMlib. A default error
handler exists that simply prints the error message
to <code class="varname">stderr</code> and exits if the severity of the error
is fatal. The client can change this error handler by calling
the <a class="xref" href="#SmcSetErrorHandler"><code class="function">SmcSetErrorHandler</code></a> function.
</p><div class="funcsynopsis"><a id="SmcSetErrorHandler"></a><p><code class="funcdef">SmcErrorHandler <strong>fsfuncSmcSetErrorHandler</strong>(</code>SmcErrorHandler <var class="pdparam">handler</var><code>)</code>;</p></div><p>
The error handler. You should pass <code class="constant">NULL</code> to
restore the default handler.
</p><p>
<a class="xref" href="#SmcSetErrorHandler"><code class="function">SmcSetErrorHandler</code></a> returns the previous error handler.
</p><p>
The <a class="xref" href="#SmcErrorHandler"><code class="function">SmcErrorHandler</code></a> has the following type:
</p><div class="funcsynopsis"><a id="SmcErrorHandler"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmcErrorHandler</strong>)(</code>SmcConn <var class="pdparam">smc_conn</var>, Bool <var class="pdparam">swap</var>, int <var class="pdparam">offending_minor_opcode</var>, unsigned long <var class="pdparam">offending_sequence_num</var>, int <var class="pdparam">error_class</var>, int <var class="pdparam">severity</var>, IcePointer <var class="pdparam">values</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>smc_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>swap</code></em></span></p></td><td><p>A flag that indicates if the specified values need byte swapping.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>offending_minor_opcode</code></em></span></p></td><td><p>The minor opcode of the offending message.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>offending_sequence_num</code></em></span></p></td><td><p>The sequence number of the offending message.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>error_class</code></em></span></p></td><td><p>The error class of the offending message.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>severity</code></em></span></p></td><td><p><code class="constant">IceCanContinue</code>,
<code class="constant">IceFatalToProtocol</code>, or
<code class="constant">IceFatalToConnection</code>
</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>values</code></em></span></p></td><td><p>Any additional error values specific to the minor opcode and class.</p></td></tr></tbody></table></div><p>
Note that this error handler is invoked for protocol related errors.
To install an error handler to be invoked when an IO error occurs, use
<span class="olink"><code class="function">IceSetIOErrorHandler</code></span> For further information, see
the “<span class="citetitle">Inter-Client Exchange Library</span>”
standard.
</p></div></div><div class="chapter" title="Chapter 6. Session Management Server (Sms) Functions"><div class="titlepage"><div><div><h2 class="title"><a id="Session_Management_Server_Sms_Functions"></a>Chapter 6. Session Management Server (<acronym class="acronym">Sms</acronym>) Functions</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="#Initializing_the_Library">Initializing the Library</a></span></dt><dd><dl><dt><span class="sect2"><a href="#The_Register_Client_Callback">The Register Client Callback</a></span></dt><dt><span class="sect2"><a href="#The_Interact_Request_Callback">The Interact Request Callback</a></span></dt><dt><span class="sect2"><a href="#The_Interact_Done_Callback">The Interact Done Callback</a></span></dt><dt><span class="sect2"><a href="#The_Save_Yourself_Request_Callback">The Save Yourself Request Callback</a></span></dt><dt><span class="sect2"><a href="#The_Save_Yourself_Phase_2_Request_Callback">The Save Yourself Phase 2 Request Callback</a></span></dt><dt><span class="sect2"><a href="#The_Save_Yourself_Done_Callback">The Save Yourself Done Callback</a></span></dt><dt><span class="sect2"><a href="#The_Connection_Closed_Callback">The Connection Closed Callback</a></span></dt><dt><span class="sect2"><a href="#The_Set_Properties_Callback">The Set Properties Callback</a></span></dt><dt><span class="sect2"><a href="#The_Delete_Properties_Callback">The Delete Properties Callback</a></span></dt><dt><span class="sect2"><a href="#The_Get_Properties_Callback">The Get Properties Callback</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Registering_the_Client">Registering the Client</a></span></dt><dt><span class="sect1"><a href="#Sending_a_Save_Yourself_Message">Sending a Save Yourself Message</a></span></dt><dt><span class="sect1"><a href="#Sending_a_Save_Yourself_Phase_2_Message">Sending a Save Yourself Phase 2 Message</a></span></dt><dt><span class="sect1"><a href="#Sending_an_Interact_Message">Sending an Interact Message</a></span></dt><dt><span class="sect1"><a href="#Sending_a_Save_Complete_Message">Sending a Save Complete Message</a></span></dt><dt><span class="sect1"><a href="#Sending_a_Die_Message">Sending a Die Message</a></span></dt><dt><span class="sect1"><a href="#Cancelling_a_Shutdown">Cancelling a Shutdown</a></span></dt><dt><span class="sect1"><a href="#Returning_Properties">Returning Properties</a></span></dt><dt><span class="sect1"><a href="#Pinging_a_Client">Pinging a Client</a></span></dt><dt><span class="sect1"><a href="#Cleaning_Up_After_a_Client_Disconnects">Cleaning Up After a Client Disconnects</a></span></dt><dt><span class="sect1"><a href="#Using_Sms_Informational_Functions">Using Sms Informational Functions</a></span></dt><dt><span class="sect1"><a href="#Error_Handling_2">Error Handling</a></span></dt></dl></div><p>
This section discusses how Session Management servers:
</p><div class="itemizedlist"><ul class="itemizedlist" type="bullet"><li class="listitem" style="list-style-type: disc"><p>Initialize the library</p></li><li class="listitem" style="list-style-type: disc"><p>Register the client</p></li><li class="listitem" style="list-style-type: disc"><p>Send a “Save Yourself” message</p></li><li class="listitem" style="list-style-type: disc"><p>Send a “Save Yourself Phase 2” message</p></li><li class="listitem" style="list-style-type: disc"><p>Send an “Interact” message</p></li><li class="listitem" style="list-style-type: disc"><p>Send a “Save Complete” message</p></li><li class="listitem" style="list-style-type: disc"><p>Send a “Die” message</p></li><li class="listitem" style="list-style-type: disc"><p>Cancel a shutdown</p></li><li class="listitem" style="list-style-type: disc"><p>Return properties</p></li><li class="listitem" style="list-style-type: disc"><p>Ping a client</p></li><li class="listitem" style="list-style-type: disc"><p>Clean up after a client disconnects</p></li><li class="listitem" style="list-style-type: disc"><p>Use Sms informational functions</p></li><li class="listitem" style="list-style-type: disc"><p>Handle errors</p></li></ul></div><p>
</p><div class="sect1" title="Initializing the Library"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Initializing_the_Library"></a>Initializing the Library</h2></div></div></div><p>
<a class="xref" href="#SmsInitialize"><code class="function">SmsInitialize</code></a> is the first SMlib function that
should be called by a session manager. It provides information about
the session manager and registers a callback that will be invoked each
time a new client connects to the session manager.
</p><div class="funcsynopsis"><a id="SmsInitialize"></a><p><code class="funcdef">Status <strong>fsfuncSmsInitialize</strong>(</code>const char *<var class="pdparam">vendor</var>, const char *<var class="pdparam">release</var>, SmsNewClientProc <var class="pdparam">new_client_proc</var>, SmPointer <var class="pdparam">manager_data</var>, IceHostBasedAuthProc <var class="pdparam">host_based_auth_proc</var>, int <var class="pdparam">error_length</var>, char *<var class="pdparam">error_string_ret</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>vendor</code></em></span></p></td><td><p>A string specifying the session manager vendor.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>release</code></em></span></p></td><td><p>A string specifying the session manager release number.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>new_client_proc</code></em></span></p></td><td><p>Callback to be invoked each time a new client connects to the session manager.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>When the <a class="xref" href="#SmsNewClientProc"><code class="function">SmsNewClientProc</code></a> callback is invoked, this pointer to manager data will be passed.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>host_based_auth_proc</code></em></span></p></td><td><p>Host based authentication callback.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>error_length</code></em></span></p></td><td><p>Length of the <em class="parameter"><code>error_string_ret</code></em> argument passed in.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>error_string_ret</code></em></span></p></td><td><p>
Returns a null-terminated error message, if any.
The <em class="parameter"><code>error_string_ret</code></em> points to user supplied memory.
No more than <em class="parameter"><code>error_length</code></em> bytes are used.
</p></td></tr></tbody></table></div><p>
After the <a class="xref" href="#SmsInitialize"><code class="function">SmsInitialize</code></a> function is called, the
session manager should call the <span class="olink"><code class="function">IceListenForConnections</code></span>
function to listen for new connections. Afterwards, each time a
client connects, the session manager should
call <span class="olink"><code class="function">IceAcceptConnection</code></span>
</p><p>
See <a class="link" href="#Authentication_of_Clients" title="Chapter 9. Authentication of Clients">section 9,
“Authentication of Clients,”</a> for more details on
authentication (including host based authentication). Also see
the “<span class="citetitle">Inter-Client Exchange
Library</span>” standard for further details on listening for and
accepting ICE connections.
</p><p>
Each time a new client connects to the session manager,
the <a class="xref" href="#SmsNewClientProc"><code class="function">SmsNewClientProc</code></a> callback is invoked. The
session manager obtains a new opaque connection object that it should
use for all future interaction with the client. At this time, the
session manager must also register a set of callbacks to respond to
the different messages that the client might send.
</p><div class="funcsynopsis"><a id="SmsNewClientProc"></a><p><code class="funcdef">typedef Status (*<strong>fsfuncSmsNewClientProc</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, SmPointer <var class="pdparam">manager_data</var>, unsigned long *<var class="pdparam">mask_ret</var>, SmsCallbacks *<var class="pdparam">callbacks_ret</var>, char **<var class="pdparam">failure_reason_ret</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>A new opaque connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>Manager data specified when the callback was registered.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>mask_ret</code></em></span></p></td><td><p>On return, indicates which callbacks were set by the session manager.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>callbacks_ret</code></em></span></p></td><td><p>On return, contains the callbacks registered by the session manager.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>failure_reason_ret</code></em></span></p></td><td><p>Failure reason returned.</p></td></tr></tbody></table></div><p>
If a failure occurs, the <a class="xref" href="#SmsNewClientProc"><code class="function">SmsNewClientProc</code></a> should
return a zero status as well as allocate and return a failure reason
string in <em class="parameter"><code>failure_reason_ret</code></em>.
SMlib will be responsible for freeing this memory.
</p><p>
The session manager must register a set of callbacks to respond to
client events. The <em class="parameter"><code>mask_ret</code></em> argument specifies
which callbacks are set. All of the callbacks specified in this version of
SMlib are mandatory. The <em class="parameter"><code>mask_ret</code></em> argument is
necessary in order to maintain backwards compatibility in future versions
of the library.
</p><p>
The following values may be ORed together to obtain a mask value:
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="constant">SmsRegisterClientProcMask</code></td></tr><tr><td><code class="constant">SmsInteractRequestProcMask</code></td></tr><tr><td><code class="constant">SmsInteractDoneProcMask</code></td></tr><tr><td><code class="constant">SmsSaveYourselfRequestProcMask</code></td></tr><tr><td><code class="constant">SmsSaveYourselfP2RequestProcMask</code></td></tr><tr><td><code class="constant">SmsSaveYourselfDoneProcMask</code></td></tr><tr><td><code class="constant">SmsCloseConnectionProcMask</code></td></tr><tr><td><code class="constant">SmsSetPropertiesProcMask</code></td></tr><tr><td><code class="constant">SmsDeletePropertiesProcMask</code></td></tr><tr><td><code class="constant">SmsGetPropertiesProcMask</code></td></tr></table><p>
</p><p>
For each callback, the session manager can register a pointer to
manager data specific to that callback. This pointer will be passed
to the callback when it is invoked by SMlib.
</p><pre class="synopsis">
typedef struct {
struct {
SmsRegisterClientProc callback;
SmPointer manager_data;
} register_client;
struct {
SmsInteractRequestProc callback;
SmPointer manager_data;
} interact_request;
struct {
SmsInteractDoneProc callback;
SmPointer manager_data;
} interact_done;
struct {
SmsSaveYourselfRequestProc callback;
SmPointer manager_data;
} save_yourself_request;
struct {
SmsSaveYourselfPhase2RequestProc callback;
SmPointer manager_data;
} save_yourself_phase2_request;
struct {
SmsSaveYourselfDoneProc callback;
SmPointer manager_data;
} save_yourself_done;
struct {
SmsCloseConnectionProc callback;
SmPointer manager_data;
} close_connection;
struct {
SmsSetPropertiesProc callback;
SmPointer manager_data;
} set_properties;
struct {
SmsDeletePropertiesProc callback;
SmPointer manager_data;
} delete_properties;
struct {
SmsGetPropertiesProc callback;
SmPointer manager_data;
} get_properties;
} SmsCallbacks;
</pre><div class="sect2" title="The Register Client Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Register_Client_Callback"></a>The Register Client Callback</h3></div></div></div><p>
The Register Client callback is the first callback that will be
invoked after the client connects to the session manager. Its type
is <a class="xref" href="#SmsRegisterClientProc"><code class="function">SmsRegisterClientProc</code></a>
</p><div class="funcsynopsis"><a id="SmsRegisterClientProc"></a><p><code class="funcdef">typedef Status (*<strong>fsfuncSmsRegisterClientProc</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, SmPointer <var class="pdparam">manager_data</var>, char *<var class="pdparam">previous_id</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>Manager data specified when the callback was registered.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>previous_id</code></em></span></p></td><td><p>The client ID from the previous session.</p></td></tr></tbody></table></div><p>
Before any further interaction takes place with the client, the client
must be registered with the session manager.
</p><p>
If the client is being restarted from a previous session,
<em class="parameter"><code>previous_id</code></em> will contain a null-terminated string
representing the client ID from the previous session.
Call <code class="function">free</code> on the <em class="parameter"><code>previous_id</code></em>
pointer when it is no longer needed. If the client is first joining the
session, <em class="parameter"><code>previous_id</code></em> will be <code class="constant">NULL</code>.
</p><p>
If <em class="parameter"><code>previous_id</code></em> is invalid, the session manager should
not register the client at this time. This callback should return a status
of zero, which will cause an error message to be sent to the client. The
client should re-register with previous_id set to <code class="constant">NULL</code>.
</p><p>
Otherwise, the session manager should register the client with a unique
client ID by calling the <a class="xref" href="#SmsRegisterClientReply"><code class="function">SmsRegisterClientReply</code></a>
function (to be discussed shortly), and the
<a class="xref" href="#SmsRegisterClientProc"><code class="function">SmsRegisterClientProc</code></a> callback should return a
status of one.
</p></div><div class="sect2" title="The Interact Request Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Interact_Request_Callback"></a>The Interact Request Callback</h3></div></div></div><p>
The Interact Request callback is of
type <a class="xref" href="#SmsInteractRequestProc"><code class="function">SmsInteractRequestProc</code></a>
</p><div class="funcsynopsis"><a id="SmsInteractRequestProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmsInteractRequestProc</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, SmPointer <var class="pdparam">manager_data</var>, int <var class="pdparam">dialog_type</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>Manager data specified when the callback was registered.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>dialog_type</code></em></span></p></td><td><p>The type of dialog the client wishes to present to the user.</p></td></tr></tbody></table></div><p>
When a client receives a “Save Yourself” message with an
<em class="parameter"><code>interact_style</code></em> of
<code class="constant">SmInteractStyleErrors</code>
or <code class="constant">SmInteractStyleAny</code> the client may choose to
interact with the user. Because only one client can interact with the
user at a time, the client must request to interact with the user.
The session manager should keep a queue of all clients wishing to
interact. It should send an “Interact” message to one
client at a time and wait for an “Interact Done” message
before continuing with the next client.
</p><p>
The <em class="parameter"><code>dialog_type</code></em> argument specifies
either <code class="constant">SmDialogError</code> indicating that the client
wants to start an error dialog, or <code class="constant">SmDialogNormal</code>
meaning that the client wishes to start a nonerror dialog.
</p><p>
If a shutdown is in progress, the user may have the option of
cancelling the shutdown. If the shutdown is cancelled (specified in
the “Interact Done” message), the session manager should
send a “Shutdown Cancelled” message to each client that
requested to interact.
</p></div><div class="sect2" title="The Interact Done Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Interact_Done_Callback"></a>The Interact Done Callback</h3></div></div></div><p>
When the client is done interacting with the user,
the <a class="xref" href="#SmsInteractDoneProc"><code class="function">SmsInteractDoneProc</code></a> callback will be invoked.
</p><div class="funcsynopsis"><a id="SmsInteractDoneProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmsInteractDoneProc</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, SmPointer <var class="pdparam">manager_data</var>, Bool <var class="pdparam">cancel_shutdown</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>Manager data specified when the callback was registered.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>cancel_shutdown</code></em></span></p></td><td><p>Specifies if the user requests that the entire shutdown be cancelled.</p></td></tr></tbody></table></div><p>
Note that the shutdown can be cancelled only if the corresponding
“Save Yourself” specified <code class="constant">True</code> for
shutdown and <code class="constant">SmInteractStyleErrors</code>
or <code class="constant">SmInteractStyleAny</code> for the
<em class="parameter"><code>interact_style</code></em>.
</p></div><div class="sect2" title="The Save Yourself Request Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Save_Yourself_Request_Callback"></a>The Save Yourself Request Callback</h3></div></div></div><p>
The Save Yourself Request callback is of
type <code class="function">SmsSaveYourselfRequestProc</code>
</p><div class="funcsynopsis"><a id="SaveYourselfRequestProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSaveYourselfRequestProc</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, SmPointer <var class="pdparam">manager_data</var>, int <var class="pdparam">save_type</var>, Bool <var class="pdparam">shutdown</var>, int <var class="pdparam">interact_style</var>, Bool <var class="pdparam">fast</var>, Bool <var class="pdparam">global</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>Manager data specified when the callback was registered.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>save_type</code></em></span></p></td><td><p>Specifies the type of information that should be saved.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>shutdown</code></em></span></p></td><td><p>Specifies if a shutdown is taking place.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>interact_style</code></em></span></p></td><td><p>The type of interaction allowed with the user.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>fast</code></em></span></p></td><td><p>If <code class="constant">True</code> the client should save its state as quickly as possible.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>global</code></em></span></p></td><td><p>Controls who gets the “Save Yourself.”</p></td></tr></tbody></table></div><p>
The Save Yourself Request prompts the session manager to initiate a
checkpoint or shutdown. For information on the
<em class="parameter"><code>save_type</code></em>, <em class="parameter"><code>shutdown</code></em>,
<em class="parameter"><code>interact_style</code></em>, and <em class="parameter"><code>fast</code></em>
arguments, see <a class="link" href="#Sending_a_Save_Yourself_Message" title="Sending a Save Yourself Message">section 6.3,
“Sending a Save Yourself Message.”</a>
</p><p>
If <em class="parameter"><code>global</code></em> is set to <code class="constant">True</code> then the
resulting “Save Yourself” should be sent to all applications.
If <em class="parameter"><code>global</code></em> is set to <code class="constant">False</code> then the
“Save Yourself” should only be sent to the client that requested it.
</p></div><div class="sect2" title="The Save Yourself Phase 2 Request Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Save_Yourself_Phase_2_Request_Callback"></a>The Save Yourself Phase 2 Request Callback</h3></div></div></div><p>
The Save Yourself Phase 2 Request callback is of
type <a class="xref" href="#SmsSaveYourselfPhase2RequestProc"><code class="function">SmsSaveYourselfPhase2RequestProc</code></a>
</p><div class="funcsynopsis"><a id="SmsSaveYourselfPhase2RequestProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmsSaveYourselfPhase2RequestProc</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, SmPointer <var class="pdparam">manager_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>Manager data specified when the callback was registered.</p></td></tr></tbody></table></div><p>
This request is sent by clients that manage other clients (for
example, window managers, workspace managers, and so on). Such
managers must make sure that all of the clients that are being managed
are in an idle state so that their state can be saved.
</p></div><div class="sect2" title="The Save Yourself Done Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Save_Yourself_Done_Callback"></a>The Save Yourself Done Callback</h3></div></div></div><p>
When the client is done saving its state in response to a
“Save Yourself” message,
the <code class="function">SmsSaveYourselfDoneProc</code> will be invoked.
</p><div class="funcsynopsis"><a id="SaveYourselfDoneProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSaveYourselfDoneProc</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, SmPointer <var class="pdparam">manager_data</var>, Bool <var class="pdparam">success</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>Manager data specified when the callback was registered.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>success</code></em></span></p></td><td><p>If <code class="constant">True</code> the Save Yourself operation was completed successfully.</p></td></tr></tbody></table></div><p>
Before the “Save Yourself Done” was sent, the client must
have set each required property at least once since it registered with
the session manager.
</p></div><div class="sect2" title="The Connection Closed Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Connection_Closed_Callback"></a>The Connection Closed Callback</h3></div></div></div><p>
If the client properly terminates (that is, it
calls <a class="xref" href="#SmcCloseConnection"><code class="function">SmcCloseConnection</code></a>,
the <a class="xref" href="#SmsCloseConnectionProc"><code class="function">SmsCloseConnectionProc</code></a> callback is invoked.
</p><div class="funcsynopsis"><a id="SmsCloseConnectionProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmsCloseConnectionProc</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, SmPointer <var class="pdparam">manager_data</var>, int <var class="pdparam">count</var>, char **<var class="pdparam">reason_msgs</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>Manager data specified when the callback was registered.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>count</code></em></span></p></td><td><p>The number of reason messages.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>reason_msgs</code></em></span></p></td><td><p>The reasons for closing the connection.</p></td></tr></tbody></table></div><p>
The <em class="parameter"><code>reason_msgs</code></em> argument will most likely
be <code class="constant">NULL</code> and the <em class="parameter"><code>count</code></em>
argument zero (0) if resignation is expected by the user. Otherwise,
it contains a list of null-terminated Compound Text strings
representing the reason for termination. The session manager should
display these reason messages to the user.
</p><p>
Call <a class="xref" href="#SmFreeReasons"><code class="function">SmFreeReasons</code></a> to free the reason messages.
For further information, see
<a class="link" href="#Freeing_Data" title="Chapter 8. Freeing Data">section 8, “Freeing Data”</a>
</p></div><div class="sect2" title="The Set Properties Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Set_Properties_Callback"></a>The Set Properties Callback</h3></div></div></div><p>
When the client sets session management properties,
the <a class="xref" href="#SmsSetPropertiesProc"><code class="function">SmsSetPropertiesProc</code></a> callback will be invoked.
</p><div class="funcsynopsis"><a id="SmsSetPropertiesProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmsSetPropertiesProc</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, SmPointer <var class="pdparam">manager_data</var>, int <var class="pdparam">num_props</var>, SmProp **<var class="pdparam">props</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>Manager data specified when the callback was registered.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>num_props</code></em></span></p></td><td><p>The number of properties.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>props</code></em></span></p></td><td><p>The list of properties to set.</p></td></tr></tbody></table></div><p>
The properties are specified as an array of property pointers. For a
description of session management properties and
the <span class="structname">SmProp</span> structure,
see <a class="link" href="#Session_Management_Properties" title="Chapter 7. Session Management Properties">section 7,
“Session Management Properties.”</a>
</p><p>
Previously set property values may be over-written. Some properties
have predefined semantics. The session manager is required to store
nonpredefined properties.
</p><p>
To free each property, use <a class="xref" href="#SmFreeProperty"><code class="function">SmFreeProperty</code></a>.
For further information, see <a class="link" href="#Freeing_Data" title="Chapter 8. Freeing Data">section 8,
“Freeing Data”</a> You should free the actual array of
pointers with a call to <code class="function">free</code>
</p></div><div class="sect2" title="The Delete Properties Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Delete_Properties_Callback"></a>The Delete Properties Callback</h3></div></div></div><p>
When the client deletes session management properties,
the <a class="xref" href="#SmsDeletePropertiesProc"><code class="function">SmsDeletePropertiesProc</code></a> callback will be invoked.
</p><div class="funcsynopsis"><a id="SmsDeletePropertiesProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmsDeletePropertiesProc</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, SmPointer <var class="pdparam">manager_data</var>, int <var class="pdparam">num_props</var>, char **<var class="pdparam">prop_names</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>Manager data specified when the callback was registered.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>num_props</code></em></span></p></td><td><p>The number of properties.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>prop_names</code></em></span></p></td><td><p>The list of properties to delete.</p></td></tr></tbody></table></div><p>
The properties are specified as an array of strings. For a
description of session management properties and
the <span class="structname">SmProp</span> structure,
see <a class="link" href="#Session_Management_Properties" title="Chapter 7. Session Management Properties">section 7,
“Session Management Properties.”</a>
</p></div><div class="sect2" title="The Get Properties Callback"><div class="titlepage"><div><div><h3 class="title"><a id="The_Get_Properties_Callback"></a>The Get Properties Callback</h3></div></div></div><p>
The <a class="xref" href="#SmsGetPropertiesProc"><code class="function">SmsGetPropertiesProc</code></a> callback is invoked when
the client wants to retrieve properties it set.
</p><div class="funcsynopsis"><a id="SmsGetPropertiesProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmsGetPropertiesProc</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, SmPointer <var class="pdparam">manager_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>manager_data</code></em></span></p></td><td><p>Manager data specified when the callback was registered.</p></td></tr></tbody></table></div><p>
The session manager should respond by
calling <a class="xref" href="#SmsReturnProperties"><code class="function">SmsReturnProperties</code></a>.
All of the properties set for this client should be returned.
</p></div></div><div class="sect1" title="Registering the Client"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Registering_the_Client"></a>Registering the Client</h2></div></div></div><p>
To register a client (in response to
a <a class="xref" href="#SmsRegisterClientProc"><code class="function">SmsRegisterClientProc</code></a> callback),
use <a class="xref" href="#SmsRegisterClientReply"><code class="function">SmsRegisterClientReply</code></a>.
</p><div class="funcsynopsis"><a id="SmsRegisterClientReply"></a><p><code class="funcdef">Status <strong>fsfuncSmsRegisterClientReply</strong>(</code>SmsConn <var class="pdparam">sms_conn</var>, char *<var class="pdparam">client_id</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_id</code></em></span></p></td><td><p>A null-terminated string representing a unique client ID.</p></td></tr></tbody></table></div><p>
The return value of <a class="xref" href="#SmsRegisterClientReply"><code class="function">SmsRegisterClientReply</code></a> is
zero for failure and a positive value for success. Failure will occur
if SMlib can not allocate memory to hold a copy of the client ID for
it's own internal needs.
</p><p>
If a non-<code class="constant">NULL</code> <em class="parameter"><code>previous_id</code></em> was
specified when the client registered itself, <em class="parameter"><code>client_id</code></em>
should be identical to <em class="parameter"><code>previous_id</code></em>.
</p><p>
Otherwise, <em class="parameter"><code>client_id</code></em> should be a unique ID freshly
generated by the session manager. In addition, the session manager should
send a “Save Yourself” message with
<em class="parameter"><code>type</code></em> = <code class="constant">Local</code>,
<em class="parameter"><code>shutdown</code></em> = <code class="constant">False</code>,
<em class="parameter"><code>interact-style</code></em> = <code class="constant">None</code>,
and <em class="parameter"><code>fast</code></em> = <code class="constant">False</code>
immediately after registering the client.
</p><p>
Note that once a client ID has been assigned to the client, the client
keeps this ID indefinitely. If the client is terminated and
restarted, it will be reassigned the same ID. It is desirable to be
able to pass client IDs around from machine to machine, from user to
user, and from session manager to session manager, while retaining the
identity of the client. This, combined with the indefinite
persistence of client IDs, means that client IDs need to be globally
unique.
</p><p>
You should call the <a class="xref" href="#SmsGenerateClientID"><code class="function">SmsGenerateClientID</code></a> function
to generate a globally unique client ID.
</p><div class="funcsynopsis"><a id="SmsGenerateClientID"></a><p><code class="funcdef">char *<strong>fsfuncSmsGenerateClientID</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr></tbody></table></div><p>
<code class="constant">NULL</code> will be returned if the ID could not be generated.
Otherwise, the return value of the function is the client ID.
It should be freed with a call to <code class="function">free</code> when
no longer needed.
</p></div><div class="sect1" title="Sending a Save Yourself Message"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Sending_a_Save_Yourself_Message"></a>Sending a Save Yourself Message</h2></div></div></div><p>
To send a “Save Yourself” to a client,
use <a class="xref" href="#SmsSaveYourself"><code class="function">SmsSaveYourself</code></a>.
</p><div class="funcsynopsis"><a id="SmsSaveYourself"></a><p><code class="funcdef">void <strong>fsfuncSmsSaveYourself</strong>(</code>SmsConn <var class="pdparam">sms_conn</var>, int <var class="pdparam">save_type</var>, Bool <var class="pdparam">shutdown</var>, int <var class="pdparam">interact_style</var>, Bool <var class="pdparam">fast</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>save_type</code></em></span></p></td><td><p>Specifies the type of information that should be saved.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>shutdown</code></em></span></p></td><td><p>Specifies if a shutdown is taking place.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>interact_style</code></em></span></p></td><td><p>The type of interaction allowed with the user.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>fast</code></em></span></p></td><td><p>If <code class="constant">True</code> the client should save its state as quickly as possible.</p></td></tr></tbody></table></div><p>
The session manager sends a “Save Yourself” message to a
client either to checkpoint it or just before termination so that it
can save its state. The client responds with zero or more “Set
Properties” messages to update the properties indicating how to
restart the client. When all the properties have been set, the client
sends a “Save Yourself Done” message.
</p><p>
If <em class="parameter"><code>interact_style</code></em>
is <code class="constant">SmInteractStyleNone</code> the
client must not interact with the user while saving state.
If <em class="parameter"><code>interact_style</code></em>
is <code class="constant">SmInteractStyleErrors</code> the
client may interact with the user only if an error condition arises.
If <em class="parameter"><code>interact_style</code></em>
is <code class="constant">SmInteractStyleAny</code> then the
client may interact with the user for any purpose. The client must
send an “Interact Request” message and wait for an
“Interact” message from the session manager before it can
interact with the user. When the client is done interacting with the
user, it should send an “Interact Done” message. The
“Interact Request” message can be sent any time after a
“Save Yourself” and before a “Save Yourself
Done.”
</p><p>
If <em class="parameter"><code>save_type</code></em> is <code class="constant">SmSaveLocal</code>
the client must update the properties to reflect its current state.
Specifically, it should save enough information to restore the state as
seen by the user of this client. It should not affect the state as seen
by other users.
If <em class="parameter"><code>save_type</code></em> is <code class="constant">SmSaveGlobal</code>
the user wants the client to commit all of its data to permanent, globally
accessible storage.
If <em class="parameter"><code>save_type</code></em> is <code class="constant">SmSaveBoth</code>
the client should do both of these (it should first commit the data to
permanent storage before updating its properties).
</p><p>
The <em class="parameter"><code>shutdown</code></em> argument specifies whether the session
is being shut down. The interaction is different depending on whether or not
shutdown is set. If not shutting down, then the client can save and
resume normal operation. If shutting down, the client must save and
then must prevent interaction until it receives either a
“Die” or a “Shutdown Cancelled,” because
anything the user does after the save will be lost.
</p><p>
The <em class="parameter"><code>fast</code></em> argument specifies that the client should
save its state as quickly as possible. For example, if the session manager
knows that power is about to fail, it should set <em class="parameter"><code>fast</code></em>
to <code class="constant">True</code>.
</p></div><div class="sect1" title="Sending a Save Yourself Phase 2 Message"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Sending_a_Save_Yourself_Phase_2_Message"></a>Sending a Save Yourself Phase 2 Message</h2></div></div></div><p>
In order to send a “Save Yourself Phase 2” message to a
client, use <a class="xref" href="#SmsSaveYourselfPhase2"><code class="function">SmsSaveYourselfPhase2</code></a>
</p><div class="funcsynopsis"><a id="SmsSaveYourselfPhase2"></a><p><code class="funcdef">void <strong>fsfuncSmsSaveYourselfPhase2</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr></tbody></table></div><p>
The session manager sends this message to a client that has previously
sent a “Save Yourself Phase 2 Request” message. This
message informs the client that all other clients are in a fixed state
and this client can save state that is associated with other clients.
</p></div><div class="sect1" title="Sending an Interact Message"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Sending_an_Interact_Message"></a>Sending an Interact Message</h2></div></div></div><p>
To send an “Interact” message to a client,
use <a class="xref" href="#SmsInteract"><code class="function">SmsInteract</code></a>.
</p><div class="funcsynopsis"><a id="SmsInteract"></a><p><code class="funcdef">void <strong>fsfuncSmsInteract</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr></tbody></table></div><p>
The “Interact” message grants the client the privilege of
interacting with the user. When the client is done interacting with
the user, it must send an “Interact Done” message to the
session manager.
</p></div><div class="sect1" title="Sending a Save Complete Message"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Sending_a_Save_Complete_Message"></a>Sending a Save Complete Message</h2></div></div></div><p>
To send a “Save Complete” message to a client,
use <a class="xref" href="#SmsSaveComplete"><code class="function">SmsSaveComplete</code></a>.
</p><div class="funcsynopsis"><a id="SmsSaveComplete"></a><p><code class="funcdef">void <strong>fsfuncSmsSaveComplete</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr></tbody></table></div><p>
The session manager sends this message when it is done with a
checkpoint. The client is then free to change its state.
</p></div><div class="sect1" title="Sending a Die Message"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Sending_a_Die_Message"></a>Sending a Die Message</h2></div></div></div><p>
To send a “Die” message to a client,
use <a class="xref" href="#SmsDie"><code class="function">SmsDie</code></a>.
</p><div class="funcsynopsis"><a id="SmsDie"></a><p><code class="funcdef">void <strong>fsfuncSmsDie</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr></tbody></table></div><p>
Before the session manager terminates, it should wait for a
“Connection Closed” message from each client that it sent
a “Die” message to, timing out appropriately.
</p></div><div class="sect1" title="Cancelling a Shutdown"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Cancelling_a_Shutdown"></a>Cancelling a Shutdown</h2></div></div></div><p>
To cancel a shutdown, use <a class="xref" href="#SmsShutdownCancelled"><code class="function">SmsShutdownCancelled</code></a>.
</p><div class="funcsynopsis"><a id="SmsShutdownCancelled"></a><p><code class="funcdef">void <strong>fsfuncSmsShutdownCancelled</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr></tbody></table></div><p>
The client can now continue as if the shutdown had never happened. If
the client has not sent a “Save Yourself Done” message
yet, it can either abort the save and send a “Save Yourself
Done” with the success argument set to <code class="constant">False</code>
or it can continue with the save and send a “Save Yourself Done”
with the <em class="parameter"><code>success</code></em> argument set to reflect the outcome
of the save.
</p></div><div class="sect1" title="Returning Properties"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Returning_Properties"></a>Returning Properties</h2></div></div></div><p>
In response to a “Get Properties” message, the session
manager should call <a class="xref" href="#SmsReturnProperties"><code class="function">SmsReturnProperties</code></a>.
</p><div class="funcsynopsis"><a id="SmsReturnProperties"></a><p><code class="funcdef">void <strong>fsfuncSmsReturnProperties</strong>(</code>SmsConn <var class="pdparam">sms_conn</var>, int <var class="pdparam">num_props</var>, SmProp **<var class="pdparam">props</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>num_props</code></em></span></p></td><td><p>The number of properties.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>props</code></em></span></p></td><td><p>The list of properties to return to the client.</p></td></tr></tbody></table></div><p>
The properties are returned as an array of property pointers. For a
description of session management properties and
the <span class="structname">SmProp</span> structure,
see <a class="link" href="#Session_Management_Properties" title="Chapter 7. Session Management Properties">section 7,
“Session Management Properties.”</a>
</p></div><div class="sect1" title="Pinging a Client"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Pinging_a_Client"></a>Pinging a Client</h2></div></div></div><p>
To check that a client is still alive, you should use
the <span class="olink"><code class="function">IcePing</code></span> function provided by the ICE library.
To do so, the ICE connection must be obtained using
the <a class="xref" href="#SmsGetIceConnection"><code class="function">SmsGetIceConnection</code></a>
(see <a class="link" href="#Using_Sms_Informational_Functions" title="Using Sms Informational Functions">section 6.12,
“Using Sms Informational Functions”</a>).
</p><div class="funcsynopsis"><a id="IcePing"></a><p><code class="funcdef">void <strong>fsfuncIcePing</strong>(</code>IceConn <var class="pdparam">ice_conn</var>, IcePingReplyProc <var class="pdparam">ping_reply_proc</var>, IcePointer <var class="pdparam">client_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>ice_conn</code></em></span></p></td><td><p>A valid ICE connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>ping_reply_proc</code></em></span></p></td><td><p>The callback to invoke when the Ping reply arrives.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_data</code></em></span></p></td><td><p>This pointer will be passed to the <a class="xref" href="#IcePingReplyProc"><code class="function">IcePingReplyProc</code></a> callback.</p></td></tr></tbody></table></div><p>
When the Ping reply is ready (if ever),
the <a class="xref" href="#IcePingReplyProc"><code class="function">IcePingReplyProc</code></a> callback will be invoked. A
session manager should have some sort of timeout period, after which
it assumes the client has unexpectedly died.
</p><div class="funcsynopsis"><a id="IcePingReplyProc"></a><p><code class="funcdef">typedef void (*<strong>fsfuncIcePingReplyProc</strong>)(</code>IceConn <var class="pdparam">ice_conn</var>, IcePointer <var class="pdparam">client_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>ice_conn</code></em></span></p></td><td><p>A valid ICE connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>client_data</code></em></span></p></td><td><p>The client data specified in the call to <span class="olink"><code class="function">IcePing</code></span></p></td></tr></tbody></table></div></div><div class="sect1" title="Cleaning Up After a Client Disconnects"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Cleaning_Up_After_a_Client_Disconnects"></a>Cleaning Up After a Client Disconnects</h2></div></div></div><p>
When the session manager receives a “Connection Closed”
message or otherwise detects that the client aborted the connection,
it should call the <a class="xref" href="#SmsCleanUp"><code class="function">SmsCleanUp</code></a> function in order
to free up the connection object.
</p><div class="funcsynopsis"><a id="SmsCleanUp"></a><p><code class="funcdef">void <strong>fsfuncSmsCleanUp</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr></tbody></table></div></div><div class="sect1" title="Using Sms Informational Functions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Using_Sms_Informational_Functions"></a>Using Sms Informational Functions</h2></div></div></div><div class="funcsynopsis"><a id="SmsProtocolVersion"></a><p><code class="funcdef">int <strong>fsfuncSmsProtocolVersion</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><p>
<a class="xref" href="#SmsProtocolVersion"><code class="function">SmsProtocolVersion</code></a> returns the major version of
the session management protocol associated with this session.
</p><div class="funcsynopsis"><a id="SmsProtocolRevision"></a><p><code class="funcdef">int <strong>fsfuncSmsProtocolRevision</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><p>
<a class="xref" href="#SmsProtocolRevision"><code class="function">SmsProtocolRevision</code></a> returns the minor version of
the session management protocol associated with this session.
</p><div class="funcsynopsis"><a id="SmsClientID"></a><p><code class="funcdef">char *<strong>fsfuncSmsClientID</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><p>
<a class="xref" href="#SmsClientID"><code class="function">SmsClientID</code></a> returns a null-terminated string for
the client ID associated with this connection. You should
call <code class="function">free</code> on this pointer when the client ID is
no longer needed.
</p><p>
To obtain the host name of a client,
use <a class="xref" href="#SmsClientHostName"><code class="function">SmsClientHostName</code></a>.
This host name will be needed to restart the client.
</p><div class="funcsynopsis"><a id="SmsClientHostName"></a><p><code class="funcdef">char *<strong>fsfuncSmsClientHostName</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><p>
The string returned is of the form
<em class="parameter"><code>protocol</code></em><code class="literal">/</code><em class="parameter"><code>hostname</code></em>,
where <em class="parameter"><code>protocol</code></em> is one of
{<code class="literal">tcp</code>, <code class="literal">decnet</code>, <code class="literal">local</code>}.
You should call <code class="function">free</code> on the string returned when
it is no longer needed.
</p><div class="funcsynopsis"><a id="SmsGetIceConnection"></a><p><code class="funcdef">IceConn <strong>fsfuncSmsGetIceConnection</strong>(</code>SmsConn <var class="pdparam">sms_conn</var><code>)</code>;</p></div><p>
<a class="xref" href="#SmsGetIceConnection"><code class="function">SmsGetIceConnection</code></a> returns the ICE connection
object associated with this session management connection object. The
ICE connection object can be used to get some additional information
about the connection. Some of the more useful functions which can be
used on the IceConn are <code class="function">IceConnectionNumber</code>
and <code class="function">IceLastSequenceNumber</code>.
For further information, see the
“<span class="citetitle">Inter-Client Exchange Library</span>”
standard.
</p></div><div class="sect1" title="Error Handling"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Error_Handling_2"></a>Error Handling</h2></div></div></div><p>
If the session manager receives an unexpected protocol error from a
client, an error handler is invoked by SMlib. A default error handler
exists which simply prints the error message (it does not exit). The
session manager can change this error handler by
calling <a class="xref" href="#SmsSetErrorHandler"><code class="function">SmsSetErrorHandler</code></a>.
</p><div class="funcsynopsis"><a id="SmsSetErrorHandler"></a><p><code class="funcdef">SmsErrorHandler <strong>fsfuncSmsSetErrorHandler</strong>(</code>SmsErrorHandler <var class="pdparam">handler</var><code>)</code>;</p></div><p>
The error handler. You should pass <code class="constant">NULL</code>
to restore the default handler.
</p><p>
<a class="xref" href="#SmsSetErrorHandler"><code class="function">SmsSetErrorHandler</code></a> returns the previous error handler.
The <a class="xref" href="#SmsErrorHandler"><code class="function">SmsErrorHandler</code></a> has the following type:
</p><div class="funcsynopsis"><a id="SmsErrorHandler"></a><p><code class="funcdef">typedef void (*<strong>fsfuncSmsErrorHandler</strong>)(</code>SmsConn <var class="pdparam">sms_conn</var>, Bool <var class="pdparam">swap</var>, int <var class="pdparam">offending_minor_opcode</var>, unsigned long <var class="pdparam">offending_sequence_num</var>, int <var class="pdparam">error_class</var>, int <var class="pdparam">severity</var>, IcePointer <var class="pdparam">values</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>sms_conn</code></em></span></p></td><td><p>The session management connection object.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>swap</code></em></span></p></td><td><p>A flag which indicates if the specified values need byte swapping.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>offending_minor_opcode</code></em></span></p></td><td><p>The minor opcode of the offending message.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>offending_sequence_num</code></em></span></p></td><td><p>The sequence number of the offending message.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>error_class</code></em></span></p></td><td><p>The error class of the offending message.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>severity</code></em></span></p></td><td><p>
<code class="constant">IceCanContinue</code>,
<code class="constant">IceFatalToProtocol</code>, or
<code class="constant">IceFatalToConnection</code>
</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>values</code></em></span></p></td><td><p>Any additional error values specific to the minor opcode and class.</p></td></tr></tbody></table></div><p>
Note that this error handler is invoked for protocol related errors.
To install an error handler to be invoked when an IO error occurs,
use <span class="olink"><code class="function">IceSetIOErrorHandler</code></span>.
For further information, see the
“<span class="citetitle">Inter-Client Exchange Library</span>”
standard.
</p></div></div><div class="chapter" title="Chapter 7. Session Management Properties"><div class="titlepage"><div><div><h2 class="title"><a id="Session_Management_Properties"></a>Chapter 7. Session Management Properties</h2></div></div></div><p>
Each property is defined by the <span class="structname">SmProp</span> structure:
</p><pre class="synopsis">
typedef struct {
char *name; /* name of property */
char *type; /* type of property */
int num_vals; /* number of values */
SmPropValue *vals; /* the list of values */
} SmProp;
typedef struct {
int length; /* the length of the value */
SmPointer value; /* the value */
} SmPropValue;
</pre><p>
</p><p>
The X Session Management Protocol defines a list of predefined
properties, several of which are required to be set by the client.
The following table specifies the predefined properties and indicates
which ones are required. Each property has a type associated with it.
</p><p>
A type of <span class="type">SmCARD8</span> indicates that there is a single 1-byte value.
A type of <span class="type">SmARRAY8</span> indicates that there is a single array of bytes.
A type of <span class="type">SmLISTofARRAY8</span> indicates that there is a list of array of
bytes.
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Name</th><th align="left">Type</th><th align="left"><acronym class="acronym">POSIX</acronym> Type</th><th align="left">Required</th></tr></thead><tbody><tr><td align="left"><span class="property">SmCloneCommand</span></td><td align="left">OS-specific</td><td align="left"><span class="type">SmLISTofARRAY8</span></td><td align="left">Yes</td></tr><tr><td align="left"><span class="property">SmCurrentDirectory</span></td><td align="left">OS-specific</td><td align="left"><span class="type">SmARRAY8</span></td><td align="left">No</td></tr><tr><td align="left"><span class="property">SmDiscardCommand</span></td><td align="left">OS-specific</td><td align="left"><span class="type">SmLISTofARRAY8</span></td><td align="left">No*</td></tr><tr><td align="left"><span class="property">SmEnvironment</span></td><td align="left">OS-specific</td><td align="left"><span class="type">SmLISTofARRAY8</span></td><td align="left">No</td></tr><tr><td align="left"><span class="property">SmProcessID</span></td><td align="left">OS-specific</td><td align="left"><span class="type">SmARRAY8</span></td><td align="left">No</td></tr><tr><td align="left"><span class="property">SmProgram</span></td><td align="left">OS-specific</td><td align="left"><span class="type">SmARRAY8</span></td><td align="left">Yes</td></tr><tr><td align="left"><span class="property">SmRestartCommand</span></td><td align="left">OS-specific</td><td align="left"><span class="type">SmLISTofARRAY8</span></td><td align="left">Yes</td></tr><tr><td align="left"><span class="property">SmResignCommand</span></td><td align="left">OS-specific</td><td align="left"><span class="type">SmLISTofARRAY8</span></td><td align="left">No</td></tr><tr><td align="left"><span class="property">SmRestartStyleHint</span></td><td align="left"><span class="type">SmCARD8</span></td><td align="left"><span class="type">SmCARD8</span></td><td align="left">No</td></tr><tr><td align="left"><span class="property">SmShutdownCommand</span></td><td align="left">OS-specific</td><td align="left"><span class="type">SmLISTofARRAY8</span></td><td align="left">No</td></tr><tr><td align="left"><span class="property">SmUserID</span></td><td align="left"><span class="type">SmARRAY8</span></td><td align="left"><span class="type">SmARRAY8</span></td><td align="left">Yes</td></tr></tbody></table></div><p>
* Required if any state is stored in an external repository (for
example, state file).
</p><div class="itemizedlist"><ul class="itemizedlist" type="bullet"><li class="listitem" style="list-style-type: disc"><p><span class="property">SmCloneCommand</span></p><p>
This is like the <span class="property">SmRestartCommand</span>, except it restarts a
copy of the application. The only difference is that the application does not
supply its client ID at register time. On <acronym class="acronym">POSIX</acronym> systems,
this should be of type <span class="type">SmLISTofARRAY8</span>.
</p></li><li class="listitem" style="list-style-type: disc"><p><span class="property">SmCurrentDirectory</span></p><p>
On <acronym class="acronym">POSIX</acronym>-based systems, this specifies the value of the
current directory that needs to be set up prior to starting the
<span class="property">SmProgram</span> and should of type <span class="type">SmARRAY8</span>.
</p></li><li class="listitem" style="list-style-type: disc"><p><span class="property">SmDiscardCommand</span></p><p>
The discard command contains a command that when delivered to the host
that the client is running on (determined from the connection), will
cause it to discard any information about the current state. If this
command is not specified, the Session Manager will assume that all of
the client's state is encoded in the <span class="property">SmRestartCommand</span>.
On <acronym class="acronym">POSIX</acronym> systems, the type should be
<span class="type">SmLISTofARRAY8</span>.
</p></li><li class="listitem" style="list-style-type: disc"><p><span class="property">SmEnvironment</span></p><p>
On <acronym class="acronym">POSIX</acronym> based systems, this will be of type
<span class="type">SmLISTofARRAY8</span>, where the <span class="type">ARRAY8</span>s alternate between
environment variable name and environment variable value.
</p></li><li class="listitem" style="list-style-type: disc"><p><span class="property">SmProcessID</span></p><p>
This specifies an OS-specific identifier for the process.
On <acronym class="acronym">POSIX</acronym> systems, this should contain the return value
of <code class="function">getpid</code> turned into a Latin-1 (decimal) string.
</p></li><li class="listitem" style="list-style-type: disc"><p><span class="property">SmProgram</span></p><p>
This is the name of the program that is running. On <acronym class="acronym">POSIX</acronym>
systems, this should be first parameter passed to <code class="function">execve</code>
and should be of type <span class="type">SmARRAY8</span>.
</p></li><li class="listitem" style="list-style-type: disc"><p><span class="property">SmRestartCommand</span></p><p>
The restart command contains a command that, when delivered to the
host that the client is running on (determined from the connection),
will cause the client to restart in its current state.
On <acronym class="acronym">POSIX</acronym>-based systems, this is of
type <span class="type">SmLISTofARRAY8</span>, and each of the elements in
the array represents an element in the <code class="varname">argv</code>
array. This restart command should ensure that the client restarts
with the specified client-ID.
</p></li><li class="listitem" style="list-style-type: disc"><p><span class="property">SmResignCommand</span></p><p>
A client that sets the <span class="property">SmRestartStyleHint</span>
to <code class="constant">SmRestartAnyway</code> uses this property to specify a
command that undoes the effect of the client and removes any saved state.
As an example, consider a user that runs <span class="command"><strong>xmodmap</strong></span> which
registers with the Session Manager,
sets <span class="property">SmRestartStyleHint</span>
to <code class="constant">SmRestartAnyway</code>, and then
terminates. To allow the Session Manager (at the user's request) to
undo this, <span class="command"><strong>xmodmap</strong></span> would register a
<span class="property">SmResignCommand</span> that undoes the effects of
the <span class="command"><strong>xmodmap</strong></span>.
</p></li><li class="listitem" style="list-style-type: disc"><p><span class="property">SmRestartStyleHint</span></p><p>
If the <span class="property">SmRestartStyleHint</span> is present, it will contain the
style of restarting the client prefers. If this style is not specified,
<code class="constant">SmRestartIfRunning</code> is assumed.
The possible values are as follows:
</p><div class="informaltable"><table border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Name</th><th align="left">Value</th></tr></thead><tbody><tr><td align="left"><code class="constant">SmRestartIfRunning</code></td><td align="left">0</td></tr><tr><td align="left"><code class="constant">SmRestartAnyway</code></td><td align="left">1</td></tr><tr><td align="left"><code class="constant">SmRestartImmediately</code></td><td align="left">2</td></tr><tr><td align="left"><code class="constant">SmRestartNever</code></td><td align="left">3</td></tr></tbody></table></div><p>
</p><p>
The <code class="constant">SmRestartIfRunning</code> style is used in the usual case.
The client should be restarted in the next session if it was running at
the end of the current session.
</p><p>
The <code class="constant">SmRestartAnyway</code> style is used to tell the Session
Manager that the application should be restarted in the next session even if
it exits before the current session is terminated. It should be noted that
this is only a hint and the Session Manager will follow the policies
specified by its users in determining what applications to restart.
</p><p>
A client that uses <code class="constant">SmRestartAnyway</code> should also set the
<span class="property">SmResignCommand</span> and <span class="property">SmShutdownCommand</span>
properties to commands that undo the state of the client after it exits.
</p><p>
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.
</p><p>
<code class="constant">SmRestartNever</code> style specifies that the client does not
wish to be restarted in the next session.
</p></li><li class="listitem" style="list-style-type: disc"><p><span class="property">SmShutdownCommand</span></p><p>
This command is executed at shutdown time to clean up after a client
that is no longer running but retained its state by setting
<span class="property">SmRestartStyleHint</span> to
<code class="constant">SmRestartAnyway</code>. The client must not remove any saved
state as the client is still part of the session. As an
example, consider a client that turns on a camera at start up time.
This client then exits. At session shutdown, the user wants the
camera turned off. This client would set the
<span class="property">SmRestartStyleHint</span> to
<code class="constant">SmRestartAnyway</code> and would register
a <span class="property">SmShutdownCommand</span> that would turn off the camera.
</p></li><li class="listitem" style="list-style-type: disc"><p><span class="property">SmUserID</span></p><p>
Specifies the user ID. On <acronym class="acronym">POSIX</acronym>-based systems, this will
contain the user's name (the <em class="structfield"><code>pw_name</code></em> member of
<span class="structname">struct passwd</span>).
</p></li></ul></div></div><div class="chapter" title="Chapter 8. Freeing Data"><div class="titlepage"><div><div><h2 class="title"><a id="Freeing_Data"></a>Chapter 8. Freeing Data</h2></div></div></div><p>
To free an individual property, use <a class="xref" href="#SmFreeProperty"><code class="function">SmFreeProperty</code></a>
</p><div class="funcsynopsis"><a id="SmFreeProperty"></a><p><code class="funcdef">void <strong>fsfuncSmFreeProperty</strong>(</code>SmProp *<var class="pdparam">prop</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>prop</code></em></span></p></td><td><p>The property to free.</p></td></tr></tbody></table></div><p>
To free the reason strings from
the <a class="xref" href="#SmsCloseConnectionProc"><code class="function">SmsCloseConnectionProc</code></a> callback,
use <a class="xref" href="#SmFreeReasons"><code class="function">SmFreeReasons</code></a>
</p><div class="funcsynopsis"><a id="SmFreeReasons"></a><p><code class="funcdef">void <strong>fsfuncSmFreeReasons</strong>(</code>int <var class="pdparam">count</var>, char **<var class="pdparam">reasons</var><code>)</code>;</p></div><div class="variablelist"><table border="0"><col align="left" valign="top" /><tbody><tr><td><p><span class="term"><em class="parameter"><code>count</code></em></span></p></td><td><p>The number of reason strings.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>reasons</code></em></span></p></td><td><p>The list of reason strings to free.</p></td></tr></tbody></table></div></div><div class="chapter" title="Chapter 9. Authentication of Clients"><div class="titlepage"><div><div><h2 class="title"><a id="Authentication_of_Clients"></a>Chapter 9. Authentication of Clients</h2></div></div></div><p>
As stated earlier, the session management protocol is layered on top
of ICE. Authentication occurs at two levels in the ICE protocol:
</p><div class="itemizedlist"><ul class="itemizedlist" type="bullet"><li class="listitem" style="list-style-type: disc"><p>The first is when an ICE connection is opened.</p></li><li class="listitem" style="list-style-type: disc"><p>The second is when a Protocol Setup occurs on an ICE connection.</p></li></ul></div><p>
</p><p>
The authentication methods that are available are
implementation-dependent (that is., dependent on the ICElib and SMlib
implementations in use). For further information, see the
“<span class="citetitle">Inter-Client Exchange Library</span>”
standard.
</p></div><div class="chapter" title="Chapter 10. Working in a Multi-Threaded Environment"><div class="titlepage"><div><div><h2 class="title"><a id="Working_in_a_Multi_Threaded_Environment"></a>Chapter 10. Working in a Multi-Threaded Environment</h2></div></div></div><p>
To declare that multiple threads in an application will be using SMlib
(or any other library layered on top of ICElib), you should
call <code class="function">IceInitThreads</code>.
For further information, see the
“<span class="citetitle">Inter-Client Exchange Library</span>”
standard.
</p></div><div class="chapter" title="Chapter 11. Acknowledgements"><div class="titlepage"><div><div><h2 class="title"><a id="Acknowledgements"></a>Chapter 11. Acknowledgements</h2></div></div></div><p>
Thanks to the following people for their participation in the
X Session Management design: Jordan Brown, Ellis Cohen, Donna Converse,
Stephen Gildea, Vania Joloboff, Stuart Marks, Bob Scheifler, Ralph Swick,
and Mike Wexler.
</p></div></div></body></html>
|