home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-03-13 | 34.1 KB | 1,240 lines |
- From decwrl!athertn!sander.cupertino.ca.us!paul@cs.purdue.edu Wed Jan 6 13:52:33 EST 1993
- Submit chipset-2 01/10
- #! /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 1 (of 10)."
- # Contents: MANIFEST README patchlevel.h src src/btree
- # src/btree/MANIFEST src/btree/patchlevel.h src/list
- # src/list/MANIFEST src/list/dldelutl.c src/list/dlfirst.c
- # src/list/dllast.c src/list/dlnew.c src/list/dlpeek.c
- # src/list/dlpeekf.c src/list/dlpeekr.c src/list/dlpop.c
- # src/list/dlpopr.c src/list/dlpush.c src/list/dlpushf.c
- # src/list/dlpushr.c src/list/dlrankutl.c src/list/patchlevel.h
- # Wrapped by paul@sander on Sun Nov 22 15:41:46 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f MANIFEST -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"MANIFEST\"
- else
- echo shar: Extracting \"MANIFEST\" \(65 characters\)
- sed "s/^X//" >MANIFEST <<'END_OF_MANIFEST'
- XChipSet
- XMANIFEST
- XREADME
- Xpatchlevel.h
- XMakefile
- Xcommon.mk
- Xrules.mk
- END_OF_MANIFEST
- if test 65 -ne `wc -c <MANIFEST`; then
- echo shar: \"MANIFEST\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f README -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"README\"
- else
- echo shar: Extracting \"README\" \(5167 characters\)
- sed "s/^X//" >README <<'END_OF_README'
- X - INTRODUCTION -
- X
- XThis directory is the root directory for the Software ChipSet, a collection
- Xof reusable software components. See the file named "ChipSet" in this
- Xdirectory for additional information regarding the Software ChipSet's goals
- Xand capabilities.
- X
- XThe src directory contains additional directories containing source code for
- Xeach of the components. Each component has its own "README" file to describe
- Xits capabilities and limitations.
- X
- XThe Makefile installs the components into a staging area that is specified
- Xas a configuration option, and then installs the result into the system's
- Xinstall area (e.g. /usr/local). Please see the file named "BUILD" in this
- Xdirectory for a detailed description of the build scaffolding.
- X
- X
- X - UNPACKING INSTRUCTIONS -
- X
- XThe Software ChipSet is distributed in a number of ways. Following are
- Xthe unpacking instructions for each of the distribution media on Unix
- Xsystems.
- X
- X-- SHAR --
- X
- XSoftware ChipSet is distributed in several numbered shell archive files that
- Xunpack themselves when executed by the Bourne Shell. The naming convention
- Xfor the archives is "ChipSet.partxx" where "xx" is a two-digit number pad-
- Xded with leading zeros. To unpack the archives, follow these steps:
- X
- X1. Edit each file to verify that the first line contains the text
- X "#! /bin/sh", removing anything preceding that line if necessary.
- X If this line is missing, then the archive file is corrupt and must
- X be replaced.
- X2. Verify that each file contains a line with the text "exit 0". This
- X should be near the end of the archive. If this line is missing, then
- X the archive is corrupt and must be replaced.
- X3. Invoke the archives as Bourne Shell scripts. This can be done by
- X invoking the following command sequence in the C Shell:
- X
- X foreach x ( `/bin/ls ChipSet.part* | /bin/sort` )
- X echo Unpacking $x
- X sh $x
- X end
- X
- X To unpack the archive files using the Bourne or Korn shells, invoke
- X the following command sequence:
- X
- X for x in `/bin/ls ChipSet.part* | /bin/sort`
- X do
- X echo Unpacking $x
- X sh $x
- X done
- X
- X
- X-- CPIO --
- X
- XSoftware ChipSet is distributed in portable cpio archive files, which may
- Xhave been compressed. The name of the archive is ChipSet.cpio or
- XChipSet.cpio.Z by convention. An archive named ChipSet.cpio can be unpacked
- Xby invoking the following command:
- X
- X cpio -icdv < ChipSet.cpio
- X
- XAn archive named ChipSet.cpio.Z can be unpacked by invoking the following
- Xcommand:
- X
- X zcat ChipSet.cpio.Z | cpio -icdv
- X
- X
- X-- TAR --
- X
- XSoftware ChipSet is distributed in "tar" archives, which may have been
- Xcompressed. The name of the archive is ChipSet.tar or ChipSet.tar.Z by
- Xconvention. An archive named ChipSet.tar can be unpacked by invoking the
- Xfollowing command:
- X
- X tar xvfo ChipSet.tar
- X
- XAn archive named ChipSet.tar.Z can be unpacked by invoking the following
- Xcommand:
- X
- X zcat ChipSet.tar.Z | tar xvfo -
- X
- X
- X-- ZIP --
- X
- XSoftware ChipSet is distributed in "zip" archives. The name of the archive
- Xis ChipSet.zip by convention. To unpack the archive, invoke the following
- Xcommand:
- X
- X unzip ChipSet.zip
- X
- X
- X
- X - BUILD INSTRUCTIONS -
- X
- XAfter unpacking the distribution archives, you may wish to verify the
- Xinstallation. To do this, invoke the following command:
- X
- X make verify
- X
- XThis will verify that all of the source files required to build the Software
- XChipSet are present.
- X
- XNext, you must configure the build procedures in this directory as needed for
- Xyour system. The common.mk file will need changes, as it is used all of the
- Xmakefiles included with the Software ChipSet. Each of the configurable macros
- Xand rules are clearly documented there, with suggestions for how to change
- Xthem.
- X
- XYou must create the directory pointed to by the STAGE macro in the common.mk
- Xfile. If the STAGEINC, STAGELIB, STAGEMAN, STAGETMP, or STAGEINST macros
- Xwere changed from their default values, it would be a good idea to create
- Xthose directories as well.
- X
- XNext, do a "make all" to build the components and install them in a staging
- Xarea where additional testing and inspection can be done if desired.
- X
- XEach of the components has a test program. These can be run by doing
- Xa "make test" in this directory. This builds all of the test cases and
- Xruns them, and gives a pass/fail indication for each test and for the
- Xentire suite. Output from each test is appended to the file test.out
- Xin the tmp directory of the staging area. Each test program is
- Xalso self-contained, and may be run in the directory in which it resides.
- X
- XPerform a "make -n install" to verify the steps that will be taken by the
- Xinstallation process. If they are correct for your system, perform a
- X"make install". This may require super-user access due to file permissions.
- XThis step places the library, public header files, and documentation in
- Xthe appropriate place on a live system for general use.
- X
- XAfter installing the components, you may clean up the occupied disk space
- Xby doing a "make clean" or "make clobber". Making "clean" removes all of
- Xthe derived files except for the final product. Making "clobber" cleans all
- Xof the derived files, including the final product.
- END_OF_README
- if test 5167 -ne `wc -c <README`; then
- echo shar: \"README\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f patchlevel.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"patchlevel.h\"
- else
- echo shar: Extracting \"patchlevel.h\" \(449 characters\)
- sed "s/^X//" >patchlevel.h <<'END_OF_patchlevel.h'
- X/*
- X * patchlevel.h -- This file contains the patchlevel of the install tools
- X * for the Software ChipSet. It is unused by the tools.
- X */
- X
- X/* This file is part of a suite of programs called Software Chipset. */
- X/* The source code for Software Chipset has been released into the */
- X/* public domain by its author, Paul Sander. */
- X
- X#define name "installTools"
- X#define patchlevel "1.1"
- X
- X/*** End of File ***/
- X
- END_OF_patchlevel.h
- if test 449 -ne `wc -c <patchlevel.h`; then
- echo shar: \"patchlevel.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test ! -d src ; then
- echo shar: Creating directory \"src\"
- mkdir src
- fi
- if test ! -d src/btree ; then
- echo shar: Creating directory \"src/btree\"
- mkdir src/btree
- fi
- if test -f src/btree/MANIFEST -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/btree/MANIFEST\"
- else
- echo shar: Extracting \"src/btree/MANIFEST\" \(248 characters\)
- sed "s/^X//" >src/btree/MANIFEST <<'END_OF_src/btree/MANIFEST'
- XMANIFEST
- XMakefile
- XREADME
- Xbt_last.c
- Xbt_next.c
- Xbt_prev.c
- Xbtdata.c
- Xbtdelete.c
- Xbtdelrank.c
- Xbtdelutl.c
- Xbtdestroy.c
- Xbtdump.c
- Xbtfirst.c
- Xbtinsert.c
- Xbtmalloc.c
- Xbtnew.c
- Xbtpriv.h
- Xbtrank.c
- Xbtree.h
- Xbtree.man
- Xbtsearch.c
- Xbttraverse.c
- Xbtutil.c
- Xpatchlevel.h
- Xtest.c
- END_OF_src/btree/MANIFEST
- if test 248 -ne `wc -c <src/btree/MANIFEST`; then
- echo shar: \"src/btree/MANIFEST\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/btree/patchlevel.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/btree/patchlevel.h\"
- else
- echo shar: Extracting \"src/btree/patchlevel.h\" \(416 characters\)
- sed "s/^X//" >src/btree/patchlevel.h <<'END_OF_src/btree/patchlevel.h'
- X/*
- X * patchlevel.h -- This file contains the patchlevel of the in-memory
- X * B-tree implementation. It is unused by the component.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X */
- X
- X#define bt_name "btree"
- X#define bt_patchlevel "2.13"
- X
- X/*** End of File ***/
- X
- END_OF_src/btree/patchlevel.h
- if test 416 -ne `wc -c <src/btree/patchlevel.h`; then
- echo shar: \"src/btree/patchlevel.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test ! -d src/list ; then
- echo shar: Creating directory \"src/list\"
- mkdir src/list
- fi
- if test -f src/list/MANIFEST -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/MANIFEST\"
- else
- echo shar: Extracting \"src/list/MANIFEST\" \(356 characters\)
- sed "s/^X//" >src/list/MANIFEST <<'END_OF_src/list/MANIFEST'
- XREADME
- Xpatchlevel.h
- XMANIFEST
- XMakefile
- Xdldata.c
- Xdldelete.c
- Xdldelrank.c
- Xdldelutl.c
- Xdldestroy.c
- Xdldump.c
- Xdlfirst.c
- Xdlinsert.c
- Xdlinsutl.c
- Xdlist.h
- Xdlist.man
- Xdljoin.c
- Xdllast.c
- Xdlnew.c
- Xdlnext.c
- Xdlpeek.c
- Xdlpeekf.c
- Xdlpeekr.c
- Xdlpop.c
- Xdlpopf.c
- Xdlpopr.c
- Xdlprev.c
- Xdlpriv.h
- Xdlpush.c
- Xdlpushf.c
- Xdlpushr.c
- Xdlrank.c
- Xdlrankutl.c
- Xdlsearch.c
- Xdlsetup.c
- Xdltrav.c
- Xdlutil.c
- Xtest.c
- END_OF_src/list/MANIFEST
- if test 356 -ne `wc -c <src/list/MANIFEST`; then
- echo shar: \"src/list/MANIFEST\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dldelutl.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dldelutl.c\"
- else
- echo shar: Extracting \"src/list/dldelutl.c\" \(1260 characters\)
- sed "s/^X//" >src/list/dldelutl.c <<'END_OF_src/list/dldelutl.c'
- X/******************************************************************
- X *
- X * dldelutl.c -- This file contains utilities related to deletion
- X * from doubly-linked lists.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X ******************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/******************************************************************
- X *
- X * dll_freeNode -- This function frees a list node.
- X *
- X ******************************************************************/
- X
- X#ifdef __STDC__
- Xvoid dll_freeNode(NODE *node)
- X#else
- Xvoid dll_freeNode(node)
- XNODE *node;
- X#endif
- X{
- X COVER("dldelutl.c",1);
- X free(node);
- X return;
- X}
- X
- X/******************************************************************
- X *
- X * dll_unlink -- This function unlinks a node from a list.
- X *
- X ******************************************************************/
- X
- X#ifdef __STDC__
- Xvoid dll_unlink(NODE *node)
- X#else
- Xvoid dll_unlink(node)
- XNODE *node;
- X#endif
- X{
- X COVER("dldelutl.c",2);
- X node->prev->next = node->next;
- X node->next->prev = node->prev;
- X return;
- X}
- X
- X/************** End of file ************/
- X
- END_OF_src/list/dldelutl.c
- if test 1260 -ne `wc -c <src/list/dldelutl.c`; then
- echo shar: \"src/list/dldelutl.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dlfirst.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dlfirst.c\"
- else
- echo shar: Extracting \"src/list/dlfirst.c\" \(1404 characters\)
- sed "s/^X//" >src/list/dlfirst.c <<'END_OF_src/list/dlfirst.c'
- X/**********************************************************************
- X *
- X * dlfirst.c -- This file contains the dll_first function.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X **********************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/**********************************************************************
- X *
- X * dll_first -- This function returns the first key stored in the list.
- X * If the list is sorted, the key returned is the lowest
- X * key in the lexical order of those keys stored in the list.
- X *
- X **********************************************************************/
- X
- X#ifdef __STDC__
- Xvoid *dll_first(DL_LIST plist, void **data)
- X#else
- Xvoid *dll_first(plist,data)
- XDL_LIST plist;
- Xvoid **data;
- X#endif
- X{
- X LIST *list;
- X
- X COVER("dlfirst.c",1);
- X list = (LIST*) plist;
- X if (list == NULL)
- X {
- X COVER("dlfirst.c",2);
- X return NULL;
- X }
- X if (list->last == NULL)
- X {
- X COVER("dlfirst.c",3);
- X return NULL;
- X }
- X COVER("dlfirst.c",4);
- X list->current = list->last->next;
- X list->nextOk = 0;
- X list->changed = 0;
- X if (data != NULL)
- X {
- X COVER("dlfirst.c",5);
- X *data = list->current->data;
- X }
- X COVER("dlfirst.c",6);
- X return list->current->key;
- X}
- X
- X/************ End of file **************/
- X
- END_OF_src/list/dlfirst.c
- if test 1404 -ne `wc -c <src/list/dlfirst.c`; then
- echo shar: \"src/list/dlfirst.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dllast.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dllast.c\"
- else
- echo shar: Extracting \"src/list/dllast.c\" \(1360 characters\)
- sed "s/^X//" >src/list/dllast.c <<'END_OF_src/list/dllast.c'
- X/**********************************************************************
- X *
- X * dllast.c -- This file contains the dll_last function.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X **********************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/**********************************************************************
- X *
- X * dll_last-- This function returns the last key stored in the list.
- X * If the list is sorted, the key returned is the highest
- X * key in the lexical order of those keys stored in the list.
- X *
- X **********************************************************************/
- X
- X#ifdef __STDC__
- Xvoid *dll_last(DL_LIST plist, void **data)
- X#else
- Xvoid *dll_last(plist,data)
- XDL_LIST plist;
- Xvoid **data;
- X#endif
- X{
- X LIST *list;
- X
- X COVER("dllast.c",1);
- X list = (LIST*) plist;
- X if (list == NULL)
- X {
- X COVER("dllast.c",2);
- X return NULL;
- X }
- X if (list->last == NULL)
- X {
- X COVER("dllast.c",3);
- X return NULL;
- X }
- X COVER("dllast.c",4);
- X list->current = list->last;
- X list->nextOk = 0;
- X list->changed = 0;
- X if (data != NULL)
- X {
- X COVER("dllast.c",5);
- X *data = list->current->data;
- X }
- X return list->current->key;
- X}
- X
- X/************ End of file **************/
- X
- END_OF_src/list/dllast.c
- if test 1360 -ne `wc -c <src/list/dllast.c`; then
- echo shar: \"src/list/dllast.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dlnew.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dlnew.c\"
- else
- echo shar: Extracting \"src/list/dlnew.c\" \(1344 characters\)
- sed "s/^X//" >src/list/dlnew.c <<'END_OF_src/list/dlnew.c'
- X/************************************************************************
- X *
- X * dlnew.c -- This file contains routines needed for creating
- X * doubly-linked lists.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X ************************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/************************************************************************
- X *
- X * dll_new -- Given a SETUP structure, this function creates an empty
- X * doubly-linked list.
- X *
- X ************************************************************************/
- X
- X#ifdef __STDC__
- XDL_LIST dll_new(DLL_SETUP psetup)
- X#else
- XDL_LIST dll_new(psetup)
- XDLL_SETUP psetup;
- X#endif
- X{
- X LIST *retval;
- X SETUP *setup;
- X
- X COVER("dlnew.c",1);
- X if (psetup == NULL)
- X {
- X COVER("dlnew.c",2);
- X return NULL;
- X }
- X setup = (SETUP*) psetup;
- X retval = (LIST*) malloc(sizeof(LIST));
- X if (retval != NULL)
- X {
- X COVER("dlnew.c",3);
- X retval->last = NULL;
- X retval->current = NULL;
- X retval->data = setup->data;
- X retval->comp = setup->comp;
- X retval->nextOk = 0;
- X retval->size = 0;
- X retval->changed = 0;
- X }
- X COVER("dlnew.c",4);
- X return (DL_LIST) retval;
- X}
- X
- X/************* End of file **************/
- X
- END_OF_src/list/dlnew.c
- if test 1344 -ne `wc -c <src/list/dlnew.c`; then
- echo shar: \"src/list/dlnew.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dlpeek.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dlpeek.c\"
- else
- echo shar: Extracting \"src/list/dlpeek.c\" \(1260 characters\)
- sed "s/^X//" >src/list/dlpeek.c <<'END_OF_src/list/dlpeek.c'
- X/*******************************************************************
- X *
- X * dlpeek.c -- This file contains the dll_peek function.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X *******************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/*******************************************************************
- X *
- X * dll_peek -- This function returns the key and data of the item
- X * at the specified end of a doubly-linked list. Subsequent
- X * calls to dll_next and dll_prev are not affected.
- X *
- X *******************************************************************/
- X
- X#ifdef __STDC__
- Xvoid *dll_peek(DL_LIST plist, int where, void **data)
- X#else
- Xvoid *dll_peek(plist,where,data)
- XDL_LIST plist;
- Xint where;
- Xvoid **data;
- X#endif
- X{
- X void *retval;
- X
- X switch (where)
- X {
- Xcase DLL_FRONT:
- X COVER("dlpeek.c",1);
- X retval = dll_peekf(plist,data);
- X break;
- X
- Xcase DLL_BACK:
- X COVER("dlpeek.c",2);
- X retval = dll_peekr(plist,data);
- X break;
- X
- Xdefault:
- X COVER("dlpeek.c",3);
- X retval = NULL;
- X break;
- X }
- X return retval;
- X}
- X
- X/*************** End of file **************/
- X
- END_OF_src/list/dlpeek.c
- if test 1260 -ne `wc -c <src/list/dlpeek.c`; then
- echo shar: \"src/list/dlpeek.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dlpeekf.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dlpeekf.c\"
- else
- echo shar: Extracting \"src/list/dlpeekf.c\" \(1374 characters\)
- sed "s/^X//" >src/list/dlpeekf.c <<'END_OF_src/list/dlpeekf.c'
- X/*********************************************************************
- X *
- X * dlpeekf.c -- This file contains the dll_peekf function.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X *********************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/*********************************************************************
- X *
- X * dll_peekf -- This function returns the key and data of the item
- X * at the head of a doubly linked list. It behaves
- X * similarly to dll_first, except that subsequent calls
- X * to dll_next and dll_prev are not affected.
- X *
- X *********************************************************************/
- X
- X#ifdef __STDC__
- Xvoid *dll_peekf(DL_LIST plist, void **data)
- X#else
- Xvoid *dll_peekf(plist,data)
- XDL_LIST plist;
- Xvoid **data;
- X#endif
- X{
- X LIST *list;
- X NODE *node;
- X
- X COVER("dlpeekf.c",1);
- X if (plist == NULL)
- X {
- X COVER("dlpeekf.c",2);
- X return NULL;
- X }
- X list = (LIST*) plist;
- X if (list->last == NULL)
- X {
- X COVER("dlpeekf.c",3);
- X return NULL;
- X }
- X
- X node = list->last->next;
- X if (data != NULL)
- X {
- X COVER("dlpeekf.c",4);
- X *data = node->data;
- X }
- X COVER("dlpeekf.c",5);
- X return node->key;
- X}
- X
- X/**************** End of file ***************/
- X
- END_OF_src/list/dlpeekf.c
- if test 1374 -ne `wc -c <src/list/dlpeekf.c`; then
- echo shar: \"src/list/dlpeekf.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dlpeekr.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dlpeekr.c\"
- else
- echo shar: Extracting \"src/list/dlpeekr.c\" \(1365 characters\)
- sed "s/^X//" >src/list/dlpeekr.c <<'END_OF_src/list/dlpeekr.c'
- X/*********************************************************************
- X *
- X * dlpeekr.c -- This file contains the dll_peekr function.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X *********************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/*********************************************************************
- X *
- X * dll_peekr -- This function returns the key and data of the item
- X * at the end of a doubly linked list. It behaves
- X * similarly to dll_last, except that subsequent calls
- X * to dll_next and dll_prev are not affected.
- X *
- X *********************************************************************/
- X
- X#ifdef __STDC__
- Xvoid *dll_peekr(DL_LIST plist, void**data)
- X#else
- Xvoid *dll_peekr(plist,data)
- XDL_LIST plist;
- Xvoid **data;
- X#endif
- X{
- X LIST *list;
- X NODE *node;
- X
- X COVER("dlpeekr.c",1);
- X if (plist == NULL)
- X {
- X COVER("dlpeekr.c",2);
- X return NULL;
- X }
- X list = (LIST*) plist;
- X if (list->last == NULL)
- X {
- X COVER("dlpeekr.c",3);
- X return NULL;
- X }
- X
- X node = list->last;
- X if (data != NULL)
- X {
- X COVER("dlpeekr.c",4);
- X *data = node->data;
- X }
- X COVER("dlpeekr.c",5);
- X return node->key;
- X}
- X
- X/**************** End of file ***************/
- X
- END_OF_src/list/dlpeekr.c
- if test 1365 -ne `wc -c <src/list/dlpeekr.c`; then
- echo shar: \"src/list/dlpeekr.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dlpop.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dlpop.c\"
- else
- echo shar: Extracting \"src/list/dlpop.c\" \(1152 characters\)
- sed "s/^X//" >src/list/dlpop.c <<'END_OF_src/list/dlpop.c'
- X/*******************************************************************
- X *
- X * dlpop.c -- This file contains the dll_pop function.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X *******************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/*******************************************************************
- X *
- X * dll_pop -- This function removes an item from a doubly-linked
- X * list at a specified end.
- X *
- X *******************************************************************/
- X
- X#ifdef __STDC__
- Xvoid *dll_pop(DL_LIST plist, int where, void **data)
- X#else
- Xvoid *dll_pop(plist,where,data)
- XDL_LIST plist;
- Xint where;
- Xvoid **data;
- X#endif
- X{
- X void *retval;
- X
- X switch (where)
- X {
- Xcase DLL_FRONT:
- X COVER("dlpop.c",1);
- X retval = dll_popf(plist,data);
- X break;
- X
- Xcase DLL_BACK:
- X COVER("dlpop.c",2);
- X retval = dll_popr(plist,data);
- X break;
- X
- Xdefault:
- X COVER("dlpop.c",3);
- X retval = NULL;
- X break;
- X }
- X return retval;
- X}
- X
- X/*************** End of file **************/
- X
- END_OF_src/list/dlpop.c
- if test 1152 -ne `wc -c <src/list/dlpop.c`; then
- echo shar: \"src/list/dlpop.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dlpopr.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dlpopr.c\"
- else
- echo shar: Extracting \"src/list/dlpopr.c\" \(1173 characters\)
- sed "s/^X//" >src/list/dlpopr.c <<'END_OF_src/list/dlpopr.c'
- X/***********************************************************************
- X *
- X * dlpopr.c -- This file contains the dll_popr function.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X ***********************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/***********************************************************************
- X *
- X * dll_popr -- This function deletes an item from the rear of a
- X * doubly-linked list.
- X *
- X ***********************************************************************/
- X
- X#ifdef __STDC__
- Xvoid *dll_popr(DL_LIST plist, void **data)
- X#else
- Xvoid *dll_popr(plist,data)
- XDL_LIST plist;
- Xvoid **data;
- X#endif
- X{
- X LIST *list;
- X NODE *node;
- X void *retval;
- X
- X COVER("dlpopr.c",1);
- X if (plist == NULL)
- X {
- X COVER("dlpopr.c",2);
- X return NULL;
- X }
- X list = (LIST*) plist;
- X if (list->last == NULL)
- X {
- X COVER("dlpopr.c",3);
- X return NULL;
- X }
- X
- X COVER("dlpopr.c",4);
- X list->last = list->last->prev;
- X return dll_popf(plist,data);
- X}
- X
- X/*************** End of file ***************/
- X
- END_OF_src/list/dlpopr.c
- if test 1173 -ne `wc -c <src/list/dlpopr.c`; then
- echo shar: \"src/list/dlpopr.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dlpush.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dlpush.c\"
- else
- echo shar: Extracting \"src/list/dlpush.c\" \(1129 characters\)
- sed "s/^X//" >src/list/dlpush.c <<'END_OF_src/list/dlpush.c'
- X/*******************************************************************
- X *
- X * dlpush.c -- This file contains the dll_push function.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X *******************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/*******************************************************************
- X *
- X * dll_push -- This function pushes an item onto a doubly-linked
- X * list at a specified end.
- X *
- X *******************************************************************/
- X
- X#ifdef __STDC__
- Xvoid *dll_push(DL_LIST plist, int where, void *key, void *data)
- X#else
- Xvoid *dll_push(plist,where,key,data)
- XDL_LIST plist;
- Xint where;
- Xvoid *key;
- Xvoid *data;
- X#endif
- X{
- X switch (where)
- X {
- Xcase DLL_FRONT:
- X COVER("dlpush.c",1);
- X return dll_pushf(plist,key,data);
- X
- Xcase DLL_BACK:
- X COVER("dlpush.c",2);
- X return dll_pushr(plist,key,data);
- X
- Xdefault:
- X COVER("dlpush.c",3);
- X return NULL;
- X }
- X}
- X
- X/*************** End of file **************/
- X
- END_OF_src/list/dlpush.c
- if test 1129 -ne `wc -c <src/list/dlpush.c`; then
- echo shar: \"src/list/dlpush.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dlpushf.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dlpushf.c\"
- else
- echo shar: Extracting \"src/list/dlpushf.c\" \(1370 characters\)
- sed "s/^X//" >src/list/dlpushf.c <<'END_OF_src/list/dlpushf.c'
- X/*********************************************************************
- X *
- X * dlpushf.c -- This file contains the dll_pushf function.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X *********************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/*********************************************************************
- X *
- X * dll_pushf -- This function pushes an item onto the front of an
- X * unordered doubly-linked list.
- X *
- X *********************************************************************/
- X
- X#ifdef __STDC__
- Xvoid *dll_pushf(DL_LIST plist, void *key, void *data)
- X#else
- Xvoid *dll_pushf(plist,key,data)
- XDL_LIST plist;
- Xvoid *key;
- Xvoid *data;
- X#endif
- X{
- X LIST *list;
- X NODE *node;
- X
- X COVER("dlpushf.c",1);
- X if (plist == NULL)
- X {
- X COVER("dlpushf.c",2);
- X return NULL;
- X }
- X list = (LIST*) plist;
- X
- X node = dll_newNode(key,data);
- X if (node == NULL)
- X {
- X COVER("dlpushf.c",3);
- X return NULL;
- X }
- X
- X if (list->last != NULL)
- X {
- X COVER("dlpushf.c",4);
- X dll_store(list->last,node);
- X }
- X else
- X {
- X COVER("dlpushf.c",5);
- X list->last = node;
- X node->next = node;
- X node->prev = node;
- X }
- X list->size += 1;
- X dll_touch(list);
- X return key;
- X}
- X
- X/*************** End of file ****************/
- X
- END_OF_src/list/dlpushf.c
- if test 1370 -ne `wc -c <src/list/dlpushf.c`; then
- echo shar: \"src/list/dlpushf.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dlpushr.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dlpushr.c\"
- else
- echo shar: Extracting \"src/list/dlpushr.c\" \(1367 characters\)
- sed "s/^X//" >src/list/dlpushr.c <<'END_OF_src/list/dlpushr.c'
- X/*********************************************************************
- X *
- X * dlpushr.c -- This file contains the dll_pushr function.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X *********************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/*********************************************************************
- X *
- X * dll_pushr -- This function pushes an item onto the rear of an
- X * unordered doubly-linked list.
- X *
- X *********************************************************************/
- X
- X#ifdef __STDC__
- Xvoid *dll_pushr(DL_LIST plist, void *key, void *data)
- X#else
- Xvoid *dll_pushr(plist,key,data)
- XDL_LIST plist;
- Xvoid *key;
- Xvoid *data;
- X#endif
- X{
- X LIST *list;
- X NODE *node;
- X
- X COVER("dlpushr.c",1);
- X if (plist == NULL)
- X {
- X COVER("dlpushr.c",1);
- X return NULL;
- X }
- X list = (LIST*) plist;
- X
- X node = dll_newNode(key,data);
- X if (node == NULL)
- X {
- X COVER("dlpushr.c",2);
- X return NULL;
- X }
- X if (list->last != NULL)
- X {
- X COVER("dlpushr.c",3);
- X dll_store(list->last,node);
- X }
- X else
- X {
- X COVER("dlpushr.c",4);
- X node->next = node;
- X node->prev = node;
- X }
- X list->last = node;
- X list->size += 1;
- X dll_touch(list);
- X return key;
- X}
- X
- X/*************** End of file ****************/
- X
- END_OF_src/list/dlpushr.c
- if test 1367 -ne `wc -c <src/list/dlpushr.c`; then
- echo shar: \"src/list/dlpushr.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/dlrankutl.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/dlrankutl.c\"
- else
- echo shar: Extracting \"src/list/dlrankutl.c\" \(1043 characters\)
- sed "s/^X//" >src/list/dlrankutl.c <<'END_OF_src/list/dlrankutl.c'
- X/*********************************************************************
- X *
- X * dlrankutl.c -- This file contains utility functions for accessing
- X * the contents of a list by rank.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X *********************************************************************/
- X
- X#include <stdio.h>
- X#include "dlpriv.h"
- X
- X/*********************************************************************
- X *
- X * dll_locRank -- This function locates a node in a list by rank.
- X *
- X *********************************************************************/
- X
- X#ifdef __STDC__
- XNODE *dll_locRank(LIST *list, int rank)
- X#else
- XNODE *dll_locRank(list,rank)
- XLIST *list;
- Xint rank;
- X#endif
- X{
- X NODE *node;
- X
- X COVER("dlrankutl.c",1);
- X node = list->last->next;
- X while (rank > 0)
- X {
- X COVER("dlrankutl.c",2);
- X node = node->next;
- X rank--;
- X }
- X return node;
- X}
- X
- X/**************** End of file ***************/
- X
- END_OF_src/list/dlrankutl.c
- if test 1043 -ne `wc -c <src/list/dlrankutl.c`; then
- echo shar: \"src/list/dlrankutl.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f src/list/patchlevel.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"src/list/patchlevel.h\"
- else
- echo shar: Extracting \"src/list/patchlevel.h\" \(420 characters\)
- sed "s/^X//" >src/list/patchlevel.h <<'END_OF_src/list/patchlevel.h'
- X/*
- X * patchlevel.h -- This file contains the patchlevel of the doubly-linked
- X * list implementation. It is unused by the component.
- X *
- X * This file is part of a suite of programs called Software Chipset.
- X * The source code for Software Chipset has been released into the
- X * public domain by its author, Paul Sander.
- X *
- X */
- X
- X#define dll_name "dlist"
- X#define dll_patchlevel "1.03"
- X
- X/*** End of File ***/
- X
- END_OF_src/list/patchlevel.h
- if test 420 -ne `wc -c <src/list/patchlevel.h`; then
- echo shar: \"src/list/patchlevel.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- echo shar: End of archive 1 \(of 10\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 10 archives.
- echo "Now edit common.mk and do a 'make all'"
- 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
-
-