home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-03-05 | 56.1 KB | 1,748 lines |
- Newsgroups: comp.sources.x
- Path: uunet!think.com!mips!msi!news
- From: chuck@trantor.harris-atd.com (Chuck Musciano)
- Subject: v16i090: Contool 3.2, Part05/05
- Message-ID: <1992Mar5.190356.2671@msi.com>
- Originator: news@sun4
- Sender: dcmartin@msi.com (David C. Martin - Moderator)
- Organization: Molecular Simulations, Inc.
- References: <csx-16i086-contool-3.2@uunet.UU.NET>
- Date: Thu, 5 Mar 1992 19:03:56 GMT
- Approved: dcmartin@msi.com
-
- Submitted-by: chuck@trantor.harris-atd.com (Chuck Musciano)
- Posting-number: Volume 16, Issue 90
- Archive-name: contool-3.2/part05
-
- # 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".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # If this archive is complete, you will see the following message at the end:
- # "End of archive 5 (of 5)."
- # Contents: INTRO Imakefile about.c busy.c contool.h error.c expand.c
- # filename_completion.c getopt.c icons/default_bad.icon
- # icons/default_flash.icon icons/default_good.icon icons/mask.icon
- # images/empty.icon images/range.icon images/single.icon load_icon.c
- # logging.c manifest.h patchlevel.h pinned_menu_notify.c regexp.c
- # sample.filter
- # Wrapped by dcmartin@fascet on Sat Feb 22 10:11:10 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'INTRO' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'INTRO'\"
- else
- echo shar: Extracting \"'INTRO'\" \(1369 characters\)
- sed "s/^X//" >'INTRO' <<'END_OF_FILE'
- X This release brings contool from version 3.1a to 3.2. This new
- Xrelease has the following enhancements:
- X
- X * -i option allows messages to be read from other sources
- X including named pipes and the standard input
- X
- X * -f option causes contool to fork automatically after
- X acquiring the console
- X
- X * alternative icons are correctly masked
- X
- X * messages can be moved to an archive window, letting you keep
- X only current messages in the contool window
- X
- XAs always, complete sources are available from trantor.harris-atd.com
- Xin the /pub/suntools/contool directory.
- X
- X Fun with sounds: if your machine can play sounds, you can use the
- X"Execute command with message" feature to produce all sorts of audible
- Xsignals when messages arrive. Ellery Chan here at Harris found a nifty
- Xuse of sound: he plays the sound /usr/demo/SOUND/sounds/splat.au as the
- Xdefault action when a message arrives, and has the window open. When a
- Xmessage arrives, he gets a satisfying "splat!" sound and contool appears
- Xon his screen. If you are running on a SPARCstation (or otherwise have
- Xa copy of splat.au for your machine) give it a try.
- X
- XChuck Musciano ARPA : chuck@trantor.harris-atd.com
- XHarris Corporation Usenet: ...!uunet!x102a!trantor!chuck
- XPO Box 37, MS 3A/1912 AT&T : (407) 727-6131
- XMelbourne, FL 32902 FAX : (407) 729-3363
- END_OF_FILE
- if test 1369 -ne `wc -c <'INTRO'`; then
- echo shar: \"'INTRO'\" unpacked with wrong size!
- fi
- # end of 'INTRO'
- fi
- if test -f 'Imakefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Imakefile'\"
- else
- echo shar: Extracting \"'Imakefile'\" \(914 characters\)
- sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
- XOPENWINHOME = /usr/openwin
- X
- XHELPDIR = /usr/local/lib/help
- X
- XMAILER = /usr/ucb/mail
- X
- XLOCAL_LIBRARIES = -lxview -lolgx $(XLIB)
- X
- XLDOPTIONS = -L$(OPENWINHOME)/lib
- X
- XCPPFLAGS = -I$(OPENWINHOME)/include
- X
- XCFLAGS = -O -DMAILER=\"$(MAILER)\"
- X
- XEXTRA_INCLUDES = -I$(OPENWINHOME)/include
- X
- XSRCS = about.c archive.c busy.c contool.c contool_ui.c error.c expand.c filename_completion.c \
- X filters.c getopt.c load.c load_icon.c logging.c misc.c parse.y \
- X pinned_menu_notify.c place_dialog.c props.c regexp.c send_mail.c store.c
- X
- XOBJS = about.o archive.o busy.o contool.o contool_ui.o error.o expand.o filename_completion.o \
- X filters.o getopt.o load.o load_icon.o logging.o misc.o parse.o \
- X pinned_menu_notify.o place_dialog.o props.o regexp.o send_mail.o store.o
- X
- XComplexProgramTarget(contool)
- X
- Xinstall: install.man install.help
- X
- Xinstall.help:
- X $(INSTALL) -c $(INSTMANFLAGS) contool.info $(HELPDIR)/contool.info
- END_OF_FILE
- if test 914 -ne `wc -c <'Imakefile'`; then
- echo shar: \"'Imakefile'\" unpacked with wrong size!
- fi
- # end of 'Imakefile'
- fi
- if test -f 'about.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'about.c'\"
- else
- echo shar: Extracting \"'about.c'\" \(2001 characters\)
- sed "s/^X//" >'about.c' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X/************************************************************************/
- X/* */
- X/* about.c display a little information window */
- 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 "contool_ui.h"
- X
- X#include "manifest.h"
- X
- XPUBLIC contool_base_objects *contool_base;
- X
- XPRIVATE contool_about_objects *dialog = NULL;
- X
- X/************************************************************************/
- XEXPORT Menu_item popup_about_contool(item, op)
- X
- XMenu_item item;
- XMenu_generate op;
- X
- X{
- X if (op == MENU_NOTIFY) {
- X if (dialog == NULL) {
- X dialog = contool_about_objects_initialize(NULL, contool_base->base);
- X place_dialog(contool_base->base, dialog->about);
- X }
- X xv_set(dialog->about, XV_SHOW, TRUE, NULL);
- X }
- X return item;
- X}
- END_OF_FILE
- if test 2001 -ne `wc -c <'about.c'`; then
- echo shar: \"'about.c'\" unpacked with wrong size!
- fi
- # end of 'about.c'
- fi
- if test -f 'busy.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'busy.c'\"
- else
- echo shar: Extracting \"'busy.c'\" \(2165 characters\)
- sed "s/^X//" >'busy.c' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X/************************************************************************/
- X/* */
- X/* busy.c turn frame busy attribute on and off */
- X/* */
- X/************************************************************************/
- X
- X#include <stdio.h>
- X#include <xview/xview.h>
- X#include <xview/panel.h>
- X
- X#include "manifest.h"
- X
- X/************************************************************************/
- XPRIVATE set_busy(base, busy, skip)
- X
- XFrame base;
- Xint busy;
- XFrame skip;
- X
- X{ Frame subframe;
- X int i;
- X
- X for (i = 1; subframe = (Frame) xv_get(base, FRAME_NTH_SUBFRAME, i); i++)
- X if (subframe != skip)
- X if (xv_get(subframe, XV_SHOW))
- X xv_set(subframe, FRAME_BUSY, busy, NULL);
- X xv_set(base, FRAME_BUSY, busy, NULL);
- X}
- X
- X/************************************************************************/
- XEXPORT lets_get_busy(base, busy, skip)
- X
- XFrame base;
- Xint busy;
- XFrame skip;
- X
- X{ static int depth = 0;
- X
- X if (busy) {
- X if (depth == 0)
- X set_busy(base, TRUE, skip);
- X depth++;
- X }
- X else if (depth > 0)
- X if (--depth == 0)
- X set_busy(base, FALSE, NULL);
- X}
- END_OF_FILE
- if test 2165 -ne `wc -c <'busy.c'`; then
- echo shar: \"'busy.c'\" unpacked with wrong size!
- fi
- # end of 'busy.c'
- fi
- if test -f 'contool.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'contool.h'\"
- else
- echo shar: Extracting \"'contool.h'\" \(2457 characters\)
- sed "s/^X//" >'contool.h' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X/************************************************************************/
- X/* */
- X/* contool.h internal contool data structures */
- X/* */
- X/************************************************************************/
- X
- X#define is_null(x) ((x)? x : "")
- X
- X#define BEEP_BIT 0x01
- X#define COMMAND_BIT 0x02
- X#define FLASH_BIT 0x04
- X#define LOG_BIT 0x08
- X#define OPEN_BIT 0x10
- X#define STAMP_BIT 0x20
- X
- X#define ARCHIVE_MANUALLY 0
- X#define ARCHIVE_ON_CLOSE 1
- X
- Xtypedef struct filter Filter;
- Xtypedef struct props Props;
- X
- Xstruct filter {char *start;
- X char *start_re;
- X int start_circf;
- X char *stop;
- X char *stop_re;
- X int stop_circf;
- X char *comment;
- X int save;
- X int beep;
- X int flash;
- X int log;
- X int open;
- X int stamp;
- X int timeout;
- X char *command;
- X Filter *next;
- X };
- X
- Xstruct props {int beep;
- X int flash;
- X int log;
- X int open;
- X int stamp;
- X char *command;
- X char *good_icon;
- X char *bad_icon;
- X char *flash_icon;
- X char *print_filter;
- X char *log_file;
- X int log_after;
- X int archive_style;
- X int stamp_resolution;
- X int max_size;
- X int delete_amount;
- X };
- X
- XPUBLIC char *compile_exp();
- XPUBLIC char *expand_tilde();
- X
- XPUBLIC Props defaults;
- XPUBLIC Props *parsed_defaults;
- XPUBLIC Filter *parsed_filters;
- XPUBLIC Filter *filters;
- XPUBLIC int parse_errors_occured;
- XPUBLIC char *filter_file;
- XPUBLIC int filter_version;
- END_OF_FILE
- if test 2457 -ne `wc -c <'contool.h'`; then
- echo shar: \"'contool.h'\" unpacked with wrong size!
- fi
- # end of 'contool.h'
- fi
- if test -f 'error.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'error.c'\"
- else
- echo shar: Extracting \"'error.c'\" \(2036 characters\)
- sed "s/^X//" >'error.c' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X/************************************************************************/
- X/* */
- X/* error.c handle error messages */
- X/* */
- X/************************************************************************/
- X
- X#include <stdio.h>
- X#include <xview/xview.h>
- X#include <xview/notice.h>
- X
- X#include "manifest.h"
- X#include "contool_ui.h"
- X
- XPUBLIC contool_base_objects *contool_base;
- X
- X/************************************************************************/
- XEXPORT void error(a, b, c, d, e, f)
- X
- Xchar *a, *b, *c, *d, *e, *f;
- X
- X{ char buf[1024];
- X
- X sprintf(buf, a, b, c, d, e, f);
- X notice_prompt(contool_base->base, NULL,
- X NOTICE_MESSAGE_STRINGS, buf, 0,
- X NOTICE_BUTTON_YES, "OK",
- X 0);
- X}
- X
- X/************************************************************************/
- XEXPORT void abend(a, b, c, d, e, f)
- X
- Xchar *a, *b, *c, *d, *e, *f;
- X
- X{ char buf[1024];
- X
- X fprintf(stderr, a, b, c, d, e, f);
- X fprintf(stderr, "\n");
- X exit(1);
- X}
- END_OF_FILE
- if test 2036 -ne `wc -c <'error.c'`; then
- echo shar: \"'error.c'\" unpacked with wrong size!
- fi
- # end of 'error.c'
- fi
- if test -f 'expand.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'expand.c'\"
- else
- echo shar: Extracting \"'expand.c'\" \(3112 characters\)
- sed "s/^X//" >'expand.c' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X#include <sys/types.h>
- X#include <sys/dir.h>
- X#include <pwd.h>
- X
- X#include "manifest.h"
- X
- XPUBLIC char *rindex(), *index();
- X
- X/************************************************************************/
- XPRIVATE char *root_path(path)
- X
- Xchar *path;
- X
- X{ char *p;
- X
- X if (p = rindex(path, '/'))
- X if (p == path)
- X p[1] = '\0';
- X else
- X *p = '\0';
- X else
- X *path = '\0';
- X return(path);
- X}
- X
- X/************************************************************************/
- XPRIVATE char *last_node(path)
- X
- Xchar *path;
- X
- X{ char *p;
- X
- X return((p = rindex(path, '/'))? p + 1 : path);
- X}
- X
- X/************************************************************************/
- XEXPORT char *expand_filename(path)
- X
- Xchar *path;
- X
- X{ static char s[1024];
- X char pattern[1024], candidate[1024], *p,*q;
- X DIR *dir;
- X struct direct *dp;
- X struct passwd *pw;
- X
- X strcpy(s, path);
- X if (*path == '~')
- X if (path[1] == '/' || path[1] == '\0') {
- X strcpy(s, getenv("HOME"));
- X strcat(s, path + 1);
- X }
- X else {
- X if ((p = index(path, '/')) != NULL)
- X *p = '\0';
- X if ((pw = getpwnam(path + 1)) != NULL) {
- X strcpy(s, pw->pw_dir);
- X if (p != NULL) {
- X strcat(s, "/");
- X strcat(s, p + 1);
- X }
- X }
- X else
- X return(NULL);
- X }
- X strcpy(pattern, last_node(s));
- X if (*pattern == '\0')
- X return(s);
- X root_path(s);
- X candidate[0] = '\0';
- X if (*s == '\0')
- X strcpy(s, ".");
- X if ((dir = opendir(s)) == NULL) {
- X strcpy(s, path);
- X return(s);
- X }
- X while ((dp = readdir(dir)) != NULL)
- X if (strncmp(dp->d_name, pattern, strlen(pattern)) == 0)
- X if (*candidate == '\0')
- X strcpy(candidate, dp->d_name);
- X else {
- X for (p = candidate, q = dp->d_name; *p == *q; p++, q++)
- X ;
- X *p = '\0';
- X }
- X closedir(dir);
- X if (*candidate == '\0')
- X return(NULL);
- X else {
- X if (strcmp(s, ".") == 0)
- X *s = '\0';
- X else if (s[strlen(s) - 1] != '/')
- X strcat(s, "/");
- X strcat(s, candidate);
- X }
- X return(s);
- X}
- END_OF_FILE
- if test 3112 -ne `wc -c <'expand.c'`; then
- echo shar: \"'expand.c'\" unpacked with wrong size!
- fi
- # end of 'expand.c'
- fi
- if test -f 'filename_completion.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'filename_completion.c'\"
- else
- echo shar: Extracting \"'filename_completion.c'\" \(2146 characters\)
- sed "s/^X//" >'filename_completion.c' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X/************************************************************************/
- X/* */
- X/* filename_completion.c completion handler for text items */
- 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
- X#include "manifest.h"
- X
- X/************************************************************************/
- XEXPORT Panel_setting filename_completion(item, event)
- X
- XPanel_item item;
- XEvent *event;
- X
- X{ char *p, *expand_filename();
- X
- X switch (event_action(event)) {
- X case '\n' :
- X case '\r' :
- X case ' ' : if ((p = expand_filename((char *) xv_get(item, PANEL_VALUE))) == NULL)
- X window_bell(xv_get(item, XV_OWNER));
- X else
- X xv_set(item, PANEL_VALUE, p, 0);
- X event_set_id(event, '\n');
- X return(PANEL_NONE);
- X case '\t' : return(event_shift_is_down(event)? PANEL_PREVIOUS : PANEL_NEXT);
- X default : return(panel_text_notify(item, event));
- X }
- X}
- END_OF_FILE
- if test 2146 -ne `wc -c <'filename_completion.c'`; then
- echo shar: \"'filename_completion.c'\" unpacked with wrong size!
- fi
- # end of 'filename_completion.c'
- fi
- if test -f 'getopt.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'getopt.c'\"
- else
- echo shar: Extracting \"'getopt.c'\" \(1926 characters\)
- sed "s/^X//" >'getopt.c' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X#include <stdio.h>
- X
- X#include "manifest.h"
- X
- X/************************************************************************/
- XPRIVATE delarg(argc, argv)
- X
- Xint *argc;
- Xchar **argv;
- X
- X{ char *p;
- X
- X while (*argv = *(argv+1))
- X argv++;
- X (*argc)--;
- X}
- X
- X/************************************************************************/
- XEXPORT char getopt(argc, argv, opts, parm)
- X
- Xint *argc;
- Xchar **argv;
- Xchar *opts;
- Xchar **parm;
- X
- X{ char c, *p, *strcpy(), *index();
- X int killed;
- X
- X *parm = NULL;
- X while (*argv && ((**argv != '-') || (*(*argv+1) == '\0')))
- X argv++;
- X if (*argv == NULL)
- X return(EOF);
- X c = *(*argv+1);
- X *++(*argv) = '-';
- X if (killed = (*(*argv+1) == '\0'))
- X delarg(argc, argv);
- X if ((p = index(opts, c)) == NULL)
- X c = '\0';
- X else if (*(p+1) == ':') {
- X *parm = killed ? *argv : *argv+1;
- X delarg(argc, argv);
- X }
- X return(c);
- X}
- END_OF_FILE
- if test 1926 -ne `wc -c <'getopt.c'`; then
- echo shar: \"'getopt.c'\" unpacked with wrong size!
- fi
- # end of 'getopt.c'
- fi
- if test -f 'icons/default_bad.icon' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'icons/default_bad.icon'\"
- else
- echo shar: Extracting \"'icons/default_bad.icon'\" \(1997 characters\)
- sed "s/^X//" >'icons/default_bad.icon' <<'END_OF_FILE'
- X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
- X */
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0xFFFF,0xFFFE,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0x8000,0x0003,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0x8000,0x0003,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0000,0xFFFF,0xFFFE,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x000F,0xFFFF,0xFFFF,0xE000,
- X 0x0018,0x0000,0x0000,0x3000,
- X 0x0031,0x5555,0x5555,0x1800,
- X 0x0062,0xAAAA,0xAAAA,0x8C00,
- X 0x00C5,0x5555,0x5555,0x4600,
- X 0x00C0,0x0000,0x0000,0x0600,
- X 0x00FF,0xFFFF,0xFFFF,0xFE00,
- X 0x00FF,0xFFFF,0xFFFF,0xFE00,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x000E,0x30B0,0xE184,0x7000,
- X 0x0010,0x48C9,0x0244,0x8800,
- X 0x0020,0x8489,0x0424,0x8800,
- X 0x0020,0x8488,0xC424,0xF800,
- X 0x0020,0x8488,0x2424,0x8000,
- X 0x0010,0x4888,0x2244,0x8800,
- X 0x000E,0x3089,0xC184,0x7000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000
- END_OF_FILE
- if test 1997 -ne `wc -c <'icons/default_bad.icon'`; then
- echo shar: \"'icons/default_bad.icon'\" unpacked with wrong size!
- fi
- # end of 'icons/default_bad.icon'
- fi
- if test -f 'icons/default_flash.icon' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'icons/default_flash.icon'\"
- else
- echo shar: Extracting \"'icons/default_flash.icon'\" \(1997 characters\)
- sed "s/^X//" >'icons/default_flash.icon' <<'END_OF_FILE'
- X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
- X */
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0xFFFF,0xFFFE,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0x8000,0x0003,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xA000,0x000B,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0x8000,0x0003,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0000,0xFFFF,0xFFFE,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x000F,0xFFFF,0xFFFF,0xE000,
- X 0x0018,0x0000,0x0000,0x3000,
- X 0x0031,0x5555,0x5555,0x1800,
- X 0x0062,0xAAAA,0xAAAA,0x8C00,
- X 0x00C5,0x5555,0x5555,0x4600,
- X 0x00C0,0x0000,0x0000,0x0600,
- X 0x00FF,0xFFFF,0xFFFF,0xFE00,
- X 0x00FF,0xFFFF,0xFFFF,0xFE00,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x000E,0x30B0,0xE184,0x7000,
- X 0x0010,0x48C9,0x0244,0x8800,
- X 0x0020,0x8489,0x0424,0x8800,
- X 0x0020,0x8488,0xC424,0xF800,
- X 0x0020,0x8488,0x2424,0x8000,
- X 0x0010,0x4888,0x2244,0x8800,
- X 0x000E,0x3089,0xC184,0x7000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000
- END_OF_FILE
- if test 1997 -ne `wc -c <'icons/default_flash.icon'`; then
- echo shar: \"'icons/default_flash.icon'\" unpacked with wrong size!
- fi
- # end of 'icons/default_flash.icon'
- fi
- if test -f 'icons/default_good.icon' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'icons/default_good.icon'\"
- else
- echo shar: Extracting \"'icons/default_good.icon'\" \(1997 characters\)
- sed "s/^X//" >'icons/default_good.icon' <<'END_OF_FILE'
- X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
- X */
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0xFFFF,0xFFFE,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0x8000,0x0003,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0xB555,0x555B,0x0000,
- X 0x0001,0xAAAA,0xAAAB,0x0000,
- X 0x0001,0xB555,0x555B,0x0000,
- X 0x0001,0xAAAA,0xA02B,0x0000,
- X 0x0001,0xB555,0x505B,0x0000,
- X 0x0001,0xAAAA,0xA02B,0x0000,
- X 0x0001,0xB555,0x505B,0x0000,
- X 0x0001,0xAAAA,0xA02B,0x0000,
- X 0x0001,0xB555,0x555B,0x0000,
- X 0x0001,0xAAAA,0xAAAB,0x0000,
- X 0x0001,0xB555,0x555B,0x0000,
- X 0x0001,0xAAAA,0xAAAB,0x0000,
- X 0x0001,0xB555,0x555B,0x0000,
- X 0x0001,0xAAAA,0xAAAB,0x0000,
- X 0x0001,0xB555,0x555B,0x0000,
- X 0x0001,0xAAAA,0xAAAB,0x0000,
- X 0x0001,0xB555,0x555B,0x0000,
- X 0x0001,0xBFFF,0xFFFB,0x0000,
- X 0x0001,0x8000,0x0003,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0000,0xFFFF,0xFFFE,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x000F,0xFFFF,0xFFFF,0xE000,
- X 0x0018,0x0000,0x0000,0x3000,
- X 0x0031,0x5555,0x5555,0x1800,
- X 0x0062,0xAAAA,0xAAAA,0x8C00,
- X 0x00C5,0x5555,0x5555,0x4600,
- X 0x00C0,0x0000,0x0000,0x0600,
- X 0x00FF,0xFFFF,0xFFFF,0xFE00,
- X 0x00FF,0xFFFF,0xFFFF,0xFE00,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x000E,0x30B0,0xE184,0x7000,
- X 0x0010,0x48C9,0x0244,0x8800,
- X 0x0020,0x8489,0x0424,0x8800,
- X 0x0020,0x8488,0xC424,0xF800,
- X 0x0020,0x8488,0x2424,0x8000,
- X 0x0010,0x4888,0x2244,0x8800,
- X 0x000E,0x3089,0xC184,0x7000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000
- END_OF_FILE
- if test 1997 -ne `wc -c <'icons/default_good.icon'`; then
- echo shar: \"'icons/default_good.icon'\" unpacked with wrong size!
- fi
- # end of 'icons/default_good.icon'
- fi
- if test -f 'icons/mask.icon' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'icons/mask.icon'\"
- else
- echo shar: Extracting \"'icons/mask.icon'\" \(1997 characters\)
- sed "s/^X//" >'icons/mask.icon' <<'END_OF_FILE'
- X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
- X */
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0xFFFF,0xFFFE,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0001,0xFFFF,0xFFFF,0x0000,
- X 0x0000,0xFFFF,0xFFFE,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x000F,0xFFFF,0xFFFF,0xE000,
- X 0x001F,0xFFFF,0xFFFF,0xF000,
- X 0x003F,0xFFFF,0xFFFF,0xF800,
- X 0x007F,0xFFFF,0xFFFF,0xFC00,
- X 0x00FF,0xFFFF,0xFFFF,0xFE00,
- X 0x00FF,0xFFFF,0xFFFF,0xFE00,
- X 0x00FF,0xFFFF,0xFFFF,0xFE00,
- X 0x00FF,0xFFFF,0xFFFF,0xFE00,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x0000,0x0000,0x0004,0x0000,
- X 0x000E,0x30B0,0xE184,0x7000,
- X 0x0010,0x48C9,0x0244,0x8800,
- X 0x0020,0x8489,0x0424,0x8800,
- X 0x0020,0x8488,0xC424,0xF800,
- X 0x0020,0x8488,0x2424,0x8000,
- X 0x0010,0x4888,0x2244,0x8800,
- X 0x000E,0x3089,0xC184,0x7000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000
- END_OF_FILE
- if test 1997 -ne `wc -c <'icons/mask.icon'`; then
- echo shar: \"'icons/mask.icon'\" unpacked with wrong size!
- fi
- # end of 'icons/mask.icon'
- fi
- if test -f 'images/empty.icon' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'images/empty.icon'\"
- else
- echo shar: Extracting \"'images/empty.icon'\" \(193 characters\)
- sed "s/^X//" >'images/empty.icon' <<'END_OF_FILE'
- X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
- X */
- X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
- X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
- END_OF_FILE
- if test 193 -ne `wc -c <'images/empty.icon'`; then
- echo shar: \"'images/empty.icon'\" unpacked with wrong size!
- fi
- # end of 'images/empty.icon'
- fi
- if test -f 'images/range.icon' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'images/range.icon'\"
- else
- echo shar: Extracting \"'images/range.icon'\" \(193 characters\)
- sed "s/^X//" >'images/range.icon' <<'END_OF_FILE'
- X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
- X */
- X 0x9440,0xBF68,0x0000,0x8000,0xF6DE,0x0000,0x8A22,0xDFBB,
- X 0x0000,0xA100,0xBBB6,0x0000,0x8824,0xEDB7,0x0000,0x0000
- END_OF_FILE
- if test 193 -ne `wc -c <'images/range.icon'`; then
- echo shar: \"'images/range.icon'\" unpacked with wrong size!
- fi
- # end of 'images/range.icon'
- fi
- if test -f 'images/single.icon' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'images/single.icon'\"
- else
- echo shar: Extracting \"'images/single.icon'\" \(193 characters\)
- sed "s/^X//" >'images/single.icon' <<'END_OF_FILE'
- X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
- X */
- X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x8A22,0xDFBB,
- X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
- END_OF_FILE
- if test 193 -ne `wc -c <'images/single.icon'`; then
- echo shar: \"'images/single.icon'\" unpacked with wrong size!
- fi
- # end of 'images/single.icon'
- fi
- if test -f 'load_icon.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'load_icon.c'\"
- else
- echo shar: Extracting \"'load_icon.c'\" \(2201 characters\)
- sed "s/^X//" >'load_icon.c' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X#include <stdio.h>
- X#include <sys/file.h>
- X
- X#include <xview/xview.h>
- X#include <xview/icon_load.h>
- X
- X#include "manifest.h"
- X
- X#if !defined(ICON_PATH)
- X#define ICON_PATH ".:./icons:/usr/local/images:/usr/include/images"
- X#endif
- X
- XPUBLIC char *getenv(), *index();
- X
- X/************************************************************************/
- XEXPORT Server_image load_icon(path, message)
- X
- Xchar *path;
- Xchar *message;
- X
- X{ char *icon_path, new_path[1024], *p, *q;
- X
- X if (*path == '/')
- X return(icon_load_svrim(path, message));
- X else {
- X if ((p = getenv("ICON_PATH")) != NULL)
- X icon_path = strsave(p);
- X else
- X icon_path = strsave(ICON_PATH);
- X for (p = icon_path; *p; ) {
- X if (q = index(p, ':'))
- X *q = '\0';
- X strcpy(new_path, p);
- X strcat(new_path, "/");
- X strcat(new_path, path);
- X if (access(new_path, R_OK) == 0) {
- X free(icon_path);
- X return(icon_load_svrim(new_path, message));
- X }
- X else if (q != NULL)
- X p = q + 1;
- X else
- X break;
- X }
- X free(icon_path);
- X return(icon_load_svrim(path, message));
- X }
- X}
- END_OF_FILE
- if test 2201 -ne `wc -c <'load_icon.c'`; then
- echo shar: \"'load_icon.c'\" unpacked with wrong size!
- fi
- # end of 'load_icon.c'
- fi
- if test -f 'logging.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'logging.c'\"
- else
- echo shar: Extracting \"'logging.c'\" \(4060 characters\)
- sed "s/^X//" >'logging.c' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X/************************************************************************/
- X/* */
- X/* logging.c message log management */
- 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/xv_xrect.h>
- X
- X#include "manifest.h"
- X#include "contool.h"
- X#include "contool_ui.h"
- X
- XPUBLIC Menu_item start_logging();
- XPUBLIC Menu_item stop_logging();
- X
- XPUBLIC contool_base_objects *contool_base;
- X
- XPRIVATE int logging = FALSE;
- XPRIVATE FILE *logfile = NULL;
- XPRIVATE char *log_path = NULL;
- X
- X/************************************************************************/
- XEXPORT void disable_logging()
- X
- X{
- X if (logging) {
- X fclose(logfile);
- X cond_free(log_path);
- X log_path = NULL;
- X logging = FALSE;
- X }
- X xv_set(contool_base->base, FRAME_RIGHT_FOOTER, "", NULL);
- X}
- X
- X/************************************************************************/
- XEXPORT void enable_logging()
- X
- X{ char buf[1024];
- X
- X if (logging) {
- X if (log_path && strcmp(log_path, defaults.log_file) == 0)
- X return;
- X disable_logging();
- X }
- X if (is_empty(defaults.log_file))
- X error("You must specify a log file in the Properties dialog");
- X else if ((logfile = fopen(defaults.log_file, "a")) == NULL)
- X error("Cannot open log file %s : %s", defaults.log_file, sys_errlist[errno]);
- X else {
- X logging = TRUE;
- X log_path = strsave(defaults.log_file);
- X sprintf(buf, "Logging to %s...", defaults.log_file);
- X xv_set(contool_base->base, FRAME_RIGHT_FOOTER, buf, NULL);
- X }
- X}
- X
- X/************************************************************************/
- XEXPORT Menu_item start_logging(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_DISPLAY)
- X xv_set(item, MENU_INACTIVE, logging, NULL);
- X else if (op == MENU_NOTIFY)
- X enable_logging();
- X return item;
- X}
- X
- X/************************************************************************/
- XEXPORT Menu_item stop_logging(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_DISPLAY)
- X xv_set(item, MENU_INACTIVE, !logging, NULL);
- X else if (op == MENU_NOTIFY)
- X disable_logging();
- X return item;
- X}
- X
- X/************************************************************************/
- XEXPORT update_logging()
- X
- X{
- X if (logging) {
- X disable_logging();
- X enable_logging();
- X }
- X}
- X
- X/************************************************************************/
- XEXPORT write_log(s)
- X
- Xchar *s;
- X
- X{ int t;
- X static char hostname[100] = "";
- X
- X if (logging) {
- X if (*hostname == NULL)
- X if (gethostname(hostname, 99) != 0)
- X strcpy(hostname, "(unknown)");
- X t = time(0);
- X fseek(logfile, 0L, 2);
- X fprintf(logfile, "%s\t%.16s\t%s", hostname, ctime(&t) + 4, s);
- X fflush(logfile);
- X }
- X}
- END_OF_FILE
- if test 4060 -ne `wc -c <'logging.c'`; then
- echo shar: \"'logging.c'\" unpacked with wrong size!
- fi
- # end of 'logging.c'
- fi
- if test -f 'manifest.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'manifest.h'\"
- else
- echo shar: Extracting \"'manifest.h'\" \(1749 characters\)
- sed "s/^X//" >'manifest.h' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X/************************************************************************/
- X/* */
- X/* manifest.h simple manifest constants */
- X/* */
- X/************************************************************************/
- X
- X#define TRUE 1
- X#define FALSE 0
- X
- X#define PRIVATE static
- X#define PUBLIC extern
- X#define EXPORT
- X
- X#ifndef NULL
- X#define NULL 0
- X#endif
- X
- X#if !defined(ICON_PATH)
- X#define ICON_PATH ".:./icons:/usr/local/images:/usr/include/images"
- X#endif
- X
- X#define strsave(x) (((x) == NULL)? NULL : (char *) strcpy((char *) malloc(strlen(x) + 1), x))
- X#define cond_free(x) ((x)? free(x) : 0)
- X
- XPUBLIC int errno;
- XPUBLIC char *sys_errlist[];
- END_OF_FILE
- if test 1749 -ne `wc -c <'manifest.h'`; then
- echo shar: \"'manifest.h'\" unpacked with wrong size!
- fi
- # end of 'manifest.h'
- fi
- if test -f 'patchlevel.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patchlevel.h'\"
- else
- echo shar: Extracting \"'patchlevel.h'\" \(2060 characters\)
- sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X/************************************************************************/
- X/* */
- X/* Patch Comments */
- X/* 0 Initial release for XView */
- X/* comp.sources.x: Volume 10, Issues 34-39 */
- X/* */
- X/* 1 Bug fixes; see README for details */
- X/* comp.sources.x: Volume 10, Issue 40 */
- X/* */
- X/* 2 Bug fixes; see README for details */
- X/* comp.sources.x: Volume 10, Issue 78 */
- X/* */
- X/* 3 Bug fixes; see README for details */
- X/* comp.sources.x: Volume 11, Issue 4 */
- X/* */
- X/* 4 Release of version 3.1; see README for details */
- X/* comp.sources.x: Volume 13, Issues 54 & 55 */
- X/* */
- X/* 5 Bug fixes; see README for details */
- X/* comp.sources.x: Volume 14, Issue 4 */
- X/* */
- X/* 6 Release of version 3.2; see README for details */
- X/* comp.sources.x: Volume ?, Issue ? */
- X/* */
- X/************************************************************************/
- END_OF_FILE
- if test 2060 -ne `wc -c <'patchlevel.h'`; then
- echo shar: \"'patchlevel.h'\" unpacked with wrong size!
- fi
- # end of 'patchlevel.h'
- fi
- if test -f 'pinned_menu_notify.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'pinned_menu_notify.c'\"
- else
- echo shar: Extracting \"'pinned_menu_notify.c'\" \(2118 characters\)
- sed "s/^X//" >'pinned_menu_notify.c' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X/************************************************************************/
- X/* */
- X/* pinned_menu_notify.c GUIDE callback for pinned menus */
- X/* */
- X/************************************************************************/
- X
- X#include <stdio.h>
- X#include <sys/param.h>
- X#include <sys/types.h>
- X#include <xview/xview.h>
- X
- X#include "manifest.h"
- X
- X/************************************************************************/
- XEXPORT void pinned_menu_notify(menu, item)
- X
- XMenu menu;
- XMenu_item item;
- X
- X{ Xv_opaque pin_window = (Xv_opaque) xv_get(menu, MENU_PIN_WINDOW);
- X void (*menu_notify)() = (void (*)()) xv_get(menu, MENU_GEN_PROC);
- X void (*item_notify)() = (void (*)()) xv_get(item, MENU_GEN_PROC);
- X
- X if (pin_window && xv_get(pin_window, XV_SHOW)) {
- X if (menu_notify)
- X (*menu_notify)(menu, MENU_NOTIFY);
- X if (item_notify)
- X (*item_notify)(item, MENU_NOTIFY);
- X if (item_notify)
- X (*item_notify)(item, MENU_NOTIFY_DONE);
- X if (menu_notify)
- X (*menu_notify)(menu, MENU_NOTIFY_DONE);
- X }
- X}
- END_OF_FILE
- if test 2118 -ne `wc -c <'pinned_menu_notify.c'`; then
- echo shar: \"'pinned_menu_notify.c'\" unpacked with wrong size!
- fi
- # end of 'pinned_menu_notify.c'
- fi
- if test -f 'regexp.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'regexp.c'\"
- else
- echo shar: Extracting \"'regexp.c'\" \(3963 characters\)
- sed "s/^X//" >'regexp.c' <<'END_OF_FILE'
- X/************************************************************************/
- X/* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
- X/* */
- X/* Full ownership of this software, and all rights pertaining to */
- X/* the for-profit distribution of this software, are retained by */
- X/* Chuck Musciano and Harris Corporation. You are permitted to */
- X/* use this software without fee. This software is provided "as */
- X/* is" without express or implied warranty. You may redistribute */
- X/* this software, provided that this copyright notice is retained, */
- X/* and that the software is not distributed for profit. If you */
- X/* wish to use this software in a profit-making venture, you must */
- X/* first license this code and its underlying technology from */
- X/* Harris Corporation. */
- X/* */
- X/* Bottom line: you can have this software, you can use it, you */
- X/* can give it away. You just can't sell any or all parts of it */
- X/* without prior permission from Harris Corporation. */
- X/************************************************************************/
- X
- X#include <stdio.h>
- X
- X#include "manifest.h"
- X#include "contool.h"
- X
- XPRIVATE regexp_error();
- X
- X#define INIT register char *expbuf = ep, *sp = instring;
- X#define GETC() (*sp++)
- X#define PEEKC() (*sp)
- X#define UNGETC(c) (--sp)
- X#define RETURN(p) {bcopy(expbuf, sp = (char *) malloc(p - expbuf), p - expbuf); return(sp);}
- X#define ERROR(val) {regexp_error(val, instring); return(NULL);}
- X
- X#include <regexp.h>
- X
- XPRIVATE char error_message[512];
- X
- X/************************************************************************/
- XEXPORT int match_exp(exp, circ, str)
- X
- Xchar *exp;
- Xint circ;
- Xchar *str;
- X
- X{ char *p;
- X int result;
- X
- X p = str + strlen(str) - 1;
- X if (p >= str && *p == '\n')
- X *p = '\0';
- X circf = circ;
- X result = step(str, exp);
- X if (p >= str && *p == '\0')
- X *p = '\n';
- X return(result);
- X}
- X
- X/************************************************************************/
- XPRIVATE regexp_error(val, string)
- X
- Xint val;
- Xchar *string;
- X
- X{ char *msg;
- X
- X switch (val) {
- X case 11 : msg = "range endpoint too large";
- X case 16 : msg = "bad number";
- X case 25 : msg = "\"\\digit\" out of range";
- X case 36 : msg = "illegal or missing delimiter";
- X case 41 : msg = "no remembered search string";
- X case 42 : msg = "\\(\\) imbalance";
- X case 43 : msg = "too many \\(";
- X case 44 : msg = "more than 2 numbers given in \\{\\}";
- X case 45 : msg = "} expected after \\";
- X case 46 : msg = "first number exceeds second in \\{\\}";
- X case 49 : msg = "[] imbalance";
- X case 50 : msg = "regular expression overflow";
- X default : msg = "regular expression error";
- X }
- X sprintf(error_message, "%s in %s", msg, string);
- X}
- X
- X/************************************************************************/
- XPRIVATE char *fix_control_chars(s)
- X
- Xchar *s;
- X
- X{ static char buf[2048];
- X char *p;
- X
- X for (p = buf; *s; s++, p++)
- X if (*s == '\\' && *(s + 1) >= '0' && *(s + 1) <= '7') {
- X for (*p = 0, s++; *s && *s >= '0' && *s <= '7'; s++)
- X *p = (*p << 3) + *s - '0';
- X s--;
- X }
- X else
- X *p = *s;
- X *p = '\0';
- X return(buf);
- X}
- X
- X/************************************************************************/
- XEXPORT char *compile_exp(filter, start, stop)
- X
- XFilter *filter;
- Xchar *start;
- Xchar *stop;
- X
- X{ char rbuf[1024], *sre, *ere;
- X int sc, ec;
- X
- X sre = ere = NULL;
- X if (start) {
- X if ((sre = compile(fix_control_chars(start), rbuf, rbuf+1024, '\0')) == NULL)
- X return(error_message);
- X sc = circf;
- X }
- X if (stop) {
- X if ((ere = compile(fix_control_chars(stop), rbuf, rbuf+1024, '\0')) == NULL) {
- X cond_free(sre);
- X return(error_message);
- X }
- X ec = circf;
- X }
- X if (filter) {
- X filter->start = start;
- X filter->stop = stop;
- X filter->start_re = sre;
- X filter->stop_re = ere;
- X filter->start_circf = sc;
- X filter->stop_circf = ec;
- X }
- X else {
- X cond_free(sre);
- X if (ere)
- X cond_free(ere);
- X }
- X return(NULL);
- X}
- END_OF_FILE
- if test 3963 -ne `wc -c <'regexp.c'`; then
- echo shar: \"'regexp.c'\" unpacked with wrong size!
- fi
- # end of 'regexp.c'
- fi
- if test -f 'sample.filter' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sample.filter'\"
- else
- echo shar: Extracting \"'sample.filter'\" \(2556 characters\)
- sed "s/^X//" >'sample.filter' <<'END_OF_FILE'
- Xversion 320
- Xdefaults {
- X beep 3
- X command ""
- X flash yes
- X log yes
- X open no
- X stamp yes
- X archive 0
- X good_icon ""
- X check_icon ""
- X flash_icon ""
- X print "lpr"
- X log_file ""
- X log_before_filtering no
- X timestamp 10
- X display 32768
- X delete 1024
- X}
- Xfilters {
- X {
- X match "su: chuck"
- X comment "Track myself becoming super user"
- X ignore no
- X beep 0
- X command ""
- X flash no
- X log yes
- X open no
- X stamp yes
- X }
- X {
- X match "su:"
- X comment "Get excited about anyone else becoming superuser"
- X ignore no
- X beep 4
- X command ""
- X flash no
- X log yes
- X open yes
- X stamp yes
- X }
- X {
- X match "Window data lock"
- X to "The offending process"
- X timeout 30
- X comment "Ignore spurious window system messages"
- X ignore yes
- X }
- X {
- X match "win ioctl number"
- X comment "Ignore spurious window system messages"
- X ignore no
- X beep 0
- X command ""
- X flash no
- X log yes
- X open no
- X stamp yes
- X }
- X {
- X match "A tty window"
- X to "Its child"
- X timeout 30
- X comment "Ignore spurious window system messages"
- X ignore no
- X beep 0
- X command ""
- X flash no
- X log yes
- X open no
- X stamp yes
- X }
- X {
- X match "Too large a window number"
- X comment "Ignore spurious window system messages"
- X ignore yes
- X }
- X {
- X match "NFS server"
- X comment "Track NFS server message"
- X ignore no
- X beep 0
- X command ""
- X flash no
- X log yes
- X open no
- X stamp yes
- X }
- X {
- X match "yp:"
- X comment "Track YP server problems"
- X ignore no
- X beep 0
- X command ""
- X flash no
- X log yes
- X open no
- X stamp yes
- X }
- X {
- X match "/usr/local/frame"
- X comment "Ignore various noisy Frame messages"
- X ignore yes
- X }
- X {
- X match "starting maker"
- X to "maker: Finished"
- X timeout 120
- X comment "Ignore various noisy Frame messages"
- X ignore yes
- X }
- X {
- X match "maker:"
- X comment "Ignore various noisy Frame messages"
- X ignore yes
- X }
- X {
- X match "fmprintdriver.ps: Using"
- X comment "Ignore various noisy Frame messages"
- X ignore yes
- X }
- X}
- END_OF_FILE
- if test 2556 -ne `wc -c <'sample.filter'`; then
- echo shar: \"'sample.filter'\" unpacked with wrong size!
- fi
- # end of 'sample.filter'
- fi
- echo shar: End of archive 5 \(of 5\).
- cp /dev/null ark5isdone
- MISSING=""
- for I in 1 2 3 4 5 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 5 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
-