summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Makefile.am5
-rw-r--r--choose.c30
-rw-r--r--configure.ac51
-rw-r--r--globals.c91
-rw-r--r--info.c62
-rw-r--r--info.h6
-rw-r--r--log.c10
-rw-r--r--mainwin.c14
-rw-r--r--misc.c1
-rw-r--r--prop.c2
-rw-r--r--remote.c5
-rw-r--r--restart.c2
-rw-r--r--save.c90
-rw-r--r--saveutil.c5
-rw-r--r--signals.c3
-rw-r--r--xsm.c84
-rw-r--r--xsm.h17
18 files changed, 215 insertions, 267 deletions
diff --git a/.gitignore b/.gitignore
index c3cab11..5ca55d6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,7 @@ stamp-h1
xsm
xsm.1
*~
+*.o
+xsm-*.tar.*
+ChangeLog
+tags
diff --git a/Makefile.am b/Makefile.am
index f474fa3..2bc8c40 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,6 +67,7 @@ appman_PRE = \
xsm.man
# App default files
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
appdefaultdir = @appdefaultdir@
@@ -81,7 +82,7 @@ systeminit_DATA = system.xsm
#
-EXTRA_DIST = globals.c system.xsm
+EXTRA_DIST = system.xsm
appmandir = $(APP_MAN_DIR)
@@ -121,6 +122,6 @@ MAINTAINERCLEANFILES = ChangeLog
.PHONY: ChangeLog
ChangeLog:
- (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+ $(CHANGELOG_CMD)
dist-hook: ChangeLog
diff --git a/choose.c b/choose.c
index e1711f9..c2a0c34 100644
--- a/choose.c
+++ b/choose.c
@@ -59,16 +59,16 @@ static Pixel save_message_background;
static int delete_session_phase = 0;
static int break_lock_phase = 0;
-Widget chooseSessionPopup;
-Widget chooseSessionForm;
-Widget chooseSessionLabel;
-Widget chooseSessionListWidget;
-Widget chooseSessionMessageLabel;
-Widget chooseSessionLoadButton;
-Widget chooseSessionDeleteButton;
-Widget chooseSessionBreakLockButton;
-Widget chooseSessionFailSafeButton;
-Widget chooseSessionCancelButton;
+static Widget chooseSessionPopup;
+static Widget chooseSessionForm;
+static Widget chooseSessionLabel;
+static Widget chooseSessionListWidget;
+static Widget chooseSessionMessageLabel;
+static Widget chooseSessionLoadButton;
+static Widget chooseSessionDeleteButton;
+static Widget chooseSessionBreakLockButton;
+static Widget chooseSessionFailSafeButton;
+static Widget chooseSessionCancelButton;
@@ -736,7 +736,7 @@ create_choose_session_popup(void)
NULL);
XtAddCallback (chooseSessionLoadButton, XtNcallback,
- ChooseSessionLoadXtProc, 0);
+ ChooseSessionLoadXtProc, NULL);
chooseSessionDeleteButton = XtVaCreateManagedWidget (
"chooseSessionDeleteButton", commandWidgetClass, chooseSessionForm,
@@ -745,7 +745,7 @@ create_choose_session_popup(void)
NULL);
XtAddCallback (chooseSessionDeleteButton, XtNcallback,
- ChooseSessionDeleteXtProc, 0);
+ ChooseSessionDeleteXtProc, NULL);
chooseSessionBreakLockButton = XtVaCreateManagedWidget (
"chooseSessionBreakLockButton",
@@ -755,7 +755,7 @@ create_choose_session_popup(void)
NULL);
XtAddCallback (chooseSessionBreakLockButton, XtNcallback,
- ChooseSessionBreakLockXtProc, 0);
+ ChooseSessionBreakLockXtProc, NULL);
chooseSessionFailSafeButton = XtVaCreateManagedWidget (
"chooseSessionFailSafeButton", commandWidgetClass, chooseSessionForm,
@@ -764,7 +764,7 @@ create_choose_session_popup(void)
NULL);
XtAddCallback (chooseSessionFailSafeButton, XtNcallback,
- ChooseSessionFailSafeXtProc, 0);
+ ChooseSessionFailSafeXtProc, NULL);
chooseSessionCancelButton = XtVaCreateManagedWidget (
@@ -774,7 +774,7 @@ create_choose_session_popup(void)
NULL);
XtAddCallback (chooseSessionCancelButton, XtNcallback,
- ChooseSessionCancelXtProc, 0);
+ ChooseSessionCancelXtProc, NULL);
XtAppAddActions (appContext, choose_actions, XtNumber (choose_actions));
diff --git a/configure.ac b/configure.ac
index 46f7aaf..321cac4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,50 +31,33 @@ AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_INSTALL
-if [[ -z $RSH ]] ; then
- AC_PATH_PROG(RSH,rsh)
-fi
-if [[ -z $RSH ]] ; then
- AC_PATH_PROG(RSH,rcmd)
-fi
-if [[ -z $RSH ]] ; then
- AC_PATH_PROG(RSH,remsh)
-fi
-if [[ -z $RSH ]] ; then
- AC_MSG_ERROR(No rsh like program found)
-fi
-
-#if !defined(RshCmd)
-#if SystemV
-#ifdef HPArchitecture
-#define RshCmd remsh
-#else
-#define RshCmd rcmd
-#endif
-#else
-#define RshCmd rsh
-#endif
-#endif
+AC_ARG_WITH(rsh, AS_HELP_STRING([--with-rsh=PATH],
+ [Rsh command to use (default: $bindir/ssh)]),
+ [ rsh="$withval"],
+ [ rsh=${bindir}/ssh ])
+RSH=$rsh
+AC_SUBST(RSH)
AC_CHECK_FUNC([mkstemp],
- AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the `mkstemp' function.]))
+ AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the 'mkstemp' function.]))
AC_CHECK_FUNC([putenv], [],
- AC_DEFINE(NOPUTENV,1,[Define to 1 if you DO NOT have the `putenv' function.]))
+ AC_DEFINE(NOPUTENV,1,[Define to 1 if you DO NOT have the 'putenv' function.]))
# Checks for pkg-config packages
-PKG_CHECK_MODULES(XSM, x11 xt ice sm)
-PKG_CHECK_MODULES(XSM_XAW, xaw7)
-XSM_CFLAGS="$XSM_XAW_CFLAGS $XSM_CFLAGS"
-XSM_LIBS="$XSM_XAW_LIBS $XSM_LIBS"
-
+PKG_CHECK_MODULES(XSM, x11 xt ice sm xaw7)
+XSM_CFLAGS="$CWARNFLAGS $XSM_CFLAGS"
+XSM_LIBS="$XSM_LIBS"
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_ARG_WITH(appdefaultdir,
+ AC_HELP_STRING([--with-appdefaultdir=<pathname>],
+ [specify directory for app-defaults files (default is autodetected)]),
+ [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
AC_SUBST(XSM_CFLAGS)
AC_SUBST(XSM_LIBS)
-
-PKG_CHECK_MODULES(APPDEFS, xt)
-appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
AC_SUBST(appdefaultdir)
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
+XORG_CHANGELOG
AC_OUTPUT([Makefile])
diff --git a/globals.c b/globals.c
deleted file mode 100644
index 2d917d9..0000000
--- a/globals.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* $Xorg: globals.c,v 1.4 2001/02/09 02:05:59 xorgcvs Exp $ */
-/******************************************************************************
-
-Copyright 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice 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
-OPEN GROUP 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.
-
-Except as contained in this notice, the name of The Open Group 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 Open Group.
-******************************************************************************/
-/* $XFree86: xc/programs/xsm/globals.c,v 1.5 2001/12/08 18:33:45 herrb Exp $ */
-
-#include <X11/ICE/ICEutil.h>
-
-int Argc;
-char **Argv;
-
-List *RunningList;
-List *PendingList;
-List *RestartAnywayList;
-List *RestartImmedList;
-
-List *WaitForSaveDoneList;
-List *InitialSaveList;
-List *FailedSaveList;
-List *WaitForInteractList;
-List *WaitForPhase2List;
-
-Bool wantShutdown = False;
-Bool shutdownInProgress = False;
-Bool phase2InProgress = False;
-Bool saveInProgress = False;
-Bool shutdownCancelled = False;
-
-Bool verbose = False;
-
-char *sm_id = NULL;
-
-char *networkIds = NULL;
-char *session_name = NULL;
-
-IceAuthDataEntry *authDataEntries = NULL;
-int numTransports = 0;
-
-Bool client_info_visible = False;
-Bool client_prop_visible = False;
-Bool client_log_visible = False;
-
-String *clientListNames = NULL;
-ClientRec **clientListRecs = NULL;
-int numClientListNames = 0;
-
-int current_client_selected;
-
-int sessionNameCount = 0;
-String *sessionNamesShort = NULL;
-String *sessionNamesLong = NULL;
-Bool *sessionsLocked = NULL;
-
-int num_clients_in_last_session = -1;
-
-char **non_session_aware_clients = NULL;
-int non_session_aware_count = 0;
-
-char *display_env = NULL, *non_local_display_env = NULL;
-char *session_env = NULL, *non_local_session_env = NULL;
-char *audio_env = NULL;
-
-Bool need_to_name_session = False;
-
-Bool remote_allowed;
-
-XtAppContext appContext;
-Widget topLevel;
-
-XtSignalId sig_term_id, sig_usr1_id;
diff --git a/info.c b/info.c
index 7760ae4..728bbb3 100644
--- a/info.c
+++ b/info.c
@@ -43,26 +43,26 @@ in this Software without prior written authorization from The Open Group.
static Pixmap checkBitmap;
Widget clientInfoPopup;
-Widget clientInfoForm;
-Widget viewPropButton;
-Widget cloneButton;
-Widget killClientButton;
-Widget clientInfoDoneButton;
-Widget restartHintButton;
-Widget restartHintMenu;
-Widget restartIfRunning;
-Widget restartAnyway;
-Widget restartImmediately;
-Widget restartNever;
-Widget clientListWidget;
-Widget noClientsLabel;
-Widget manualRestartLabel;
-Widget manualRestartCommands;
+static Widget clientInfoForm;
+static Widget viewPropButton;
+static Widget cloneButton;
+static Widget killClientButton;
+static Widget clientInfoDoneButton;
+static Widget restartHintButton;
+static Widget restartHintMenu;
+static Widget restartIfRunning;
+static Widget restartAnyway;
+static Widget restartImmediately;
+static Widget restartNever;
+Widget clientListWidget;
+static Widget noClientsLabel;
+Widget manualRestartLabel;
+Widget manualRestartCommands;
Widget clientPropPopup;
-Widget clientPropForm;
-Widget clientPropDoneButton;
-Widget clientPropTextWidget;
+static Widget clientPropForm;
+static Widget clientPropDoneButton;
+static Widget clientPropTextWidget;
@@ -815,8 +815,8 @@ create_client_info_popup(void)
XtNleft, XawChainLeft,
XtNright, XawChainLeft,
NULL);
-
- XtAddCallback (viewPropButton, XtNcallback, ViewPropXtProc, 0);
+
+ XtAddCallback (viewPropButton, XtNcallback, ViewPropXtProc, NULL);
cloneButton = XtVaCreateManagedWidget (
@@ -828,8 +828,8 @@ create_client_info_popup(void)
XtNleft, XawChainLeft,
XtNright, XawChainLeft,
NULL);
-
- XtAddCallback (cloneButton, XtNcallback, CloneXtProc, 0);
+
+ XtAddCallback (cloneButton, XtNcallback, CloneXtProc, NULL);
killClientButton = XtVaCreateManagedWidget (
@@ -841,8 +841,8 @@ create_client_info_popup(void)
XtNleft, XawChainLeft,
XtNright, XawChainLeft,
NULL);
-
- XtAddCallback (killClientButton, XtNcallback, KillClientXtProc, 0);
+
+ XtAddCallback (killClientButton, XtNcallback, KillClientXtProc, NULL);
restartHintButton = XtVaCreateManagedWidget (
@@ -880,10 +880,10 @@ create_client_info_popup(void)
XtNleftMargin, 18,
NULL);
- XtAddCallback (restartIfRunning, XtNcallback, RestartHintXtProc, 0);
- XtAddCallback (restartAnyway, XtNcallback, RestartHintXtProc, 0);
- XtAddCallback (restartImmediately, XtNcallback, RestartHintXtProc, 0);
- XtAddCallback (restartNever, XtNcallback, RestartHintXtProc, 0);
+ XtAddCallback (restartIfRunning, XtNcallback, RestartHintXtProc, NULL);
+ XtAddCallback (restartAnyway, XtNcallback, RestartHintXtProc, NULL);
+ XtAddCallback (restartImmediately, XtNcallback, RestartHintXtProc, NULL);
+ XtAddCallback (restartNever, XtNcallback, RestartHintXtProc, NULL);
clientInfoDoneButton = XtVaCreateManagedWidget (
@@ -896,7 +896,7 @@ create_client_info_popup(void)
XtNright, XawChainLeft,
NULL);
- XtAddCallback (clientInfoDoneButton, XtNcallback, listDoneXtProc, 0);
+ XtAddCallback (clientInfoDoneButton, XtNcallback, listDoneXtProc, NULL);
clientListWidget = XtVaCreateManagedWidget (
@@ -910,7 +910,7 @@ create_client_info_popup(void)
XtNbottom, XawChainTop,
NULL);
- XtAddCallback (clientListWidget, XtNcallback, ClientListXtProc, 0);
+ XtAddCallback (clientListWidget, XtNcallback, ClientListXtProc, NULL);
noClientsLabel = XtVaCreateWidget (
"noClientsLabel", labelWidgetClass, clientInfoForm,
@@ -971,7 +971,7 @@ create_client_info_popup(void)
XtNright, XawChainLeft,
NULL);
- XtAddCallback (clientPropDoneButton, XtNcallback, clientPropDoneXtProc, 0);
+ XtAddCallback (clientPropDoneButton, XtNcallback, clientPropDoneXtProc, NULL);
clientPropTextWidget = XtVaCreateManagedWidget (
diff --git a/info.h b/info.h
index c07f404..3fb709c 100644
--- a/info.h
+++ b/info.h
@@ -41,4 +41,10 @@ extern void ClientInfoXtProc(Widget w, XtPointer client_data,
XtPointer callData);
extern void create_client_info_popup(void);
+extern Widget clientInfoPopup;
+extern Widget clientPropPopup;
+extern Widget clientListWidget;
+extern Widget manualRestartLabel;
+extern Widget manualRestartCommands;
+
#endif
diff --git a/log.c b/log.c
index 179f55f..930c3f5 100644
--- a/log.c
+++ b/log.c
@@ -35,10 +35,10 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xaw/Command.h>
#include <X11/Xaw/AsciiText.h>
-Widget logPopup;
-Widget logForm;
-Widget logText;
-Widget logOkButton;
+static Widget logPopup;
+static Widget logForm;
+static Widget logText;
+static Widget logOkButton;
@@ -146,5 +146,5 @@ create_log_popup(void)
XtNright, XawChainLeft,
NULL);
- XtAddCallback (logOkButton, XtNcallback, logOkXtProc, 0);
+ XtAddCallback (logOkButton, XtNcallback, logOkXtProc, NULL);
}
diff --git a/mainwin.c b/mainwin.c
index ef7a96d..f14748d 100644
--- a/mainwin.c
+++ b/mainwin.c
@@ -43,8 +43,8 @@ Widget clientInfoButton;
Widget logButton;
Widget checkPointButton;
Widget shutdownButton;
-Widget shutdownMenu;
-Widget shutdownSave;
+static Widget shutdownMenu;
+static Widget shutdownSave;
Widget shutdownDontSave;
@@ -80,7 +80,7 @@ create_main_window (void)
XtNjustify, XtJustifyLeft,
NULL);
- XtAddCallback (clientInfoButton, XtNcallback, ClientInfoXtProc, 0);
+ XtAddCallback (clientInfoButton, XtNcallback, ClientInfoXtProc, NULL);
logButton = XtVaCreateManagedWidget (
"logButton", commandWidgetClass, mainWindow,
@@ -90,7 +90,7 @@ create_main_window (void)
XtNjustify, XtJustifyLeft,
NULL);
- XtAddCallback (logButton, XtNcallback, DisplayLogXtProc, 0);
+ XtAddCallback (logButton, XtNcallback, DisplayLogXtProc, NULL);
checkPointButton = XtVaCreateManagedWidget (
"checkPointButton", commandWidgetClass, mainWindow,
@@ -100,7 +100,7 @@ create_main_window (void)
XtNjustify, XtJustifyLeft,
NULL);
- XtAddCallback (checkPointButton, XtNcallback, CheckPointXtProc, 0);
+ XtAddCallback (checkPointButton, XtNcallback, CheckPointXtProc, NULL);
shutdownButton = XtVaCreateManagedWidget (
"shutdownButton", menuButtonWidgetClass, mainWindow,
@@ -123,8 +123,8 @@ create_main_window (void)
"shutdownDontSave", smeBSBObjectClass, shutdownMenu,
NULL);
- XtAddCallback (shutdownSave, XtNcallback, ShutdownSaveXtProc, 0);
- XtAddCallback (shutdownDontSave, XtNcallback, ShutdownDontSaveXtProc, 0);
+ XtAddCallback (shutdownSave, XtNcallback, ShutdownSaveXtProc, NULL);
+ XtAddCallback (shutdownDontSave, XtNcallback, ShutdownDontSaveXtProc, NULL);
XtAppAddActions (appContext, actions, XtNumber (actions));
}
diff --git a/misc.c b/misc.c
index 544b50c..0efa8e4 100644
--- a/misc.c
+++ b/misc.c
@@ -42,7 +42,6 @@ putenv(char *s)
{
char *v;
int varlen, idx;
- extern char **environ;
char **newenv;
static int virgin = 1; /* true while "environ" is a virgin */
diff --git a/prop.c b/prop.c
index 2e0958d..b5ebac8 100644
--- a/prop.c
+++ b/prop.c
@@ -30,8 +30,6 @@ in this Software without prior written authorization from The Open Group.
#include "prop.h"
#include <X11/Xaw/List.h>
-extern Widget clientListWidget;
-
void
FreePropValues(List *propValues)
diff --git a/remote.c b/remote.c
index 52df33e..76cde30 100644
--- a/remote.c
+++ b/remote.c
@@ -32,13 +32,8 @@ in this Software without prior written authorization from The Open Group.
#include "xsm.h"
#include "log.h"
-#include <X11/ICE/ICEutil.h>
-
static char *format_rstart_env(char *str);
-extern IceAuthDataEntry *authDataEntries;
-extern int numTransports;
-
void
remote_start(char *restart_protocol, char *restart_machine, char *program,
diff --git a/restart.c b/restart.c
index 10e9ba3..0cd7714 100644
--- a/restart.c
+++ b/restart.c
@@ -30,8 +30,6 @@ in this Software without prior written authorization from The Open Group.
#include "restart.h"
#include "saveutil.h"
-extern char **environ;
-
/*
* Until XSMP provides a better way to know which clients are "managers",
diff --git a/save.c b/save.c
index 229a6d7..1c40d72 100644
--- a/save.c
+++ b/save.c
@@ -41,42 +41,36 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xaw/AsciiText.h>
-Widget savePopup;
-Widget saveForm;
-Widget saveMessageLabel;
-Widget saveName;
-Widget saveTypeLabel;
-Widget saveTypeGlobal;
-Widget saveTypeLocal;
-Widget saveTypeBoth;
-Widget interactStyleLabel;
-Widget interactStyleNone;
-Widget interactStyleErrors;
-Widget interactStyleAny;
-Widget saveOkButton;
-Widget helpSaveButton;
-Widget saveCancelButton;
-Widget helpPopup;
-Widget helpForm;
-Widget helpSaveText;
-Widget helpSaveOkButton;
-Widget nameInUsePopup;
-Widget nameInUseForm;
-Widget nameInUseLabel;
-Widget nameInUseOverwriteButton;
-Widget nameInUseCancelButton;
-Widget badSavePopup;
-Widget badSaveForm;
-Widget badSaveLabel;
-Widget badSaveOkButton;
-Widget badSaveCancelButton;
-Widget badSaveListWidget;
-
-extern Widget clientInfoPopup;
-extern Widget clientPropPopup;
-extern Widget nameSessionPopup;
-
-extern int checkpoint_from_signal;
+static Widget savePopup;
+static Widget saveForm;
+static Widget saveMessageLabel;
+static Widget saveName;
+static Widget saveTypeLabel;
+static Widget saveTypeGlobal;
+static Widget saveTypeLocal;
+static Widget saveTypeBoth;
+static Widget interactStyleLabel;
+static Widget interactStyleNone;
+static Widget interactStyleErrors;
+static Widget interactStyleAny;
+static Widget saveOkButton;
+static Widget helpSaveButton;
+static Widget saveCancelButton;
+static Widget helpPopup;
+static Widget helpForm;
+static Widget helpSaveText;
+static Widget helpSaveOkButton;
+static Widget nameInUsePopup;
+static Widget nameInUseForm;
+static Widget nameInUseLabel;
+static Widget nameInUseOverwriteButton;
+static Widget nameInUseCancelButton;
+static Widget badSavePopup;
+static Widget badSaveForm;
+static Widget badSaveLabel;
+static Widget badSaveOkButton;
+static Widget badSaveCancelButton;
+static Widget badSaveListWidget;
static int saveTypeData[] = {
SmSaveLocal,
@@ -959,8 +953,8 @@ create_save_popup(void)
XtNvertDistance, 20,
XtNresizable, True,
NULL);
-
- XtAddCallback (saveOkButton, XtNcallback, SaveOkXtProc, 0);
+
+ XtAddCallback (saveOkButton, XtNcallback, SaveOkXtProc, NULL);
helpSaveButton = XtVaCreateManagedWidget (
@@ -970,7 +964,7 @@ create_save_popup(void)
XtNvertDistance, 20,
NULL);
- XtAddCallback (helpSaveButton, XtNcallback, HelpSaveXtProc, 0);
+ XtAddCallback (helpSaveButton, XtNcallback, HelpSaveXtProc, NULL);
saveCancelButton = XtVaCreateManagedWidget (
@@ -980,7 +974,7 @@ create_save_popup(void)
XtNvertDistance, 20,
NULL);
- XtAddCallback (saveCancelButton, XtNcallback, SaveCancelXtProc, 0);
+ XtAddCallback (saveCancelButton, XtNcallback, SaveCancelXtProc, NULL);
XtSetKeyboardFocus (saveForm, saveName);
@@ -1027,7 +1021,7 @@ create_save_popup(void)
NULL);
XtAddCallback (nameInUseOverwriteButton, XtNcallback,
- NameInUseOverwriteXtProc, 0);
+ NameInUseOverwriteXtProc, NULL);
nameInUseCancelButton = XtVaCreateManagedWidget (
@@ -1040,7 +1034,7 @@ create_save_popup(void)
NULL);
XtAddCallback (nameInUseCancelButton, XtNcallback,
- NameInUseCancelXtProc, 0);
+ NameInUseCancelXtProc, NULL);
/*
@@ -1074,7 +1068,7 @@ create_save_popup(void)
NULL);
XtAddCallback (helpSaveOkButton, XtNcallback,
- HelpSaveOkXtProc, 0);
+ HelpSaveOkXtProc, NULL);
/*
@@ -1111,7 +1105,7 @@ create_save_popup(void)
XtNbottom, XawChainBottom,
NULL);
- XtAddCallback (badSaveListWidget, XtNcallback, BadSaveListXtProc, 0);
+ XtAddCallback (badSaveListWidget, XtNcallback, BadSaveListXtProc, NULL);
badSaveOkButton = XtVaCreateManagedWidget (
"badSaveOkButton", commandWidgetClass, badSaveForm,
@@ -1120,8 +1114,8 @@ create_save_popup(void)
XtNtop, XawChainBottom,
XtNbottom, XawChainBottom,
NULL);
-
- XtAddCallback (badSaveOkButton, XtNcallback, BadSaveOkXtProc, 0);
+
+ XtAddCallback (badSaveOkButton, XtNcallback, BadSaveOkXtProc, NULL);
badSaveCancelButton = XtVaCreateManagedWidget (
@@ -1131,8 +1125,8 @@ create_save_popup(void)
XtNtop, XawChainBottom,
XtNbottom, XawChainBottom,
NULL);
-
- XtAddCallback (badSaveCancelButton, XtNcallback, BadSaveCancelXtProc, 0);
+
+ XtAddCallback (badSaveCancelButton, XtNcallback, BadSaveCancelXtProc, NULL);
XtInstallAllAccelerators (badSaveForm, badSaveForm);
}
diff --git a/saveutil.c b/saveutil.c
index cd020dd..19c051b 100644
--- a/saveutil.c
+++ b/saveutil.c
@@ -28,10 +28,9 @@ in this Software without prior written authorization from The Open Group.
#include "xsm.h"
#include "log.h"
#include "saveutil.h"
+#include "info.h"
-char session_save_file[PATH_MAX];
-
-extern Widget manualRestartCommands;
+static char session_save_file[PATH_MAX];
void
diff --git a/signals.c b/signals.c
index fb9c34d..5757e0c 100644
--- a/signals.c
+++ b/signals.c
@@ -102,9 +102,6 @@ in this Software without prior written authorization from The Open Group.
int checkpoint_from_signal = 0;
-extern XtSignalId sig_term_id, sig_usr1_id;
-extern Bool wantShutdown;
-
static SIGVAL
Signal(int sig, SIGVAL (*handler)(int))
diff --git a/xsm.c b/xsm.c
index 4a95bd2..1d377bc 100644
--- a/xsm.c
+++ b/xsm.c
@@ -34,7 +34,6 @@ in this Software without prior written authorization from The Open Group.
*/
#include "xsm.h"
-#include "globals.c"
#include "xtwatch.h"
#include "prop.h"
#include "choose.h"
@@ -51,8 +50,71 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xatom.h>
#include <X11/Xaw/List.h>
-Atom wmStateAtom;
-Atom wmDeleteAtom;
+int Argc;
+char **Argv;
+
+List *RunningList;
+List *PendingList;
+List *RestartAnywayList;
+List *RestartImmedList;
+
+List *WaitForSaveDoneList;
+static List *InitialSaveList;
+List *FailedSaveList;
+List *WaitForInteractList;
+List *WaitForPhase2List;
+
+Bool wantShutdown = False;
+Bool shutdownInProgress = False;
+Bool phase2InProgress = False;
+Bool saveInProgress = False;
+Bool shutdownCancelled = False;
+
+Bool verbose = False;
+
+char *sm_id = NULL;
+
+char *networkIds = NULL;
+char *session_name = NULL;
+
+IceAuthDataEntry *authDataEntries = NULL;
+int numTransports = 0;
+
+Bool client_info_visible = False;
+Bool client_prop_visible = False;
+Bool client_log_visible = False;
+
+String *clientListNames = NULL;
+ClientRec **clientListRecs = NULL;
+int numClientListNames = 0;
+
+int current_client_selected;
+
+int sessionNameCount = 0;
+String *sessionNamesShort = NULL;
+String *sessionNamesLong = NULL;
+Bool *sessionsLocked = NULL;
+
+int num_clients_in_last_session = -1;
+
+char **non_session_aware_clients = NULL;
+int non_session_aware_count = 0;
+
+char *display_env = NULL, *non_local_display_env = NULL;
+char *session_env = NULL, *non_local_session_env = NULL;
+char *audio_env = NULL;
+
+Bool need_to_name_session = False;
+
+Bool remote_allowed;
+
+XtAppContext appContext;
+Widget topLevel;
+
+XtSignalId sig_term_id, sig_usr1_id;
+
+static Atom wmStateAtom;
+static Atom wmDeleteAtom;
static char *cmd_line_display = NULL;
/*
@@ -88,20 +150,6 @@ static void MyIoErrorHandler(IceConn ice_conn);
static void InstallIOErrorHandler(void);
static void CloseListeners(void);
-/*
- * Extern declarations
- */
-
-extern Widget clientInfoPopup;
-extern Widget clientPropPopup;
-extern Widget clientInfoButton;
-extern Widget logButton;
-extern Widget checkPointButton;
-extern Widget shutdownButton;
-extern Widget clientListWidget;
-extern Widget savePopup;
-
-extern int checkpoint_from_signal;
static IceListenObj *listenObjs;
@@ -389,7 +437,7 @@ GetEnvironment(void)
* display environment we give it has the SM's hostname.
*/
- if ((temp = strchr (p, '/')) == 0)
+ if ((temp = strchr (p, '/')) == NULL)
temp = p;
else
temp++;
diff --git a/xsm.h b/xsm.h
index d6fa0b7..75e7479 100644
--- a/xsm.h
+++ b/xsm.h
@@ -70,6 +70,8 @@ in this Software without prior written authorization from The Open Group.
#include <X11/StringDefs.h>
#include <X11/Intrinsic.h>
+#include <X11/ICE/ICEutil.h>
+
#include <X11/SM/SMlib.h>
#include "list.h"
@@ -122,6 +124,8 @@ typedef struct _PropValue {
} PropValue;
+extern char **environ;
+
extern int Argc;
extern char **Argv;
@@ -140,6 +144,9 @@ extern char *sm_id;
extern char *networkIds;
extern char *session_name;
+extern IceAuthDataEntry *authDataEntries;
+extern int numTransports;
+
extern List *RunningList;
extern List *PendingList;
extern List *RestartAnywayList;
@@ -177,6 +184,13 @@ extern int non_session_aware_count;
extern XtAppContext appContext;
extern Widget topLevel;
extern Widget mainWindow;
+extern Widget clientInfoButton;
+extern Widget logButton;
+extern Widget checkPointButton;
+extern Widget shutdownButton;
+extern Widget shutdownDontSave;
+
+extern XtSignalId sig_term_id, sig_usr1_id;
extern void fprintfhex(FILE *fp, unsigned int len, char *cp);
extern Status StartSession(char *name, Bool use_default);
@@ -186,6 +200,7 @@ extern void SetAllSensitive(Bool on);
extern void FreeClient(ClientRec *client, Bool freeProps);
extern void CloseDownClient(ClientRec *client);
+
/* misc.c */
extern int strbw(char *a, char *b);
extern void nomem(void);
@@ -218,6 +233,8 @@ extern void xt_sig_usr1_handler(XtPointer closure, XtSignalId *id);
extern void register_signals(XtAppContext);
extern int execute_system_command(char *s);
+extern int checkpoint_from_signal;
+
#ifdef XKB
#include <X11/extensions/XKBbells.h>
#endif