home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso
/
altsrc
/
articles
/
10701
< prev
next >
Wrap
Internet Message Format
|
1994-06-19
|
86KB
Path: wupost!gumby!newsxfer.itd.umich.edu!zip.eecs.umich.edu!panix!MathWorks.Com!solaris.cc.vt.edu!uunet!tsw!not-for-mail
From: dean%tsw@uunet.UU.NET (Dean Collins)
Newsgroups: alt.sources
Subject: X Problem Tracking System (03/16)
Followup-To: alt.sources.d
Date: 18 Jun 1994 12:23:02 -0700
Organization: Zombie Software
Lines: 2488
Distribution: world
Message-ID: <2tvhim$2t2@hal.sea.tsw.com>
References: <2tvhif$q4k@hal.sea.tsw.com>
Reply-To: dean@halcyon.com
NNTP-Posting-Host: hal.sea.tsw.com
Archive-name: pts/part03
Submitted-by: dean@halcyon.com (Dean Collins)
Version: 1.05
#! /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 16)."
# Contents: pts-1.05/ANNOUNCEMENT pts-1.05/Imakefile
# pts-1.05/PLATFORMS pts-1.05/config/Imakefile
# pts-1.05/config/configtest.c pts-1.05/config/sample2.config
# pts-1.05/contrib/DANGER/danger.c pts-1.05/contrib/ptsprt/Imakefile
# pts-1.05/contrib/texttest/texttest.c pts-1.05/neb_cld/clouderror.h
# pts-1.05/neb_cld/subtree.c pts-1.05/neb_cld/tester.c
# pts-1.05/ptsager/Imakefile pts-1.05/util/str.c
# pts-1.05/util/writebuf.c pts-1.05/xpts/CODE
# pts-1.05/xpts/Imakefile pts-1.05/xpts/popup.h
# pts-1.05/xpts/select.h
# Wrapped by dean@hal on Sat Jun 18 12:08:12 1994
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'pts-1.05/ANNOUNCEMENT' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/ANNOUNCEMENT'\"
else
echo shar: Extracting \"'pts-1.05/ANNOUNCEMENT'\" \(4562 characters\)
sed "s/^X//" >'pts-1.05/ANNOUNCEMENT' <<'END_OF_FILE'
X
X ANNOUNCEMENT!!!
X ===============
X
XThis document announces release of version 1.05 of the Problem Tracking
XSystem (PTS), also known as the X Problem Tracking System. PTS/Xpts is
XFREE software.
X
XSOFTWARE: Problem Tracking System(PTS) / X Problem Tracking System(Xpts)
X
XVERSION: 1.05
X
XSYNOPSIS: PTS/Xpts helps with system management. It lets people
X report problems and lets sysops record their solutions
X to those problems. It also helps automate other related
X communication activities. Some might call this "help-desk"
X software or "groupware".
X
XSYSTEM REQMTS: The core of PTS is "xpts", an X11R4/X11R5 application
X which uses the Athena widgets. Building PTS requires
X a Unix variant, an ANSI C compiler, lex, yacc, make
X and imake/xmkmf. PTS should build on most AIX, HP-UX,
X OSF/1, SCO, SunOS, Solaris, Domain/OS, Linux,
X Ultrix, IRIX, SGI, and Intergraph systems, among others.
X
XWHAT'S NEW: This version introduces a command-line utility for
X reporting problems. It can also be used interactively.
X Also, all filenames are now 14 or less characters long.
X
XCAVEAT: The text-mode and command-line interfaces are limited
X at this time. This is an area for continued development.
X An e-mail interface is still being planned; however, a
X simple one could easily be built around the new utility
X "newprob".
X
XAUTHORS: Dean Collins, Chris Hyde, Luke Sheneman, Brian Goff,
X and John Hunter, among others, known collectively
X (for convenience only) as "Zombie Software".
X
XAVAILABILITY: PTS/Xpts is FREE software. Sources may be obtained from
X the following sites via anonymous-FTP, which are the
X "official" distribution sites:
X
X ftp.x.org /contrib/applications/pts
X ftp.halcyon.com /local/pts
X
X Source file is pts-1.05.tar.gz. Look for patches and
X README files, too. Also, the design documentation should
X be available wherever you obtain the source code in the
X file pts-1.0-doc.tar.gz.
X
X Numerous sites mirror the ftp.x.org site. PTS may be
X available from the following locations, and many others,
X as well as the "official" sites:
X
X public.x.org /contrib/applications/pts
X ftp.uu.net /systems/window-sys/X/contrib/applications/pts
X ftp.cs.columbia.edu /archives/X11R6/contrib/applications/pts
X ftp.germany.eu.net /pub/X11/XConsortium/contrib/applications/pts
X ftp.inria.fr /pub/X11/contrib/applications/pts
X ftp.luth.se /pub/X11/contrib/applications/pts
X SunSITE.sut.ac.jp /pub/archives/X11/contrib/applications/pts
X
X
X Also, the PTS source code is being distributed via
X Usenet and the alt.sources and/or comp.sources newsgroups.
X
X
X
XDESCRIPTION
X-----------
XPTS is a tool for improving communication between system users
Xand support personnel (sysops) about problems encountered
Xwith the system. It consists of several programs, including
X"xpts" and "ptsager".
X
XIn a nutshell:
XXpts is used by system users to report problems. Support personnel
X(sysops) also use it to log their activities on solving each problem.
XXpts also sends e-mail to problem reporters when their problems are solved.
XProblems are stored in a permanent database for future reference.
X
XThe problems are organized in a tree-like structure. For example, a
Xproblem with "rn" might be reported in "/Software/News/rn". A problem
Xwith a computer monitor might be reported in "/Hardware/Monitor".
XThe problem tree structure is _completely_ configurable to meet your
Xparticular needs.
X
XPtsager scans through the database once a day and sends electronic mail
Xto certain system users about problems that have remained unsolved for
Xseveral days.
X
XWhile PTS was designed with managing a network of Unix workstations in
Xmind, it is general and versatile enough to be used in many other ways.
XFor example, at the University of Idaho, PTS was used by the PTS
Xdesign team to report problems with and take suggestions about early
Xversions of PTS. We are very interested in hearing about unique
Xand creative ways in which you use PTS/Xpts.
X
XPTS was designed and implemented by "Zombie Software", consisting of
Xme (Dean Collins), Chris Hyde, Luke Sheneman, Brian Goff, John Hunter,
XBrent Heikkula, and Dayne Steed. It was designed in great part on a
Xvolunteer basis for the University of Idaho Computer Science Department.
X
XI can't really provide much support for this free software,
Xbut I'll help when I can. I would appreciate help from others
Xin this project.
X
XPTS is being offered as a gift to the Internet community for it's
Xgenerosity towards us. Enjoy!
X
X
X--
XDean Collins (dean@halcyon.com, dean@uidaho.edu)
XFri Jun 17 18:26:22 1994
END_OF_FILE
if test 4562 -ne `wc -c <'pts-1.05/ANNOUNCEMENT'`; then
echo shar: \"'pts-1.05/ANNOUNCEMENT'\" unpacked with wrong size!
fi
# end of 'pts-1.05/ANNOUNCEMENT'
fi
if test -f 'pts-1.05/Imakefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/Imakefile'\"
else
echo shar: Extracting \"'pts-1.05/Imakefile'\" \(3213 characters\)
sed "s/^X//" >'pts-1.05/Imakefile' <<'END_OF_FILE'
X######################################################################
X#
X# Imakefile -- Imake rules for PTS.
X# Dean Collins, Thu Jul 30 13:46:51 PDT 1992
X#
X# Modified: Dean Collins Sat Feb 12 23:27:44 1994
X# Cleaned up, simplified, etc.
X#
X# Modified: Dean Collins Thu Mar 10 20:44:34 1994
X# Moved customization to Imake.config, which each Imakefile
X# will #include. This eliminates the need to set CC within
X# each one.
X#
X######################################################################
X#
X# Copyright (c) 1992,1993,1994 Dean Collins.
X# Copyright (c) 1992 University of Idaho, Moscow, Idaho.
X#
X# Permission to use, copy, modify, and distribute this software and its
X# documentation free of charge for any purpose is hereby granted without
X# fee, provided that the above copyright notice appear in all copies and
X# that both that copyright notice and this permission notice appear in
X# supporting documentation, and that the name of the University of Idaho
X# not be used in advertising or publicity pertaining to distribution of
X# the software without specific, written prior permission. The University
X# of Idaho makes no representations about the suitability of this software
X# for any purpose. It is provided "as is" without express or implied warranty.
X#
X# THE UNIVERSITY OF IDAHO DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
X# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
X# IN NO EVENT SHALL THE UNIVERSITY OF IDAHO BE LIABLE FOR ANY SPECIAL,
X# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X# PERFORMANCE OF THIS SOFTWARE.
X######################################################################
X
X
X######################################################################
X# YOU SHOULDN'T NEED TO MODIFY ANYTHING IN THIS FILE.
X# All customization is now done in Imake.config.
X######################################################################
X
X
X#include "Imake.config"
X
X
X#define IHaveSubdirs
X#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
X
X SUBDIRS = util zdbm config neb_cld xpts ptsager doc/Manual contrib
X
XMakeSubdirs($(SUBDIRS))
XDependSubdirs($(SUBDIRS))
X/*CleanSubdirs($(SUBDIRS))*/
XLintSubdirs($(SUBDIRS))
X
X###### pts.cf ###################
X# Install the config file. Create a config file manually ("pts.cf")
X# in the config directory before installing.
X# (You can start with config/sample.config, but it must be customized.)
X# This should not overwrite an existing pts.cf file, as far as I know.
XPTSInstallNonExecFile(config/pts.cf,pts.cf,$(CFGDIR),$(OWNER))
X
X# Make the PTSROOT directory hierarchy. You should be the "support"
X# user when running "make install".
Xinstall:: xpts/xpts ptsager/ptsager
X $(MKDIRHIER) $(PTSROOT)
X chown $(OWNER) $(PTSROOT)
X
Xconfigtest:
X cd config; $(MAKE) $(MFLAGS) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' configtest
X
XXpts:
X cd xpts; $(MAKE) $(MFLAGS) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' xpts
X
Xager:
X cd ptsager; $(MAKE) $(MFLAGS) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' ptsager
X
Xptsprt:
X cd contrib/ptsprt; $(MAKE) $(MFLAGS) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' ptsprt
X
END_OF_FILE
if test 3213 -ne `wc -c <'pts-1.05/Imakefile'`; then
echo shar: \"'pts-1.05/Imakefile'\" unpacked with wrong size!
fi
# end of 'pts-1.05/Imakefile'
fi
if test -f 'pts-1.05/PLATFORMS' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/PLATFORMS'\"
else
echo shar: Extracting \"'pts-1.05/PLATFORMS'\" \(3651 characters\)
sed "s/^X//" >'pts-1.05/PLATFORMS' <<'END_OF_FILE'
XPLATFORMS
X---------
XPTS was originally written on a BSD-like Unix system using the X11R5
XAthena widgets in ANSI C.
X
XPTS has been successfully compiled by the authors on the following platforms.
XOnly modification to the Imakefile(s) (and occasionally, Makefile(s))
Xshould be necessary to build with similar configurations.
X
X1. HP-UX
X HARDWARE: HP 9000/817s
X OS: HP-UX 9.00
X C: gcc 2.4.5
X X: X11R5 from MIT
X Other software used: HP's lex and yacc, part of their ANSI C package.
X PTS version: 1.05
X Notes:
X You should be able to use Flex/Bison in place of lex/yacc.
X I've never gotten PTS to build correctly with HP's ANSI compiler,
X but some have done so, reportedly (don't ask how, I don't know.)
X
X2. AIX
X HARDWARE: Powerserver 520
X OS: AIX 3.2.3
X C: IBM's stock compiler
X X: X11R5 from MIT
X Other software used: none
X PTS version: 1.05
X Notes:
X You should be able to use gcc instead of IBM's C compiler.
X
X3. Linux
X HARDWARE: Zeos 486DX2/66
X OS: Linux 0.99.pl9-1 (Old! I know!)
X C: gcc 2.3.3
X X: X11R5
X Other software used: flex/bison
X PTS version: 1.05
X Notes:
X Default window sizes may be way too big. Customize in Xpts.ad.
X Signal handler should be fixed.
X
X4. HP/Apollo
X HARDWARE: Apollo DN10000
X OS: Domain/OS 10.4
X C: Apollo's ANSI C compiler
X X: X11R5 from MIT
X Other software use: none
X PTS version: 1.01
X Notes:
X gcc not available for DN10000 RISC cpu.
X Originally developed on this platform.
X Built under BSD subsystem, _not_ SYSV or Aegis.
X Newer versions have not been tested (or even compiled)
X on Apollos by the authors.
X
X HARDWARE: Apollo DN3500, DN2500
X OS: Domain/OS 10.4
X C: gcc x.x.x or Apollo's ANSI C compiler
X X: X11R5 from MIT
X Other software used: none
X PTS version: 1.01
X Notes:
X Originally developed on this platform.
X Built under BSD subsystem, _not_ SYSV or Aegis.
X Newer versions have not been tested (or even compiled)
X on Apollos by the authors.
X
X5. OSF/1
X HARDWARE: DEC Alpha 3000/600
X OS: OSF/1 1.3
X C: standard DEC "base" C compiler
X X: standard DECwindows + X software development
X Other software used: none
X PTS version: 1.04
X Notes:
X Marginally tested. Beta software at best.
X
X6. SCO Unix
X HARDWARE: Clone i486/33
X OS: SCO Unix SysVR3.2 v4.1
X C: gcc 2.5.8
X X: XFree86 2.1 from XFree86 Project, Inc.
X Other software used: PD strftime.c (from comp.sources.misc)
X PTS version: 1.03b
X Notes:
X Ensure your X installation defines either -DSCO or -Dsco.
X You will need to either (I recommend #2, libx.a has some
X things in it we don't need, or want.):
X 1. Link with libx.a
X 2. Extract chsize.o from libx.a and add it to libzdbm.a
X A copy of the PD strftime.c is included, you will need to
X define MISSING_SRCS as strftime.c and MISSING_OBJS as
X strftime.o (an example is in the Imakefile.common file.)
X (Contributed by Kent Hamilton, <kenth@hns.st-louis.mo.us>.)
X
X
X
XPTS has reportedly been built on the following systems (not by the
Xauthors). Note that getting it to work on them may (or may not)
Xrequire modification of the source code. Please let me have your
Xmodifications so others can use them.
X DEC Ultrix
X Sun Sparc & SunOS 4.x, w/ gcc, MIT X11R5
X Sun Solaris 2.x
X SGI IRIX 5.1, SGI C compiler (v3.17)
X Intergraph
X
X
XYou should be able to get PTS to compile and run on many other Unix
Xsystems. If you build PTS on a platform not listed, pease fill out
Xthe following form and e-mail it to me. Please be as specific
Xas possible where appropriate:
X
X HARDWARE:
X OS:
X C:
X X:
X Other software used:
X PTS version:
X Notes:
X
X
X--
XDean Collins (dean@halcyon.com)
XWed Jun 15 23:25:45 1994
END_OF_FILE
if test 3651 -ne `wc -c <'pts-1.05/PLATFORMS'`; then
echo shar: \"'pts-1.05/PLATFORMS'\" unpacked with wrong size!
fi
# end of 'pts-1.05/PLATFORMS'
fi
if test -f 'pts-1.05/config/Imakefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/config/Imakefile'\"
else
echo shar: Extracting \"'pts-1.05/config/Imakefile'\" \(3029 characters\)
sed "s/^X//" >'pts-1.05/config/Imakefile' <<'END_OF_FILE'
X######################################################################
X#
X# Imakefile -- Imake rules for config file parser.
X# Dean Collins, Tue Jun 16 09:49:26 PDT 1992
X#
X# Modified: Dean Collins Thu Mar 10 20:48:02 1994
X# Moved customization to ../Imake.config, which each Imakefile
X# will #include. This eliminates the need to set CC within
X# each one.
X
X######################################################################
X#
X# Copyright (c) 1994 Dean Collins.
X# Copyright (c) 1992 University of Idaho, Moscow, Idaho.
X#
X# Permission to use, copy, modify, and distribute this software and its
X# documentation free of charge for any purpose is hereby granted without
X# fee, provided that the above copyright notice appear in all copies and
X# that both that copyright notice and this permission notice appear in
X# supporting documentation, and that the name of the University of Idaho
X# not be used in advertising or publicity pertaining to distribution of
X# the software without specific, written prior permission. The University
X# of Idaho makes no representations about the suitability of this software
X# for any purpose. It is provided "as is" without express or implied warranty.
X#
X# THE UNIVERSITY OF IDAHO DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
X# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
X# IN NO EVENT SHALL THE UNIVERSITY OF IDAHO BE LIABLE FOR ANY SPECIAL,
X# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X# PERFORMANCE OF THIS SOFTWARE.
X######################################################################
X
X######################################################################
X# YOU SHOULDN'T NEED TO MODIFY ANYTHING IN THIS FILE.
X# All customization is now done in ../Imake.config.
X######################################################################
X
X
X#include "../Imake.config"
X
X
X#----------------------------------------------------------------------
X
X SRCS = lex.yy.c y.tab.c config.c
X OBJS = lex.yy.o y.tab.o config.o
X HDRS = y.tab.h cloud.h zdbm.h
XLOCAL_LIBRARIES =
X DEPLIBS =
X PROGRAMS =
X INCLUDES = -I../neb_cld -I../zdbm -I../util
X LEX = lex
X YACC = yacc -d
X
XNormalLibraryTarget(config,$(OBJS))
XSpecialObjectRule(configtest.o, configtest.c, -UXPTS)
XNormalProgramTarget(configtest, $(OBJS) configtest.o, $(DEPLIBS), \
X $(LOCAL_LIBRARIES) -L../neb_cld -L../zdbm -L../util \
X -L. -lcloud -lzdbm -lconfig -lutil, /**/ )
XDependTarget()
XLintTarget()
X
Xy.tab.c: config.yacc
X $(YACC) config.yacc
X
Xlex.yy.c: config.lex y.tab.h
X $(LEX) config.lex
X
Xy.tab.h: y.tab.c
X
Xlex.yy.o: lex.yy.c
X $(CC) -c lex.yy.c $(LOCAL_LIBRARIES) $(DEPLIBS) $(INCLUDES) $(CDEBUGFLAGS)
X
Xy.tab.o: y.tab.c
X $(CC) -c y.tab.c $(LOCAL_LIBRARIES) $(DEPLIBS) $(INCLUDES) $(CDEBUGFLAGS)
X
Xclean::
X $(RM) y.tab.c y.tab.h lex.yy.c
X
Xuninstall::
X
END_OF_FILE
if test 3029 -ne `wc -c <'pts-1.05/config/Imakefile'`; then
echo shar: \"'pts-1.05/config/Imakefile'\" unpacked with wrong size!
fi
# end of 'pts-1.05/config/Imakefile'
fi
if test -f 'pts-1.05/config/configtest.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/config/configtest.c'\"
else
echo shar: Extracting \"'pts-1.05/config/configtest.c'\" \(4173 characters\)
sed "s/^X//" >'pts-1.05/config/configtest.c' <<'END_OF_FILE'
X/*configtest.c -- Used to test the config file parser.
X Dean Collins
X Wed Feb 23 12:18:04 1994
X
X Usage: configtest [file [parsetype]]
X
XCopyright (c) 1994 Dean Collins
X
XPermission to use, copy, modify, and distribute this software and its
Xdocumentation free of charge for any purpose is hereby granted without
Xfee, provided that the above copyright notices appear in all copies and
Xthat both those copyright notices and this permission notice appear in
Xsupporting documentation, and that the name of Dean Collins not be
Xused in advertising or publicity pertaining to distribution of the
Xsoftware without specific, written prior permission. Dean Collins
Xmakes no representations about the suitability of this software for
Xany purpose. It is provided "as is" without express or implied warranty.
X
XDEAN COLLINS DISCLAIMS ALL WARRANTIES WITH
XREGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
XMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
XDEAN COLLINS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
XDAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
XPROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
XACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
XTHIS SOFTWARE.
X*/
X
X#include <stdio.h>
X#include "zdbm.h"
X#include "cloud.h"
X#include "config.h"
X
Xextern int debug ;
Xextern char ParserPath[] ;
Xextern char ParserName[] ;
Xextern int ParserDays ;
Xextern FILE *yyin ; /* From lex.yy.c */
X
X/* The rest really aren't supposed to be accessed outside of config.yacc,
X * but are anyhow for testing purposes.
X */
Xextern int parsetype ;
Xextern struct Full_path *CfgTree ;
X
X
X/*
X______________________________________________________________________
Xmain()
X
XFUNCTION DESCRIPTION:
X This function is used to test the parser.
X______________________________________________________________________
XREVISION HISTORY:
X Author: Dean Collins Date: 2/23/94
X______________________________________________________________________
X*/
X
X
X
Xint main(int argc,
X char *argv[])
X
X /* Interface description:
X INPUT:
X argc - command-line argument count
X argv - command-line argument list
X OUTPUT:
X None.
X RETURN VALUE:
X int - status
X */
X
X{
X /* Internal variables: */
X /* Major */
X /* NONE */
X /* Minor */
X /* NONE */
X
X
X /*------------------ Start of main() routine -------------------*/
X
X if (argc > 3)
X { printf("wrong number of arguments.\n") ;
X fprintf(stderr,"Usage: %s [file [parsetype]]\n", argv[0]) ;
X exit(1) ;
X }
X printf("Beginning parse test...\n") ;
X if (argc == 2)
X ParseTest(PARSEMISC, argv[1]) ;
X else if (argc == 3)
X ParseTest(atoi(argv[2]), argv[1]) ;
X else ParseTest(PARSEMISC, NULL) ;
X
X} /*---------------------- End of main() -------------------------*/
X
X
X
Xint
XParseTest(int type,
X char *Fname)
X
X /* Interface description:
X INPUT:
X type - type of parse to perform (PARSEPATH, PARSEMAIL,...)
X Fname - filename of the config file to test, if not NULL.
X OUTPUT:
X None.
X RETURN VALUE:
X int - status
X */
X{
X
X /* Internal variables: */
X /* Major */
X /* NONE */
X /* Minor */
X /* NONE */
X
X /*------------------ Start of ParseTest() routine -------------------*/
X
X /* Open the configuration file for reading. */
X if (Fname != NULL)
X yyin = fopen(Fname, "r") ;
X else yyin = fopen(CONFIGFILE, "r") ;
X if (yyin == NULL)
X { fprintf(stderr, "Error opening config file %s !\n", CONFIGFILE) ;
X return (-1) ;
X }
X
X /* Call the parser and have it build the tree. */
X parsetype=type;
X parse_error=0 ;
X if (debug) printf("Beginning NEW & IMPROVED config file parse...\n") ;
X
X yyparse() ;
X
X if (debug) printf("\nEnding NEW & IMPROVED config file parse...\n") ;
X
X#ifdef DEBUG
X/*CLD*/ if (parsetype == PARSEPATH) TraverseList(CfgTree) ;
X#endif
X
X /* Close the configuration file. */
X fclose(yyin) ;
X
X return(parse_error) ;
X
X} /*---------------------- End of ParseTest() -------------------------*/
X
X/* End of tester.c */
END_OF_FILE
if test 4173 -ne `wc -c <'pts-1.05/config/configtest.c'`; then
echo shar: \"'pts-1.05/config/configtest.c'\" unpacked with wrong size!
fi
# end of 'pts-1.05/config/configtest.c'
fi
if test -f 'pts-1.05/config/sample2.config' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/config/sample2.config'\"
else
echo shar: Extracting \"'pts-1.05/config/sample2.config'\" \(2859 characters\)
sed "s/^X//" >'pts-1.05/config/sample2.config' <<'END_OF_FILE'
X# /usr/local/lib/PTS/pts.cf
X# This is the config file for the Problem Tracking System (PTS).
X#
X#
X############################################################
X#
Xmailer: /usr/lib/sendmail #What mail prog. to use?
Xmailer_opts: -t #And it's command-line opts?
Xprinter: /usr/bin/lpr #What print prog. to use?
Xprinter_opts: -Plj #And it's command-line opts?
X
X############################################################
X#Sysop list goes here... (optional)
X#
Xsysops: dean chris sheneman brian hunter874
Xsysops: simon johnd
X
X############################################################
X#Mail list goes here...
X#
X# e-mail
X# address age problem types list (opt.)
X#==== ================ === =================================
Xmail: dean 2
Xmail: dean%foo@bar.com 1 /Software/Mail, /Software/News
Xmail: simon 4
Xmail: sirocco@gaea.com 2 /Software/PTS, \
X /Software/Programming, \
X /Software/X-Windows-System/Programming
Xmail: simon 1 /Hardware
Xmail: johnd 7
Xmail: zombie@cemetary 1 /Software/PTS
X
X
X############################################################
X# Problem types go here...
X# list leaves ONLY...
X# Case IS significant...
X
X## Report PTS problems with PTS... What a concept!
Xleaf: /Software/PTS/problems
Xleaf: /Software/PTS/suggestions
Xleaf: /Software/PTS/comments
X
Xleaf: /Software/Editors/vi
Xleaf: /Software/Editors/emacs
Xleaf: /Software/Editors/Other
X
Xleaf: /Software/Programming/C
Xleaf: /Software/Programming/Pascal
Xleaf: /Software/Programming/Fortran
Xleaf: /Software/Programming/Scheme
Xleaf: /Software/Programming/ML
Xleaf: /Software/Programming/Other
X
Xleaf: /Software/X-Windows-System/Usage
Xleaf: /Software/X-Windows-System/Programming
Xleaf: /Software/X-Windows-System/Other
X
Xleaf: /Software/Network/Remote-Logins
Xleaf: /Software/Network/File-Transfers
Xleaf: /Software/Network/Other
X
X#Note these two. Often problems will be appropriate
X#in multiple leaves.
Xleaf: /Hardware/Modems
Xleaf: /Software/Modems
X
Xleaf: /Software/Shell/Korn-shell(ksh)
Xleaf: /Software/Shell/C-Shell(csh)
Xleaf: /Software/Shell/Bourne-Shell(sh)
Xleaf: /Software/Shell/Aegis
Xleaf: /Software/Shell/Other
X
Xleaf: /Software/Login-Logout
X
Xleaf: /Software/Mail/elm
Xleaf: /Software/Mail/mail
Xleaf: /Software/Mail/mh
Xleaf: /Software/Mail/xmh
Xleaf: /Software/Mail/sendmail
Xleaf: /Software/Mail/Other
X
Xleaf: /Software/Other
X
Xleaf: /Hardware/Printer
Xleaf: /Hardware/Keyboard
Xleaf: /Hardware/Display
Xleaf: /Hardware/Mouse
Xleaf: /Hardware/Tape-Drive
Xleaf: /Hardware/Hard-Drive
Xleaf: /Hardware/Network
Xleaf: /Hardware/X-Terminal
Xleaf: /Hardware/Other
X
Xleaf: /Other
X
X################ END OF pts.cf #############################
END_OF_FILE
if test 2859 -ne `wc -c <'pts-1.05/config/sample2.config'`; then
echo shar: \"'pts-1.05/config/sample2.config'\" unpacked with wrong size!
fi
# end of 'pts-1.05/config/sample2.config'
fi
if test -f 'pts-1.05/contrib/DANGER/danger.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/contrib/DANGER/danger.c'\"
else
echo shar: Extracting \"'pts-1.05/contrib/DANGER/danger.c'\" \(3775 characters\)
sed "s/^X//" >'pts-1.05/contrib/DANGER/danger.c' <<'END_OF_FILE'
X/* danger.c
X *
X * This program goes through the problem tree and blindly changes the edit
X * flags in the index enties to FALSE. It DOES NOT check anything before
X * changing the flag, so BE CAREFULL!!!!!
X *
X */
X
X/* danger2.c
X *
X * This program goes through the problem tree and checks the mrd field of each
X * problem index entry, if the field == DELETED rather than GONE, then it
X * changes the mrd field to GONE and writes the index back out. While this
X * is not too dumb, it could still cause problems if used at the wrong time,
X * so BE CAREFULL!!!!
X *
X */
X
X#include "danger.h"
X
XFILE *locknload();
Xvoid remove_edit_locks();
Xvoid fix_deleted();
X
Xmain(int argc, char *argv[])
X{
X struct Full_path *tree_root;
X char emess[81];
X int choice;
X
X printf("Which DANGEROUS one (1 or 2)? ");
X gets(emess);
X choice=atoi(emess);
X
X if (config_tree(&tree_root)==ERROR)
X {
X perror("Error in config()");
X exit(errno);
X }
X
X switch (choice)
X {
X case 1: remove_edit_locks(tree_root);
X break; /* end of switch 1 */
X
X case 2: fix_deleted(tree_root);
X break; /* end of switch 2 */
X
X default: printf("BAD choice %d - exiting.\n", choice);
X exit(1);
X } /* end switch */
X
X} /* end danger.c */
X
XFILE *locknload(char *path)
X{
X char db_path[COMPLETEPATHLEN];
X char *cp;
X char emess[81];
X FILE *temp;
X
X cp=rindex(path, '/');
X if (cp==NULL)
X cp=path;
X else
X cp++;
X
X sprintf(db_path, "%s%s/%s.index", PTSROOT, path, cp);
X
X if ((temp=fopen(db_path, "r+"))==NULL)
X {
X sprintf(emess, "\n*****\n\tCould not open %s\n\t", db_path);
X perror(emess);
X return(NULL);
X }
X
X if (lock_file(temp)==FAIL)
X {
X fclose(temp);
X sprintf(emess, "\n***** Could not lock %s\n\t", db_path);
X perror(emess);
X return(NULL);
X }
X return(temp);
X} /* end locknload() */
X
Xvoid remove_edit_locks(struct Full_path *tree_root)
X{
X struct Full_path *node;
X index_record index;
X FILE *db_pointer;
X char *cp;
X char emess[81];
X
X for (node=tree_root; node->next!=NULL; node=node->next)
X {
X if ((db_pointer=locknload(node->path))==NULL)
X {
X continue;
X }
X printf("\n*****\n Cleaning up %s%s index file now ", PTSROOT, node->path);
X while (fread(&index, sizeof(index_record), 1, db_pointer)==1)
X {
X printf("!");
X index.ef=FALSE;
X fseek(db_pointer, -(long)sizeof(index_record), SEEK_CUR);
X if (fwrite(&index, sizeof(index_record), 1, db_pointer)!=1)
X break;
X fseek(db_pointer, 0L, SEEK_CUR);
X } /* end while */
X
X if (ferror(db_pointer))
X {
X sprintf(emess, "Error reading or writting to %s index file");
X perror(emess);
X }
X printf("\n*****\n");
X unlock_file(db_pointer);
X fclose(db_pointer);
X } /* end for */
X} /*end remove_edit_locks() */
X
Xvoid fix_deleted(struct Full_path *tree_root)
X{
X struct Full_path *node;
X index_record index;
X FILE *db_pointer;
X char *cp;
X char emess[81];
X
X for (node=tree_root; node->next!=NULL; node=node->next)
X {
X if ((db_pointer=locknload(node->path))==NULL)
X {
X sprintf(emess, "Problem with locking and loading %s", node->path);
X continue;
X }
X printf("\n*****\n Cleaning up %s%s index file now ", PTSROOT, node->path);
X while (fread(&index, sizeof(index_record), 1, db_pointer)==1)
X {
X printf("!");
X if (index.mrd==DELETED)
X {
X index.mrd=GONE;
X fseek(db_pointer, -(long)sizeof(index_record), SEEK_CUR);
X if (fwrite(&index, sizeof(index_record), 1, db_pointer)!=1)
X break;
X fseek(db_pointer, 0L, SEEK_CUR);
X } /* end if */
X } /* end while */
X if (ferror(db_pointer))
X {
X sprintf(emess, "Error reading or writting to %s index file");
X perror(emess);
X }
X printf("\n*****\n");
X unlock_file(db_pointer);
X fclose(db_pointer);
X } /* end for */
X} /* end fix_deleted() */
END_OF_FILE
if test 3775 -ne `wc -c <'pts-1.05/contrib/DANGER/danger.c'`; then
echo shar: \"'pts-1.05/contrib/DANGER/danger.c'\" unpacked with wrong size!
fi
# end of 'pts-1.05/contrib/DANGER/danger.c'
fi
if test -f 'pts-1.05/contrib/ptsprt/Imakefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/contrib/ptsprt/Imakefile'\"
else
echo shar: Extracting \"'pts-1.05/contrib/ptsprt/Imakefile'\" \(2818 characters\)
sed "s/^X//" >'pts-1.05/contrib/ptsprt/Imakefile' <<'END_OF_FILE'
X######################################################################
X#
X# Imakefile -- Imake rules for the ptsprt utility.
X# Dean Collins, Thu Jul 30 08:33:47 PDT 1992
X#
X######################################################################
X#
X######################################################################
X#
X# Copyright (c) 1994 Dean Collins.
X# Copyright (c) 1992 University of Idaho, Moscow, Idaho.
X#
X# Permission to use, copy, modify, and distribute this software and its
X# documentation free of charge for any purpose is hereby granted without
X# fee, provided that the above copyright notice appear in all copies and
X# that both that copyright notice and this permission notice appear in
X# supporting documentation, and that the name of the University of Idaho
X# not be used in advertising or publicity pertaining to distribution of
X# the software without specific, written prior permission. The University
X# of Idaho makes no representations about the suitability of this software
X# for any purpose. It is provided "as is" without express or implied warranty.
X#
X# THE UNIVERSITY OF IDAHO DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
X# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
X# IN NO EVENT SHALL THE UNIVERSITY OF IDAHO BE LIABLE FOR ANY SPECIAL,
X# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X# PERFORMANCE OF THIS SOFTWARE.
X######################################################################
X
X######################################################################
X# YOU SHOULDN'T NEED TO MODIFY ANYTHING IN THIS FILE.
X# All costomization is now done in ../Imake.config.
X######################################################################
X
X
X#include "../../Imake.config"
X
X
X#----------------------------------------------------------------------
X
XCCOPTIONS = -DBSD -UXPTS $(INCLUDES)
XPTSTOP=../..
X
X SRCS = ptsprt.c
X OBJS = ptsprt.o cgetopts.o
X HDRS =
X PROGRAMS = ptsprt
X INCLUDES = -I$(PTSTOP)/util -I$(PTSTOP)/zdbm -I$(PTSTOP)/neb_cld \
X -I$(PTSTOP)/config
XLOCAL_LIBRARIES = -L$(PTSTOP)/neb_cld -lcloud -L$(PTSTOP)/config -lconfig \
X -L$(PTSTOP)/zdbm -lzdbm \
X -L$(PTSTOP)/util -lutil $(MISSING_LIBS)
X PTSLIBS = $(PTSTOP)/neb_cld/libcloud.a $(PTSTOP)/config/libconfig.a \
X $(PTSTOP)/zdbm/libzdbm.a $(PTSTOP)/util/libutil.a
X# INSTPGMFLAGS = -m 4755 -o $(OWNER)
X
XAllTarget(ptsprt)
XNormalProgramTarget(ptsprt,$(OBJS),$(PTSLIBS),$(LOCAL_LIBRARIES),/**/)
XLintTarget()
XDependTarget()
XInstallProgram(ptsprt,$(BINDIR))
X
Xinstall.man::
X
X
Xuninstall::
X $(RM) $(BINDIR)/ptsprt
X @echo "uninstall in $(CURRENT_DIR) done"
X
END_OF_FILE
if test 2818 -ne `wc -c <'pts-1.05/contrib/ptsprt/Imakefile'`; then
echo shar: \"'pts-1.05/contrib/ptsprt/Imakefile'\" unpacked with wrong size!
fi
# end of 'pts-1.05/contrib/ptsprt/Imakefile'
fi
if test -f 'pts-1.05/contrib/texttest/texttest.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/contrib/texttest/texttest.c'\"
else
echo shar: Extracting \"'pts-1.05/contrib/texttest/texttest.c'\" \(3343 characters\)
sed "s/^X//" >'pts-1.05/contrib/texttest/texttest.c' <<'END_OF_FILE'
X/* Test program #1 -- Text-Test */
X
X/* Copyright 1993 Dean Collins */
X
X#include <stdlib.h>
X#include <stdio.h> /* Standard input/output utilities hdr. file */
X#include <sys/param.h> /* System parameters header file */
X#include "zdbm.h" /* Zombie Database Manager header file */
X#include "cloud.h" /* Nebulous Cloud header file */
X#include "clouderror.h" /* Nebulous Cloud error rtn. header file */
X#include "config.h" /* Config. file parser header file */
X/*#include "util.h"*/
X
X
Xmain(int argc, char *argv[])
X{
X char *text ;
X char **UnsolvedList = NULL ;
X Summary *CloudUnSummaries = NULL ;
X ProblemTree *ProbTree ;
X UserInfo UserInfoRec ;
X int i,index ;
X char Path[100] ;
X problem_record * ProblemRecord ;
X
X /* Get information about the user and read the problem hierarchy. */
X#ifdef DEBUG
X printf("calling Setup()...\n") ;
X#endif
X printf("loading config file...\n") ;
X/*CLD*/ if (Setup(&UserInfoRec, &ProbTree) == False)
X { fprintf(stderr, "Error in configuration file %s !\n", CONFIGFILE) ;
X exit(1);
X }
X#ifdef DEBUG
X printf("returned from Setup()...\n") ;
X printf("\tUserInfoRec.sysopflag = %d\n", UserInfoRec.sysopflag);
X printf("\tUserInfoRec.username = %s\n", UserInfoRec.username) ;
X printf("\tUserInfoRec.realname = %s\n", UserInfoRec.realname) ;
X#endif
X
X /* Read all unsolved problems */
X printf("searching for all unsolved problems...\n") ;
X CloudUnSummaries = ReadUnsolvedSummaries(ProbTree, &UnsolvedList) ;
X
X if (!CloudUnSummaries)
X ;
X
X#ifdef DEBUG
X printf("Checking for NULL values\n") ;
X if (ProbTree == NULL) printf("ProbTree is NULL\n") ;
X if (CloudUnSummaries== NULL) printf("CloudUnSummaries is NULL\n") ;
X if (UnsolvedList == NULL) printf("UnsolvedList is NULL\n") ;
X else if (UnsolvedList[0] == NULL) printf("UnsolvedList[0] is NULL\n") ;
X#endif
X
X while (index != -1)
X {
X /* Print summaries with lines numbered. */
X PrintSummaries(CloudUnSummaries,UnsolvedList) ;
X
X /* Get selection from user */
X index=GetSelection() ;
X
X if (index >=0)
X {
X /* Read selected problem */
X/*CLD*/ ProblemRecord = ReadUnsolved(ProbTree, Path, CloudUnSummaries, index) ;
X
X
X /* Format the problem */
X text=FormatProblem(ProblemRecord) ;
X
X /* Print the problem */
X printf("-----------------------------------"
X "-----------------------------------\n") ;
X printf("%s",text) ;
X printf("-----------------------------------"
X "-----------------------------------\n") ;
X }
X }
X}
X
XPrintSummaries(Summary *CloudUnSummaries,
X char **UnsolvedList)
X{
X int i,j ;
X char str[MAXSUMLEN+1] ;
X
X#ifdef DEBUG
X printf("entering PrintSummaries()\n") ;
X#endif
X for (i=0; UnsolvedList[i] != NULL; ++i)
X { strcpy(str,UnsolvedList[i]) ;
X for (j=0; j<strlen(str); ++j)
X if (str[j] == '\n')
X str[j] = ' ' ;
X printf("%-4d :\t%s\n",i+1,str) ;
X }
X#ifdef DEBUG
X printf("leaving PrintSummaries()\n") ;
X#endif
X}
X
Xint GetSelection(void)
X{
X int index ;
X char line[1000] ;
X char test[1000] ;
X
X printf("Enter problem number to view ('q' to quit):\n==>") ;
X gets(line) ;
X sscanf(line,"%d",&index) ;
X sscanf(line,"%s",test) ;
X if (test[0] == 'q' || index <= 0)
X { index = 0 ;
X }
X return (index-1) ;
X}
X
END_OF_FILE
if test 3343 -ne `wc -c <'pts-1.05/contrib/texttest/texttest.c'`; then
echo shar: \"'pts-1.05/contrib/texttest/texttest.c'\" unpacked with wrong size!
fi
# end of 'pts-1.05/contrib/texttest/texttest.c'
fi
if test -f 'pts-1.05/neb_cld/clouderror.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/neb_cld/clouderror.h'\"
else
echo shar: Extracting \"'pts-1.05/neb_cld/clouderror.h'\" \(3911 characters\)
sed "s/^X//" >'pts-1.05/neb_cld/clouderror.h' <<'END_OF_FILE'
X/* Author: Luke Sheneman */
X
X
X/*
X * Copyright (c) 1992 University of Idaho, Moscow, Idaho.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation free of charge for any purpose is hereby granted without
X * fee, provided that the above copyright notice appear in all copies and
X * that both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of the University of Idaho
X * not be used in advertising or publicity pertaining to distribution of
X * the software without specific, written prior permission. The University
X * of Idaho makes no representations about the suitability of this software
X * for any purpose. It is provided "as is" without express or implied warranty.
X *
X * THE UNIVERSITY OF IDAHO DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
X * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
X * IN NO EVENT SHALL THE UNIVERSITY OF IDAHO BE LIABLE FOR ANY SPECIAL,
X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X * PERFORMANCE OF THIS SOFTWARE.
X */
X
X
X
X
Xextern int cld_errno; /* our global variable */
X
Xchar *CloudStrerror(); /* A prototype */
X
X#define MAXERRORSTRING 2500
X
X
X
X/* For setup.c */
X
X#define CLD_ERR1 400 /* getpwuid could not get information */
X#define CLD_ERR2 401 /* could not parse config file info */
X
X
X
X/* For summaries.c */
X
X#define CLD_ERR3 402 /* could not read next unsolved problem */
X#define CLD_ERR4 403 /* could not read next reopened requested problem */
X#define CLD_ERR5 404 /* could not read next solved problem */
X#define CLD_ERR6 405 /* could not read particular unsolved problem */
X#define CLD_ERR7 406 /* could not read particular reopened problem */
X#define CLD_ERR8 407 /* invalid problem status in ReadUnsolved() */
X#define CLD_ERR9 408 /* empty summary list passed into ReadUnsolved() */
X
X
X
X/* For problems.c */
X
X#define CLD_ERR10 409 /* invalid path in problem tree */
X#define CLD_ERR11 410 /* branch has no children in problem tree. */
X#define CLD_ERR12 411 /* non-existant branch in problem tree. */
X#define CLD_ERR13 412 /* generic difficulty moving to desired branch */
X#define CLD_ERR14 413 /* requested problem does not exist (cloud fault) */
X#define CLD_ERR15 414 /* requested problem does not exist (zdbm fault) */
X#define CLD_ERR16 415 /* error locking problem */
X#define CLD_ERR17 416 /* error unlocking problem */
X#define CLD_ERR18 417 /* error solving problem */
X#define CLD_ERR19 418 /* error reopening problem */
X#define CLD_ERR20 419 /* error requesting the reopening of a problem */
X#define CLD_ERR21 420 /* error opening temp mail file for deny letter */
X#define CLD_ERR22 421 /* error denying the reopen of a problem */
X#define CLD_ERR23 422 /* error adding reporter to reporter list */
X#define CLD_ERR24 423 /* error deleting file from database */
X#define CLD_ERR25 424 /* source path invalid for moving problem */
X#define CLD_ERR26 425 /* destination path invalid for moving problem */
X#define CLD_ERR27 426 /* error moving problem */
X#define CLD_ERR28 427 /* source path invalid for linking a problem */
X#define CLD_ERR29 428 /* destination path invalid for linking a problem */
X#define CLD_ERR30 429 /* error linking problem */
X#define CLD_ERR31 430 /* error opening temp file for printing a problem */
X#define CLD_ERR32 431 /* error adding problem to database */
X#define CLD_ERR33 432 /* error appending a problem log to a problem */
X#define CLD_ERR35 434 /* Error Reopening Problem */
X
X
X
X
X/* For subtree.c */
X
X#define CLD_ERR34 433 /* SubTree not found in Tree with specified path */
X
X
END_OF_FILE
if test 3911 -ne `wc -c <'pts-1.05/neb_cld/clouderror.h'`; then
echo shar: \"'pts-1.05/neb_cld/clouderror.h'\" unpacked with wrong size!
fi
# end of 'pts-1.05/neb_cld/clouderror.h'
fi
if test -f 'pts-1.05/neb_cld/subtree.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/neb_cld/subtree.c'\"
else
echo shar: Extracting \"'pts-1.05/neb_cld/subtree.c'\" \(4327 characters\)
sed "s/^X//" >'pts-1.05/neb_cld/subtree.c' <<'END_OF_FILE'
X/* Author: Luke Sheneman */
X
X/*
X * Copyright (c) 1992 University of Idaho, Moscow, Idaho.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation free of charge for any purpose is hereby granted without
X * fee, provided that the above copyright notice appear in all copies and
X * that both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of the University of Idaho
X * not be used in advertising or publicity pertaining to distribution of
X * the software without specific, written prior permission. The University
X * of Idaho makes no representations about the suitability of this software
X * for any purpose. It is provided "as is" without express or implied warranty.
X *
X * THE UNIVERSITY OF IDAHO DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
X * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
X * IN NO EVENT SHALL THE UNIVERSITY OF IDAHO BE LIABLE FOR ANY SPECIAL,
X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X * PERFORMANCE OF THIS SOFTWARE.
X *
X * Modified: Dean Collins Sun Jun 12 20:29:40 1994
X * Added IsLeaf() function. This seems to be the least-inappropriate
X * source file to place it in.
X */
X
X
X/* The following functions are defined in subtree.c:
X *
X * FreeParts() - frees an array of strings which was created by BreakUpPath().
X * SubTree() - returns a pointer to a subtree of the problem tree given the
X * tree and a path to the desired tree.
X * IsLeaf() - determines if a path is a leaf in a problem tree.
X * TraverseList() - Traverses a linked list of Full_path structures.
X * (Moved from tester.c, RDC, Thu Jun 16 17:39:32 1994)
X *
X */
X
X
X#include <stdio.h>
X#include "zdbm.h"
X#include "cloud.h"
X#include "clouderror.h"
X
X
Xvoid FreeParts(parts)
Xchar *parts[MAXBRANCHES];
X{
X int loop;
X
X cld_errno=0;
X
X for(loop=0;loop<MAXBRANCHES;loop++)
X free(parts[loop]);
X}
X
X
XProblemTree *SubTree(tree,ppath)
XProblemTree *tree;
Xchar ppath[DBPATHLEN];
X{
X ProblemTree *subtree,*current;
X char *parts[MAXBRANCHES];
X char newpath[DBPATHLEN];
X int loop=0;
X
X cld_errno=0;
X
X current=tree;
X strcpy(newpath,ppath);
X strcat(newpath,"/");
X
X BreakUpPath(newpath,parts);
X if(!strcmp(parts[0],ROOTSTR))
X if(!strcmp(parts[1],""))
X return(tree);
X else
X loop++;
X
X while(strcmp(parts[loop],""))
X {
X subtree=FindBranch(current,parts[loop]);
X if(subtree)
X {
X current=subtree;
X loop++;
X }
X else
X {
X cld_errno=CLD_ERR34;
X FreeParts(parts);
X return(NULL);
X }
X }
X FreeParts(parts);
X return(subtree);
X}
X
X
X
X/*
X______________________________________________________________________
XIsLeaf()
X
XFUNCTION DESCRIPTION:
X
X This function determines if a path is a leaf in a problem tree.
X
X______________________________________________________________________
XUNIT TESTING:
X This function has been tested by using white-box tests.
X______________________________________________________________________
XREVISION HISTORY:
X Author: Dean Collins Date: 6/11/94
X______________________________________________________________________
X*/
X
Xint IsLeaf(tree, path)
XProblemTree *tree ;
Xchar *path ;
X{
X ProblemTree *subtree ;
X
X /* Find the node in the tree corresponding to path. */
X subtree = SubTree(tree, path) ;
X if (subtree == NULL) /* path not in tree, so it's not a leaf. */
X return 0 ;
X
X /* If node has any children it's not a leaf. */
X return ( (subtree->subhead) == 0) ;
X
X}
X
X
X
X/* Prints out all the paths in a problem tree. Moved from tester.c. */
X
Xvoid TraverseList(path)
Xstruct Full_path *path;
X{
X struct Full_path *t;
X
X cld_errno=0;
X
X t=path;
X
X#ifdef DEBUG
X printf("\n");
X#endif /* DEBUG */
X
X while(t)
X {
X
X#ifdef DEBUG
X printf("TraverseList() - %s\n",t->path);
X#else
X printf("%s\n",t->path);
X#endif /* DEBUG */
X
X t=t->next;
X }
X
X#ifdef DEBUG
X printf("\n");
X#endif /* DEBUG */
X
X}
X
END_OF_FILE
if test 4327 -ne `wc -c <'pts-1.05/neb_cld/subtree.c'`; then
echo shar: \"'pts-1.05/neb_cld/subtree.c'\" unpacked with wrong size!
fi
# end of 'pts-1.05/neb_cld/subtree.c'
fi
if test -f 'pts-1.05/neb_cld/tester.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/neb_cld/tester.c'\"
else
echo shar: Extracting \"'pts-1.05/neb_cld/tester.c'\" \(4684 characters\)
sed "s/^X//" >'pts-1.05/neb_cld/tester.c' <<'END_OF_FILE'
X/* Author: Luke Sheneman */
X
X/* Modified: Dean Collins Thu Jun 16 17:53:08 1994
X * Moved TraverseList() to subtree.c.
X */
X
X/*
X * Copyright (c) 1992 University of Idaho, Moscow, Idaho.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation free of charge for any purpose is hereby granted without
X * fee, provided that the above copyright notice appear in all copies and
X * that both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of the University of Idaho
X * not be used in advertising or publicity pertaining to distribution of
X * the software without specific, written prior permission. The University
X * of Idaho makes no representations about the suitability of this software
X * for any purpose. It is provided "as is" without express or implied warranty.
X *
X * THE UNIVERSITY OF IDAHO DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
X * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
X * IN NO EVENT SHALL THE UNIVERSITY OF IDAHO BE LIABLE FOR ANY SPECIAL,
X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X * PERFORMANCE OF THIS SOFTWARE.
X */
X
X/* These functions are marginally useful for debugging purposes only. These
X functions are not necessary for the normal operation of the PTS system,
X but can provide help in the case of debugging.
X*/
X
X/* tester.c provides definitions for the following functions:
X *
X * PrintUserInfo() - Prints out a given userinfo structure.
X * P_code() - Remnants of the past...no longer useful.
X * PrintParts() - Prints out an array of path part strings.
X * PrintUnsolvedSummaries() - Prints out an array of unsolved summary
X * strings.
X * TraverseSummaries() - Traverses a linked list of Summary structures,
X * printing the members of the structure as it goes.
X * printsummary() - prints the contents of a summary structure.
X *
X */
X
X
X#define NUMPATHS 6
X
X#include <stdio.h>
X#include "zdbm.h"
X#include "cloud.h"
X#include "clouderror.h"
X
Xvoid PrintUserInfo(userinfo)
XUserInfo *userinfo;
X{
X cld_errno=0;
X
X#ifdef DEBUG
X printf("SYSOP: %d\n",userinfo->sysopflag);
X printf("USERNAME: %s\n",userinfo->username);
X printf("REALNAME: %s\n",userinfo->realname);
X#endif /* DEBUG */
X
X}
X
Xint P_code(flag,ppath)
Xstruct Full_path **ppath;
X{
X int loop;
X char table[NUMPATHS][DBPATHLEN];
X struct Full_path *temp;
X struct Full_path *path;
X
X cld_errno=0;
X
X strcpy(table[0],"/Help/Me");
X strcpy(table[1],"/Help/Me/Now");
X strcpy(table[2],"/Help/Me/Later");
X strcpy(table[3],"/Help/You");
X strcpy(table[4],"/Help/You/Junk");
X strcpy(table[5],"/PTS/REOPEN");
X
X path=(struct Full_path *)malloc(sizeof(struct Full_path));
X strcpy(path->path,table[0]);
X path->next=NULL;
X
X for(loop=1;loop<NUMPATHS;loop++)
X {
X struct Full_path *t;
X
X t=(struct Full_path *)malloc(sizeof(struct Full_path));
X strcpy(t->path,table[loop]);
X t->next=path;
X path=t;
X }
X
X temp=path;
X *ppath=path;
X return(NULL);
X}
X
Xvoid PrintParts(parts)
Xchar parts[MAXBRANCHES][DBPATHLEN];
X{
X int loop=0;
X
X cld_errno=0;
X
X#ifdef DEBUG
X printf("\n");
X#endif /* DEBUG */
X while(strcmp(parts[loop],""))
X {
X#ifdef DEBUG
X printf("PrintParts() - %s\n",parts[loop]);
X#endif /* DEBUG */
X loop++;
X }
X
X#ifdef DEBUG
X printf("\n");
X#endif /* DEBUG */
X
X}
X
Xvoid PrintUnsolvedSummaries(unsummaries)
Xchar unsummaries[MAXSUMMARIES][MAXSUMLEN];
X{
X int loop;
X
X cld_errno=0;
X
X while(strcmp(unsummaries[loop],""));
X {
X
X#ifdef DEBUG
X printf("%s\n",unsummaries[loop]);
X#endif /* DEBUG */
X
X loop++;
X }
X}
X
X
Xvoid TraverseSummaries(summaries)
XSummary *summaries;
X{
X Summary *s;
X
X cld_errno=0;
X
X#ifdef DEBUG
X printf("In TraverseSummaries() about to traverse linked list of summaries.\n");
X#endif /* DEBUG */
X
X s=summaries;
X while(s)
X {
X#ifdef DEBUG
X printf("TraverseSummaries() - summary ptr=%p\n",s);
X printf(" summary prid=%s\n",s->prid);
X printf(" summary summary=%s\n",s->summary);
X printf(" summary path=%s\n",s->path);
X printf(" summary status=%d\n",s->status);
X#endif /* DEBUG */
X s=s->next;
X }
X}
X
X
Xvoid printsummary(summary)
XSummary *summary;
X{
X cld_errno=0;
X
X#ifdef DEBUG
X printf("printsummary() - \n");
X printf("^^^ prid: %s\n",summary->prid);
X printf("^^^ path: %s\n",summary->path);
X printf("^^^ summary: %s\n",summary->summary);
X printf("^^^ status: %d\n",summary->prid);
X#endif /* DEBUG */
X
X}
END_OF_FILE
if test 4684 -ne `wc -c <'pts-1.05/neb_cld/tester.c'`; then
echo shar: \"'pts-1.05/neb_cld/tester.c'\" unpacked with wrong size!
fi
# end of 'pts-1.05/neb_cld/tester.c'
fi
if test -f 'pts-1.05/ptsager/Imakefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/ptsager/Imakefile'\"
else
echo shar: Extracting \"'pts-1.05/ptsager/Imakefile'\" \(3149 characters\)
sed "s/^X//" >'pts-1.05/ptsager/Imakefile' <<'END_OF_FILE'
X######################################################################
X#
X# Imakefile -- Imake rules for the problem-ager utility.
X# Dean Collins, Thu Jul 30 08:33:47 PDT 1992
X#
X######################################################################
X#
X# Modified: Dean Collins Thu Feb 24 15:23:48 1994
X# Removed mutant use of xpts/util.c. Changed file mode of installed
X# program to be setuid. Should be set up as "setuid support"
X# to ensure proper access to the database.
X#
X# Modified: Dean Collins Thu Mar 10 20:52:51 1994
X# Moved customization to ../Imake.config, which each Imakefile
X# will #include. This eliminates the need to set CC within
X# each one.
X#
X######################################################################
X#
X# Copyright (c) 1994 Dean Collins.
X# Copyright (c) 1992 University of Idaho, Moscow, Idaho.
X#
X# Permission to use, copy, modify, and distribute this software and its
X# documentation free of charge for any purpose is hereby granted without
X# fee, provided that the above copyright notice appear in all copies and
X# that both that copyright notice and this permission notice appear in
X# supporting documentation, and that the name of the University of Idaho
X# not be used in advertising or publicity pertaining to distribution of
X# the software without specific, written prior permission. The University
X# of Idaho makes no representations about the suitability of this software
X# for any purpose. It is provided "as is" without express or implied warranty.
X#
X# THE UNIVERSITY OF IDAHO DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
X# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
X# IN NO EVENT SHALL THE UNIVERSITY OF IDAHO BE LIABLE FOR ANY SPECIAL,
X# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X# PERFORMANCE OF THIS SOFTWARE.
X######################################################################
X
X######################################################################
X# YOU SHOULDN'T NEED TO MODIFY ANYTHING IN THIS FILE.
X# All customization is now done in ../Imake.config.
X######################################################################
X
X
X#include "../Imake.config"
X
X
X#----------------------------------------------------------------------
X
XCCOPTIONS = -DBSD -UXPTS $(INCLUDES)
X
X SRCS = ptsager.c
X OBJS = ptsager.o
X HDRS =
X PROGRAMS = ptsager
X INCLUDES = -I../util -I../zdbm -I../neb_cld -I../config
XLOCAL_LIBRARIES = -L../neb_cld -lcloud -L../config -lconfig -L../zdbm -lzdbm \
X -L../util -lutil $(MISSING_LIBS)
X PTSLIBS = ../neb_cld/libcloud.a ../config/libconfig.a \
X ../zdbm/libzdbm.a ../util/libutil.a
X INSTPGMFLAGS = -m 4755 -o $(OWNER)
X
X
X
XAllTarget($(PROGRAMS))
X/*ComplexProgramTarget(ptsager)*/
XNormalProgramTarget(ptsager,$(OBJS),$(PTSLIBS),$(LOCAL_LIBRARIES),/**/)
XLintTarget()
X
X
XDependTarget()
XInstallProgram(ptsager,$(BINDIR))
X
Xuninstall::
X $(RM) $(BINDIR)/$(PROGRAMS)
X @echo "uninstall in $(CURRENT_DIR) done"
X
END_OF_FILE
if test 3149 -ne `wc -c <'pts-1.05/ptsager/Imakefile'`; then
echo shar: \"'pts-1.05/ptsager/Imakefile'\" unpacked with wrong size!
fi
# end of 'pts-1.05/ptsager/Imakefile'
fi
if test -f 'pts-1.05/util/str.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/util/str.c'\"
else
echo shar: Extracting \"'pts-1.05/util/str.c'\" \(6359 characters\)
sed "s/^X//" >'pts-1.05/util/str.c' <<'END_OF_FILE'
X/*
X * str.c -- A couple of common string functions.
X *
X * Dean Collins
X * created: Thu Feb 24 09:19:43 1994
X * Moved FixStr, StripLeading, & StripTrailing from xpts/util.c
X */
X
X/*
X * Copyright (c) 1992,1993,1994 Dean Collins.
X * Copyright (c) 1992 University of Idaho, Moscow, Idaho.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation free of charge for any purpose is hereby granted without
X * fee, provided that the above copyright notices appear in all copies and
X * that both those copyright notices and this permission notice appear in
X * supporting documentation, and that neither the name of the University of
X * Idaho nor the name of Dean Collins be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission from both parties. Neither The University of Idaho
X * nor Dean Collins make any representations about the suitability of
X * this software for any purpose. It is provided "as is" without express
X * or implied warranty.
X *
X * THE UNIVERSITY OF IDAHO AND DEAN COLLINS DISCLAIM ALL WARRANTIES WITH
X * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
X * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE UNIVERSITY OF IDAHO
X * OR DEAN COLLINS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
X * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
X * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
X * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
X * THIS SOFTWARE.
X */
X
X#include <stdlib.h> /* General C utilities header file */
X#include <stdio.h> /* Standard input/output utilities hdr. file */
X#include <sys/types.h> /* Common data types */
X#include <sys/stat.h> /* File status utilities */
X#include <errno.h> /* Error utilities header file */
X
X#include "util.h"
X
X
X
X/******************** MODULES *************************************/
X
X/*
X______________________________________________________________________
XFixStr()
X
XFUNCTION DESCRIPTION:
X
X This function "fixes" strings so they don't contain new-lines
Xand strips off leading and trailing white-space.
X______________________________________________________________________
XREVISION HISTORY:
X Author: Dean Collins Date: 2/13/93
X______________________________________________________________________
X*/
X
X
Xchar *FixStr(char *str)
X
X /* Interface description:
X INPUT:
X str - The string to fix.
X OUTPUT:
X None.
X RETURN VALUE:
X char * - The fixed string. This is static data, and must
X be copied to be used.
X */
X
X{
X /* Internal variables: */
X /* Major */
X /* NONE */
X /* Minor */
X static char *tmpstr=NULL ;
X char *tmpstr2 ;
X int i ;
X
X
X /*------------------- Start of FixStr() routine --------------------*/
X
X#ifdef DEBUG
X printf("XPTS(util.c): FixStr() str(before)='%s'\n",str) ;
X#endif
X
X if ( strlen(str) == 0 ) return NULL ; /* Return val. fixed 2/12/94 DC*/
X
X if (tmpstr) free(tmpstr) ;
X tmpstr = malloc(strlen(str)+1) ; /* "+1" added 2/12/94 DC */
X strcpy(tmpstr,str) ;
X
X for (i=0; tmpstr[i] != '\0'; ++i) /* Nuke newlines */
X if (tmpstr[i] == '\n')
X tmpstr[i] = ' ' ;
X
X tmpstr2 = StripLeading(StripTrailing(tmpstr)) ;
X
X#ifdef DEBUG
X printf("XPTS(util.c): FixStr() str(after)='%s'\n",tmpstr2) ;
X#endif
X
X return(tmpstr2) ;
X
X} /*-------- End of FixStr() ---------------------------*/
X
X
X
X/*
X______________________________________________________________________
XStripLeading()
X
XFUNCTION DESCRIPTION:
X
X This function removes leading spaces and tabs from a string.
X______________________________________________________________________
XREVISION HISTORY:
X Author: Dean Collins Date: 2/13/93
X______________________________________________________________________
X*/
X
X
Xchar *StripLeading(char *str)
X
X /* Interface description:
X INPUT:
X str - The string to strip.
X OUTPUT:
X None.
X RETURN VALUE:
X char * - The stripped string.
X */
X
X{
X /* Internal variables: */
X /* Major */
X /* NONE */
X /* Minor */
X char *c ;
X int i ;
X
X
X /*---------------- Start of StripLeading() routine -----------------*/
X
X#ifdef DEBUG
X printf("XPTS(util.c): StripLeading() str(before)='%s'\n",str) ;
X#endif
X
X /* strip leading spaces. c will point to the first non-space
X * and non-tab character in tmpstr.
X */
X for (c=str,i=0;
X (str[i]==' ' || str[i]=='\t') && i<strlen(str) ;
X ++c, ++i)
X ; /*nothing*/
X
X#ifdef DEBUG
X printf("XPTS(util.c): StripLeading() str(after)='%s'\n",c) ;
X#endif
X
X return(c) ;
X
X} /*----------End of StripLeading() --------------------*/
X
X
X/*
X______________________________________________________________________
XStripTrailing()
X
XFUNCTION DESCRIPTION:
X
X This function removes trailing spaces and tabs from a string.
X______________________________________________________________________
XREVISION HISTORY:
X Author: Dean Collins Date: 2/13/93
X______________________________________________________________________
X*/
X
X
Xchar *StripTrailing(char *str)
X
X /* Interface description:
X INPUT:
X str - The string to strip.
X OUTPUT:
X None.
X RETURN VALUE:
X char * - The stripped string. This data is static and must
X be copied to be used.
X */
X
X{
X /* Internal variables: */
X /* Major */
X /* NONE */
X /* Minor */
X static char *tmpstr=NULL ;
X int i ;
X
X
X /*---------------- Start of StripTrailing() routine -----------------*/
X
X if (tmpstr) free(tmpstr) ;
X tmpstr = malloc(strlen(str)+1) ; /* "+1" added 2/12/94 DC */
X strcpy(tmpstr,str) ;
X
X#ifdef DEBUG
X printf("XPTS(util.c): StripTrailing() str(before)='%s'\n",tmpstr) ;
X#endif
X /* strip trailing spaces and tabs */
X for (i=strlen(tmpstr)-1;
X i>=0 && (tmpstr[i]==' ' || tmpstr[i]=='\t');
X tmpstr[i--]='\0')
X ; /*nothing*/
X
X#ifdef DEBUG
X printf("XPTS(util.c): StripTrailing() str(after)='%s'\n",tmpstr) ;
X#endif
X
X return(tmpstr) ;
X
X} /*----------End of StripTrailing() --------------------*/
X
X/* end of str.c */
END_OF_FILE
if test 6359 -ne `wc -c <'pts-1.05/util/str.c'`; then
echo shar: \"'pts-1.05/util/str.c'\" unpacked with wrong size!
fi
# end of 'pts-1.05/util/str.c'
fi
if test -f 'pts-1.05/util/writebuf.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/util/writebuf.c'\"
else
echo shar: Extracting \"'pts-1.05/util/writebuf.c'\" \(4110 characters\)
sed "s/^X//" >'pts-1.05/util/writebuf.c' <<'END_OF_FILE'
X/*
X * writebuf.c -- Write a specified number of bytes to a file.
X *
X * Dean Collins
X * created: Sat Mar 12 23:32:53 1994
X */
X
X/*
X * Copyright (c) 1994 Dean Collins.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation free of charge for any purpose is hereby granted without
X * fee, provided that the above copyright notices appear in all copies and
X * that both those copyright notices and this permission notice appear in
X * supporting documentation, and that the name of
X * Dean Collins not be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission from both parties.
X * Dean Collinss make no representations about the suitability of
X * this software for any purpose. It is provided "as is" without express
X * or implied warranty.
X *
X * DEAN COLLINS DISCLAIMS ALL WARRANTIES WITH
X * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
X * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
X * DEAN COLLINS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
X * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
X * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
X * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
X * THIS SOFTWARE.
X */
X
X#include <stdlib.h> /* General C utilities header file */
X#include <stdio.h> /* Standard input/output utilities hdr. file */
X#include <string.h> /* String and memory functions header file.*/
X#include <errno.h> /* Error utilities header file */
X#include <sys/stat.h> /* File status utilities */
X
X#ifndef SYSV
X
X#include <sys/types.h> /* Common data types */
X#include <sys/file.h> /* Low-level file I/O */
X#include <limits.h> /* Common system limits */
X#ifdef linux
X#include <unistd.h> /* Standard Unix definitions */
X#endif /* linux */
X/* end not system 5 */
X
X#else /* it is system 5 */
X
X#include <strings.h> /* String and memory functions header file.*/
X#include <unistd.h> /* Standard Unix definitions */
X#include <fcntl.h> /* File control */
X
X#endif /* system 5 */
X
X/* No non-system includes should be here, other than util.h. */
X#include "util.h" /* Misc. low-level utilities */
X
X
X#ifdef DEBUG
X#define MYDEBUG(a,b,c,d,e) printf(a,b,c,d,e)
X#else
X#define MYDEBUG(a,b,c,d,e)
X#endif
X
X
X/******************** MODULES *************************************/
X/*
X______________________________________________________________________
XWriteBuf()
X
XFUNCTION DESCRIPTION:
X
X This function writes a specified number of bytes to
Xa file descriptor.
X______________________________________________________________________
XREVISION HISTORY:
X Author: Dean Collins Date: 3/12/94
X______________________________________________________________________
X*/
X
X
Xint WriteBuf(int fd,
X char *buf,
X int count)
X
X /* Interface description:
X INPUT:
X fd - The output file descriptor.
X buf - The buffer to write.
X count - Number of bytes to write.
X OUTPUT:
X None.
X RETURN VALUE:
X int - Number of bytes successfully written.
X If -1 see errno for error info.
X */
X{
X /* Internal variables: */
X /* Major */
X /* NONE */
X /* Minor */
X int cur=0 ;
X int done=0 ;
X int n=0 ;
X
X /*----------------- Start of WriteBuf() routine ------------------*/
X
X /* Repeatedly call write() until the buffer is written. */
X MYDEBUG("num bytes to write = %d\n",count,0,0,0) ;
X while(cur<count && !done)
X { n = write(fd, buf+cur, count-cur) ;
X MYDEBUG("num bytes written = %d (%d total)\n",n,cur+n,0,0) ;
X if (n>0)
X {
X cur += n ;
X }
X else if (n == -1)
X { MYDEBUG("error %d: %s\n", errno, strerror(errno), 0, 0) ;
X done = 1 ;
X if (cur==0) cur = -1 ;
X }
X else done = 1 ;
X }
X
X MYDEBUG("WriteBuf returning %d\n", cur, 0, 0, 0) ;
X return cur ;
X
X} /*--------------------- End of WriteBuf() ------------------------*/
X
X/* End of writebuf.c */
X
END_OF_FILE
if test 4110 -ne `wc -c <'pts-1.05/util/writebuf.c'`; then
echo shar: \"'pts-1.05/util/writebuf.c'\" unpacked with wrong size!
fi
# end of 'pts-1.05/util/writebuf.c'
fi
if test -f 'pts-1.05/xpts/CODE' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/xpts/CODE'\"
else
echo shar: Extracting \"'pts-1.05/xpts/CODE'\" \(3112 characters\)
sed "s/^X//" >'pts-1.05/xpts/CODE' <<'END_OF_FILE'
X----------------------------------------------------------------------
XSOME NOTES ABOUT THE CODE:
X
XVersion 1.03: (First public release outside of University of Idaho.)
X
X o Minor changes having to do with producing the first "public release."
X o Added patchlevel.h.
X
X----------------------------------------------------------------------
X
XVersion 1.02:
X
X o Added AIX support.
X o Minor bug fixes.
X o Changed icon bitmap. (New icon is from Anthony's X Icon Library
X v. 1.3. Thanks Anthony!)
X o Added several zdbm enhancements.
X
X----------------------------------------------------------------------
X
XVersion 1.01:
X
X o AddProblemSelect() now cleans up the data more before
X calling AddProblem(). It removes leading and trailing
X spaces and tabs from the problem summary and node fields.
X It also changes any imbedded new-lines into spaces.
X (While the user is not allowed to type a new line into
X these fields, they can, unfortunatly, PASTE one in,
X which has happened. Ho, hum. That's what I get for
X taking a shortcut...)
X
X o The header file xpts.h was split into several files
X to add more modularity.
X
X o The ability to use util.c without the rest of xpts was added,
X like I always intended. Just compile it without XPTS
X defined. This is used in ptsager.c.
X
X o Some functions were moved around, from .c file to .c file.
X Things were occasionally in an inappropriate module.
X In particular, FormatProblem is now in util.c.
X
X o xpts now doesn't allow itself to be executed by root.
X Nor does it allow itself to be run as setuid root.
X This is for security reasons.
X
X o zdbm provides a shorthand method to read problem records
X when the entire record (ie the problem log) is not
X needed. This optimization is intended to speed
X up the "Show All Unsolved" feature.
X
X----------------------------------------------------------------------
X
XORIGINAL CODE NOTES FROM VERSION 1.00:
X
XSome notes about the xpts code:
X
XAll calls to neb_cld functions are marked with '/*CLD*/' at the beginning
Xof the line.
X
XThere are no "real" calls to zdbm functions. There is one call to print_prob
Xthat is used only when DEBUG is turned on. Any calls to zdbm functions
Xare marked with '/*ZDBM*/' at the beginning of the line.
X
XThe whole ptrlist business is rather gross. I wish I had known a better
Xway to send a variable number of arguments to callback functions.
XThe best I could come up with was a pointer to an array of values.
XI think there is something called a WidgetList, which might have made
Xthings easier. As it is, it works, and make sense once you understand
Xwhat's going on. Apologies if it doesn't work on your system.
X
X"This function will be tested by using a combination of white-box and
Xblack-box tests." This is a cop-out. Sorry. I practically live in the
Xcomputer labs as it is. Rest assured that the functions have been tested,
Xbut all the testing has not been documented. I'll try to document this more.
XBoth black-box and white-box testing were performed.
X
X(No bugs, just unexpected features.... :-)
X
X----------------------------------------------------------------------
END_OF_FILE
if test 3112 -ne `wc -c <'pts-1.05/xpts/CODE'`; then
echo shar: \"'pts-1.05/xpts/CODE'\" unpacked with wrong size!
fi
# end of 'pts-1.05/xpts/CODE'
fi
if test -f 'pts-1.05/xpts/Imakefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/xpts/Imakefile'\"
else
echo shar: Extracting \"'pts-1.05/xpts/Imakefile'\" \(5466 characters\)
sed "s/^X//" >'pts-1.05/xpts/Imakefile' <<'END_OF_FILE'
X######################################################################
X#
X# Imakefile -- Imake rules for xpts.
X# Dean Collins, Tue Jun 16 09:49:26 PDT 1992
X#
X# Modified: Dean Collins Thu Mar 10 20:55:54 1994
X# Moved customization to ../Imake.config, which each Imakefile
X# will #include. This eliminates the need to set CC within
X# each one.
X#
X######################################################################
X#
X# Copyright (c) 1994 Dean Collins.
X# Copyright (c) 1992 University of Idaho, Moscow, Idaho.
X#
X# Permission to use, copy, modify, and distribute this software and its
X# documentation free of charge for any purpose is hereby granted without
X# fee, provided that the above copyright notice appear in all copies and
X# that both that copyright notice and this permission notice appear in
X# supporting documentation, and that the name of the University of Idaho
X# not be used in advertising or publicity pertaining to distribution of
X# the software without specific, written prior permission. The University
X# of Idaho makes no representations about the suitability of this software
X# for any purpose. It is provided "as is" without express or implied warranty.
X#
X# THE UNIVERSITY OF IDAHO DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
X# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
X# IN NO EVENT SHALL THE UNIVERSITY OF IDAHO BE LIABLE FOR ANY SPECIAL,
X# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
X# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
X# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
X# PERFORMANCE OF THIS SOFTWARE.
X######################################################################
X
X######################################################################
X# YOU SHOULDN'T NEED TO MODIFY ANYTHING IN THIS FILE.
X# All customization is now done in ../Imake.config.
X######################################################################
X
X
X#include "../Imake.config"
X
X
X#----------------------------------------------------------------------
X
X PTS_TOP = ..
X SRCS = xpts.c activate.c popup.c select.c misc.c xutil.c \
X signal.c
X OBJS = xpts.o activate.o popup.o select.o misc.o xutil.o \
X signal.o
X HDRS = activate.h copyright.h defines.h macros.h main.h \
X misc.h popup.h resources.h select.h signal.h \
X types.h xutil.h xpts.h
X PTS_LIBS = -lcloud -lzdbm -lconfig -lutil
X PTS_DEPLIBS = $(PTS_TOP)/neb_cld/libcloud.a $(PTS_TOP)/config/libconfig.a \
X $(PTS_TOP)/zdbm/libzdbm.a $(PTS_TOP)/util/libutil.a
X PTS_LIBDIRS = -L$(PTS_TOP)/neb_cld -L$(PTS_TOP)/zdbm -L$(PTS_TOP)/config \
X -L$(PTS_TOP)/util
XLOCAL_LIBRARIES = $(PTS_LIBDIRS) $(PTS_LIBS) XawClientLibs $(MISSING_LIBS)
X DEPLIBS = $(PTS_DEPLIBS) XawClientDepLibs
X PROGRAMS = xpts
X INCLUDES = -I$(PTS_TOP)/util -I$(PTS_TOP)/zdbm -I$(PTS_TOP)/neb_cld \
X -I$(PTS_TOP)/config -I$(PTS_TOP)
X LIBFILES = Xpts.ad xpts.help xptssysop.help
X TARCMD = tar cvf
X TARFILE = xpts.tar
X ALLFILES = $(SRCS) $(PROGRAMS) $(LIBFILES) Imakefile Makefile \
X xpts.xbm $(HDRS) doc
X INSTAPPFLAGS = -m 0644 -o $(OWNER)
X INSTPGMFLAGS = -m 4755 -o $(OWNER)
X INSTDATFLAGS = -m 0644 -o $(OWNER)
X INSTMANFLAGS = -m 0644 -o $(OWNER)
X XPTS_MAN_SRC = ../doc/Manual/xpts.man
X
X
XAllTarget(xpts)
XNormalProgramTarget(xpts,$(OBJS),$(PTSLIBS),$(LOCAL_LIBRARIES),/**/)
XLintTarget()
XDependTarget()
XInstallProgram(xpts,$(BINDIR))
X
Xinstall.man::
X
X
XInstallNonExec(xpts.help,$(LIBDIR))
XInstallNonExec(xptssysop.help,$(LIBDIR))
XInstallNonExec(xpts.xbm,$(INCROOT)/X11/bitmaps)
XInstallAppDefaults(Xpts)
X
X
X
X#Strip out all the underlining, bolding, etc. From a formatted manpage
X#and use to create the help page.
X#
X#Could also do this by setting your TERM to "unknown" or "dumb" and
X#leaving out the sed filter. That would probably be better, since
X#this assumes some things about your terminal type.
Xxpts.help: $(XPTS_MAN_SRC)
X nroff -man $(XPTS_MAN_SRC) |sed -e '1,$$s/.\'`echo '\b'`'//g' -e '1,$$s/'`echo '\015'`'.//g' >xpts.help
X# groff -Tascii -man $(XPTS_MAN_SRC) |sed -e '1,$$s/.\'`echo '\b'`'//g' -e '1,$$s/'`echo '\015'`'.//g' >xpts.help
X# (TERM=unknown; nroff -man $(XPTS_MAN_SRC) >xpts.help)
X
X#Since xpts_sysop.help is being replaced by xptssysop.help in this
X#version (so the name is 14 or less characters long), ensure that
X#the old version is is removed.
Xinstall::
X $(RM) $(LIBDIR)/xpts_sysop.help
X
Xuninstall::
X $(RM) $(LIBDIR)/xpts.help $(LIBDIR)/xptssysop.help \
X $(INCROOT)/X11/bitmaps/xpts.xbm \
X $(XAPPLOADDIR)/Xpts $(BINDIR)/xpts
X @echo "uninstall in $(CURRENT_DIR) done"
X
X
X# Create an app-defaults file from the resources.h file. This should
X# not be needed by anyone other than the software development team.
X# Xpts should be shipped with an Xpts.ad file that corresponds to the
X# resources.h file. Do your customizations in Xpts.ad (or, really,
X# /usr/lib/X11/app-defaults/Xpts) and you'll never need this.
X# If you DO change resources.h (don't!) this may or may not work.
X# It's a fairly gross hack.
XXpts.ad: resources.h
X sed -e '1,$$s/[\/][\*]/!#/g' \
X -e '1,$$s/^"//' \
X -e '1,$$s/",//g' \
X -e '1,$$s/ \* /!# /g' \
X -e '1,$$s/ \*[ ]/!# /g' \
X -e '1,$$s/ \*$$/!# /g' \
X -e '1,$$s/[ ]*[*][/]$$//g' \
X -e '1,$$s/resources[.]h/Xpts.ad/g' resources.h | \
X grep -v 'fallback_resources\[\]' | \
X grep -v '^NULL' | \
X grep -v '^} ;' | \
X grep -v '!#$$' > Xpts.ad
END_OF_FILE
if test 5466 -ne `wc -c <'pts-1.05/xpts/Imakefile'`; then
echo shar: \"'pts-1.05/xpts/Imakefile'\" unpacked with wrong size!
fi
# end of 'pts-1.05/xpts/Imakefile'
fi
if test -f 'pts-1.05/xpts/popup.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/xpts/popup.h'\"
else
echo shar: Extracting \"'pts-1.05/xpts/popup.h'\" \(3282 characters\)
sed "s/^X//" >'pts-1.05/xpts/popup.h' <<'END_OF_FILE'
X/*
X * popup.h -- Function prototypes for popup.c.
X * Dean Collins -- Mon Feb 8 21:17:40 PST 1993
X */
X
X/*
X * Copyright (c) 1992,1993 Dean Collins.
X * Copyright (c) 1992 University of Idaho, Moscow, Idaho.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation free of charge for any purpose is hereby granted without
X * fee, provided that the above copyright notices appear in all copies and
X * that both those copyright notices and this permission notice appear in
X * supporting documentation, and that neither the name of the University of
X * Idaho nor the name of Dean Collins be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission from both parties. Neither The University of Idaho
X * nor Dean Collins make any representations about the suitability of
X * this software for any purpose. It is provided "as is" without express
X * or implied warranty.
X *
X * THE UNIVERSITY OF IDAHO AND DEAN COLLINS DISCLAIM ALL WARRANTIES WITH
X * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
X * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE UNIVERSITY OF IDAHO
X * OR DEAN COLLINS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
X * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
X * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
X * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
X * THIS SOFTWARE.
X */
X
X
Xvoid ButtonPopup(String name, Widget *popupp, Widget parent, Widget *buttonp) ;
Xvoid DestroyPopup(Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid EditMOTDPopup(Widget w, Widget parent) ;
Xvoid ErrorPopup(String name, Widget parent, String message) ;
Xvoid HelpPopup(Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid InfoPopup(Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid ListPopup(String name,
X int columns,
X Widget *popupp,
X Widget parent,
X Widget *listp,
X Widget *buttonBoxp,
X Widget *quitButtonp) ;
Xvoid PickProblemPopup(Widget w, Widget parent) ;
Xvoid ProblemEntryPopup(Widget w, XtPointer client_data, XtPointer call_data);
Xvoid ProblemViewerPopup(String name,
X Widget *probViewerp,
X Widget parent,
X Widget *dialog1p,
X Widget *dialog2p,
X Widget *dialog3p,
X Widget *textp,
X Widget *editp) ;
Xvoid ShowAllUnsolvedPopup(Widget w, Widget parent) ;
Xvoid StringEntryPopup(String name,
X Widget *popupp,
X Widget parent,
X String prompt,
X XtPointer successFunc) ;
Xvoid SysopMenuPopup(Widget w, Widget parent) ;
Xvoid ViewTextPopup(String name,
X Widget *popupp,
X Widget parent,
X Widget *textp,
X Widget *buttonBoxp,
X Widget *quitButtonp) ;
Xvoid WarningPopup(String name,
X Widget parent,
X String message,
X XtPointer ok_func,
X XtPointer ok_client_data) ;
X
X/* end of popup.h */
END_OF_FILE
if test 3282 -ne `wc -c <'pts-1.05/xpts/popup.h'`; then
echo shar: \"'pts-1.05/xpts/popup.h'\" unpacked with wrong size!
fi
# end of 'pts-1.05/xpts/popup.h'
fi
if test -f 'pts-1.05/xpts/select.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pts-1.05/xpts/select.h'\"
else
echo shar: Extracting \"'pts-1.05/xpts/select.h'\" \(3150 characters\)
sed "s/^X//" >'pts-1.05/xpts/select.h' <<'END_OF_FILE'
X/*
X * select.h -- Function prototypes for select.c.
X * Dean Collins -- Mon Feb 8 21:17:40 PST 1993
X */
X
X/*
X * Copyright (c) 1992,1993 Dean Collins.
X * Copyright (c) 1992 University of Idaho, Moscow, Idaho.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation free of charge for any purpose is hereby granted without
X * fee, provided that the above copyright notices appear in all copies and
X * that both those copyright notices and this permission notice appear in
X * supporting documentation, and that neither the name of the University of
X * Idaho nor the name of Dean Collins be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission from both parties. Neither The University of Idaho
X * nor Dean Collins make any representations about the suitability of
X * this software for any purpose. It is provided "as is" without express
X * or implied warranty.
X *
X * THE UNIVERSITY OF IDAHO AND DEAN COLLINS DISCLAIM ALL WARRANTIES WITH
X * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
X * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE UNIVERSITY OF IDAHO
X * OR DEAN COLLINS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
X * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
X * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
X * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
X * THIS SOFTWARE.
X */
X
X
X
Xvoid AddProblemSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid CancelReopenSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid CancelSaveSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid DeleteProblemSelect(Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid EditProblemSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid MoveProblemSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid PreviousMenuSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid PrintProblemSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid QuitMainMenuSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid ReopenAcceptSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid ReopenDenyCancelSelect(Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid ReopenDenyMailSelect(Widget w, XtPointer client_data, XtPointer call_data);
Xvoid ReopenDenySelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid ReopenRequestSelect(Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid ReopenSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid ReportAgainSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid SaveMOTDButtonSelect(Widget w, XtPointer client_data, XtPointer call_data);
Xvoid SaveProblemSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid SleepButtonSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
Xvoid SolveProblemSelect (Widget w, XtPointer client_data, XtPointer call_data) ;
X
X/* end of select.h */
END_OF_FILE
if test 3150 -ne `wc -c <'pts-1.05/xpts/select.h'`; then
echo shar: \"'pts-1.05/xpts/select.h'\" unpacked with wrong size!
fi
# end of 'pts-1.05/xpts/select.h'
fi
echo shar: End of archive 3 \(of 16\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 16 archives.
echo "\nNow execute the command 'touch pts-1.05/xpts/xpts.help' and \nread the INSTALL document.\n"
rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0