home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / reviewed / volume03 / chipset2 / 01 < prev    next >
Encoding:
Text File  |  1993-03-13  |  34.1 KB  |  1,240 lines

  1. From decwrl!athertn!sander.cupertino.ca.us!paul@cs.purdue.edu Wed Jan  6 13:52:33 EST 1993
  2. Submit chipset-2 01/10 
  3. #! /bin/sh
  4. # This is a shell archive.  Remove anything before this line, then unpack
  5. # it by saving it into a file and typing "sh file".  To overwrite existing
  6. # files, type "sh file -c".  You can also feed this as standard input via
  7. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  8. # will see the following message at the end:
  9. #        "End of archive 1 (of 10)."
  10. # Contents:  MANIFEST README patchlevel.h src src/btree
  11. #   src/btree/MANIFEST src/btree/patchlevel.h src/list
  12. #   src/list/MANIFEST src/list/dldelutl.c src/list/dlfirst.c
  13. #   src/list/dllast.c src/list/dlnew.c src/list/dlpeek.c
  14. #   src/list/dlpeekf.c src/list/dlpeekr.c src/list/dlpop.c
  15. #   src/list/dlpopr.c src/list/dlpush.c src/list/dlpushf.c
  16. #   src/list/dlpushr.c src/list/dlrankutl.c src/list/patchlevel.h
  17. # Wrapped by paul@sander on Sun Nov 22 15:41:46 1992
  18. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  19. if test -f MANIFEST -a "${1}" != "-c" ; then 
  20.   echo shar: Will not over-write existing file \"MANIFEST\"
  21. else
  22. echo shar: Extracting \"MANIFEST\" \(65 characters\)
  23. sed "s/^X//" >MANIFEST <<'END_OF_MANIFEST'
  24. XChipSet
  25. XMANIFEST
  26. XREADME
  27. Xpatchlevel.h
  28. XMakefile
  29. Xcommon.mk
  30. Xrules.mk
  31. END_OF_MANIFEST
  32. if test 65 -ne `wc -c <MANIFEST`; then
  33.     echo shar: \"MANIFEST\" unpacked with wrong size!
  34. fi
  35. # end of overwriting check
  36. fi
  37. if test -f README -a "${1}" != "-c" ; then 
  38.   echo shar: Will not over-write existing file \"README\"
  39. else
  40. echo shar: Extracting \"README\" \(5167 characters\)
  41. sed "s/^X//" >README <<'END_OF_README'
  42. X                                - INTRODUCTION -
  43. X
  44. XThis directory is the root directory for the Software ChipSet, a collection
  45. Xof reusable software components.  See the file named "ChipSet" in this
  46. Xdirectory for additional information regarding the Software ChipSet's goals
  47. Xand capabilities.
  48. X
  49. XThe src directory contains additional directories containing source code for
  50. Xeach of the components.  Each component has its own "README" file to describe
  51. Xits capabilities and limitations.
  52. X
  53. XThe Makefile installs the components into a staging area that is specified
  54. Xas a configuration option, and then installs the result into the system's
  55. Xinstall area (e.g. /usr/local).  Please see the file named "BUILD" in this
  56. Xdirectory for a detailed description of the build scaffolding.
  57. X
  58. X
  59. X                           - UNPACKING INSTRUCTIONS -
  60. X
  61. XThe Software ChipSet is distributed in a number of ways.  Following are
  62. Xthe unpacking instructions for each of the distribution media on Unix
  63. Xsystems.
  64. X
  65. X-- SHAR --
  66. X
  67. XSoftware ChipSet is distributed in several numbered shell archive files that
  68. Xunpack themselves when executed by the Bourne Shell.  The naming convention
  69. Xfor the archives is "ChipSet.partxx" where "xx" is a two-digit number pad-
  70. Xded with leading zeros.  To unpack the archives, follow these steps:
  71. X
  72. X1.  Edit each file to verify that the first line contains the text
  73. X    "#! /bin/sh", removing anything preceding that line if necessary.
  74. X    If this line is missing, then the archive file is corrupt and must
  75. X    be replaced.
  76. X2.  Verify that each file contains a line with the text "exit 0".  This
  77. X    should be near the end of the archive.  If this line is missing, then
  78. X    the archive is corrupt and must be replaced.
  79. X3.  Invoke the archives as Bourne Shell scripts.  This can be done by
  80. X    invoking the following command sequence in the C Shell:
  81. X
  82. X    foreach x ( `/bin/ls ChipSet.part* | /bin/sort` )
  83. X    echo Unpacking $x
  84. X    sh $x
  85. X    end
  86. X
  87. X    To unpack the archive files using the Bourne or Korn shells, invoke
  88. X    the following command sequence:
  89. X
  90. X    for x in `/bin/ls ChipSet.part* | /bin/sort`
  91. X    do
  92. X    echo Unpacking $x
  93. X    sh $x
  94. X    done
  95. X
  96. X
  97. X-- CPIO --
  98. X
  99. XSoftware ChipSet is distributed in portable cpio archive files, which may
  100. Xhave been compressed.  The name of the archive is ChipSet.cpio or
  101. XChipSet.cpio.Z by convention.  An archive named ChipSet.cpio can be unpacked
  102. Xby invoking the following command:
  103. X
  104. X    cpio -icdv < ChipSet.cpio
  105. X
  106. XAn archive named ChipSet.cpio.Z can be unpacked by invoking the following
  107. Xcommand:
  108. X
  109. X    zcat ChipSet.cpio.Z | cpio -icdv
  110. X
  111. X
  112. X-- TAR --
  113. X
  114. XSoftware ChipSet is distributed in "tar" archives, which may have been
  115. Xcompressed.  The name of the archive is ChipSet.tar or ChipSet.tar.Z by
  116. Xconvention.  An archive named ChipSet.tar can be unpacked by invoking the
  117. Xfollowing command:
  118. X
  119. X    tar xvfo ChipSet.tar
  120. X
  121. XAn archive named ChipSet.tar.Z can be unpacked by invoking the following
  122. Xcommand:
  123. X
  124. X    zcat ChipSet.tar.Z | tar xvfo -
  125. X
  126. X
  127. X-- ZIP --
  128. X
  129. XSoftware ChipSet is distributed in "zip" archives.  The name of the archive
  130. Xis ChipSet.zip by convention.  To unpack the archive, invoke the following
  131. Xcommand:
  132. X
  133. X    unzip ChipSet.zip
  134. X
  135. X
  136. X
  137. X                             - BUILD INSTRUCTIONS -
  138. X
  139. XAfter unpacking the distribution archives, you may wish to verify the
  140. Xinstallation.  To do this, invoke the following command:
  141. X
  142. X    make verify
  143. X
  144. XThis will verify that all of the source files required to build the Software
  145. XChipSet are present.
  146. X
  147. XNext, you must configure the build procedures in this directory as needed for
  148. Xyour system.  The common.mk file will need changes, as it is used all of the
  149. Xmakefiles included with the Software ChipSet.  Each of the configurable macros
  150. Xand rules are clearly documented there, with suggestions for how to change
  151. Xthem.
  152. X
  153. XYou must create the directory pointed to by the STAGE macro in the common.mk
  154. Xfile.  If the STAGEINC, STAGELIB, STAGEMAN, STAGETMP, or STAGEINST macros
  155. Xwere changed from their default values, it would be a good idea to create
  156. Xthose directories as well.
  157. X
  158. XNext, do a "make all" to build the components and install them in a staging
  159. Xarea where additional testing and inspection can be done if desired.
  160. X
  161. XEach of the components has a test program.  These can be run by doing
  162. Xa "make test" in this directory.  This builds all of the test cases and
  163. Xruns them, and gives a pass/fail indication for each test and for the
  164. Xentire suite.  Output from each test is appended to the file test.out
  165. Xin the tmp directory of the staging area.  Each test program is
  166. Xalso self-contained, and may be run in the directory in which it resides.
  167. X
  168. XPerform a "make -n install" to verify the steps that will be taken by the
  169. Xinstallation process.  If they are correct for your system, perform a
  170. X"make install".  This may require super-user access due to file permissions.
  171. XThis step places the library, public header files, and documentation in
  172. Xthe appropriate place on a live system for general use.
  173. X
  174. XAfter installing the components, you may clean up the occupied disk space
  175. Xby doing a "make clean" or "make clobber".  Making "clean" removes all of
  176. Xthe derived files except for the final product.  Making "clobber" cleans all
  177. Xof the derived files, including the final product.
  178. END_OF_README
  179. if test 5167 -ne `wc -c <README`; then
  180.     echo shar: \"README\" unpacked with wrong size!
  181. fi
  182. # end of overwriting check
  183. fi
  184. if test -f patchlevel.h -a "${1}" != "-c" ; then 
  185.   echo shar: Will not over-write existing file \"patchlevel.h\"
  186. else
  187. echo shar: Extracting \"patchlevel.h\" \(449 characters\)
  188. sed "s/^X//" >patchlevel.h <<'END_OF_patchlevel.h'
  189. X/*
  190. X * patchlevel.h -- This file contains the patchlevel of the install tools
  191. X *                 for the Software ChipSet.  It is unused by the tools.
  192. X */
  193. X
  194. X/* This file is part of a suite of programs called Software Chipset. */
  195. X/* The source code for Software Chipset has been released into the   */
  196. X/* public domain by its author, Paul Sander.                         */
  197. X
  198. X#define name "installTools"
  199. X#define patchlevel "1.1"
  200. X
  201. X/*** End of File ***/
  202. X
  203. END_OF_patchlevel.h
  204. if test 449 -ne `wc -c <patchlevel.h`; then
  205.     echo shar: \"patchlevel.h\" unpacked with wrong size!
  206. fi
  207. # end of overwriting check
  208. fi
  209. if test ! -d src ; then
  210.     echo shar: Creating directory \"src\"
  211.     mkdir src
  212. fi
  213. if test ! -d src/btree ; then
  214.     echo shar: Creating directory \"src/btree\"
  215.     mkdir src/btree
  216. fi
  217. if test -f src/btree/MANIFEST -a "${1}" != "-c" ; then 
  218.   echo shar: Will not over-write existing file \"src/btree/MANIFEST\"
  219. else
  220. echo shar: Extracting \"src/btree/MANIFEST\" \(248 characters\)
  221. sed "s/^X//" >src/btree/MANIFEST <<'END_OF_src/btree/MANIFEST'
  222. XMANIFEST
  223. XMakefile
  224. XREADME
  225. Xbt_last.c
  226. Xbt_next.c
  227. Xbt_prev.c
  228. Xbtdata.c
  229. Xbtdelete.c
  230. Xbtdelrank.c
  231. Xbtdelutl.c
  232. Xbtdestroy.c
  233. Xbtdump.c
  234. Xbtfirst.c
  235. Xbtinsert.c
  236. Xbtmalloc.c
  237. Xbtnew.c
  238. Xbtpriv.h
  239. Xbtrank.c
  240. Xbtree.h
  241. Xbtree.man
  242. Xbtsearch.c
  243. Xbttraverse.c
  244. Xbtutil.c
  245. Xpatchlevel.h
  246. Xtest.c
  247. END_OF_src/btree/MANIFEST
  248. if test 248 -ne `wc -c <src/btree/MANIFEST`; then
  249.     echo shar: \"src/btree/MANIFEST\" unpacked with wrong size!
  250. fi
  251. # end of overwriting check
  252. fi
  253. if test -f src/btree/patchlevel.h -a "${1}" != "-c" ; then 
  254.   echo shar: Will not over-write existing file \"src/btree/patchlevel.h\"
  255. else
  256. echo shar: Extracting \"src/btree/patchlevel.h\" \(416 characters\)
  257. sed "s/^X//" >src/btree/patchlevel.h <<'END_OF_src/btree/patchlevel.h'
  258. X/*
  259. X * patchlevel.h -- This file contains the patchlevel of the in-memory
  260. X *                 B-tree implementation.  It is unused by the component.
  261. X *
  262. X * This file is part of a suite of programs called Software Chipset.
  263. X * The source code for Software Chipset has been released into the
  264. X * public domain by its author, Paul Sander.
  265. X *
  266. X */
  267. X
  268. X#define bt_name "btree"
  269. X#define bt_patchlevel "2.13"
  270. X
  271. X/*** End of File ***/
  272. X
  273. END_OF_src/btree/patchlevel.h
  274. if test 416 -ne `wc -c <src/btree/patchlevel.h`; then
  275.     echo shar: \"src/btree/patchlevel.h\" unpacked with wrong size!
  276. fi
  277. # end of overwriting check
  278. fi
  279. if test ! -d src/list ; then
  280.     echo shar: Creating directory \"src/list\"
  281.     mkdir src/list
  282. fi
  283. if test -f src/list/MANIFEST -a "${1}" != "-c" ; then 
  284.   echo shar: Will not over-write existing file \"src/list/MANIFEST\"
  285. else
  286. echo shar: Extracting \"src/list/MANIFEST\" \(356 characters\)
  287. sed "s/^X//" >src/list/MANIFEST <<'END_OF_src/list/MANIFEST'
  288. XREADME
  289. Xpatchlevel.h
  290. XMANIFEST
  291. XMakefile
  292. Xdldata.c
  293. Xdldelete.c
  294. Xdldelrank.c
  295. Xdldelutl.c
  296. Xdldestroy.c
  297. Xdldump.c
  298. Xdlfirst.c
  299. Xdlinsert.c
  300. Xdlinsutl.c
  301. Xdlist.h
  302. Xdlist.man
  303. Xdljoin.c
  304. Xdllast.c
  305. Xdlnew.c
  306. Xdlnext.c
  307. Xdlpeek.c
  308. Xdlpeekf.c
  309. Xdlpeekr.c
  310. Xdlpop.c
  311. Xdlpopf.c
  312. Xdlpopr.c
  313. Xdlprev.c
  314. Xdlpriv.h
  315. Xdlpush.c
  316. Xdlpushf.c
  317. Xdlpushr.c
  318. Xdlrank.c
  319. Xdlrankutl.c
  320. Xdlsearch.c
  321. Xdlsetup.c
  322. Xdltrav.c
  323. Xdlutil.c
  324. Xtest.c
  325. END_OF_src/list/MANIFEST
  326. if test 356 -ne `wc -c <src/list/MANIFEST`; then
  327.     echo shar: \"src/list/MANIFEST\" unpacked with wrong size!
  328. fi
  329. # end of overwriting check
  330. fi
  331. if test -f src/list/dldelutl.c -a "${1}" != "-c" ; then 
  332.   echo shar: Will not over-write existing file \"src/list/dldelutl.c\"
  333. else
  334. echo shar: Extracting \"src/list/dldelutl.c\" \(1260 characters\)
  335. sed "s/^X//" >src/list/dldelutl.c <<'END_OF_src/list/dldelutl.c'
  336. X/******************************************************************
  337. X *
  338. X * dldelutl.c -- This file contains utilities related to deletion
  339. X *               from doubly-linked lists.
  340. X *
  341. X * This file is part of a suite of programs called Software Chipset.
  342. X * The source code for Software Chipset has been released into the
  343. X * public domain by its author, Paul Sander.
  344. X *
  345. X ******************************************************************/
  346. X
  347. X#include <stdio.h>
  348. X#include "dlpriv.h"
  349. X
  350. X/******************************************************************
  351. X *
  352. X * dll_freeNode -- This function frees a list node.
  353. X *
  354. X ******************************************************************/
  355. X
  356. X#ifdef __STDC__
  357. Xvoid dll_freeNode(NODE *node)
  358. X#else
  359. Xvoid dll_freeNode(node)
  360. XNODE    *node;
  361. X#endif
  362. X{
  363. X    COVER("dldelutl.c",1);
  364. X    free(node);
  365. X    return;
  366. X}
  367. X
  368. X/******************************************************************
  369. X *
  370. X * dll_unlink -- This function unlinks a node from a list.
  371. X *
  372. X ******************************************************************/
  373. X
  374. X#ifdef __STDC__
  375. Xvoid dll_unlink(NODE *node)
  376. X#else
  377. Xvoid dll_unlink(node)
  378. XNODE    *node;
  379. X#endif
  380. X{
  381. X    COVER("dldelutl.c",2);
  382. X    node->prev->next = node->next;
  383. X    node->next->prev = node->prev;
  384. X    return;
  385. X}
  386. X
  387. X/************** End of file ************/
  388. X
  389. END_OF_src/list/dldelutl.c
  390. if test 1260 -ne `wc -c <src/list/dldelutl.c`; then
  391.     echo shar: \"src/list/dldelutl.c\" unpacked with wrong size!
  392. fi
  393. # end of overwriting check
  394. fi
  395. if test -f src/list/dlfirst.c -a "${1}" != "-c" ; then 
  396.   echo shar: Will not over-write existing file \"src/list/dlfirst.c\"
  397. else
  398. echo shar: Extracting \"src/list/dlfirst.c\" \(1404 characters\)
  399. sed "s/^X//" >src/list/dlfirst.c <<'END_OF_src/list/dlfirst.c'
  400. X/**********************************************************************
  401. X *
  402. X * dlfirst.c -- This file contains the dll_first function.
  403. X *
  404. X * This file is part of a suite of programs called Software Chipset.
  405. X * The source code for Software Chipset has been released into the
  406. X * public domain by its author, Paul Sander.
  407. X *
  408. X **********************************************************************/
  409. X
  410. X#include <stdio.h>
  411. X#include "dlpriv.h"
  412. X
  413. X/**********************************************************************
  414. X *
  415. X * dll_first -- This function returns the first key stored in the list.
  416. X *              If the list is sorted, the key returned is the lowest
  417. X *              key in the lexical order of those keys stored in the list.
  418. X *
  419. X **********************************************************************/
  420. X
  421. X#ifdef __STDC__
  422. Xvoid *dll_first(DL_LIST plist, void **data)
  423. X#else
  424. Xvoid *dll_first(plist,data)
  425. XDL_LIST    plist;
  426. Xvoid    **data;
  427. X#endif
  428. X{
  429. X    LIST    *list;
  430. X
  431. X    COVER("dlfirst.c",1);
  432. X    list = (LIST*) plist;
  433. X    if (list == NULL)
  434. X    {
  435. X        COVER("dlfirst.c",2);
  436. X        return NULL;
  437. X    }
  438. X    if (list->last == NULL)
  439. X    {
  440. X        COVER("dlfirst.c",3);
  441. X        return NULL;
  442. X    }
  443. X    COVER("dlfirst.c",4);
  444. X    list->current = list->last->next;
  445. X    list->nextOk = 0;
  446. X    list->changed = 0;
  447. X    if (data != NULL)
  448. X    {
  449. X        COVER("dlfirst.c",5);
  450. X        *data = list->current->data;
  451. X    }
  452. X    COVER("dlfirst.c",6);
  453. X    return list->current->key;
  454. X}
  455. X
  456. X/************ End of file **************/
  457. X
  458. END_OF_src/list/dlfirst.c
  459. if test 1404 -ne `wc -c <src/list/dlfirst.c`; then
  460.     echo shar: \"src/list/dlfirst.c\" unpacked with wrong size!
  461. fi
  462. # end of overwriting check
  463. fi
  464. if test -f src/list/dllast.c -a "${1}" != "-c" ; then 
  465.   echo shar: Will not over-write existing file \"src/list/dllast.c\"
  466. else
  467. echo shar: Extracting \"src/list/dllast.c\" \(1360 characters\)
  468. sed "s/^X//" >src/list/dllast.c <<'END_OF_src/list/dllast.c'
  469. X/**********************************************************************
  470. X *
  471. X * dllast.c -- This file contains the dll_last function.
  472. X *
  473. X * This file is part of a suite of programs called Software Chipset.
  474. X * The source code for Software Chipset has been released into the
  475. X * public domain by its author, Paul Sander.
  476. X *
  477. X **********************************************************************/
  478. X
  479. X#include <stdio.h>
  480. X#include "dlpriv.h"
  481. X
  482. X/**********************************************************************
  483. X *
  484. X * dll_last-- This function returns the last key stored in the list.
  485. X *            If the list is sorted, the key returned is the highest
  486. X *            key in the lexical order of those keys stored in the list.
  487. X *
  488. X **********************************************************************/
  489. X
  490. X#ifdef __STDC__
  491. Xvoid *dll_last(DL_LIST plist, void **data)
  492. X#else
  493. Xvoid *dll_last(plist,data)
  494. XDL_LIST    plist;
  495. Xvoid    **data;
  496. X#endif
  497. X{
  498. X    LIST    *list;
  499. X
  500. X    COVER("dllast.c",1);
  501. X    list = (LIST*) plist;
  502. X    if (list == NULL)
  503. X    {
  504. X        COVER("dllast.c",2);
  505. X        return NULL;
  506. X    }
  507. X    if (list->last == NULL)
  508. X    {
  509. X        COVER("dllast.c",3);
  510. X        return NULL;
  511. X    }
  512. X    COVER("dllast.c",4);
  513. X    list->current = list->last;
  514. X    list->nextOk = 0;
  515. X    list->changed = 0;
  516. X    if (data != NULL)
  517. X    {
  518. X        COVER("dllast.c",5);
  519. X        *data = list->current->data;
  520. X    }
  521. X    return list->current->key;
  522. X}
  523. X
  524. X/************ End of file **************/
  525. X
  526. END_OF_src/list/dllast.c
  527. if test 1360 -ne `wc -c <src/list/dllast.c`; then
  528.     echo shar: \"src/list/dllast.c\" unpacked with wrong size!
  529. fi
  530. # end of overwriting check
  531. fi
  532. if test -f src/list/dlnew.c -a "${1}" != "-c" ; then 
  533.   echo shar: Will not over-write existing file \"src/list/dlnew.c\"
  534. else
  535. echo shar: Extracting \"src/list/dlnew.c\" \(1344 characters\)
  536. sed "s/^X//" >src/list/dlnew.c <<'END_OF_src/list/dlnew.c'
  537. X/************************************************************************
  538. X *
  539. X * dlnew.c -- This file contains routines needed for creating
  540. X *            doubly-linked lists.
  541. X *
  542. X * This file is part of a suite of programs called Software Chipset.
  543. X * The source code for Software Chipset has been released into the
  544. X * public domain by its author, Paul Sander.
  545. X *
  546. X ************************************************************************/
  547. X
  548. X#include <stdio.h>
  549. X#include "dlpriv.h"
  550. X
  551. X/************************************************************************
  552. X *
  553. X * dll_new -- Given a SETUP structure, this function creates an empty
  554. X *            doubly-linked list.
  555. X *
  556. X ************************************************************************/
  557. X
  558. X#ifdef __STDC__
  559. XDL_LIST dll_new(DLL_SETUP psetup)
  560. X#else
  561. XDL_LIST dll_new(psetup)
  562. XDLL_SETUP    psetup;
  563. X#endif
  564. X{
  565. X    LIST    *retval;
  566. X    SETUP    *setup;
  567. X
  568. X    COVER("dlnew.c",1);
  569. X    if (psetup == NULL)
  570. X    {
  571. X        COVER("dlnew.c",2);
  572. X        return NULL;
  573. X    }
  574. X    setup = (SETUP*) psetup;
  575. X    retval = (LIST*) malloc(sizeof(LIST));
  576. X    if (retval != NULL)
  577. X    {
  578. X        COVER("dlnew.c",3);
  579. X        retval->last = NULL;
  580. X        retval->current = NULL;
  581. X        retval->data = setup->data;
  582. X        retval->comp = setup->comp;
  583. X        retval->nextOk = 0;
  584. X        retval->size = 0;
  585. X        retval->changed = 0;
  586. X    }
  587. X    COVER("dlnew.c",4);
  588. X    return (DL_LIST) retval;
  589. X}
  590. X
  591. X/************* End of file **************/
  592. X
  593. END_OF_src/list/dlnew.c
  594. if test 1344 -ne `wc -c <src/list/dlnew.c`; then
  595.     echo shar: \"src/list/dlnew.c\" unpacked with wrong size!
  596. fi
  597. # end of overwriting check
  598. fi
  599. if test -f src/list/dlpeek.c -a "${1}" != "-c" ; then 
  600.   echo shar: Will not over-write existing file \"src/list/dlpeek.c\"
  601. else
  602. echo shar: Extracting \"src/list/dlpeek.c\" \(1260 characters\)
  603. sed "s/^X//" >src/list/dlpeek.c <<'END_OF_src/list/dlpeek.c'
  604. X/*******************************************************************
  605. X *
  606. X * dlpeek.c -- This file contains the dll_peek function.
  607. X *
  608. X * This file is part of a suite of programs called Software Chipset.
  609. X * The source code for Software Chipset has been released into the
  610. X * public domain by its author, Paul Sander.
  611. X *
  612. X *******************************************************************/
  613. X
  614. X#include <stdio.h>
  615. X#include "dlpriv.h"
  616. X
  617. X/*******************************************************************
  618. X *
  619. X * dll_peek -- This function returns the key and data of the item
  620. X *             at the specified end of a doubly-linked list.  Subsequent
  621. X *             calls to dll_next and dll_prev are not affected.
  622. X *
  623. X *******************************************************************/
  624. X
  625. X#ifdef __STDC__
  626. Xvoid *dll_peek(DL_LIST plist, int where, void **data)
  627. X#else
  628. Xvoid *dll_peek(plist,where,data)
  629. XDL_LIST    plist;
  630. Xint    where;
  631. Xvoid    **data;
  632. X#endif
  633. X{
  634. X    void    *retval;
  635. X
  636. X    switch (where)
  637. X    {
  638. Xcase DLL_FRONT:
  639. X        COVER("dlpeek.c",1);
  640. X        retval = dll_peekf(plist,data);
  641. X        break;
  642. X
  643. Xcase DLL_BACK:
  644. X        COVER("dlpeek.c",2);
  645. X        retval = dll_peekr(plist,data);
  646. X        break;
  647. X
  648. Xdefault:
  649. X        COVER("dlpeek.c",3);
  650. X        retval = NULL;
  651. X        break;
  652. X    }
  653. X    return retval;
  654. X}
  655. X
  656. X/*************** End of file **************/
  657. X
  658. END_OF_src/list/dlpeek.c
  659. if test 1260 -ne `wc -c <src/list/dlpeek.c`; then
  660.     echo shar: \"src/list/dlpeek.c\" unpacked with wrong size!
  661. fi
  662. # end of overwriting check
  663. fi
  664. if test -f src/list/dlpeekf.c -a "${1}" != "-c" ; then 
  665.   echo shar: Will not over-write existing file \"src/list/dlpeekf.c\"
  666. else
  667. echo shar: Extracting \"src/list/dlpeekf.c\" \(1374 characters\)
  668. sed "s/^X//" >src/list/dlpeekf.c <<'END_OF_src/list/dlpeekf.c'
  669. X/*********************************************************************
  670. X *
  671. X * dlpeekf.c -- This file contains the dll_peekf function.
  672. X *
  673. X * This file is part of a suite of programs called Software Chipset.
  674. X * The source code for Software Chipset has been released into the
  675. X * public domain by its author, Paul Sander.
  676. X *
  677. X *********************************************************************/
  678. X
  679. X#include <stdio.h>
  680. X#include "dlpriv.h"
  681. X
  682. X/*********************************************************************
  683. X *
  684. X * dll_peekf -- This function returns the key and data of the item
  685. X *              at the head of a doubly linked list.  It behaves
  686. X *              similarly to dll_first, except that subsequent calls
  687. X *              to dll_next and dll_prev are not affected.
  688. X *
  689. X *********************************************************************/
  690. X
  691. X#ifdef __STDC__
  692. Xvoid *dll_peekf(DL_LIST plist, void **data)
  693. X#else
  694. Xvoid *dll_peekf(plist,data)
  695. XDL_LIST    plist;
  696. Xvoid    **data;
  697. X#endif
  698. X{
  699. X    LIST    *list;
  700. X    NODE    *node;
  701. X
  702. X    COVER("dlpeekf.c",1);
  703. X    if (plist == NULL)
  704. X    {
  705. X        COVER("dlpeekf.c",2);
  706. X        return NULL;
  707. X    }
  708. X    list = (LIST*) plist;
  709. X    if (list->last == NULL)
  710. X    {
  711. X        COVER("dlpeekf.c",3);
  712. X        return NULL;
  713. X    }
  714. X
  715. X    node = list->last->next;
  716. X    if (data != NULL)
  717. X    {
  718. X        COVER("dlpeekf.c",4);
  719. X        *data = node->data;
  720. X    }
  721. X    COVER("dlpeekf.c",5);
  722. X    return node->key;
  723. X}
  724. X
  725. X/**************** End of file ***************/
  726. X
  727. END_OF_src/list/dlpeekf.c
  728. if test 1374 -ne `wc -c <src/list/dlpeekf.c`; then
  729.     echo shar: \"src/list/dlpeekf.c\" unpacked with wrong size!
  730. fi
  731. # end of overwriting check
  732. fi
  733. if test -f src/list/dlpeekr.c -a "${1}" != "-c" ; then 
  734.   echo shar: Will not over-write existing file \"src/list/dlpeekr.c\"
  735. else
  736. echo shar: Extracting \"src/list/dlpeekr.c\" \(1365 characters\)
  737. sed "s/^X//" >src/list/dlpeekr.c <<'END_OF_src/list/dlpeekr.c'
  738. X/*********************************************************************
  739. X *
  740. X * dlpeekr.c -- This file contains the dll_peekr function.
  741. X *
  742. X * This file is part of a suite of programs called Software Chipset.
  743. X * The source code for Software Chipset has been released into the
  744. X * public domain by its author, Paul Sander.
  745. X *
  746. X *********************************************************************/
  747. X
  748. X#include <stdio.h>
  749. X#include "dlpriv.h"
  750. X
  751. X/*********************************************************************
  752. X *
  753. X * dll_peekr -- This function returns the key and data of the item
  754. X *              at the end of a doubly linked list.  It behaves
  755. X *              similarly to dll_last, except that subsequent calls
  756. X *              to dll_next and dll_prev are not affected.
  757. X *
  758. X *********************************************************************/
  759. X
  760. X#ifdef __STDC__
  761. Xvoid *dll_peekr(DL_LIST plist, void**data)
  762. X#else
  763. Xvoid *dll_peekr(plist,data)
  764. XDL_LIST    plist;
  765. Xvoid    **data;
  766. X#endif
  767. X{
  768. X    LIST    *list;
  769. X    NODE    *node;
  770. X
  771. X    COVER("dlpeekr.c",1);
  772. X    if (plist == NULL)
  773. X    {
  774. X        COVER("dlpeekr.c",2);
  775. X        return NULL;
  776. X    }
  777. X    list = (LIST*) plist;
  778. X    if (list->last == NULL)
  779. X    {
  780. X        COVER("dlpeekr.c",3);
  781. X        return NULL;
  782. X    }
  783. X
  784. X    node = list->last;
  785. X    if (data != NULL)
  786. X    {
  787. X        COVER("dlpeekr.c",4);
  788. X        *data = node->data;
  789. X    }
  790. X    COVER("dlpeekr.c",5);
  791. X    return node->key;
  792. X}
  793. X
  794. X/**************** End of file ***************/
  795. X
  796. END_OF_src/list/dlpeekr.c
  797. if test 1365 -ne `wc -c <src/list/dlpeekr.c`; then
  798.     echo shar: \"src/list/dlpeekr.c\" unpacked with wrong size!
  799. fi
  800. # end of overwriting check
  801. fi
  802. if test -f src/list/dlpop.c -a "${1}" != "-c" ; then 
  803.   echo shar: Will not over-write existing file \"src/list/dlpop.c\"
  804. else
  805. echo shar: Extracting \"src/list/dlpop.c\" \(1152 characters\)
  806. sed "s/^X//" >src/list/dlpop.c <<'END_OF_src/list/dlpop.c'
  807. X/*******************************************************************
  808. X *
  809. X * dlpop.c -- This file contains the dll_pop function.
  810. X *
  811. X * This file is part of a suite of programs called Software Chipset.
  812. X * The source code for Software Chipset has been released into the
  813. X * public domain by its author, Paul Sander.
  814. X *
  815. X *******************************************************************/
  816. X
  817. X#include <stdio.h>
  818. X#include "dlpriv.h"
  819. X
  820. X/*******************************************************************
  821. X *
  822. X * dll_pop -- This function removes an item from a doubly-linked
  823. X *            list at a specified end.
  824. X *
  825. X *******************************************************************/
  826. X
  827. X#ifdef __STDC__
  828. Xvoid *dll_pop(DL_LIST plist, int where, void **data)
  829. X#else
  830. Xvoid *dll_pop(plist,where,data)
  831. XDL_LIST    plist;
  832. Xint    where;
  833. Xvoid    **data;
  834. X#endif
  835. X{
  836. X    void    *retval;
  837. X
  838. X    switch (where)
  839. X    {
  840. Xcase DLL_FRONT:
  841. X        COVER("dlpop.c",1);
  842. X        retval = dll_popf(plist,data);
  843. X        break;
  844. X
  845. Xcase DLL_BACK:
  846. X        COVER("dlpop.c",2);
  847. X        retval = dll_popr(plist,data);
  848. X        break;
  849. X
  850. Xdefault:
  851. X        COVER("dlpop.c",3);
  852. X        retval = NULL;
  853. X        break;
  854. X    }
  855. X    return retval;
  856. X}
  857. X
  858. X/*************** End of file **************/
  859. X
  860. END_OF_src/list/dlpop.c
  861. if test 1152 -ne `wc -c <src/list/dlpop.c`; then
  862.     echo shar: \"src/list/dlpop.c\" unpacked with wrong size!
  863. fi
  864. # end of overwriting check
  865. fi
  866. if test -f src/list/dlpopr.c -a "${1}" != "-c" ; then 
  867.   echo shar: Will not over-write existing file \"src/list/dlpopr.c\"
  868. else
  869. echo shar: Extracting \"src/list/dlpopr.c\" \(1173 characters\)
  870. sed "s/^X//" >src/list/dlpopr.c <<'END_OF_src/list/dlpopr.c'
  871. X/***********************************************************************
  872. X *
  873. X * dlpopr.c -- This file contains the dll_popr function.
  874. X *
  875. X * This file is part of a suite of programs called Software Chipset.
  876. X * The source code for Software Chipset has been released into the
  877. X * public domain by its author, Paul Sander.
  878. X *
  879. X ***********************************************************************/
  880. X
  881. X#include <stdio.h>
  882. X#include "dlpriv.h"
  883. X
  884. X/***********************************************************************
  885. X *
  886. X * dll_popr -- This function deletes an item from the rear of a
  887. X *             doubly-linked list.
  888. X *
  889. X ***********************************************************************/
  890. X
  891. X#ifdef __STDC__
  892. Xvoid *dll_popr(DL_LIST plist, void **data)
  893. X#else
  894. Xvoid *dll_popr(plist,data)
  895. XDL_LIST    plist;
  896. Xvoid    **data;
  897. X#endif
  898. X{
  899. X    LIST    *list;
  900. X    NODE    *node;
  901. X    void    *retval;
  902. X
  903. X    COVER("dlpopr.c",1);
  904. X    if (plist == NULL)
  905. X    {
  906. X        COVER("dlpopr.c",2);
  907. X        return NULL;
  908. X    }
  909. X    list = (LIST*) plist;
  910. X    if (list->last == NULL)
  911. X    {
  912. X        COVER("dlpopr.c",3);
  913. X        return NULL;
  914. X    }
  915. X
  916. X    COVER("dlpopr.c",4);
  917. X    list->last = list->last->prev;
  918. X    return dll_popf(plist,data);
  919. X}
  920. X
  921. X/*************** End of file ***************/
  922. X
  923. END_OF_src/list/dlpopr.c
  924. if test 1173 -ne `wc -c <src/list/dlpopr.c`; then
  925.     echo shar: \"src/list/dlpopr.c\" unpacked with wrong size!
  926. fi
  927. # end of overwriting check
  928. fi
  929. if test -f src/list/dlpush.c -a "${1}" != "-c" ; then 
  930.   echo shar: Will not over-write existing file \"src/list/dlpush.c\"
  931. else
  932. echo shar: Extracting \"src/list/dlpush.c\" \(1129 characters\)
  933. sed "s/^X//" >src/list/dlpush.c <<'END_OF_src/list/dlpush.c'
  934. X/*******************************************************************
  935. X *
  936. X * dlpush.c -- This file contains the dll_push function.
  937. X *
  938. X * This file is part of a suite of programs called Software Chipset.
  939. X * The source code for Software Chipset has been released into the
  940. X * public domain by its author, Paul Sander.
  941. X *
  942. X *******************************************************************/
  943. X
  944. X#include <stdio.h>
  945. X#include "dlpriv.h"
  946. X
  947. X/*******************************************************************
  948. X *
  949. X * dll_push -- This function pushes an item onto a doubly-linked
  950. X *             list at a specified end.
  951. X *
  952. X *******************************************************************/
  953. X
  954. X#ifdef __STDC__
  955. Xvoid *dll_push(DL_LIST plist, int where, void *key, void *data)
  956. X#else
  957. Xvoid *dll_push(plist,where,key,data)
  958. XDL_LIST    plist;
  959. Xint    where;
  960. Xvoid    *key;
  961. Xvoid    *data;
  962. X#endif
  963. X{
  964. X    switch (where)
  965. X    {
  966. Xcase DLL_FRONT:
  967. X        COVER("dlpush.c",1);
  968. X        return dll_pushf(plist,key,data);
  969. X
  970. Xcase DLL_BACK:
  971. X        COVER("dlpush.c",2);
  972. X        return dll_pushr(plist,key,data);
  973. X
  974. Xdefault:
  975. X        COVER("dlpush.c",3);
  976. X        return NULL;
  977. X    }
  978. X}
  979. X
  980. X/*************** End of file **************/
  981. X
  982. END_OF_src/list/dlpush.c
  983. if test 1129 -ne `wc -c <src/list/dlpush.c`; then
  984.     echo shar: \"src/list/dlpush.c\" unpacked with wrong size!
  985. fi
  986. # end of overwriting check
  987. fi
  988. if test -f src/list/dlpushf.c -a "${1}" != "-c" ; then 
  989.   echo shar: Will not over-write existing file \"src/list/dlpushf.c\"
  990. else
  991. echo shar: Extracting \"src/list/dlpushf.c\" \(1370 characters\)
  992. sed "s/^X//" >src/list/dlpushf.c <<'END_OF_src/list/dlpushf.c'
  993. X/*********************************************************************
  994. X *
  995. X * dlpushf.c -- This file contains the dll_pushf function.
  996. X *
  997. X * This file is part of a suite of programs called Software Chipset.
  998. X * The source code for Software Chipset has been released into the
  999. X * public domain by its author, Paul Sander.
  1000. X *
  1001. X *********************************************************************/
  1002. X
  1003. X#include <stdio.h>
  1004. X#include "dlpriv.h"
  1005. X
  1006. X/*********************************************************************
  1007. X *
  1008. X * dll_pushf -- This function pushes an item onto the front of an
  1009. X *              unordered doubly-linked list.
  1010. X *
  1011. X *********************************************************************/
  1012. X
  1013. X#ifdef __STDC__
  1014. Xvoid *dll_pushf(DL_LIST plist, void *key, void *data)
  1015. X#else
  1016. Xvoid *dll_pushf(plist,key,data)
  1017. XDL_LIST    plist;
  1018. Xvoid    *key;
  1019. Xvoid    *data;
  1020. X#endif
  1021. X{
  1022. X    LIST    *list;
  1023. X    NODE    *node;
  1024. X
  1025. X    COVER("dlpushf.c",1);
  1026. X    if (plist == NULL)
  1027. X    {
  1028. X        COVER("dlpushf.c",2);
  1029. X        return NULL;
  1030. X    }
  1031. X    list = (LIST*) plist;
  1032. X
  1033. X    node = dll_newNode(key,data);
  1034. X    if (node == NULL)
  1035. X    {
  1036. X        COVER("dlpushf.c",3);
  1037. X        return NULL;
  1038. X    }
  1039. X
  1040. X    if (list->last != NULL)
  1041. X    {
  1042. X        COVER("dlpushf.c",4);
  1043. X        dll_store(list->last,node);
  1044. X    }
  1045. X    else
  1046. X    {
  1047. X        COVER("dlpushf.c",5);
  1048. X        list->last = node;
  1049. X        node->next = node;
  1050. X        node->prev = node;
  1051. X    }
  1052. X    list->size += 1;
  1053. X    dll_touch(list);
  1054. X    return key;
  1055. X}
  1056. X
  1057. X/*************** End of file ****************/
  1058. X
  1059. END_OF_src/list/dlpushf.c
  1060. if test 1370 -ne `wc -c <src/list/dlpushf.c`; then
  1061.     echo shar: \"src/list/dlpushf.c\" unpacked with wrong size!
  1062. fi
  1063. # end of overwriting check
  1064. fi
  1065. if test -f src/list/dlpushr.c -a "${1}" != "-c" ; then 
  1066.   echo shar: Will not over-write existing file \"src/list/dlpushr.c\"
  1067. else
  1068. echo shar: Extracting \"src/list/dlpushr.c\" \(1367 characters\)
  1069. sed "s/^X//" >src/list/dlpushr.c <<'END_OF_src/list/dlpushr.c'
  1070. X/*********************************************************************
  1071. X *
  1072. X * dlpushr.c -- This file contains the dll_pushr function.
  1073. X *
  1074. X * This file is part of a suite of programs called Software Chipset.
  1075. X * The source code for Software Chipset has been released into the
  1076. X * public domain by its author, Paul Sander.
  1077. X *
  1078. X *********************************************************************/
  1079. X
  1080. X#include <stdio.h>
  1081. X#include "dlpriv.h"
  1082. X
  1083. X/*********************************************************************
  1084. X *
  1085. X * dll_pushr -- This function pushes an item onto the rear of an
  1086. X *              unordered doubly-linked list.
  1087. X *
  1088. X *********************************************************************/
  1089. X
  1090. X#ifdef __STDC__
  1091. Xvoid *dll_pushr(DL_LIST plist, void *key, void *data)
  1092. X#else
  1093. Xvoid *dll_pushr(plist,key,data)
  1094. XDL_LIST    plist;
  1095. Xvoid    *key;
  1096. Xvoid    *data;
  1097. X#endif
  1098. X{
  1099. X    LIST    *list;
  1100. X    NODE    *node;
  1101. X
  1102. X    COVER("dlpushr.c",1);
  1103. X    if (plist == NULL)
  1104. X    {
  1105. X        COVER("dlpushr.c",1);
  1106. X        return NULL;
  1107. X    }
  1108. X    list = (LIST*) plist;
  1109. X
  1110. X    node = dll_newNode(key,data);
  1111. X    if (node == NULL)
  1112. X    {
  1113. X        COVER("dlpushr.c",2);
  1114. X        return NULL;
  1115. X    }
  1116. X    if (list->last != NULL)
  1117. X    {
  1118. X        COVER("dlpushr.c",3);
  1119. X        dll_store(list->last,node);
  1120. X    }
  1121. X    else
  1122. X    {
  1123. X        COVER("dlpushr.c",4);
  1124. X        node->next = node;
  1125. X        node->prev = node;
  1126. X    }
  1127. X    list->last = node;
  1128. X    list->size += 1;
  1129. X    dll_touch(list);
  1130. X    return key;
  1131. X}
  1132. X
  1133. X/*************** End of file ****************/
  1134. X
  1135. END_OF_src/list/dlpushr.c
  1136. if test 1367 -ne `wc -c <src/list/dlpushr.c`; then
  1137.     echo shar: \"src/list/dlpushr.c\" unpacked with wrong size!
  1138. fi
  1139. # end of overwriting check
  1140. fi
  1141. if test -f src/list/dlrankutl.c -a "${1}" != "-c" ; then 
  1142.   echo shar: Will not over-write existing file \"src/list/dlrankutl.c\"
  1143. else
  1144. echo shar: Extracting \"src/list/dlrankutl.c\" \(1043 characters\)
  1145. sed "s/^X//" >src/list/dlrankutl.c <<'END_OF_src/list/dlrankutl.c'
  1146. X/*********************************************************************
  1147. X *
  1148. X * dlrankutl.c -- This file contains utility functions for accessing
  1149. X *                the contents of a list by rank.
  1150. X *
  1151. X * This file is part of a suite of programs called Software Chipset.
  1152. X * The source code for Software Chipset has been released into the
  1153. X * public domain by its author, Paul Sander.
  1154. X *
  1155. X *********************************************************************/
  1156. X
  1157. X#include <stdio.h>
  1158. X#include "dlpriv.h"
  1159. X
  1160. X/*********************************************************************
  1161. X *
  1162. X * dll_locRank -- This function locates a node in a list by rank.
  1163. X *
  1164. X *********************************************************************/
  1165. X
  1166. X#ifdef __STDC__
  1167. XNODE *dll_locRank(LIST *list, int rank)
  1168. X#else
  1169. XNODE *dll_locRank(list,rank)
  1170. XLIST    *list;
  1171. Xint    rank;
  1172. X#endif
  1173. X{
  1174. X    NODE    *node;
  1175. X
  1176. X    COVER("dlrankutl.c",1);
  1177. X    node = list->last->next;
  1178. X    while (rank > 0)
  1179. X    {
  1180. X        COVER("dlrankutl.c",2);
  1181. X        node = node->next;
  1182. X        rank--;
  1183. X    }
  1184. X    return node;
  1185. X}
  1186. X
  1187. X/**************** End of file ***************/
  1188. X
  1189. END_OF_src/list/dlrankutl.c
  1190. if test 1043 -ne `wc -c <src/list/dlrankutl.c`; then
  1191.     echo shar: \"src/list/dlrankutl.c\" unpacked with wrong size!
  1192. fi
  1193. # end of overwriting check
  1194. fi
  1195. if test -f src/list/patchlevel.h -a "${1}" != "-c" ; then 
  1196.   echo shar: Will not over-write existing file \"src/list/patchlevel.h\"
  1197. else
  1198. echo shar: Extracting \"src/list/patchlevel.h\" \(420 characters\)
  1199. sed "s/^X//" >src/list/patchlevel.h <<'END_OF_src/list/patchlevel.h'
  1200. X/*
  1201. X * patchlevel.h -- This file contains the patchlevel of the doubly-linked
  1202. X *                 list implementation.  It is unused by the component.
  1203. X *
  1204. X * This file is part of a suite of programs called Software Chipset.
  1205. X * The source code for Software Chipset has been released into the
  1206. X * public domain by its author, Paul Sander.
  1207. X *
  1208. X */
  1209. X
  1210. X#define dll_name "dlist"
  1211. X#define dll_patchlevel "1.03"
  1212. X
  1213. X/*** End of File ***/
  1214. X
  1215. END_OF_src/list/patchlevel.h
  1216. if test 420 -ne `wc -c <src/list/patchlevel.h`; then
  1217.     echo shar: \"src/list/patchlevel.h\" unpacked with wrong size!
  1218. fi
  1219. # end of overwriting check
  1220. fi
  1221. echo shar: End of archive 1 \(of 10\).
  1222. cp /dev/null ark1isdone
  1223. MISSING=""
  1224. for I in 1 2 3 4 5 6 7 8 9 10 ; do
  1225.     if test ! -f ark${I}isdone ; then
  1226.     MISSING="${MISSING} ${I}"
  1227.     fi
  1228. done
  1229. if test "${MISSING}" = "" ; then
  1230.     echo You have unpacked all 10 archives.
  1231.     echo "Now edit common.mk and do a 'make all'"
  1232.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1233. else
  1234.     echo You still need to unpack the following archives:
  1235.     echo "        " ${MISSING}
  1236. fi
  1237. ##  End of shell archive.
  1238. exit 0
  1239.  
  1240.