[comp.sources.sun] v02i022: Contool 3.0, Part03/06

mcgrew@aramis.rutgers.edu (Charles Mcgrew) (09/26/90)

Submitted-by: chuck@trantor.harris-atd.com (Chuck Musciano)
Posting-number: Volume 2, Issue 22
Archive-name: contool3.0/part03

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 3 (of 6)."
# Contents:  contool.info contool.man props.c
# Wrapped by chuck@melmac on Fri Aug 17 10:00:52 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'contool.info' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'contool.info'\"
else
echo shar: Extracting \"'contool.info'\" \(18660 characters\)
sed "s/^X//" >'contool.info' <<'END_OF_FILE'
X# 
X# contool.info - User interface object help text.
X# This file was generated by `gxv' from `contool.G'.
X# DO NOT EDIT BY HAND.
X# 
X:contool_controls
XThe contool control panel has buttons which let you load and store configuration data, adjust contool's configuration, and create and modify message filters.  Point at the desired button and press the Help key for more information about that set of
functions.
X# 
X:file
XThe File button provides various file-related services to contool users.  The associated menu has five entries.
X
X"Load Configuration" brings up the Load Configuration dialog.
X
X"Store Configuration" brings up the Store Configuration dialog.
X
X"Start Logging" starts logging messages to the log file specified in the Properties dialog.  If logging is already in effect, this menu item is disabled.
X
X"Stop Logging" stops logging.  If logging is not in effect, this menu item is disabled.
X
X"Print" prints the contents of the console use the print filter specified in the Properties dialog. 
X
XThe default action is "Load Configuration".
X# 
X:view
XThe View button provides three contool support functions:
X
X"Become Console" ensures that contool has the system console attribute.  Only one process under SunOS can own the console.  If some other process acquires this attribute, messages will no longer be routed to contool.  This selection will give the console
attribute back to contool.
X
X"Clear Messages" clears the current console messages from the scrolling display.
X
X"Reset Filter" causes contool to stop processing a multi-line filter.  If the user has incorrectly specified the end pattern of a multi-line filter, contool may never stop processing that filter, preventing subsequent messages from being displayed.  This
sleection cancels any multi-line fiter in effect.  If a multi-line filter is being processed, its starting pattern will be displayed in the left footer of the contool window.
X
XThe default selection is "Become Console".
X# 
X:edit
XThe Edit button lets the user edit either the contool properties or the current filter set.
X
XThe "Filters" selection brings up the Filters dialog.
X
XThe "Properties" selection brings up the Properties dialog.
X
XThe default selection is "Filters".
X# 
X:display
XThe contool console display contains the text of those messages which contoolhas been configured to display.  Some messages may be timestamped.  Which messages make it into the console is controlled by the Filters dialog; how many messages are retained is
determined by the Properties dialog.
X# 
X:prop_controls
XThe Properties dialog box lets you modify various default attributes of contool.  These attributes include how to handle messages which do not match any filter, message logging and printing, and icon images.
X# 
X:default_action
XThe Default action setting determines what action contool will take when a message arrives that does not match any filter.
X
XIf "Beep" is selected, the machine bell will be rung the indicated number of times.
X
XIf "Command" is selected, the indicated command will be executed.  The contents of the message are written to the command's standard input.
X
XIf "Flash icon" is selected, contool's icon will flash, alternating between the "Check console" and "Flash" images specified in the contool Properties dialog box.
X
XIf "Open window" is selected, contool will open to a window (if iconic) and move in front of any obscuring windows.
X
XIf "Timestamp" is selected, a timestamp will be written to the console before the message text.  Timestamping is further controlled by the timestamp resolution defined in the contool Properties dialog box.
X
X# 
X:default_beep_count
XThis numeric text field determines the number of times the terminal bell will be rung when a message arrives that does not match any filter.
X
XThis item is only enabled if "Beep" is enabled in the "Default action" setting.
X# 
X:default_beep_times
XThis numeric text field determines the number of times the terminal bell will be rung when a message arrives that does not match any filter.
X
XThis item is only enabled if "Beep" is enabled in the "Default action" setting.
X# 
X:default_command
XThis text field determines the command that will be exedcuted when a message arrives that does not match any filter.  The contents of the message are written to standard input of the executing command.
X
XThis item is only enabled if "Command" is enabled in the "Default action" setting.
X# 
X:log_file
XThe Log file text field contains the path of the file to which messages are written if logging is enabled.
X
XMessages are always appended to the file, preserving any previous contents.
X
XTyping a space in this field will cause file name completion to occur, expanding the current pathname to match, as much as possible, any existing files with the same name.
X# 
X:log_style
XThe Log messages setting determines whether messages will be written to the log before or after filtering.
X
XIf "Before filtering" is selected, everything received by contool is written to the log.
X
XIf "After filtering" is selected, only those messages that do not match any filter, or that match a filter whose match action is to save the message, are written to the log.
X# 
X:print_filter
XThe Print filter text field specifies the command which will be used to print the console when "Print" is selected from the contool "File" menu.
X
XThis command should route its standard input to a printer.
X# 
X:good_icon
XThe "All is well" icon text field should contain the path of a file containing the image to be used by contool when it is not flashing its icon.  The image should have been produced using iconedit(1).
X
XIf this field is blank, the default icon is used.
X# 
X:bad_icon
XThe "Check console" icon text field should contain the path of a file containing the image to be used by contool when it is flashing its icon.  The image should have been produced using iconedit(1).  The image will be alternated with the "Flash" image to
produce a blinking effect.
X
XIf this field is blank, the default icon is used.
X# 
X:flash_icon
XThe "Flash" icon text field should contain the path of a file containing the image to be used by contool when it is flashing its icon.  The image should have been produced using iconedit(1).  The image will be alternated with the "Check console" image to
produce a blinking effect.
X
XIf this field is blank, the default icon is used.
X# 
X:stamp_resolution
XThe Timestamp resolution numeric text item specifies the number of seconds that must elapse before contool will write a new timestamp to the console.  Even if a filter requires that a timestamp be written, the stamp will only be inserted if the specified
time has transpired.  This keeps the console from becoming clogged with a large number of similar timestamps.
X# 
X:message2
XThe Timestamp resolution numeric text item specifies the number of seconds that must elapse before contool will write a new timestamp to the console.  Even if a filter requires that a timestamp be written, the stamp will only be inserted if the specified
time has transpired.  This keeps the console from becoming clogged with a large number of similar timestamps.
X# 
X:max_message
XThe Maximum message text numeric field determines the maximum number of characters contool will keep in the console display.  If inserting a new message would exceed this amount, contool will remove text from the beginning fo the display to make room. 
The amount of text removed is determined by the "Overflow deletion amount" value.
X# 
X:message3
XThe Maximum message text numeric field determines the maximum number of characters contool will keep in the console display.  If inserting a new message would exceed this amount, contool will remove text from the beginning fo the display to make room. 
The amount of text removed is determined by the "Overflow deletion amount" value.
X# 
X:delete_amount
XThe Overflow deletion amount numeric field determines how much text will be removed from the start of the console to make room for a new message whose insertion would cause the console the exceed the "Maximum message text" size.
X
XContool will attempt to remove whole messages from the console in order to retain an orderly appearance.
X# 
X:message4
XThe Overflow deletion amount numeric field determines how much text will be removed from the start of the console to make room for a new message whose insertion would cause the console the exceed the "Maximum message text" size.
X
XContool will attempt to remove whole messages from the console in order to retain an orderly appearance.
X# 
X:props_apply
XThe Apply button causes the values displayed in the Properties dialog to become the current contool properties.  Before Apply is pressed, changes made in this dialog do not affect contool.
X
XEven after pressing Apply, the changes are not written to the contool configuration file.  If you wish your changes to remaina cross invocations of contool, use the "Save Configuration" dialog to write the properties to the configuration file.
X# 
X:props_reset
XThe Reset button restores the values in the Properties dialog to match the current values in use by contool.  Any changes made to these values and not applied to contool are discarded.
X# 
X:filter_controls
XThis is the contool filter editing dialog.  You use this dialog to add, delete, and modify console message filters.
X# 
X:filter_list
XThis scrolling list displays the current contool filter set.  Each line corresponds to one filter.
X
XThe starting pattern for each filter is shown in the list, preceded by a small glyph which indicates whether the filter is a single-line or multi-line filter.
X
XTo see the other attributes of a single filter, select that filter with the mouse.  The attributes will be displayed in the Filter dialog box.
X
XIf you select more than one filter, the remainder of the dialog box will be grayed out.  The dialog box is also disabled if no filter is selected.
X# 
X:filter_insert
XThe Insert button inserts a new, blank filter into the filter list.  The menu associated with the button allows you to specify where the new filter will be inserted.
X
XThe insert positions are at the top of the list, the bottom of the list, and before or after the current selection.  These last choices are only enabled if exactly one filter in the list is selected.  The default position is at the bottom of the list.
X
XAfter inserting the new filter, any other selected filters are deselected, and the new filter is selected.  You can then define the attributes of this new filter, and update the filter using the Update button.
X# 
X:filter_edit
XThe Edit button lets you modify the current filter list.  The menu associated with this button provides Cut, Copy, Paste, and Delete operations.
X
XThe Cut operation removes the selected filters from the list and places them on the clipboard.  You can place these filters back into the list using the Paste operation.
X
XThe Copy operation places a copy of the selected filters onto the clipboard.  The Paste operation will paste the copied filters into the list.
X
XThe Paste operation pastes filters on the clipboard into the filter list.  The Paste submenu provides four posting positions: at the top of the list, the bottom of the list, and before or after the current selection.  The last two choices are only enabled
if exactly one filter in the list is selected.  The default position is at the bottom of the list.
X
XThe Delete operation removes the selected filters from the list.  The filters are not placed on the clipboard.  Once deleted, filters cannot be recovered with the Paste operation.
X
XThe Cut, Copy, and Delete operations are only enabled when one or more filters in the list are selected.  The Paste operation is only enabled after a Cut or Copy operation has placed filters on the clipboard.
X
XThe default edit operation is Cut.
X# 
X:filter_update
XThe Update button applies the current filter attributes displayed in the Filters dialog box to the currently selected filter.  The only way to modify a filter is to select it, change its attributes, and click the Update button.
X
XThe Update button is only enabled when exactly one filter in the list is selected.
X
XYou must use Update to make changes to a filter take effect.  Clciking the Apply button does not perform an Update function on the current filter.
X# 
X:filter_type
XThe Type setting determines whether the currently selected filter will match one or several lines of text written to the console.
X
XIf "Single line filter" is selected, the "Pattern" text field is enabled, and must contain a regular expression describing the line of text to be matched by this filter.
X
XIf "Multi-line filter" is selected, both "Pattern" and "End pattern" are enabled.  The "Pattern" field should contain a pattern which will match the first line of a multi-line filter.  The "End pattern" must match the last line of the multi-line filter. 
All text between the first and last lines is considered part of the filtered text.
X# 
X:start
XThe Pattern text field contains a regular expression (see ed(1), for more on regular expressions) which will match the first line of a message written to the console.  For single line filters, this is the only line matched by the filter.  For multi-line
filters, lines of text beginning with the first line and continuing until a line matches the "End pattern" are considered part of the filtered text.
X# 
X:stop
XThe End pattern text field contains a regular expression (see ed(1) for more on regular expressions) which will match the last line of a multi-line filter.
X# 
X:comment
XThe Comment text field should contain a short description of what the current filter does.  Since some filters can be quite arcane, this description can be helpful to new users.
X
XThis field is optional, and can be left empty.  Let your conscience be your guide...
X# 
X:ignore
XThe When matched selection determines what contool does with a message once it has matched a filter.
X
XIf "Save message" is selected, the actions selected in the "When saved" setting are performed, and the message text is written to the  console.
X
XIf "Ignore message" is selected, "When saved" is disabled and the message text is discarded.
X# 
X:action
XThe When saved setting determines what action contool will take when a particular filter matches a console message.
X
XIf "Beep" is selected, the machine bell will be rung the indicated number of times.
X
XIf "Command" is selected, the indicated command will be executed.  The contents of the message are written to the command's standard input.
X
XIf "Flash icon" is selected, contool's icon will flash, alternating between the "Check console" and "Flash" images specified in the contool Properties dialog box.
X
XIf "Open window" is selected, contool will open to a window (if iconic) and move in front of any obscuring windows.
X
XIf "Timestamp" is selected, a timestamp will be written to the console before the message text.  Timestamping is further controlled by the timestamp resolution defined in the contool Properties dialog box.
X
XWhen a new filter is created, the save actions are set to match the default message actions defined in the Properties dialog box.
X# 
X:filter_beep_count
XThis numeric text field determines the number of times the terminal bell will be rung when a message arrives matching the current filter.
X
XThis item is only enabled if "When matched" is set to "Save message" and "Beep" is enabled in the "When saved" setting.
X# 
X:filter_beep_times
XThis numeric text field determines the number of times the terminal bell will be rung when a message arrives matching the current filter.
X
XThis item is only enabled if "When matched" is set to "Save message" and "Beep" is enabled in the "When saved" setting.
X# 
X:filter_command
XThis text field determines the command that will be exedcuted when a message arrives matching the current filter.  The contents of the message are written to standard input of the executing command.
X
XThis item is only enabled if "When matched" is set to "Save message" and "Command" is enabled in the "When saved" setting.
X# 
X:filters_apply
XThe Apply button takes the set of filters displayed in the filter list and makes them the current contool filter set.  Before Apply is pressed, any additions, deletions, or changes made to the filters remain local to the Filters dialog box.
X
XEven after pressing Apply, the filter changes are not written to the configuration file.  In roder to make your changes take effect for subsequent invocations of contool, use the Save Configuration dialog box to write them to your configuration file.
X# 
X:filters_reset
XThe Reset button discards any changes you have made to the displayed filter set, restoring the filters to match the set currently in use by contool.
X
XChanges made to the filters are local to the Filters dialog box.  You can discard your work and start fresh with the existing filter set by pressing the Reset button.
X# 
X:load_controls
XThe Load Configuration dialog lets the user load tool properties and/or filter definitions from a configuration file.
X# 
X:load_type
XThe Load selection lets the user choose which items are to be loaded from the configuration file.
X
XIf "Tool properties" is selected, contool properties will be loaded from the file.
X
XIf "Filter definitions" is selected, new filters will be loaded from the file, replacing any existing filters.
X# 
X:load_file
XThe Configuration file text field must contain the name of the desired configuration file.
X
XTyping a space in this field will cause file name completion to occur, expanding the current pathname to match, as much as possible, any existing files with the same name.
X# 
X:accept_load
XThe Load button causes the selected items to be read from the configuration file.  Existing properties and/or filters are replaced by those read from the file.
X# 
X:store_controls
XThe Store Configuration dialog lets the user store tool properties and/or filter definitions in a configuration file.
X# 
X:store_type
XThe Store selection lets the user choose which items are to be stored in the configuration file.
X
XIf "Tool properties" is selected, contool properties will be written to the file.
X
XIf "Filter definitions" is selected, new filters will be written to the file.
X# 
X:store_file
XThe Configuration file text field must contain the name of the desired configuration file.
X
XTyping a space in this field will cause file name completion to occur, expanding the current pathname to match, as much as possible, any existing files with the same name.
X# 
X:accept_store
XThe Store button writes the desired items to the configuration file.  The entire file is overwritten with the data.  Thus, a file containing properties and filters will be completely rewritten, even if you only write the filters to it.
END_OF_FILE
if test 18660 -ne `wc -c <'contool.info'`; then
    echo shar: \"'contool.info'\" unpacked with wrong size!
fi
# end of 'contool.info'
fi
if test -f 'contool.man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'contool.man'\"
else
echo shar: Extracting \"'contool.man'\" \(17253 characters\)
sed "s/^X//" >'contool.man' <<'END_OF_FILE'
X.TH CONTOOL 1 "13 October 1989"
X.SH NAME
Xcontool \- capture and display console output
X.SH SYNOPSIS
Xcontool [\fB\(hyf\fP \fIfile\fP] [\fB\(hyl\fP] [\f3\(hyL\fP \f2logfile\fP]
X.SH DESCRIPTION
X.LP
X\f2Contool\fP captures and displays any messages sent to the system console.
XEach message is timestamped as it arrives.  The messages are displayed in a
Xscrolling text window, so the user can scroll through old messages.
X.LP
XWhen a message arrives, \f3contool\fP will beep and, if closed, begin
Xblinking its icon until the user opens the tool.  This behavior can be changed
Xby modifying the default contool properties.
X.LP
X\f2Contool\fP must be run under either Open Windows or X Windows.
XIt accepts the standard Open Windows command line options.
X.SH OPTIONS
X.IP "\fB\\(hyf\fP \fIfile\fP"
Xspecifies an alternate configuration file.  \f2Contool\fP normally
Xreads its configuration information from ~/.contool.
X.IP "\fB\\(hyl\fP"
Xenables logging when \f2contool\fP starts.  Initially, \f2contool\fP
Xdoes not log messages to a file.  This option allows logging to be started
Xautomatically.  Logging behavior can be enabled and disabled via the
X\*(lqFile\*(rq menu (see below).
X.IP "\fB\\(hyL\fP \fIlogfile\fP"
Xspecifies an alternate log file.  The value of \fIlogfile\fP overrides
Xany log file stored in the configuration file.  The \fB-l\fP and \fB-L\fP
Xoptions used together allow multiple copies of contool to be started on 
Xa single machine, with each copy logging to a different file, without
Xhaving to create and maintain multiple configuration files.
X.SH USER INTERFACE
X.LP
X\f2Contool\fP presents the user with a control panel containing three
Xbuttons and a scrolling text window.  Console messages appear in the
Xtext window; \f2contool\fP's behavior is managed with the \fBFile\fP,
X\fBView\fP, and \fBEdit\fP buttons.  These buttons have several menu choices
Xassociated with them:
X.IP "\fBFile: Load Configuration...\fP"
Xbrings up the \fBLoad Configuration\fP dialog box.  This dialog contains
Xa non-exclusive setting, a text field, and a single \fBLoad\fP button.
XThe setting has two entries: \*(lqTool Properties\*(rq and \*(lqFilter
XDefinitions\*(rq.  The user can choose which of these items to load from
Xthe configuration file.  The default action is to load both properties and
Xfilters from the file.
X.IP ""
XThe text field contains the path of the configuration file.  By default,
Xthis is either ~/.contool, or the value of the \fB-f\fP option (above).
XThis text field provides file name completion, like \f2csh\fP(1), by typing
Xa space or carriage return.
X.IP ""
XAfter determining which components to be read from the file, and the name of
Xthe file, clicking on the \fBLoad\fP button will cause the desired elements
Xto be read from the file.  If filters are loaded, any existing filters are
Xdiscarded.  If \f2contool\fP was in the middle of filtering a multi-line message,
Xthat filtering action is terminated.
X.IP ""
X\f2Contool\fP can read files created by versions 2.0, 2.1, 2.2, and 3.0 of
X\f2contool\fP.  Files used by version 1.0 will need to be manually converted
Xby first reading and writing them with any 2.x release of \f2contool\fP.
X.IP "\fBFile: Save Configuration...\fP"
Xis analogous to the \fBLoad Configuration\fP operation, bringing up a dialog
Xbox containing a non-exclusive setting, a text field, and a \fBSave\fP
Xbutton.  In the same manner as the \fBLoad Configuration\fP dialog, the
Xuser indiactes which items he desires to save, specifies the destination
Xfile, and clicks on the \fBSave\fP button to save the information.
X.IP ""
X\f2Contool\fP writes the data in a format incompatible with previous
Xversions (release 2.2 or earlier) of the tool.
X.IP "\fBFile: Start Logging\fP"
Xstarts logging console messages to the log file specified by the tool
Xproperties, or the \fB-L\fP option (above).  The tool properties also
Xcontains a switch which determines whether messages are written before
Xor after filtering occurs.  If before, all messages are logged.  If after,
Xonly those messages which do not match a filter, or whose filter has the
X\*(lqSave\*(rq attribute, are logged.
X.IP ""
XThe log file is written in such a manner that multiple invocations of
X\f2contool\fP can write to the same log file without conflict.  New 
Xmessages are always appended to the log file.
X.IP "\fBFile: Stop Logging\fP"
Xstops the logging process.
X.IP "\fBFile: Print\fP"
Xuses the \*(lqPrint Filter\*(rq specified in the tool properties to 
Xprint the contents of the console.  Only messages saved in the console
Xcan be printed.
X.IP "\fBView: Become Console\fP"
Xensures that \f2contool\fP has the system console attribute.  SunOS
Xallows exactly one process in the system to own the console.  If some
Xother process takes control of the console, the user can reassign the
Xconsole attribute to \f2contool\fP using this menu selection.
X.IP "\fBView: Clear Messages\fP"
Xclears all messages from the console text display.
X.IP "\fBView: Reset Filter\fP"
Xinterrupts filtering of a multi-line filter.  If the user incorrectly
Xspecifies the end pattern of a multi-line filter, \f2contool\fP may
Xnever stop processing the filter, causing all subsequent console
Xmessages to be incorrectly handled.  This selection resets the effect
Xof any multi-line filter that may be in effect.
X.IP ""
XWhen processing a multi-line filter, \f2contool\fP displays the
Xstarting filter pattern in the left window footer.  If the left footer
Xis blank, \f2contool\fP is not processing a multi-line filter.
X.IP "\fBEdit: Filters...\fP"
Xbrings up the \fBFilters\fP dialog box.  See EDITING FILTERS, below.
X.IP "\fBEdit: Properties...\fP"
Xbrings up the \fBTool Properties\fP dialog box.  See TOOL PROPERTIES, below.
X.SH EDITING FILTERS
XThe \fBFilters\fP dialog presents a scrolling list of filters and a variety of
Xdevices used to modify the current filter set.  The items in this dialog are:
X.IP "\fBFilters\fP"
XThis scrolling list shows the starting pattern of each filter currently used by
X\f2contool\fP.  The pattern text is preceded by a small glyph indicating
Xwhether the filter is a single-line or multi-line filter.
X.IP ""
XIf exactly one item in the list is selected, the properties of that filter
Xwill be displayed in the dialog box.  If no, or more than one, filter is
Xselected, the remainder of the dialog box is grayed out.
X.IP "\fBInsert\fP"
XThis button inserts a new blank filter into the scrolling list, allowing
Xthe user to add new filters to the filter set.  A menu attached to
Xthe button allows the user to select the insert point: at the top of the
Xlist, before the current selection, after the current selection, or at
Xthe bottom of the list.  The \*(lqbefore\*(rq and \*(lqafter\*(rq
Xchoices are only enabled if exactly one filter in the list is selected.
XThe default position is the bottom of the list.
X.IP "\fBEdit\fP"
XThis button edits the currently selected filters in the list.  The
Xmenu attached to this button has four choices: \fBCut\fP, \fBCopy\fP, \fBPaste\fP,
Xand \fBDelete\fP.
X.IP ""
XThe \fBCut\fP operation removes the selected filters from the list
Xand places them on the clipboard, where they can subsequently be pasted
Xback into the list.
X.IP ""
XThe \fBCopy\fP operation copies the selected filters to the clipboard.
XThe filters are not removed from the list.  The copied filters can subsequently
Xbe pasted back into the list.
X.IP ""
XThe \fBPaste\fP operation copies filters from the clipboard into the list.
XThis selection has a menu which specifies the paste position: at the top of the
Xlist, before the current selection, after the current selection, or at
Xthe bottom of the list.  The \*(lqbefore\*(rq and \*(lqafter\*(rq
Xchoices are only enabled if exactly one filter in the list is selected.
XThe default position is the bottom of the list.
X.IP ""
XThe \fBDelete\fP operation removes the selected filters from the list
Xwithout placing them on the clipboard.  Once deleted, filters cannot
Xbe recovered with a paste operation.
X.IP ""
XThe \fBCut\fP, \fBCopy\fP, and \fBDelete\fP selections are only presented
Xif one or more filters in the list are selected.  The \fBPaste\fP selection
Xis only available after a \fBCut\fP or \fBCopy\fP operation.
X.IP "\fBUpdate\fP"
XThis button updates the currently selected filter using the values 
Xpresented in the remainder of the dialog box.  This button is only
Xaccessible if exactly one filter in the list is selected.
X.IP ""
X\fBUpdate\fP is used to modify an existing filter.  When just that filter
Xis selected, its attributes are placed into the other dialog elements
Xdescribed below.  After adjusting the filter attributes, the user clicks
Xthe \fBUpdate\fP button to apply the changes to the currently selected
Xfilter.
X.IP ""
XIn a similar manner, \fBUpdate\fP is used to apply attributes to a new,
Xblank filter placed in the list via the \fBInsert\fP button.
X.IP "\fBType\fP"
XThe \fBType\fP toggle indicates whether a filter will match just a single
Xline message, or will match a multiple line message.  When \*(lqSingle
Xline filter\*(rq is chosen, the \fBEnd pattern\fP item is disabled,
Xand the user must specify the pattern which will match a single line of
Xtext written to the console.  When \*(lqMulti-line filter\*(rq is
Xselected, the \fBEnd pattern\fP item is enabled, and the user needs to specify
Xboth a starting and an ending pattern.  All text following a line which
Xmatches the starting pattern, up to and including a line which matches the
Xending pattern, is considered to be part of the filtered message.
X.IP "\fBPattern\fP"
XThis text field specifies the regular expression which matches the first
X(and, in the case of single line filters, the only) line of text in the
Xfiltered message.  Any valid regular expression is permitted.  Users that
Xare trying to match some text exactly should be aware that regular
Xexpressions can match text anywhere in a line, and that the expression
Xshould be anchored to the start (or end) of the line by using the "^"
X(or "$") metacharacters.  For more information on regular expressions,
Xsee \f2ed\fP(1).
X.IP "\fBEnd pattern\fP"
XIf the \fBType\fP is set to \*(lqMulti-line filter\*(rq, this field
Xmust contain the regular expression which matches the last line of the
Xblock of text handled by this filter.
X.IP "\fBComment\fP"
XThis text field contains any comments regarding the filter the user
Xwishes to record.  Since some filters can be rather arcane, it is suggested
Xthat users comment their filters.
X.IP "\fBWhen matched\fP"
XThis exclusive setting dictates the behavior of \f2contool\fP when a
Xfilter is matched.  If \*(lqSave message\*(rq is chosen, the message
Xis copied into the console display, and various actions can be taken.
XIf \*(lqIgnore message\*(rq is selected, the filter text is discarded
Xand no further actions are taken by \f2contool\fP.
X.IP "\fBWhen saved\fP"
XIf \fBWhen matched\fP is set to \*(lqSave message\*(rq, this non-exclusive
Xchoice item will be enabled, allowing the user to specify what contool
Xshould do with this message.
X.IP ""
XThe \*(lqBeep\*(rq choice causes the terminal bell to be sounded.  If
Xselected, the beep counter to the right of this item is enabled, allowing
Xthe user to choose anywhere from one brief beep up to 99 annoying beeps.
X.IP ""
XThe \*(lqCommand\*(rq choice causes a single command to be executed.
XThe text field to the right of this item must contain the command to
Xbe executed.  \f2Contool\fP will write the text of the message to the
Xstandard input of the command.  For example, using \*(lqmail -s 'Contool
Xoutput' user\*(rq as the command would mail the message text to the
X\f2user\fP.
X.IP ""
XThe \*(lqFlash icon\*(rq choice causes the \f2contool\fP icon to flash,
Xalternating between the \*(lqCheck console\*(rq and \*(lqFlash\*(rq
Xicons.
X.IP ""
XThe \*(lqOpen window\*(rq choice causes \f2contool\fP to open from
Xits iconic state, and to move in front of any obscuring windows.
X.IP ""
XThe \*(lqTimestamp\*(rq choice causes \f2contool\fP to write a timestamp
Xto the console before copying the message into the console.  The timestamp
Xis written in conjunction with the timestamp resolution specified in the
X\fBTool Properties\fP dialog.
X.IP "\fBApply\fP"
XThis button makes the filters contained in the scrolling list the current
Xset of active filters.  Until this button is clicked, all changes made to
Xthe filters are not used by \f2contool\fP.  After clicking \fBAccept\fP,
Xthe changed filters become the current working set.
X.IP ""
XNote that even after clicking \fBAccept\fP, the configuration file is
Xnot updated.  To make the changes permanent between invocations of
X\f2contool\fP, use the \fBSave Configuration\fP dialog to save the
Xchanged filters.
X.IP "\fBReset\fP"
XThis button discards any changes made to the current filter set, 
Xrestoring the filter list to match the current filter set in use
Xby \f2contool\fP.
X.SH TOOL PROPERTIES
XThe \fBTool Properties\fP dialog allows the user to change the default behavior
Xof \f2contool\fP.  This includes various tool attributes, and the 
Xactions taken when a message arrives which does not match any filter.
XThe various properties include:
X.IP "\fBDefault action\fP"
XThis non-exclusive setting determines the actions taken by \f2contool\fP
Xwhen a message arrives which does not match any filter.  The various
Xchoices in this setting exactly correspond to the \fBWhen saved\fP
Xsetting the \fBFilters\fP dialog, above.
X.IP "\fBLog file\fP
XThis text field contains the path of the file to which messages will
Xbe logged.  This field must be filled in before logging is enabled.
X.IP "\fBLog messages\fP"
XIf this exclusive setting is set to \*(lqbefore filtering\*(rq, all
Xmessages will be logged.  If set to \*(lqafter filtering\*(rq, 
Xmessages that match filters whose \fBWhen matched\fP behavior is
Xset to \*(lqIgnore message\*(rq will not be logged.
X.IP "\fBPrint filter\fP"
XThis text field specifies the command to be used to print the
Xconsole.  The default is \*(lqlpr\*(rq.  Local site dependencies
Xmay require a different command.
X.IP "\fB\\*(lqAll is well\\*(rq icon\fP"
XThis text field contains the path of a file created with \f2iconedit\fP(1).
XThe contained image will be used as \f2contool\fP's regular icon image.
XThis image is displayed whenever no flashing is in effect.
X.IP "\fB\\*(lqCheck console\\*(rq icon\fP"
XThis image is alternated with the \fB\*(lqFlash\*(rq icon\fP image whenever flashing
Xis required.
X.IP "\fB\\*(lqFlash\\*(rq icon\fP"
XThis image is alternated with the \fB\*(lqCheck console\*(rq icon\fP image whenever flashing
Xis required.  Ideally, all three icons should be the same size.
X.IP "\fBTimestamp resolution\fP"
XThis numeric field specifies the minimum number of seconds to wait before
Xwriting a new timestamp to the console.  Messages which require timestamping
Xwill only write a timestamp if this number of seconds have transpired since the
Xlast timestamp.
X.IP "\fBMaximum message text\fP"
XThis numeric field determines the maximum size, in bytes, of messages that will
Xbe stored in the console.  When writing a message to the console would exceed
Xthis limit, some number of bytes, as determined by the \fBOverflow delete amount\fP,
Xbelow, will be removed from the front of the console.  This feature prevents the
Xconsole from becoming so large over time that it begins to swamp system resources.
X.IP "\fBOverflow delete amount\fP"
XWhen writing a message to the console would exceed the \fBMaximum message text\fP,
Xabove, text will be deleted from the beginning of the console to make room.
XThis numeric field specifies how many bytes to remove to make room.  \f2Contool\fP
Xwill attempt to remove whole messages within the constraints of the console
Xsize to preserve a readable console.
X.IP "\fBApply\fP"
XThis button makes the values in the dialog box the
Xcurrent tool properties.  Until this button is clicked, all changes made to
Xthe properties are not used by \f2contool\fP.  After clicking \fBAccept\fP,
Xthe changed values become the current properties.
X.IP ""
XNote that even after clicking \fBAccept\fP, the configuration file is
Xnot updated.  To make the changes permanent between invocations of
X\f2contool\fP, use the \fBSave Configuration\fP dialog to save the
Xchanged properties.
X.IP "\fBReset\fP"
XThis button discards any changes in the dialog box made to the current properties, 
Xrestoring the properties to match the current properties in use
Xby \f2contool\fP.
X.SH CONFIGURATION FILE FORMAT
XPrevious versions of \f2contool\fP relied on the user editing the
Xconfiguration file by hand.  This version manages the file automatically,
Xand it is not intended that the file be edited directly by users.
XSee EDITING FILTERS, above, for information on modifying the behavior
Xof \f2contool\fP.
X.SH FILES
X.ta 2i
X~/.contool	filter pattern file
X.SH SEE ALSO
Xcmdtool(1), ed(1)
X.SH AUTHOR
X.LP
XChuck Musciano
X.br
XAdvanced Technology Department
X.br
XHarris Corporation
X.br
XPO Box 37, MS 3A/1912
X.br
XMelbourne, FL 32902
X.br
X(407) 727-6131
X.br
XARPA: chuck@trantor.harris-atd.com
X.SH BUGS
X.LP
X\f2Contool\fP is a view-only tool, and there is no way to type commands
Xon the console.
X.LP
XWindow system bugs may cause unusual, but harmless, quirks in the behavior
Xof \f2contool\fP.  In particular, displaying a menu in a dialog box without
Xactually selecting an item from that menu will cause the dialog box to close.
END_OF_FILE
if test 17253 -ne `wc -c <'contool.man'`; then
    echo shar: \"'contool.man'\" unpacked with wrong size!
fi
# end of 'contool.man'
fi
if test -f 'props.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'props.c'\"
else
echo shar: Extracting \"'props.c'\" \(8606 characters\)
sed "s/^X//" >'props.c' <<'END_OF_FILE'
X/************************************************************************/
X/*	Copyright 1988-1990 by Chuck Musciano and Harris Corporation	*/
X/*									*/
X/*	Permission to use, copy, modify, and distribute this software	*/
X/*	and its documentation for any purpose and without fee is	*/
X/*	hereby granted, provided that the above copyright notice	*/
X/*	appear in all copies and that both that copyright notice and	*/
X/*	this permission notice appear in supporting documentation, and	*/
X/*	that the name of Chuck Musciano and Harris Corporation not be	*/
X/*	used in advertising or publicity pertaining to distribution	*/
X/*	of the software without specific, written prior permission.	*/
X/*	Chuck Musciano and Harris Corporation make no representations	*/
X/*	about the suitability of this software for any purpose.  It is	*/
X/*	provided "as is" without express or implied warranty.  This 	*/
X/*	software may not be sold without the prior explicit permission	*/
X/*	of Harris Corporation.						*/
X/************************************************************************/
X
X/************************************************************************/
X/*									*/
X/*	props.c		contool properties dialog manager		*/
X/*									*/
X/************************************************************************/
X
X#include	<stdio.h>
X#include	<sys/param.h>
X#include	<sys/types.h>
X#include	<xview/xview.h>
X#include	<xview/panel.h>
X#include	<xview/rect.h>
X#include	<xview/screen.h>
X
X#include	"manifest.h"
X#include	"contool.h"
X#include	"contool_ui.h"
X
XEXPORT	Props	defaults = {3,		/* beeps			 */
X			    TRUE,	/* flash the icon		 */
X			    FALSE,	/* don't pop the window		 */
X			    TRUE,	/* timestamp the message	 */
X			    NULL,	/* no command to run		 */
X			    NULL,	/* default good icon		 */
X			    NULL,	/* default bad icon		 */
X			    NULL,	/* default flash icon		 */
X			    "lpr",	/* default print filter		 */
X			    NULL,	/* no log file			 */
X			    TRUE,	/* log after filtering		 */
X			    60,		/* timestamp every 60 seconds	 */
X			    32768,	/* save 32K of messages		 */
X			    1024	/* remove 1K when we get full	 */
X			   };
X
XPRIVATE	contool_props_objects	*contool_props = NULL;
X
X/************************************************************************/
XPRIVATE	init_props(ip)
X
Xcontool_props_objects	*ip;
X
X{	int	val;
X
X	val = 0;
X	if (defaults.beep > 0)
X	   val |= BEEP_BIT;
X	if (defaults.command > 0)
X	   val |= COMMAND_BIT;
X	if (defaults.flash)
X	   val |= FLASH_BIT;
X	if (defaults.open)
X	   val |= OPEN_BIT;
X	if (defaults.stamp > 0)
X	   val |= STAMP_BIT;
X	xv_set(ip->default_action,     PANEL_VALUE,    val,                       NULL);
X	xv_set(ip->default_beep_count, PANEL_VALUE,    defaults.beep,
X				       PANEL_INACTIVE, defaults.beep == 0,        NULL);
X	xv_set(ip->default_beep_times, PANEL_INACTIVE, defaults.beep == 0,        NULL);
X	xv_set(ip->default_command,    PANEL_VALUE,    is_null(defaults.command),
X				       PANEL_INACTIVE, defaults.command == NULL,  NULL);
X	xv_set(ip->log_file,           PANEL_VALUE,    defaults.log_file,         NULL);
X	xv_set(ip->log_style,          PANEL_VALUE,    defaults.log_after,        NULL);
X	xv_set(ip->good_icon,          PANEL_VALUE,    defaults.good_icon,        NULL);
X	xv_set(ip->bad_icon,           PANEL_VALUE,    defaults.bad_icon,         NULL);
X	xv_set(ip->flash_icon,         PANEL_VALUE,    defaults.flash_icon,       NULL);
X	xv_set(ip->print_filter,       PANEL_VALUE,    defaults.print_filter,     NULL);
X	xv_set(ip->max_message,        PANEL_VALUE,    defaults.max_size,         NULL);
X	xv_set(ip->stamp_resolution,   PANEL_VALUE,    defaults.stamp_resolution, NULL);
X	xv_set(ip->delete_amount,      PANEL_VALUE,    defaults.delete_amount,    NULL);
X}
X
X/************************************************************************/
XEXPORT	Menu_item	edit_properties(item, op)
X
XMenu_item	item;
XMenu_generate	op;
X
X{	contool_base_objects	*ip = (contool_base_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
X
X	if (op == MENU_NOTIFY) {
X	   xv_set(ip->base, FRAME_BUSY, TRUE, NULL);
X	   if (contool_props == NULL) {
X	      contool_props = contool_props_objects_initialize(NULL, ip->base);
X	      xv_set(contool_props->log_file,
X	      	        PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
X	      	        PANEL_NOTIFY_STRING, "\n\r ",
X	      	     NULL);
X	      xv_set(contool_props->good_icon,
X	      	        PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
X	      	        PANEL_NOTIFY_STRING, "\n\r ",
X	      	     NULL);
X	      xv_set(contool_props->bad_icon,
X	      	        PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
X	      	        PANEL_NOTIFY_STRING, "\n\r ",
X	      	     NULL);
X	      xv_set(contool_props->flash_icon,
X	      	        PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
X	      	        PANEL_NOTIFY_STRING, "\n\r ",
X	      	     NULL);
X	      place_dialog(ip->base, contool_props->props);
X	      }
X	   init_props(contool_props);
X	   xv_set(contool_props->props, XV_SHOW, TRUE, NULL);
X	   xv_set(ip->base, FRAME_BUSY, FALSE, NULL);
X	   }
X	return item;
X}
X
X/************************************************************************/
XEXPORT	void	default_action(item, value, event)
X
XPanel_item	item;
Xunsigned int	value;
XEvent		*event;
X
X{	contool_props_objects	*ip = (contool_props_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
X	
X	xv_set(ip->default_beep_count, PANEL_INACTIVE, !(value & BEEP_BIT), NULL);
X	xv_set(ip->default_beep_times, PANEL_INACTIVE, !(value & BEEP_BIT), NULL);
X	xv_set(ip->default_command,    PANEL_INACTIVE, !(value & COMMAND_BIT), NULL);
X}
X
X/************************************************************************/
XEXPORT	void	accept_properties(item, event)
X
XPanel_item	item;
XEvent		*event;
X
X{	contool_props_objects	*ip = (contool_props_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
X	Props	new;
X	int	val;
X	Server_image	icon = NULL, load_icon();
X	char	msg[1024];
X
X	val = (int) xv_get(ip->default_action, PANEL_VALUE);
X
X	if (val & BEEP_BIT)
X	   new.beep = (int) xv_get(ip->default_beep_count, PANEL_VALUE);
X	else
X	   new.beep = 0;
X
X	if (val & COMMAND_BIT) {
X	   new.command = (char *) xv_get(ip->default_command, PANEL_VALUE);
X	   if (is_empty(new.command)) {
X	      error("You must specify a command to be executed");
X	      xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
X	      return;
X	      }
X	   }
X	else
X	   new.command = NULL;
X
X	new.flash            = (val & FLASH_BIT)? TRUE : FALSE;
X	new.open             = (val & OPEN_BIT)? TRUE : FALSE;
X	new.stamp            = (val & STAMP_BIT)? TRUE : FALSE;
X	new.log_file         = (char *) xv_get(ip->log_file,         PANEL_VALUE);
X	new.log_after        = (int)    xv_get(ip->log_style,        PANEL_VALUE);
X	new.good_icon        = (char *) xv_get(ip->good_icon,        PANEL_VALUE);
X	new.bad_icon         = (char *) xv_get(ip->bad_icon,         PANEL_VALUE);
X	new.flash_icon       = (char *) xv_get(ip->flash_icon,       PANEL_VALUE);
X	new.print_filter     = (char *) xv_get(ip->print_filter,     PANEL_VALUE);
X	new.max_size         = (int)    xv_get(ip->max_message,      PANEL_VALUE);
X	new.stamp_resolution = (int)    xv_get(ip->stamp_resolution, PANEL_VALUE);
X	new.delete_amount    = (int)    xv_get(ip->delete_amount,    PANEL_VALUE);
X
X	new.good_icon = is_empty(new.good_icon)? NULL : expand_tilde(new.good_icon);
X	new.bad_icon = is_empty(new.bad_icon)? NULL : expand_tilde(new.bad_icon);
X	new.flash_icon = is_empty(new.flash_icon)? NULL : expand_tilde(new.flash_icon);
X
X	if (new.good_icon && (icon = load_icon(new.good_icon, msg)) == NULL) {
X	   error("Invalid \"All is well\" icon: %s", msg);
X	   xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
X	   return;
X	   }
X	if (icon)
X	   xv_destroy(icon);
X	if (new.bad_icon && (icon = load_icon(new.bad_icon, msg)) == NULL) {
X	   error("Invalid \"Check console\" icon: %s", msg);
X	   xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
X	   return;
X	   }
X	if (icon)
X	   xv_destroy(icon);
X	if (new.flash_icon && (icon = load_icon(new.flash_icon, msg)) == NULL) {
X	   error("Invalid \"Flash\" icon: %s", msg);
X	   xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
X	   return;
X	   }
X	if (icon)
X	   xv_destroy(icon);
X
X	new.log_file = is_empty(new.log_file)? NULL : expand_tilde(new.log_file);
X	new.print_filter = strsave(new.print_filter);
X	new.command = strsave(defaults.command);
X	defaults = new;
X
X	update_icons();
X	update_logging();
X}
X
X/************************************************************************/
XEXPORT	void	reset_properties(item, event)
X
XPanel_item	item;
XEvent		*event;
X
X{	contool_props_objects	*ip = (contool_props_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
X	
X	init_props(ip);
X	xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
X}
END_OF_FILE
if test 8606 -ne `wc -c <'props.c'`; then
    echo shar: \"'props.c'\" unpacked with wrong size!
fi
# end of 'props.c'
fi
echo shar: End of archive 3 \(of 6\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 5 6 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 6 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0

Chuck Musciano				ARPA  : chuck@trantor.harris-atd.com
Harris Corporation 			Usenet: ...!uunet!x102a!trantor!chuck
PO Box 37, MS 3A/1912			AT&T  : (407) 727-6131
Melbourne, FL 32902			FAX   : (407) 727-{5118,5227,4004}

I'm glad you asked, son.  Being popular
	is the most important thing in the world.	-- Homer Simpson