home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-14 | 53.2 KB | 1,881 lines |
- Newsgroups: comp.sources.x
- From: jjm@hplb.hpl.hp.com (Jean-Jacques Moreau)
- Subject: REPOST: v20i026: xmps - Motif process monitor, Part01/03
- Message-ID: <csx-v20i026=xmps.090810@sparky.IMD.Sterling.COM>
- X-Md4-Signature: 71e88b5fec4eeaa86b61a41093eadfa7
- Sender: chris@sparky.imd.sterling.com (Chris Olson)
- Organization: Sterling Software
- Date: Tue, 15 Jun 1993 14:08:58 GMT
- Approved: chris@sparky.imd.sterling.com
-
- Submitted-by: jjm@hplb.hpl.hp.com (Jean-Jacques Moreau)
- Posting-number: Volume 20, Issue 26
- Archive-name: xmps/part01
- Environment: HP-UX, X11. OSF/Motif
-
-
- XMPS NOTES
- ------------
-
-
- Description
- -----------
-
- This directory contains the sources and documentation for XmPs, an X/Motif
- version of `ps'. This release of XmPs offers several useful features,
- including process sorting by ancestry, the ability to search for a process
- by name (using regular expressions), the ability to kill a process or group
- of processes, to restrict the process information to specific users, groups
- or terminals, the ability to refresh the information automatically on a
- periodic basis, and to keep multiple snapshots of that information.
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: README Imakefile Makefile menus.h xmps.c xmps.man
- # Wrapped by chris@sparky on Tue Jun 15 08:52:04 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 1 (of 3)."'
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(2496 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- X
- X XMPS NOTES
- X ------------
- X
- X
- XDescription
- X-----------
- X
- XThis directory contains the sources and documentation for XmPs, an X/Motif
- Xversion of `ps'. This release of XmPs offers several useful features,
- Xincluding process sorting by ancestry, the ability to search for a process
- Xby name (using regular expressions), the ability to kill a process or group
- Xof processes, to restrict the process information to specific users, groups
- Xor terminals, the ability to refresh the information automatically on a
- Xperiodic basis, and to keep multiple snapshots of that information.
- X
- X
- X
- XSoftware required
- X-----------------
- X
- XThe only software required to compile XmPs are a C compiler (ansi or
- Xnon-ansi; POSIX or non-POSIX; both cc and gcc work fine), and either X11R5
- Xand Motif1.2, or X11R4 and Motif1.1.
- X
- XBy default, XmPs is compiled by cc, with X11R5 and Motif1.2.
- X
- X
- XMachines supported
- X------------------
- X
- XIf you follow the directions below, this release should compile and run on
- Xany unix platform, either directly or with only minimal changes, although
- Xonly the following configurations have been tested:
- X
- X - HP 9000 s300/700/800 running HP-UX 8.0 or 9.01.
- X
- XIf you find problems running XmPs on any of the above configurations,
- Xplease let me know. Also, if you are able to compile and run XmPs on
- Xconfigurations not listed above, please let me know and tell me what
- Xchanges, if any, you needed to make to do it. I would like to keep the
- Xabove list up-to-date and continue to improve the portability of XmPs.
- X
- X
- XCompiling XmPs
- X--------------
- X
- XTo compile XmPs do the following:
- X
- X (a) If you have only an Ansi compiler, and/or do not have X11R5 and
- X Motif1.2, edit the Imakefile (or Makefile) and change the default
- X switches to the ones required by your personal environment.
- X
- X (b) Type `imake' to compile the main executable. This will create xmps.
- X A non-imake Makefile exists for those who might want/need it, called
- X Makefile.std.
- X
- X (c) Edit the XmPs file so that the X resources for XmPs reflect your
- X own system and preferences.
- X
- X (d) Type `make install' to install XmPs.
- X
- X
- XSupport
- X-------
- X
- XThere is no official support organization for XmPs. However, I am very
- Xinterested in receiving bug reports, suggestions for improvements and
- Xpatches. Bugs should get fixed quickly (particularly if they are serious),
- Xbut enhancements may take a while and may not happen at all unless there
- Xis widespread support for them.
- X
- X
- XJean-Jacques Moreau (jjm@hplb.hpl.hp.com).
- END_OF_FILE
- if test 2496 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'Imakefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Imakefile'\"
- else
- echo shar: Extracting \"'Imakefile'\" \(599 characters\)
- sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
- X OBJS = xmps.o process.o search.o snapshot.o print.o status.o format.o \
- X option.o cursor.o timer.o error.o exit.o command.o xutil.o util.o
- X
- X#CDEBUGFLAGS = DebuggableCDebugFlags
- X# CC = c89 -D_HPUX_SOURCE
- X# CC = cc -Aa -D_HPUX_SOURCE
- X# CC = gcc
- X CC = cc
- X
- XDEPEXTENSIONLIB =
- X EXTENSIONLIB =
- X XMLIB = -L/usr/lib/Motif1.2 -lXm
- X
- X EXTRA_INCLUDES = -I. -I/usr/include/Motif1.2
- X
- X DEPLIBS = $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB)
- X SYS_LIBRARIES = $(XMLIB) $(XTOOLLIB) $(XLIB)
- X
- Xall:: xmps
- X
- XComplexProgramTarget(xmps)
- XInstallAppDefaults(XmPs)
- END_OF_FILE
- if test 599 -ne `wc -c <'Imakefile'`; then
- echo shar: \"'Imakefile'\" unpacked with wrong size!
- fi
- # end of 'Imakefile'
- fi
- if test -f 'Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile'\"
- else
- echo shar: Extracting \"'Makefile'\" \(11818 characters\)
- sed "s/^X//" >'Makefile' <<'END_OF_FILE'
- X# Makefile generated by imake - do not edit!
- X# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
- X#
- X# The cpp used on this machine replaces all newlines and multiple tabs and
- X# spaces in a macro expansion with a single space. Imake tries to compensate
- X# for this, but is not always successful.
- X#
- X
- X# -------------------------------------------------------------------------
- X# Makefile generated from "Imake.tmpl" and </tmp/IIf.a20081>
- X# $XConsortium: Imake.tmpl,v 1.138 91/07/30 14:59:20 rws Exp $
- X#
- X# Platform-specific parameters may be set in the appropriate <vendor>.cf
- X# configuration files. Site-specific parameters should be set in the file
- X# site.def. Full rebuilds are recommended if any parameters are changed.
- X#
- X# If your C preprocessor does not define any unique symbols, you will need
- X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
- X# "make World" the first time).
- X#
- X
- X# 57
- X
- X# 64
- X
- X# 71
- X
- X# 85
- X
- X# 92
- X
- X# 114
- X
- X# 121
- X
- X# 128
- X
- X# 136
- X
- X# 143
- X
- X# 152
- X
- X# 159
- X
- X# 184
- X
- X# 197
- X
- X# 208
- X
- X# 220
- X
- X# 230
- X
- X# 237
- X
- X# 246
- X
- X# 253
- X
- X# -------------------------------------------------------------------------
- X# site-specific configuration parameters that need to come before
- X# the platform-specific parameters - edit site.def to change
- X
- X# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- X# 41
- X
- X# -------------------------------------------------------------------------
- X# platform-specific configuration parameters - edit hp.cf to change
- X
- X# platform: $XConsortium: hp.cf,v 1.47 91/07/28 22:39:35 rws Exp $
- X# modified for HP X11R5 includes and libs by bt@irfu.se 920222
- X
- X# machines: HP9000/700 and 800 series
- X
- X# operating system: HP-UX 9 . 01
- X# 39
- X
- X# $$
- X
- X# 27
- X
- X# 49
- X
- X# 283
- X
- X# 294
- X
- X# -------------------------------------------------------------------------
- X# site-specific configuration parameters that go after
- X# the platform-specific parameters - edit site.def to change
- X
- X# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- X# 30
- X
- X# 312
- X
- X# 315
- X
- X# 321
- X
- X# 324
- X
- X# 334
- X
- X# 344
- X
- X# 356
- X
- X# 362
- X
- X# 366
- X
- X# 378
- X
- X# 381
- X
- X# 390
- X
- X# 424
- X
- X# 435
- X
- X# 445
- X
- X# 451
- X
- X# 491
- X
- X# 504
- X
- X# 537
- X
- X# 540
- X
- X# 553
- X
- X# 560
- X
- X# 571
- X
- X# 577
- X
- X# 583
- X
- X# 596
- X
- X# 606
- X
- X# 613
- X
- X# 619
- X
- X# 631
- X
- X# 638
- X
- X# 669
- X
- X SHELL = /bin/sh
- X
- X TOP = .
- X CURRENT_DIR = .
- X
- X AR = ar clq
- X BOOTSTRAPCFLAGS =
- X CC = cc
- X AS = as
- X
- X FC = f77
- X FDEBUGFLAGS =
- X FCFLAGS = $(FDEBUGFLAGS)
- X
- X COMPRESS = compress
- X CPP = /lib/cpp $(STD_CPP_DEFINES)
- X PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
- X INSTALL = $(BINDIR)/bsdinst
- X LD = ld
- X LINT = lint
- X LINTLIBFLAG = -o
- X LINTOPTS = -ax
- X LN = ln -s
- X MAKE = make
- X MV = mv -f
- X CP = cp
- X# 712
- X
- X RM = rm -f
- X TROFF = psroff
- X MSMACROS = -ms
- X TBL = tbl
- X EQN = eqn
- X STD_INCLUDES = -I/usr/include/X11R5 -I/usr/include/Motif1.2
- X STD_CPP_DEFINES = -DSYSV
- X STD_DEFINES = -DSYSV
- X EXTRA_LOAD_FLAGS =
- X EXTRA_LIBRARIES = -lPW
- X TAGS = ctags
- X
- X MFLAGS = -$(MAKEFLAGS)
- X
- X SHAREDCODEDEF = -DSHAREDCODE
- X SHLIBDEF =
- X
- X# 733
- X
- X# 739
- X
- X# 742
- X
- X# 745
- X
- X# 748
- X
- X# 751
- X
- X# 754
- X
- X# 757
- X
- X# 770
- X
- X PROTO_DEFINES =
- X
- X# 777
- X
- X INSTPGMFLAGS =
- X
- X INSTBINFLAGS = -m 0755
- X INSTUIDFLAGS = -m 4755
- X INSTLIBFLAGS = -m 0644
- X INSTINCFLAGS = -m 0444
- X INSTMANFLAGS = -m 0444
- X INSTDATFLAGS = -m 0444
- X INSTKMEMFLAGS = -m 4755
- X
- X# 790
- X
- X# 794
- X
- X# 797
- X
- X CDEBUGFLAGS = -O
- X CCOPTIONS =
- X
- X ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
- X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
- X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
- X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
- X# 813
- X
- X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X
- X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
- X# 820
- X
- X LDCOMBINEFLAGS = -X -r
- X DEPENDFLAGS =
- X
- X MACROFILE = hp.cf
- X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
- X
- X IMAKE_DEFINES =
- X
- X IRULESRC = $(CONFIGDIR)
- X IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
- X# 834
- X
- X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
- X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
- X $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
- X
- X# -------------------------------------------------------------------------
- X# X Window System Build Parameters
- X# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
- X
- X# 21
- X
- X# 33
- X
- X# 37
- X
- X# 62
- X
- X# 132
- X
- X# 135
- X
- X# 169
- X
- X# 180
- X
- X# 197
- X
- X# 206
- X
- X# 211
- X
- X# 238
- X
- X# 241
- X
- X# 253
- X
- X# 261
- X
- X# 271
- X
- X# 286
- X
- X# 332
- X
- X# 363
- X
- X# 375
- X
- X# 385
- X
- X# 388
- X
- X# 391
- X
- X# 394
- X
- X# 397
- X
- X# 400
- X
- X# 403
- X
- X# 406
- X
- X# 409
- X
- X# 412
- X
- X# 418
- X
- X# 424
- X
- X# 427
- X
- X# 430
- X
- X# 433
- X
- X# 436
- X
- X# 442
- X
- X# -------------------------------------------------------------------------
- X# X Window System make variables; this need to be coordinated with rules
- X
- X PATHSEP = /
- X USRLIBDIR = /usr/lib
- X BINDIR = /usr/bin/X11
- X INCROOT = /usr/include
- X BUILDINCROOT = $(TOP)
- X BUILDINCDIR = $(BUILDINCROOT)/X11
- X BUILDINCTOP = ..
- X INCDIR = $(INCROOT)/X11
- X ADMDIR = /usr/adm
- X LIBDIR = $(USRLIBDIR)/X11
- X CONFIGDIR = /usr/lib/X11/config
- X LINTLIBDIR = $(USRLIBDIR)/lint
- X
- X FONTDIR = $(LIBDIR)/fonts
- X XINITDIR = $(LIBDIR)/xinit
- X XDMDIR = $(LIBDIR)/xdm
- X TWMDIR = $(LIBDIR)/twm
- X MANPATH = /usr/man
- X MANSOURCEPATH = $(MANPATH)/man
- X MANSUFFIX = n
- X LIBMANSUFFIX = 3
- X MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
- X LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
- X NLSDIR = $(LIBDIR)/nls
- X PEXAPIDIR = $(LIBDIR)/PEX
- X XAPPLOADDIR = $(LIBDIR)/app-defaults
- X FONTCFLAGS = -t
- X
- X INSTAPPFLAGS = $(INSTDATFLAGS)
- X
- X IMAKE = imake
- X DEPEND = makedepend
- X RGB = rgb
- X# 492
- X
- X FONTC = bdftopcf
- X
- X MKFONTDIR = mkfontdir
- X MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
- X# 508
- X
- X CONFIGSRC = $(TOP)/config
- X DOCUTILSRC = $(TOP)/doc/util
- X CLIENTSRC = $(TOP)/clients
- X DEMOSRC = $(TOP)/demos
- X LIBSRC = $(TOP)/lib
- X FONTSRC = $(TOP)/fonts
- X INCLUDESRC = $(TOP)/X11
- X SERVERSRC = $(TOP)/server
- X UTILSRC = $(TOP)/util
- X SCRIPTSRC = $(UTILSRC)/scripts
- X EXAMPLESRC = $(TOP)/examples
- X CONTRIBSRC = $(TOP)/../contrib
- X DOCSRC = $(TOP)/doc
- X RGBSRC = $(TOP)/rgb
- X DEPENDSRC = $(UTILSRC)/makedepend
- X IMAKESRC = $(CONFIGSRC)
- X XAUTHSRC = $(LIBSRC)/Xau
- X XLIBSRC = $(LIBSRC)/X
- X XMUSRC = $(LIBSRC)/Xmu
- X TOOLKITSRC = $(LIBSRC)/Xt
- X AWIDGETSRC = $(LIBSRC)/Xaw
- X OLDXLIBSRC = $(LIBSRC)/oldX
- X XDMCPLIBSRC = $(LIBSRC)/Xdmcp
- X BDFTOSNFSRC = $(FONTSRC)/bdftosnf
- X BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
- X BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
- X MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
- X FSLIBSRC = $(FONTSRC)/lib/fs
- X FONTSERVERSRC = $(FONTSRC)/server
- X EXTENSIONSRC = $(TOP)/extensions
- X XILIBSRC = $(EXTENSIONSRC)/lib/xinput
- X PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
- X
- X# 551
- X
- X# 565
- X
- X# 570
- X
- X# 577
- X
- X# $$
- X
- XSHLIBLDFLAGS = -b
- XPICFLAGS = +Z
- X
- X DEPEXTENSIONLIB =
- X EXTENSIONLIB = -lXext
- X
- X DEPXLIB = $(DEPEXTENSIONLIB)
- X XLIB = $(EXTENSIONLIB) -lX11
- X
- X DEPXMULIB = $(USRLIBDIR)/X11R5/libXmu.sl
- X XMULIB = -lXmu
- X
- X DEPOLDXLIB =
- X OLDXLIB = -loldX
- X
- X DEPXTOOLLIB = $(USRLIBDIR)/X11R5/libXt.sl
- X XTOOLLIB = -lXt
- X
- X DEPXAWLIB = $(USRLIBDIR)/X11R5/libXaw.sl
- X XAWLIB = -lXaw
- X
- X DEPXILIB =
- X XILIB = -lXi
- X
- X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)/X11R5 -L$(USRLIBDIR)/Motif1.2
- X# 47
- X
- X SOXLIBREV = SharedXlibRev
- X SOXTREV = SharedXtRev
- X SOXAWREV = SharedXawRev
- X SOOLDXREV = SharedOldXRev
- X SOXMUREV = SharedXmuRev
- X SOXEXTREV = SharedXextRev
- X SOXINPUTREV = SharedXinputRev
- X
- X# 594
- X
- X# 598
- X
- X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
- X XAUTHLIB = -lXau
- X DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
- X XDMCPLIB = -lXdmcp
- X# 606
- X
- X# 610
- X
- X# 614
- X
- X# 618
- X
- X# 622
- X
- X DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
- X PHIGSLIB = -lphigs
- X
- X DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
- X XBSDLIB = -lXbsd
- X
- X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
- X LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
- X LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
- X LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
- X LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
- X LINTXI = $(LINTLIBDIR)/llib-lXi.ln
- X LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
- X
- X DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
- X# 657
- X
- X DEPLIBS1 = $(DEPLIBS)
- X DEPLIBS2 = $(DEPLIBS)
- X DEPLIBS3 = $(DEPLIBS)
- X
- X# -------------------------------------------------------------------------
- X# Imake rules for building libraries, programs, scripts, and data files
- X# rules: $XConsortium: Imake.rules,v 1.121 91/08/22 16:32:50 rws Exp $
- X
- X# 168
- X
- X# 179
- X
- X# 359
- X
- X# 606
- X
- X# 621
- X
- X# 643
- X
- X# 714
- X
- X# 1347
- X
- X# 1444
- X
- X# 1461
- X
- X# 1473
- X
- X# 1492
- X
- X# 1507
- X
- X# -------------------------------------------------------------------------
- X# start of Imakefile
- X
- X OBJS = xmps.o process.o search.o snapshot.o print.o status.o format.o \
- X option.o cursor.o timer.o error.o exit.o command.o xutil.o util.o
- X
- XCDEBUGFLAGS = -g
- X CC = c89 -D_HPUX_SOURCE
- X# CC = cc -Aa -D_HPUX_SOURCE
- X# CC = gcc
- X
- XDEPEXTENSIONLIB =
- X EXTENSIONLIB =
- X XMLIB = -L/usr/lib/Motif1.2 -lXm
- X
- X EXTRA_INCLUDES = -I. -I/usr/include/Motif1.2
- X
- X DEPLIBS = $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB)
- X SYS_LIBRARIES = $(XMLIB) $(XTOOLLIB) $(XLIB)
- X
- Xall:: xmps
- X
- X PROGRAM = xmps
- X
- Xall:: xmps
- X
- Xxmps: $(OBJS) $(DEPLIBS)
- X if [ -f $@ ]; then $(RM) $@~; $(MV) $@ $@~; fi
- X $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
- X
- Xinstall:: xmps
- X @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
- X else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
- X $(INSTALL) -c $(INSTPGMFLAGS) xmps $(DESTDIR)$(BINDIR)
- X
- Xinstall.man:: xmps.man
- X @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
- X else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
- X $(INSTALL) -c $(INSTMANFLAGS) xmps.man $(DESTDIR)$(MANDIR)/xmps.$(MANSUFFIX)
- X
- Xdepend::
- X $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
- X
- Xlint:
- X $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
- Xlint1:
- X $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
- X
- Xclean::
- X $(RM) $(PROGRAM)
- X
- Xinstall:: XmPs.ad
- X @if [ -d $(DESTDIR)$(XAPPLOADDIR) ]; then set +x; \
- X else (set -x; $(MKDIRHIER) $(DESTDIR)$(XAPPLOADDIR)); fi
- X $(INSTALL) -c $(INSTAPPFLAGS) XmPs.ad $(DESTDIR)$(XAPPLOADDIR)/XmPs
- X
- X# -------------------------------------------------------------------------
- X# common rules for all Makefiles - do not edit
- X
- Xemptyrule::
- X
- Xclean::
- X $(RM_CMD) "#"*
- X
- XMakefile::
- X -@if [ -f Makefile ]; then set -x; \
- X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
- X else exit 0; fi
- X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
- X
- Xtags::
- X $(TAGS) -w *.[ch]
- X $(TAGS) -xw *.[ch] > TAGS
- X# 868
- X
- X# 876
- X
- X# 890
- X
- X# -------------------------------------------------------------------------
- X# empty rules for directories that do not have SUBDIRS - do not edit
- X
- Xinstall::
- X @echo "install in $(CURRENT_DIR) done"
- X
- Xinstall.man::
- X @echo "install.man in $(CURRENT_DIR) done"
- X
- XMakefiles::
- X
- Xincludes::
- X
- X# -------------------------------------------------------------------------
- X# dependencies generated by makedepend
- X
- END_OF_FILE
- if test 11818 -ne `wc -c <'Makefile'`; then
- echo shar: \"'Makefile'\" unpacked with wrong size!
- fi
- # end of 'Makefile'
- fi
- if test -f 'menus.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'menus.h'\"
- else
- echo shar: Extracting \"'menus.h'\" \(3263 characters\)
- sed "s/^X//" >'menus.h' <<'END_OF_FILE'
- XMenuDescStruct processMenu[] = {
- X { "Process", "process", 'P' },
- X { "Refresh", "refresh", 'R', "<Ctrl>R", "Ctrl<Key>r:",
- X reDisplayProcesses},
- X { "-" },
- X { "Select All", "selectAll", '-', "-", "-",
- X selectAllProcesses},
- X { "Unselect All", "unselectAll", '-', "-", "-",
- X unselectAllProcesses},
- X { "Execute Action On", "executeAction", 'E', "<Ctrl>E", "Ctrl<Key>e:",
- X applyAction},
- X { "-" },
- X { "Search For...", "searchFor", 'S', "<Ctrl>S", "Ctrl<Key>s:",
- X searchProcessPrompt},
- X { "-Previous", "previous", 'P', "<Ctrl>P", "Ctrl<Key>p:",
- X searchProcess, (caddr_t) ACTION_SEARCH_PREVIOUS},
- X { "-Next", "next", 'N', "<Ctrl>N", "Ctrl<Key>n:",
- X searchProcess, (caddr_t) ACTION_SEARCH_NEXT},
- X { "-" },
- X { "Exit", "exit", 'x', "<Ctrl>X", "Ctrl<Key>x:",
- X exitXmPs},
- X};
- X
- XMenuDescStruct viewMenu[] = {
- X { "View", "view", 'V' },
- X { "-New", "new", '-', "-", "-",
- X createNewView, (caddr_t) ACTION_NEW_VIEW },
- X { "Print", "print", '-', "-", "-",
- X printProcesses },
- X { "Snapshot...", "snapshot", '-', "-", "-",
- X takeSnapshot },
- X { "-" },
- X { "^Full Listing", "fullListing", '-', "-", "-",
- X changeOption, (caddr_t) MENU_FULL_LISTING, &resources.fullListing },
- X { "^Long Listing", "longListing", '-', "-", "-",
- X changeOption, (caddr_t) MENU_LONG_LISTING, &resources.longListing },
- X { "-" },
- X { "^All Processes", "allProcesses", '-', "-", "-",
- X changeOption, (caddr_t) MENU_ALL_PROCESSES, &resources.allProcesses },
- X { "^No Group Leader Process", "noGroupLeader", '-', "-", "-",
- X changeOption, (caddr_t) MENU_NO_GROUP_LEADER, &resources.noGroupLeader },
- X { "^No Terminal Independent Process", "noNonTerminal", '-', "-", "-",
- X changeOption, (caddr_t) MENU_NO_NON_TERMINAL, &resources.noNonTerminal },
- X};
- X
- XMenuDescStruct optionMenu[] = {
- X { "Option", "option", 'O' },
- X { "^Beautify Listing", "beautify", '-', "-", "-",
- X changeOption, (caddr_t) MENU_BEAUTIFY, &resources.beautify },
- X { "-" },
- X { "^Refresh Automatically", "automaticRefresh", '-', "-", "-",
- X changeOption, (caddr_t) MENU_AUTOMATIC_REFRESH, &resources.automaticRefresh },
- X { "^Refresh Periodically", "periodicRefresh", '-', "-", "-",
- X changeOption, (caddr_t) MENU_PERIODIC_REFRESH, &resources.periodicRefresh },
- X { "-" },
- X { "^Search Ignore Case", "ignoreCase", '-', "-", "-",
- X changeOption, (caddr_t) MENU_IGNORE_CASE, &resources.ignoreCase },
- X { "^Search & Select Multiple Occurrences", "multipleOccurrences", '-', "-", "-",
- X changeOption, (caddr_t) MENU_MULTIPLE_OCCURRENCES, &resources.multipleOccurrences},
- X { "-" },
- X { "^Print Only Selected Processes", "printSelected", '-', "-", "-",
- X changeOption, (caddr_t) MENU_PRINT_SELECTED, &resources.printSelected },
- X { "-" },
- X { "^Memorize New Parameters", "automaticMemory", '-', "-", "-",
- X changeOption, (caddr_t) MENU_AUTOMATIC_MEMORY, &resources.automaticMemory },
- X};
- X
- XMenuDescStruct helpMenu[] = {
- X { "Help", "help", 'H' },
- X { "On Version", "version", 'V', "<Ctrl>V", "Ctrl<Key>v:",
- X versionXmPs},
- X};
- X
- X
- END_OF_FILE
- if test 3263 -ne `wc -c <'menus.h'`; then
- echo shar: \"'menus.h'\" unpacked with wrong size!
- fi
- # end of 'menus.h'
- fi
- if test -f 'xmps.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xmps.c'\"
- else
- echo shar: Extracting \"'xmps.c'\" \(16822 characters\)
- sed "s/^X//" >'xmps.c' <<'END_OF_FILE'
- X/*
- X * Copyright (C) 1991, 1992 Jean-Jacques Moreau.
- X *
- X * Permission to use, copy, modify, distribute, and sell this software
- X * and its documentation for any purpose is hereby granted without fee,
- X * provided that the above copyright notice appear in all copies and
- X * that both that copyright notice and this permission notice appear
- X * in supporting documentation. The author makes no representations
- X * about the suitability of this software for any purpose. It is
- X * provided "as is" without express or implied warranty.
- X *
- X * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
- X * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
- X * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- X * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
- X * USE OR PERFORMANCE OF THIS SOFTWARE.
- X */
- X
- X#ifndef lint
- Xstatic char copyright[] = "@(#) Copyright (c) 1991, 1992 Jean-Jacques Moreau\n\
- X All rights reserved";
- X#endif
- X
- X#ifndef lint
- Xstatic char rcsid[] = "@(#)$Header: xmps.c,v 1.1 92/05/19 17:14:01 jjm Exp $";
- X#endif
- X
- Xstatic char *version = "Motif Process Browser Version 1.1\n\
- X(c) Copyright 1991-1993 Jean-Jacques Moreau, All Rights Reserved";
- X
- X
- X#include <X11/Xlib.h>
- X#include <X11/cursorfont.h>
- X#include <Xm/Xm.h>
- X#include <Xm/XmStrDefs.h>
- X#include <Xm/CascadeB.h>
- X#include <Xm/CascadeBG.h>
- X#include <Xm/DialogS.h>
- X#include <Xm/Frame.h>
- X#include <Xm/MainW.h>
- X#include <Xm/List.h>
- X#include <Xm/PushBG.h>
- X#include <Xm/RowColumn.h>
- X#include <Xm/ScrolledW.h>
- X#include <Xm/SeparatoG.h>
- X#include <Xm/Text.h>
- X#include <Xm/ToggleBG.h>
- X
- X#include <stdio.h>
- X#include <unistd.h>
- X#include <errno.h>
- X
- X#define GLOBAL
- X#include "xmps.h"
- X#include "options.h"
- X#include "menus.h"
- X
- X
- XString generalTranslations =
- X "<Map>: ReDisplay()";
- X
- XString textTranslations =
- X "<Key>Return: UpdateParameter()\n\
- X <Key>Escape: CancelInput()";
- X
- XString statusTranslations =
- X "<Btn1Down>: DoInput()\n\
- X <Key>Return: DoInput()";
- X
- XXtActionsRec xmPsActions[] = {
- X { "ReDisplay", (XtActionProc) reDisplayProcessesIfNecessary},
- X { "UpdateParameter", (XtActionProc) textParameterChange},
- X { "DoInput", (XtActionProc) inputMode},
- X { "CancelInput", (XtActionProc) noInputMode},
- X};
- X
- X
- Xint versionXmPs (widget, clientData, callData)
- X Widget widget;
- X caddr_t clientData;
- X caddr_t callData;
- X{
- X Widget versionDialog = NULL;
- X
- X if (! versionDialog) {
- X XmString title, message;
- X
- X Arg arglist[5];
- X Cardinal i;
- X
- X title = XmStringCreateLtoR ("Version Dialog",
- X XmSTRING_DEFAULT_CHARSET);
- X message = XmStringCreateLtoR (version,
- X XmSTRING_DEFAULT_CHARSET);
- X
- X i = 0;
- X XtSetArg (arglist[i], XmNdialogTitle, title); i++;
- X XtSetArg (arglist[i], XmNmessageString, message); i++;
- X XtSetArg (arglist[i], XmNmessageAlignment, XmALIGNMENT_CENTER); i++;
- X XtSetArg (arglist[i], XmNdialogStyle, XmDIALOG_MODELESS); i++;
- X versionDialog = (Widget) XmCreateInformationDialog (topLevel,
- X "versionDialog",
- X arglist, i);
- X
- X XtUnmanageChild ((Widget) XmMessageBoxGetChild (versionDialog,
- X XmDIALOG_CANCEL_BUTTON));
- X XtUnmanageChild ((Widget) XmMessageBoxGetChild (versionDialog,
- X XmDIALOG_HELP_BUTTON));
- X
- X XmStringFree (title);
- X XmStringFree (message);
- X }
- X
- X XtManageChild (versionDialog);
- X}
- X
- X
- XWidget createMenu (parent, menu, menuSize)
- X Widget parent;
- X MenuDescStruct menu[];
- X int menuSize;
- X{
- X Widget pane;
- X Widget button;
- X Widget menuElement;
- X
- X XmString label;
- X XmString acceleratorText;
- X Boolean sensitive, toggle;
- X int j;
- X
- X Arg arglist[6];
- X Cardinal i;
- X
- X /*
- X * Create a pulldown menu.
- X */
- X pane = (Widget) XmCreatePulldownMenu (parent, concat (menu[0].id, "Pane"),
- X NULL, 0);
- X
- X /*
- X * Create all the menu elements.
- X */
- X for (j = 1; j < menuSize; j++) {
- X int labelPosition = 0;
- X
- X if (strcmp (menu[j].label, "-") == 0) {
- X XtManageChild (XmCreateSeparatorGadget (pane, "separator",
- X NULL, 0));
- X } else {
- X sensitive = True;
- X if (menu[j].label[labelPosition] == '-') {
- X sensitive = False;
- X labelPosition++;
- X }
- X
- X toggle = False;
- X if (menu[j].label[labelPosition] == '^') {
- X toggle = True;
- X labelPosition++;
- X }
- X
- X label = XmStringCreateLtoR (&menu[j].label[labelPosition],
- X XmSTRING_DEFAULT_CHARSET);
- X
- X acceleratorText = XmStringCreateLtoR (menu[j].acceleratorText,
- X XmSTRING_DEFAULT_CHARSET);
- X
- X i = 0;
- X XtSetArg (arglist[i], XmNlabelString, label); i++;
- X if (menu[j].mnemonic != '-') {
- X XtSetArg (arglist[i],
- X XmNmnemonic, menu[j].mnemonic); i++;
- X XtSetArg (arglist[i],
- X XmNacceleratorText, acceleratorText); i++;
- X XtSetArg (arglist[i],
- X XmNaccelerator, menu[j].accelerator); i++;
- X }
- X XtSetArg (arglist[i], XmNsensitive, sensitive); i++;
- X
- X if (! toggle)
- X menuElement = XmCreatePushButtonGadget (pane, menu[j].id,
- X arglist, i);
- X else {
- X menuElement = XmCreateToggleButtonGadget (pane, menu[j].id,
- X arglist, i);
- X XmToggleButtonSetState (menuElement,
- X *(menu[j].state), False);
- X }
- X
- X XtManageChild (menuElement);
- X
- X XtAddCallback (menuElement,
- X toggle ?
- X XmNvalueChangedCallback : XmNactivateCallback,
- X (XtCallbackProc) menu[j].callback,
- X menu[j].callbackData);
- X
- X XmStringFree (label);
- X XmStringFree (acceleratorText);
- X }
- X }
- X
- X
- X /*
- X * Link the label and separators into the menu.
- X */
- X label = XmStringCreateLtoR (menu[0].label, XmSTRING_DEFAULT_CHARSET);
- X
- X i = 0;
- X XtSetArg (arglist[i], XmNlabelString, label); i++;
- X XtSetArg (arglist[i], XmNmnemonic, menu[0].mnemonic); i++;
- X XtSetArg (arglist[i], XmNsubMenuId, pane); i++;
- X
- X button = (Widget) XmCreateCascadeButton (parent,
- X concat (menu[0].id, "Menu"),
- X arglist, i);
- X
- X XtManageChild (button);
- X
- X XmStringFree (label);
- X
- X /*
- X * Declare the help menu as the help menu for this application.
- X */
- X if (strcmp (menu[0].label, "Help") == 0) {
- X i = 0;
- X XtSetArg (arglist[i], XmNmenuHelpWidget, button); i++;
- X XtSetValues (parent, arglist, i);
- X }
- X
- X return (pane);
- X}
- X
- X
- XWidget createSelectionMenu (parent, title, labels)
- X Widget parent;
- X String title;
- X String labels;
- X{
- X Widget pane;
- X Widget menu;
- X Widget menuElement;
- X XmString string, accelerator;
- X char s[512];
- X
- X String label;
- X String labelSeparators = ","; /* <comma> */
- X
- X Arg arglist[5];
- X Cardinal i;
- X
- X /*
- X * Create a pulldown menu.
- X */
- X pane = (Widget) XmCreatePulldownMenu (parent,
- X concat (title, "Pane"), NULL, 0);
- X
- X /*
- X * Add the first menu label.
- X */
- X if ((label = strtok (labels, labelSeparators)) != NULL) {
- X string = XmStringCreateLtoR (label, XmSTRING_DEFAULT_CHARSET);
- X
- X i = 0;
- X XtSetArg (arglist[i], XmNlabelString, string); i++;
- X menuElement = (Widget) XmCreatePushButtonGadget (pane,
- X concat (label, ""),
- X arglist, i);
- X XtManageChild (menuElement);
- X XtAddCallback (menuElement,
- X XmNactivateCallback,
- X (XtCallbackProc) menuParameterChange, label);
- X
- X XmStringFree (string);
- X
- X /*
- X * Add the other labels.
- X */
- X while ((label = strtok (NULL, labelSeparators)) != NULL) {
- X string = XmStringCreateLtoR (label, XmSTRING_DEFAULT_CHARSET);
- X
- X i = 0;
- X XtSetArg (arglist[i], XmNlabelString, string); i++;
- X menuElement = (Widget) XmCreatePushButtonGadget (pane,
- X concat (label,""),
- X arglist, i);
- X XtManageChild (menuElement);
- X XtAddCallback (menuElement,
- X XmNactivateCallback,
- X (XtCallbackProc) menuParameterChange, label);
- X
- X XmStringFree (string);
- X }
- X }
- X
- X /*
- X * Link the label and separators into the menu.
- X */
- X string = XmStringCreateLtoR (title, XmSTRING_DEFAULT_CHARSET);
- X
- X i = 0;
- X XtSetArg (arglist[i], XmNlabelString, string); i++;
- X XtSetArg (arglist[i], XmNmnemonic, title[0]); i++;
- X XtSetArg (arglist[i], XmNsubMenuId, pane); i++;
- X menu = (Widget) XmCreateCascadeButton (parent,
- X concat (title, "Menu"),
- X arglist, i);
- X XtManageChild (menu);
- X
- X XmStringFree (string);
- X
- X return (pane);
- X}
- X
- X
- XWidget createMenuArea (parent)
- X Widget parent;
- X{
- X Widget menuArea;
- X
- X /*
- X * Create a menu bar.
- X */
- X menuArea = XmCreateMenuBar (parent, "menuArea", NULL, 0);
- X XtManageChild (menuArea);
- X
- X /*
- X * Add the application's main menus.
- X */
- X processPane = createMenu (menuArea, processMenu, XtNumber (processMenu));
- X
- X hostPane = createSelectionMenu (menuArea, "Host", resources.hosts);
- X userPane = createSelectionMenu (menuArea, "User", resources.users);
- X groupPane = createSelectionMenu (menuArea, "Group", resources.groups);
- X terminalPane = createSelectionMenu (menuArea, "Terminal", resources.terminals);
- X actionPane = createSelectionMenu (menuArea, "Action", resources.actions);
- X
- X viewPane = createMenu (menuArea, viewMenu, XtNumber (viewMenu));
- X optionPane = createMenu (menuArea, optionMenu, XtNumber (optionMenu));
- X helpPane = createMenu (menuArea, helpMenu, XtNumber (helpMenu));
- X
- X return (menuArea);
- X}
- X
- X
- XWidget createSelectionArea (parent)
- X Widget parent;
- X{
- X Widget selectionArea;
- X Widget statusArea;
- X Widget textArea;
- X Widget infoArea;
- X
- X XmFontList fontList;
- X Dimension width, height;
- X
- X Arg arglist[10];
- X Cardinal i;
- X
- X /*
- X * Create a form to contain the different fields.
- X */
- X selectionArea = (Widget) XmCreateForm (parent, "selectionArea", NULL, 0);
- X XtManageChild (selectionArea);
- X
- X /*
- X * Add an info zone.
- X */
- X i = 0;
- X XtSetArg (arglist[i], XmNalignment, XmALIGNMENT_END); i++;
- X XtSetArg (arglist[i], XmNwidth, 200); i++;
- X XtSetArg (arglist[i], XmNtopAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNleftAttachment, XmATTACH_NONE); i++;
- X XtSetArg (arglist[i], XmNrightAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNbottomAttachment, XmATTACH_FORM); i++;
- X
- X infoArea = (Widget) XmCreateLabel (selectionArea,
- X "infoArea", arglist,i);
- X XtManageChild (infoArea);
- X
- X /*
- X * Add a status zone.
- X */
- X i = 0;
- X XtSetArg (arglist[i], XmNalignment, XmALIGNMENT_BEGINNING); i++;
- X XtSetArg (arglist[i], XmNtopAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNleftAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNrightAttachment, XmATTACH_WIDGET); i++;
- X XtSetArg (arglist[i], XmNrightWidget, infoArea); i++;
- X XtSetArg (arglist[i], XmNbottomAttachment, XmATTACH_FORM); i++;
- X
- X statusArea = (Widget) XmCreateLabel (selectionArea,
- X "statusArea", arglist,i);
- X XtManageChild (statusArea);
- X
- X XtOverrideTranslations (statusArea,
- X XtParseTranslationTable (statusTranslations));
- X
- X i = 0;
- X XtSetArg (arglist[i], XmNfontList, &fontList); i++;
- X XtGetValues (statusArea, arglist, i);
- X
- X /*
- X * Add an input zone.
- X */
- X i = 0;
- X XtSetArg (arglist[i], XmNtopAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNleftAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNrightAttachment, XmATTACH_WIDGET); i++;
- X XtSetArg (arglist[i], XmNrightWidget, infoArea); i++;
- X XtSetArg (arglist[i], XmNbottomAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNfontList, fontList); i++;
- X
- X textArea = XmCreateText (selectionArea, "textArea", arglist, i);
- X
- X XtOverrideTranslations (textArea,
- X XtParseTranslationTable (textTranslations));
- X
- X i = 0;
- X XtSetArg (arglist[i], XmNwidth, &width); i++;
- X XtSetArg (arglist[i], XmNheight, &height); i++;
- X XtGetValues (textArea, arglist, i);
- X
- X i = 0;
- X XtSetArg (arglist[i], XmNwidth, width); i++;
- X XtSetArg (arglist[i], XmNheight, height); i++;
- X XtSetValues (statusArea, arglist, i);
- X
- X return (selectionArea);
- X}
- X
- X
- XWidget createProcessArea (parent)
- X Widget parent;
- X{
- X Arg arglist[10];
- X Cardinal i;
- X
- X /*
- X * Create a form to contain the processes windows.
- X */
- X processArea = (Widget) XmCreateForm (parent, "processArea", NULL, 0);
- X XtManageChild (processArea);
- X
- X /*
- X * Add a processes info header.
- X */
- X i = 0;
- X XtSetArg (arglist[i], XmNalignment, XmALIGNMENT_BEGINNING); i++;
- X XtSetArg (arglist[i], XmNtopAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNleftAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNrightAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNbottomAttachment, XmATTACH_NONE); i++;
- X
- X headerArea = (Widget) XmCreateLabelGadget (processArea,
- X "headerArea", arglist, i);
- X XtManageChild (headerArea);
- X
- X /*
- X * Add a scrolled list.
- X */
- X i = 0;
- X XtSetArg (arglist[i], XmNlistSizePolicy, XmCONSTANT); i++;
- X XtSetArg (arglist[i], XmNselectionPolicy, XmEXTENDED_SELECT); i++;
- X XtSetArg (arglist[i], XmNautomaticSelection, True); i++;
- X
- X XtSetArg (arglist[i], XmNtopAttachment, XmATTACH_WIDGET); i++;
- X XtSetArg (arglist[i], XmNtopWidget, headerArea); i++;
- X XtSetArg (arglist[i], XmNleftAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNrightAttachment, XmATTACH_FORM); i++;
- X XtSetArg (arglist[i], XmNbottomAttachment, XmATTACH_FORM); i++;
- X
- X listArea = XmCreateScrolledList (processArea, "listArea", arglist, i);
- X XtManageChild (listArea);
- X
- X return (processArea);
- X}
- X
- X
- XWidget createAllAreas (parent)
- X Widget parent;
- X{
- X Widget topWindow;
- X Widget menuArea;
- X Widget selectionArea;
- X
- X Arg arglist[2];
- X Cardinal i;
- X
- X /*
- X * Create the main window.
- X */
- X i = 0;
- X XtSetArg (arglist[i], XmNshowSeparator, True); i++;
- X topWindow = XmCreateMainWindow (parent, "topWindow", arglist, i);
- X XtManageChild (topWindow);
- X
- X /*
- X * Add a menu bar.
- X */
- X menuArea = createMenuArea (topWindow);
- X
- X /*
- X * Add the processes area.
- X */
- X processArea = createProcessArea (topWindow);
- X
- X /*
- X * Add the selection area.
- X */
- X selectionArea = createSelectionArea (topWindow);
- X
- X /*
- X * Identify the main window's children.
- X */
- X XmMainWindowSetAreas (topWindow,
- X menuArea, selectionArea, NULL, NULL, processArea);
- X
- X return (topWindow);
- X}
- X
- X
- Xint createNewView (widget, clientData, callData)
- X Widget widget;
- X caddr_t clientData;
- X caddr_t callData;
- X{
- X}
- X
- X
- Xvoid main (argc, argv)
- X unsigned int argc;
- X char *argv[];
- X{
- X Arg arglist[3];
- X Cardinal i;
- X
- X /*
- X * Create the main window.
- X */
- X topLevel = XtInitialize ("topLevel", "XmPs",
- X xmPsOptions, XtNumber (xmPsOptions),
- X &argc, argv);
- X
- X i = 0;
- X XtSetArg (arglist[i], XmNtitle, "Process Browser"); i++;
- X XtSetValues (topLevel, arglist, i);
- X
- X /*
- X * Add our specific actions.
- X */
- X XtAddActions (xmPsActions, XtNumber (xmPsActions));
- X XtOverrideTranslations (topLevel,
- X XtParseTranslationTable (generalTranslations));
- X
- X /*
- X * Get our resources.
- X */
- X XtGetApplicationResources (topLevel, &resources,
- X xmPsResources, XtNumber (xmPsResources),
- X NULL, 0);
- X
- X verifyOptions ();
- X
- X /*
- X * Initialize some private data.
- X */
- X strcpy (currentHost, strtok (strdup (resources.hosts), ","));
- X strcpy (currentUser, strtok (strdup (resources.users), ","));
- X strcpy (currentGroup, strtok (strdup (resources.groups), ","));
- X strcpy (currentTerminal, strtok (strdup (resources.terminals), ","));
- X strcpy (currentAction, strtok (strdup (resources.actions), ","));
- X
- X /*
- X * Create the busy cursor.
- X */
- X busyCursor = XCreateFontCursor (XtDisplay (topLevel), XC_watch);
- X
- X /*
- X * Create all the widgets.
- X */
- X (void) createAllAreas (topLevel);
- X
- X /*
- X * Display the processes information only if automatic refresh is
- X * not in action.
- X */
- X if (! resources.automaticRefresh)
- X displayProcesses ();
- X XtRealizeWidget (topLevel);
- X
- X if (resources.allProcesses ||
- X resources.noGroupLeader || resources.noNonTerminal) {
- X disableUser ();
- X disableGroup ();
- X disableTerminal ();
- X }
- X
- X statusLineUpdate ();
- X
- X /*
- X * Let the toolkit handle events from now on.
- X */
- X XtMainLoop ();
- X}
- X
- END_OF_FILE
- if test 16822 -ne `wc -c <'xmps.c'`; then
- echo shar: \"'xmps.c'\" unpacked with wrong size!
- fi
- # end of 'xmps.c'
- fi
- if test -f 'xmps.man' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xmps.man'\"
- else
- echo shar: Extracting \"'xmps.man'\" \(13335 characters\)
- sed "s/^X//" >'xmps.man' <<'END_OF_FILE'
- X.TH XmPs 1X
- X.ds ]W X11R5 Motif 1.2 (92/05/19)
- X.SH NAME
- X\fBxmps \(em A X/Motif Process Browser.\fP
- X.sp 1
- X.SH SYNOPSIS
- X.B xmps
- X[options]
- X.sp 1
- X.SH DESCRIPTION
- XThe X/Motif Process Browser \fIxmps\fP provides process manipulation
- Xfuntionalities. It offers several useful features including process
- Xsorting by ancestry, the ability to search for a process by name (using
- Xregular expressions), to kill a process or group of processes, to restrict
- Xthe process information to specific users, groups or terminals, and to keep
- Xmultiple snapshots of the process information.
- X.P
- X\fIXmps\fP can display many main windows, each of which contains
- Xthe processes of a single computer (not implemented yet). A menu bar provides
- Xprocess operations.
- X.P
- XA direct manipulation paradigm is used to perform operations on the
- Xdisplayed processes. Selection and multiple selection activate a process
- Xor a set of processes. This is primarily used to indicate the active
- Xobject(s) for menu operations.
- X.P
- X\fIXmps\fP is especially useful to manage multiple hosts on a network.
- XOnce \fIremsh(1)\fP privileges have been enabled on those other hosts, it
- Xis possible to view and manipulate their processes from within a single
- X\fIxmps\fP session.
- X.sp 1
- X.SH OPTIONS
- X.TP 8
- X.BI \-ps " process status command"
- XThis option specifies an alternative \fIps(1)\fP command to use to obtain
- Xprocess information.
- X.TP 8
- X.BI \-pspp " pretty-printer command"
- XThis option specifies an alternative command to use to sort processes by
- Xancestry.
- X.TP 8
- X.BI \-rsh " remote shell command"
- XThis option specifies an alternative \fIremsh(1)\fP command to use to
- Xrun \fIps(1)\fP on remote hosts.
- X.TP 8
- X.BI \-hosts " hostname,[hostname,...]"
- XThis option allows users to specify alternative \fIhost names\fP from which
- Xthey will be able to get process information.
- X.TP 8
- X.BI \-users " user,[user,...]"
- XThis option allows users to specify alternative \fIuser ids\fP or \fIuser
- Xnames\fP to which they will be able to restrict the process information.
- X.TP 8
- X.BI \-groups " group,[group,...]"
- XThis option allows users to specify alternative \fIgroup ids\fP or \fIgroup
- Xnames\fP to which they will be able to restrict the process information.
- X.TP 8
- X.BI \-terminals " terminal,[terminal,...]"
- XThis option allows users to specify alternative \fIterminal names\fP to which
- Xthey will be able to restrict the process information.
- X.TP 8
- X.BI \-actions " action,[action,...]"
- XThis option allows users to specify \fIactions\fP that can be applied to
- Xactive processes. The current action will be applied iteratively on each
- Xactive process and will be given as input that particular process number.
- X.sp 1
- X.SH FEATURES
- X.IP "\fBSelecting a Process\fP"
- XClicking on a process selects it and deselects any other selected process.
- XDragging over a range of processes, or pressing <Shift> while clicking,
- Xselects all processes between the process under the mouse and the process
- Xon which the first click was made. This also deselects any other selected
- Xprocesses outside that range.
- X.sp 1
- XAlso, users can select and deselect discontiguous ranges of processes.
- XPressing <Ctrl> while clicking on a process toggles its selection state but
- Xdoes not deselect any other selected items. Pressing <Ctrl> and dragging
- Xover a range of processes sets the selection state of all processes between
- Xthe process under the mouse and the process on which the first <Ctrl>-click
- Xwas made to the state of that process. This does not deselect any other
- Xselected processes outside that range.
- X.sp 1
- XAll selection operations available from the mouse are also available from
- Xthe keyboard. Refer to \fIXmList(3X)\fP for more details.
- X.IP "\fBExecuting an Action on a Process\fP"
- XActions can be executed on selected processes. There is no restriction on
- Xwhat an action can do. However, the state of a process as displayed by
- X\fIxmps\fP is not refreshed after the action has been successfully executed.
- XThe user must \fBRefresh\fP the process information himself in order to
- Xkeep that information up-to-date.
- X.sp 1
- XActions are selected via a menu. However, an input area is provided to type
- Xin an action which is not available in a menu. See \fBProcess Filtering\fP
- Xfor more details.
- X.IP "\fBCreating Snapshots\fP"
- XSnapshots of the process information can be taken and displayed in separate
- Xand independant windows. It allows the user to compare the evolution of
- Xprocesses on a host over time, or to compare processes running on different
- Xhosts.
- X.IP "\fBProcess Filtering\fP"
- XProcesses belong to many different hosts, users, groups and terminals. The
- XProcess Browser's filtering mechanism provides the
- Xmeans by which the user can selectively display sets of processes. The
- Xtypes of filtering available include: by host, by user, by group, by terminal
- Xand by terminal capabilities.
- X.sp 1
- XA status area below the menu bar displays the current user, group, terminal,
- Xhost and action. It has the following format :
- X.BI user:group(terminal)@host (action)
- X.sp 1
- XOther hosts, users, groups and terminals can be selected from menus.
- XHowever, an input area is provided to type in a host, user, group or
- Xterminal which is not available on the corresponding menu. New values typed
- Xin are automatically added to the corresponding menu if
- X\fBautomaticMemory\fP is true.
- X.sp 1
- XThe input area is normally not displayed. To make it visible, mouse <Button1>
- Xshould be pressed over the status area.
- X.IP "\fBSetting Display Preferences\fP"
- XBoth simple and detailed representations for process display are provided.
- X.IP "\fBFinding Processes\fP"
- XProcesses can be searched for a particular string. Search strings can
- Xinclude regular expressions (see \fIregexp(5)\fP). When processes
- Xmatch the search criteria, they become the selected processes. Only the
- Xfirst process found is normaly selected; however, all matching processes
- Xcan be selected at once if \fBmultipleOccurrences\fP is true.
- X.sp 1
- X.SH RESOURCES
- XThe following resources can be used to taylor the initial appearance of
- X\fIXmps\fP:
- X.sp 2
- X.TS
- Xcenter;
- XcB sss
- XlB lB lB lB
- Xl l l l.
- XX/Motif Process Browser Appearance Resource Set
- XName Class Type Default
- X_
- Xactions Actions String "kill"
- XallProcesses AllProcesses Boolean True
- XautomaticMemory AutomaticMemory Boolean True
- XautomaticRefresh AutomaticRefresh Boolean True
- Xbeautify Beautify Boolean True
- XfullListing FullListing Boolean True
- Xgroups Groups String "all"
- Xhosts Hosts String "localhost"
- XignoreCase IgnoreCase Boolean True
- XlongListing LongListing Boolean False
- XmultipleOccurrences MultipleOccurrences Boolean False
- XnoGroupLeader NoGroupLeader Boolean False
- XnoNonTerminal NoNonTerminal Boolean False
- XperiodicRefresh PeriodicRefresh Boolean False
- XprintSelected PrintSelected Boolean False
- XrefreshPeriod RefreshPeriod unsigned int 600
- Xterminals Terminals String ""
- Xusers Users String "all"
- X.TE
- X.sp 1
- X.IP "\fBactions\fP"
- XThis resource specifies a list of actions that can be applied to active
- Xprocesses. When the \fBExecute Action\fP command is selected, the current
- Xaction is applied iteratively on each active process, and is given as input
- Xthat particular process number. If no process is active, no action is
- Xrequested. (Note: \fIactions\fP is a list of comma separated actions).
- X.sp 1
- X.IP "\fBallProcesses\fP"
- XThis resource specifies whether \fIxmps\fP displays information about all
- Xprocesses or only about processes associated with the current terminal
- X(if any). Refer to \fIps(1)\fP for more details.
- X.sp 1
- X.IP "\fBautomaticMemory\fP"
- XThis resource specifies whether \fIxmps\fP adds to the corresponding menu
- Xthe hosts, users, groups, terminals and actions that are typed in the input
- Xzone, or does not memorize them.
- X.sp 1
- X.IP "\fBautomaticRefresh\fP"
- XThis resource specifies whether \fIxmps\fP refreshes the process information
- Xwhen a new host, user, group, terminal or listing option is specified, or
- Xwaits until
- Xan explicit \fBRefresh\fP command is executed. When \fBAutomaticRefresh\fP
- Xis true, the process information is also refreshed upon deiconification.
- X.sp 1
- X.IP "\fBbeautify\fP"
- XThis resource specifies whether \fIxmps\fP sorts processes by ancestry
- Xbefore displaying them, or generates a raw listing as output by \fIps(1)\fP.
- XBy default, \fIxmps\fP uses an internal formatter to sort processes. However,
- Xan external formatter can used if \fBBeautifierCommand\fP is set
- Xappropriately.
- X.sp 1
- X.IP "\fBfullListing\fP"
- XThis resource specifies whether \fIxmps\fP generates a full listing, or
- Xdisplays only a short listing. Refer to \fIps(1)\fP for more details.
- X.sp 1
- X.IP "\fBgroups\fP"
- XThis resource specifies a list of groups to which the process
- Xinformation can be restricted to. (Note: \fIgroups\fP is a list of comma
- Xseparated groups).
- X.sp 1
- X.IP "\fBhosts\fP"
- XThis resource specifies a list of hosts from which process information can
- Xbe obtained and displayed. (Note: \fIhosts\fP is a list of comma
- Xseparated hosts).
- X.sp 1
- X.IP "\fBignoreCase\fP"
- XThis resource specifies whether \fIxmps\fP ignores the case when searching
- Xfor a process, or takes it into account (see \fIregcomp(3)\fP).
- X.sp 1
- X.IP "\fBlongListing\fP"
- XThis resource specifies whether \fIxmps\fP generates a long listing, or
- Xdisplays only a short listing. Refer to \fIps(1)\fP for more details.
- X.sp 1
- X.IP "\fBmultipleOccurrences\fP"
- XThis resource specifies whether \fIxmps\fP selects multiple processes
- Xmatching the string being searched, or only the first one. Search strings
- Xmay be specified as regular expressions (see \fIregexp(5)\fP).
- X.sp 1
- X.IP "\fBnoGroupLeader\fP"
- XThis resource specifies whether \fIxmps\fP displays information about all
- Xprocesses, except process group leaders, or about processes associated
- Xwith the current terminal (if any). Refer to \fIps(1)\fP for more details.
- X.sp 1
- X.IP "\fBnoNonTerminal\fP"
- XThis resource specifies whether \fIxmps\fP displays information about all
- Xprocesses, except process group leaders and processes not associated with
- Xa terminal, or about processes associated with the current terminal (if any).
- XRefer to \fIps(1)\fP for more details.
- X.sp 1
- X.IP "\fBperiodicRefresh\fP"
- XWhen \fBperiodicRefresh\fP is true, \fIxmps\fP refreshes the process
- Xinformation after \fBrefreshPeriod\fP seconds have ellapsed since the
- Xlast refresh.
- X.sp 1
- X.IP "\fBprintSelected\fP"
- XThis resource specifies whether \fIxmps\fP prints information only about
- Xselected processes (if any), or about all processes.
- X.sp 1
- X.IP "\fBrefreshPeriod\fP"
- XThis resource specifies a time in second after which the process information
- Xis refreshed if \fBperiodicRefresh\fP is true.
- X.sp 1
- X.IP "\fBterminals\fP"
- XThis resource specifies a list of terminals to which the process
- Xinformation can be restricted to. (Note: \fIterminals\fP is a list of comma
- Xseparated terminals).
- X.sp 1
- X.IP "\fBusers\fP"
- XThis resource specifies a list of users to whom the displayed process
- Xinformation may be restricted to. (Note: \fIusers\fP is a list of comma
- Xseparated users).
- X.P
- XThe following resources can be used to adapt \fIxmps\fP to a
- Xsystem for which it was not designed:
- X.sp 2
- X.TS
- Xcenter;
- XcB sss
- XlB lB lB lB
- Xl l l l.
- XX/Motif Process Browser System Dependant Resource Set
- XName Class Type Default
- X_
- XallProcessesOption AllProcessesOption String "e"
- XbeautifyCommand BeautifyCommand String ""
- XfullListingOption FullListingOption String "f"
- XlongListingOption LongListingOption String "l"
- XnoGroupLeaderOption NoGroupLeaderOption String "d"
- XnoNonTerminalOption NoNonTerminalOption String "a"
- XprintCommand PrintCommand String "lp %s"
- XpsCommand PsCommand String "/bin/ps"
- XrshCommand RshCommand String "remsh"
- XterminalsOption TerminalsOption String "g"
- XusersOption UsersOption String "u"
- X.TE
- X.sp 1
- X.IP "\fBallProcessesOption\fP"
- XThis resource specifies the \fIps(1)\fP option corresponding to
- X\fBallProcesses\fP.
- X.sp 1
- X.IP "\fBbeautifyCommand\fP"
- XThis resource specifies an alternate command to beautify the process
- Xinformation. If this resource is not set, an internal formatter is used.
- X.sp 1
- X.IP "\fBfullListingOption\fP"
- XThis resource specifies the \fIps(1)\fP option corresponding to
- X\fBfullListing\fP.
- X.sp 1
- X.IP "\fBgroupsOption\fP"
- XThis resource specifies the \fIps(1)\fP option corresponding to
- X\fBgroups\fP.
- X.sp 1
- X.IP "\fBlongListingOption\fP"
- XThis resource specifies the \fIps(1)\fP option corresponding to
- X\fBlongListing\fP.
- X.sp 1
- X.IP "\fBnoGroupLeaderOption\fP"
- XThis resource specifies the \fIps(1)\fP option corresponding to
- X\fBnoGroupLeader\fP.
- X.sp 1
- X.IP "\fBnoNonTerminalOption\fP"
- XThis resource specifies the \fIps(1)\fP option corresponding to
- X\fBnoNonTerminal\fP.
- X.sp 1
- X.IP "\fBprintCommand\fP"
- XThis resource specifies the command to use to print the process information.
- X.sp 1
- X.IP "\fBpsCommand\fP"
- XThis resource specifies the command to use to obtain the process information.
- X.sp 1
- X.IP "\fBrshCommand\fP"
- XThis resource specifies the command to use to run a given command on
- Xa remote host.
- X.sp 1
- X.IP "\fBterminalsOption\fP"
- XThis resource specifies the \fIps(1)\fP option corresponding to
- X\fBterminals\fP.
- X.sp 1
- X.IP "\fBusersOption\fP"
- XThis resource specifies the \fIps(1)\fP option corresponding to
- X\fBusers\fP.
- X.sp 1
- X.SH BUGS
- XThe code to select all processes does not work.
- X.sp 1
- X.SH COPYRIGHT
- XCopyright 1991-1993 Jean-Jacques Moreau.
- X.sp 1
- X.SH AUTHOR
- XJean-Jacques Moreau (jjm@hplb.hpl.hp.com).
- X.sp 1
- X.SH RELATED INFORMATION
- X\fBX(1)\fP, \fBps(1)\fP, \fBkill(1)\fP, \fBremsh(1)\fP,
- X\fBregexp(5)\fP, \fBXmList(3X)\fP, \fBezps(1X)\fP, \fBxps(1X)\fP,
- X\fBpspp(1)\fP.
- END_OF_FILE
- if test 13335 -ne `wc -c <'xmps.man'`; then
- echo shar: \"'xmps.man'\" unpacked with wrong size!
- fi
- # end of 'xmps.man'
- fi
- echo shar: End of archive 1 \(of 3\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 3 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
- --
- // chris@IMD.Sterling.COM | Send comp.sources.x submissions to:
- \X/ Amiga - The only way to fly! | sources-x@imd.sterling.com
- "It's intuitively obvious to the |
- most casual observer..." | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
-