home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume27 / clc / part09 < prev    next >
Encoding:
Text File  |  1993-11-28  |  31.0 KB  |  1,240 lines

  1. Newsgroups: comp.sources.unix
  2. From: panos@anchor.cs.colorado.edu (Panos Tsirigotis)
  3. Subject: v27i115: clc - C Libraries Collection, Part09/20
  4. References: <1.754527080.23891@gw.home.vix.com>
  5. Sender: unix-sources-moderator@gw.home.vix.com
  6. Approved: vixie@gw.home.vix.com
  7.  
  8. Submitted-By: panos@anchor.cs.colorado.edu (Panos Tsirigotis)
  9. Posting-Number: Volume 27, Issue 115
  10. Archive-Name: clc/part09
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 9 (of 20)."
  19. # Contents:  libs/src/dict/bstimpl.h libs/src/sio/Makefile
  20. #   libs/src/sio/suite/copytest.c libs/src/str/Makefile
  21. #   libs/src/str/strparse.c libs/src/str/strs.3
  22. # Wrapped by panos@eclipse on Sun Nov 28 14:48:16 1993
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'libs/src/dict/bstimpl.h' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'libs/src/dict/bstimpl.h'\"
  26. else
  27. echo shar: Extracting \"'libs/src/dict/bstimpl.h'\" \(4198 characters\)
  28. sed "s/^X//" >'libs/src/dict/bstimpl.h' <<'END_OF_FILE'
  29. X/*
  30. X * (c) Copyright 1993 by Panagiotis Tsirigotis
  31. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  32. X * and conditions for redistribution.
  33. X */
  34. X
  35. X
  36. X/*
  37. X * $Id: bstimpl.h,v 3.4 93/11/19 20:03:23 panos Exp $
  38. X */
  39. X
  40. X#include "dictimpl.h"
  41. X#include "bst.h"
  42. X
  43. X/*
  44. X * We allocate a tree_node or a balanced_tree_node depending on the type
  45. X * of tree. The code requires that both node types have the same memory
  46. X * representation (except for the extra field(s) at the end of the
  47. X * balanced_tree_node).
  48. X */
  49. Xstruct tree_node
  50. X{
  51. X    struct tree_node    *left ;
  52. X    struct tree_node    *right ;
  53. X    struct tree_node    *parent ;
  54. X    dict_obj                obj ;
  55. X} ;
  56. X
  57. Xtypedef struct tree_node tnode_s ;
  58. X
  59. X#define TNP( p )                       ((tnode_s *)(p))
  60. X#define NULL_NODE                      TNP( NULL )
  61. X
  62. X#define LEFT( p )                      (p)->left
  63. X#define RIGHT( p )                     (p)->right
  64. X#define PARENT( p )                    (p)->parent
  65. X#define OBJ( p )                       (p)->obj
  66. X
  67. Xenum node_color { RED, BLACK } ;
  68. X
  69. Xstruct balanced_tree_node
  70. X{
  71. X    tnode_s                node ;
  72. X    enum node_color    color ;
  73. X} ;
  74. X
  75. Xtypedef struct balanced_tree_node btnode_s ;
  76. X
  77. X#define BTNP( p )                                ((btnode_s *)(p))
  78. X
  79. X#define COLOR( p )                            BTNP(p)->color
  80. X
  81. X
  82. X/*
  83. X * ABOUT HINTS:
  84. X *    a. We keep hints to avoid searches of the tree.
  85. X *    b. A hint is either correct or non-existent.
  86. X *    c. To avoid bad hints, bst_delete clears all hints
  87. X *    d. An operation that uses/consults a hint always clears it or resets it.
  88. X *
  89. X *   --------------------------------------------------------------------
  90. X *  | OPERATIONS |                        HINTS                          |
  91. X *  |------------|-------------------------------------------------------|
  92. X *  |            |    SEARCH    |    SUCCESSOR       |      PREDECESSOR  |
  93. X *  |------------|--------------|--------------------|-------------------|
  94. X *  | insert     |       X      |        X           |         X         |
  95. X *  | delete     | USE & CLEAR  |      CLEAR         |       CLEAR       |
  96. X *  | search     |      SET     |        X           |         X         |
  97. X *  | minimum    |       X      |       SET          |         X         |
  98. X *  | maximum    |       X      |        X           |        SET        |
  99. X *  | successor  |       X      |    USE & SET       |         X         |
  100. X *  | predecessor|       X      |        X           |     USE & SET     |
  101. X *   --------------------------------------------------------------------
  102. X *
  103. X */
  104. X
  105. X
  106. Xstruct hints
  107. X{
  108. X   tnode_s   *last_search ;
  109. X   tnode_s   *last_successor ;
  110. X   tnode_s   *last_predecessor ;
  111. X} ;
  112. X
  113. X
  114. X#define HINT_GET( hp, hintname )       (hp)->hint.hintname
  115. X#define HINT_SET( hp, hintname, v )    (hp)->hint.hintname = v
  116. X#define HINT_CLEAR( hp, hintname )     HINT_SET( hp, hintname, NIL( hp ) )
  117. X#define HINT_MATCH( hp, hintname, v )  ( OBJ( (hp)->hint.hintname ) == v )
  118. X
  119. X
  120. X#include "fsma.h"
  121. X
  122. Xstruct tree_iterator
  123. X{
  124. X    enum dict_direction    direction ;
  125. X    tnode_s                    *next ;
  126. X} ;
  127. X
  128. X
  129. X/*
  130. X * The 'nil' field is used instead of NULL, to indicate the absence of
  131. X * a node. This allows us to avoid explicit tests against NULL in case
  132. X * of boundary conditions.
  133. X *
  134. X * The only unusual thing in this implementation is the 'anchor' field
  135. X * which is used as the actual root of the tree. The user-visible root of 
  136. X * the tree is always the *left* child of the anchor. The TREE_EMPTY macro
  137. X * below tests this condition.
  138. X */
  139. Xstruct tree_header
  140. X{
  141. X    dheader_s                dh ;
  142. X    struct hints            hint ;
  143. X    fsma_h                    alloc ;
  144. X    btnode_s                    anchor ;
  145. X    btnode_s                    nil ;
  146. X    struct tree_iterator iter ;
  147. X} ;
  148. X
  149. Xtypedef struct tree_header header_s ;
  150. X
  151. X#define THP( p )                       ((header_s *)(p))
  152. X#define DHP( hp )                      (&(hp->dh))
  153. X#define NULL_HEADER                    THP( NULL )
  154. X
  155. X#define ANCHOR( hp )                   TNP( (&(hp)->anchor) )
  156. X#define ROOT( hp )                     LEFT( ANCHOR( hp ) )
  157. X#define NIL( hp )                      TNP( (&(hp)->nil) )
  158. X
  159. X#define TREE_EMPTY( hp )               ( ROOT( hp ) == NIL( hp ) )
  160. X
  161. X#define NODE_ALLOC( hp )               TNP( fsm_alloc( (hp)->alloc ) )
  162. X#define NODE_FREE( hp, np )            fsm_free( (hp)->alloc, (char *)(np) )
  163. X
  164. Xvoid __dict_rbt_insfix() ;
  165. Xvoid __dict_rbt_delfix() ;
  166. X
  167. END_OF_FILE
  168. if test 4198 -ne `wc -c <'libs/src/dict/bstimpl.h'`; then
  169.     echo shar: \"'libs/src/dict/bstimpl.h'\" unpacked with wrong size!
  170. fi
  171. # end of 'libs/src/dict/bstimpl.h'
  172. fi
  173. if test -f 'libs/src/sio/Makefile' -a "${1}" != "-c" ; then 
  174.   echo shar: Will not clobber existing file \"'libs/src/sio/Makefile'\"
  175. else
  176. echo shar: Extracting \"'libs/src/sio/Makefile'\" \(4242 characters\)
  177. sed "s/^X//" >'libs/src/sio/Makefile' <<'END_OF_FILE'
  178. X# (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  179. X# All rights reserved.  The file named COPYRIGHT specifies the terms 
  180. X# and conditions for redistribution.
  181. X
  182. X#
  183. X# $Id: Makefile,v 8.7 1993/09/08 05:57:40 panos Exp $
  184. X#
  185. X# Based on Library makefile template: *Revision: 1.15 *
  186. X#
  187. X
  188. X# 
  189. X# Available entries:
  190. X#         lib             --> creates the library
  191. X#        install        --> installs the library (archive, man page(s), header(s))
  192. X#        uninstall    --> uninstall the library
  193. X#        clean            --> removes all .o and .a files
  194. X#        spotless        --> clean + uninstall
  195. X#         lint            --> lints a file (usage: make lint MODULE=foo.c)
  196. X#        tags            --> creates a tags file (from the SOURCES and HEADERS)
  197. X#        checkout     --> checkout all files
  198. X#        dist            --> distribution support
  199. X#
  200. X
  201. XNAME                = sio
  202. XVERSION            = 1.6.3
  203. X
  204. XHEADERS            = sio.h impl.h events.h sioconf.h
  205. XSOURCES            = sprint.c sio.c siosup.c
  206. XOBJECTS            = sprint.o sio.o siosup.o
  207. X
  208. XMANFILES            = sio.3 Sprint.3
  209. XINCLUDEFILES    = sio.h
  210. X
  211. X# The following variables are used by the 'install' entry and
  212. X# should be customized:
  213. X#     LIBDIR:     where the library will be placed
  214. X#     INCUDEDIR:  where the include files will be placed
  215. X#     MANDIR:     where the man pages will be placed
  216. X#
  217. XLIBDIR            = $(HOME)/.links/libraries/$(ARCH)
  218. XINCLUDEDIR        = $(HOME)/.links/includes
  219. XMANDIR            = $(HOME)/.links/manpages/man3
  220. X
  221. X#
  222. X# Available flags:
  223. X#  -DDEBUG           :  enables assertions in the code. A failed assertion
  224. X#                       terminates the program
  225. X#  -DEVENTS          :  enables code that records events (currently limited
  226. X#                       to which functions have been called on a given fd)
  227. X#                       and code that accesses the event buffers.
  228. X#  -DLITTLE_ENDIAN   :  says that the machine is a little endian. This is
  229. X#                       needed if you enable EVENTS and your machine is a
  230. X#                       little endian (big endian is the default).
  231. X#
  232. X
  233. X#
  234. X# DEFS should be set from the command line; the current group of defs
  235. X# is for SunOS 4.x
  236. X#
  237. XDEFS                = -DHAS_MMAP -DHAS_ONEXIT -DHAS_MEMOPS -DHAS_ISATTY
  238. X
  239. XDEBUG                = -g            # -g or -O
  240. XVERSION_DEF        = -DVERSION=\"SIO\ Version\ $(VERSION)\"
  241. X
  242. XCPP_DEFS            = $(VERSION_DEF) $(DEFS)
  243. X
  244. X#
  245. X# The following variables shouldn't need to be changed
  246. X#
  247. XLINT_FLAGS        = -hbux
  248. XCPP_FLAGS        = $(CPP_DEFS)
  249. XCC_FLAGS            = $(DEBUG)
  250. XCFLAGS            = $(CPP_FLAGS) $(CC_FLAGS)
  251. X
  252. XINSTALL            = install -c
  253. XFMODE                = -m 640            # used by install
  254. XRANLIB            = ranlib
  255. X
  256. XPAGER                = less
  257. X
  258. X
  259. XLIBNAME            = lib$(NAME).a
  260. X
  261. Xlib: $(LIBNAME)
  262. X
  263. Xlibopt: clean
  264. X    make DEBUG=-O "DEFS=$(DEFS)" lib
  265. X    $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized
  266. X
  267. X$(LIBNAME): $(OBJECTS)
  268. X    ar r $@ $?
  269. X    $(RANLIB) $@
  270. X
  271. Xlint:
  272. X    lint $(CPP_FLAGS) $(LINT_FLAGS) $(MODULE) 2>&1 | $(PAGER)
  273. X
  274. Xinstall: $(LIBNAME)
  275. X    @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
  276. X    then \
  277. X        $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
  278. X        echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
  279. X        for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
  280. X        echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
  281. X        for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
  282. X        echo Installed $(MANFILES) to $(MANDIR) ;\
  283. X    else \
  284. X        echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
  285. X    fi
  286. X
  287. Xuninstall:
  288. X    a=`pwd` ; cd $(INCLUDEDIR) ;\
  289. X    if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
  290. X    a=`pwd` ; cd $(LIBDIR) ;\
  291. X    if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
  292. X    a=`pwd` ; cd $(MANDIR) ;\
  293. X    if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
  294. X
  295. Xclean:
  296. X    rm -f $(OBJECTS) $(LIBNAME) core
  297. X
  298. Xspotless: clean uninstall
  299. X
  300. Xtags: $(SOURCES) $(HEADERS)
  301. X    ctags -w $(SOURCES) $(HEADERS)
  302. X
  303. Xcheckout:
  304. X    co $(SOURCES) $(HEADERS) $(MANFILES)
  305. X
  306. X#
  307. X# Distribution section
  308. X# This section contains the 2 targets for distribution support: dist, dirs
  309. X# "dist" checks out all files to be distributed
  310. X# "dirs" prints a list of directories to be included in the distribution.
  311. X# These directories should have a Makefile with a "dist" target
  312. X#
  313. XDISTRIBUTION_FILES    = $(HEADERS) $(SOURCES) $(MANFILES) README COPYRIGHT
  314. XDIRS                        = suite
  315. X
  316. Xdist:
  317. X    -co -q $(DISTRIBUTION_FILES)
  318. X
  319. Xdirs:
  320. X    @echo $(DIRS)
  321. X
  322. X#
  323. X# PUT HERE THE RULES TO MAKE THE OBJECT FILES
  324. X#
  325. Xsprint.o:   sio.h impl.h sioconf.h
  326. Xsio.o:      sio.h impl.h sioconf.h events.h
  327. Xsiosup.o:   sio.h impl.h sioconf.h events.h
  328. X
  329. END_OF_FILE
  330. if test 4242 -ne `wc -c <'libs/src/sio/Makefile'`; then
  331.     echo shar: \"'libs/src/sio/Makefile'\" unpacked with wrong size!
  332. fi
  333. # end of 'libs/src/sio/Makefile'
  334. fi
  335. if test -f 'libs/src/sio/suite/copytest.c' -a "${1}" != "-c" ; then 
  336.   echo shar: Will not clobber existing file \"'libs/src/sio/suite/copytest.c'\"
  337. else
  338. echo shar: Extracting \"'libs/src/sio/suite/copytest.c'\" \(4308 characters\)
  339. sed "s/^X//" >'libs/src/sio/suite/copytest.c' <<'END_OF_FILE'
  340. X/*
  341. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  342. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  343. X * and conditions for redistribution.
  344. X */
  345. X
  346. Xstatic char RCSid[] = "$Id: copytest.c,v 8.2 1993/09/08 05:59:46 panos Exp $" ;
  347. X
  348. X#include "sio.h"
  349. X#include <stdio.h>
  350. X#include <syscall.h>
  351. X
  352. X#ifndef RANDOM
  353. X#define RANDOM        random
  354. X#endif
  355. X
  356. X
  357. X/*************************************************************/
  358. X
  359. X#ifdef TEST_Sread
  360. X
  361. X#define BUFFER_SIZE  4096
  362. X
  363. Xmain()
  364. X{
  365. X    char buf[ BUFFER_SIZE ] ;
  366. X    int cc ;
  367. X    int nbytes ;
  368. X
  369. X    for ( ;; )
  370. X    {
  371. X        nbytes = RANDOM() & ( BUFFER_SIZE - 1 ) ;
  372. X        if ( nbytes == 0 )
  373. X            nbytes = 1 ;
  374. X        cc = Sread( 0, buf, nbytes ) ;
  375. X        if ( cc == 0 )
  376. X            break ;
  377. X        if ( cc == SIO_ERR )
  378. X            exit( 1 ) ;
  379. X        write( 1, buf, cc ) ;
  380. X    }
  381. X    exit( 0 ) ;
  382. X}
  383. X#endif /* TEST_Sread */
  384. X
  385. X/*************************************************************/
  386. X
  387. X#ifdef TEST_Swrite
  388. X
  389. X#define BUFFER_SIZE  4096
  390. X
  391. Xmain()
  392. X{
  393. X    char buf[ BUFFER_SIZE ] ;
  394. X    int cc ;
  395. X    int nbytes ;
  396. X
  397. X    for ( ;; )
  398. X    {
  399. X        nbytes = RANDOM() & ( BUFFER_SIZE - 1 ) ;
  400. X        if ( nbytes == 0 )
  401. X            nbytes = 1 ;
  402. X        cc = read( 0, buf, nbytes ) ;
  403. X        if ( cc == 0 )
  404. X            break ;
  405. X        if ( Swrite( 1, buf, cc ) != cc )
  406. X            exit( 1 ) ;
  407. X    }
  408. X    exit( 0 ) ;
  409. X}
  410. X#endif /* TEST_Swrite */
  411. X
  412. X/*************************************************************/
  413. X
  414. X#ifdef TEST_Srdline
  415. X
  416. Xmain()
  417. X{
  418. X    char *s ;
  419. X    int count=0 ;
  420. X
  421. X    while ( s = Srdline( 0 ) )
  422. X    {
  423. X        puts( s ) ;
  424. X        count++ ;
  425. X    }
  426. X    Sdone( 0 ) ;
  427. X    exit( 0 ) ;
  428. X}
  429. X
  430. X#endif  /* TEST_Srdline */
  431. X
  432. X/*************************************************************/
  433. X
  434. X#ifdef TEST_Sputchar
  435. X
  436. Xmain()
  437. X{
  438. X    int c ;
  439. X
  440. X    while ( ( c = getchar() ) != EOF )
  441. X        if ( Sputchar( 1, c ) != c )
  442. X            exit( 1 ) ;
  443. X    exit( 0 ) ;
  444. X}
  445. X
  446. X#endif /* TEST_Sputchar */
  447. X
  448. X/*************************************************************/
  449. X
  450. X#ifdef TEST_Sgetchar
  451. X
  452. Xmain()
  453. X{
  454. X    int c ;
  455. X
  456. X    while ( ( c = Sgetchar( 0 ) ) != SIO_EOF )
  457. X        putchar( c ) ;
  458. X    exit( 0 ) ;
  459. X}
  460. X
  461. X#endif    /* TEST_Sgetchar */
  462. X
  463. X/*************************************************************/
  464. X
  465. X#ifdef TEST_Sputc
  466. X
  467. Xmain()
  468. X{
  469. X   int c ;
  470. X   while ( ( c = getchar() ) != EOF )
  471. X      if ( Sputc( 1, c ) != c )
  472. X         exit( 1 ) ;
  473. X   exit( 0 ) ;
  474. X}
  475. X
  476. X#endif /* TEST_Sputc */
  477. X
  478. X/*************************************************************/
  479. X
  480. X#ifdef TEST_Sgetc
  481. X
  482. Xmain()
  483. X{
  484. X   int c ;
  485. X
  486. X   while ( ( c = Sgetc( 0 ) ) != SIO_EOF )
  487. X      putchar( c ) ;
  488. X   exit( 0 ) ;
  489. X}
  490. X
  491. X#endif /* TEST_Sgetc */
  492. X
  493. X/*************************************************************/
  494. X
  495. X#ifdef TEST_Sfetch
  496. X
  497. Xmain()
  498. X{
  499. X    char *s ;
  500. X    int len ;
  501. X
  502. X    while ( s = Sfetch( 0, &len ) )
  503. X        fwrite( s, 1, len, stdout ) ;
  504. X    exit( 0 ) ;
  505. X}
  506. X
  507. X#endif /* TEST_Sfetch */
  508. X
  509. X/*************************************************************/
  510. X
  511. X#ifdef TEST_Sflush
  512. X
  513. X#define MAX_COUNT        100
  514. X
  515. Xmain()
  516. X{
  517. X    int c ;
  518. X    int errval ;
  519. X    int count = 0 ;
  520. X    int max_count = RANDOM() % MAX_COUNT + 1 ;
  521. X
  522. X    while ( ( c = getchar() ) != EOF )
  523. X        if ( Sputchar( 1, c ) != c )
  524. X            exit( errval ) ;
  525. X        else
  526. X        {
  527. X            count++ ;
  528. X            if ( count >= max_count )
  529. X            {
  530. X                errval = Sflush( 1 ) ;
  531. X                if ( errval != 0 )
  532. X                    exit( 1 ) ;
  533. X                max_count = RANDOM() % MAX_COUNT + 1 ;
  534. X                count = 0 ;
  535. X            }
  536. X        }
  537. X    exit( 0 ) ;
  538. X}
  539. X
  540. X#endif /* TEST_Sflush */
  541. X
  542. X/*************************************************************/
  543. X
  544. X#ifdef TEST_Sundo
  545. X
  546. Xmain()
  547. X{
  548. X    int c ;
  549. X    char *s ;
  550. X    int errval ;
  551. X
  552. X    for ( ;; )
  553. X    {
  554. X        if ( RANDOM() % 1 )
  555. X        {
  556. X            s = Srdline( 0 ) ;
  557. X            if ( s == NULL )
  558. X                break ;
  559. X            if ( RANDOM() % 16 < 5 )
  560. X            {
  561. X                errval = Sundo( 0, SIO_UNDO_LINE ) ;
  562. X                if ( errval == SIO_ERR )
  563. X                    exit( 1 ) ;
  564. X            }
  565. X            else
  566. X                puts( s ) ;
  567. X        }
  568. X        else
  569. X        {
  570. X            c = Sgetchar( 0 ) ;
  571. X            if ( c == SIO_EOF )
  572. X                break ;
  573. X            if ( RANDOM() % 16 < 5 )
  574. X            {
  575. X                errval = Sundo( 0, SIO_UNDO_CHAR ) ;
  576. X                if ( errval == SIO_ERR )
  577. X                    exit( 2 ) ;
  578. X            }
  579. X            else
  580. X                putchar( c ) ;
  581. X        }
  582. X    }
  583. X    exit( 0 ) ;
  584. X}
  585. X
  586. X#endif /* TEST_Sundo */
  587. X
  588. X
  589. X#if defined( TEST_switch ) || defined( TEST_switch2 )
  590. X
  591. Xmain()
  592. X{
  593. X    int c ;
  594. X    char *s ;
  595. X    int lines = 4000 ;
  596. X
  597. X    for ( ;; )
  598. X    {
  599. X        c = Sgetchar( 0 ) ;
  600. X        if ( c == SIO_EOF )
  601. X            exit( 0 ) ;
  602. X        if ( c == SIO_ERR )
  603. X            exit( 1 ) ;
  604. X        putchar( c ) ;
  605. X        if ( c == '\n' )
  606. X        {
  607. X            lines-- ;
  608. X            if ( lines == 0 )
  609. X                break ;
  610. X        }
  611. X    }
  612. X    while ( s = Srdline( 0 ) )
  613. X        puts( s ) ;
  614. X    exit( 0 ) ;
  615. X}
  616. X
  617. X#ifdef TEST_switch2
  618. X
  619. Xchar *mmap( addr, len, prot, type, fd, off )
  620. X    char *addr ;
  621. X    int len, prot, type, fd, off ;
  622. X{
  623. X    return( (char *)-1 ) ;
  624. X}
  625. X
  626. X#endif    /* TEST_switch2 */
  627. X
  628. X#endif     /* TEST_switch */
  629. X
  630. X
  631. X
  632. END_OF_FILE
  633. if test 4308 -ne `wc -c <'libs/src/sio/suite/copytest.c'`; then
  634.     echo shar: \"'libs/src/sio/suite/copytest.c'\" unpacked with wrong size!
  635. fi
  636. # end of 'libs/src/sio/suite/copytest.c'
  637. fi
  638. if test -f 'libs/src/str/Makefile' -a "${1}" != "-c" ; then 
  639.   echo shar: Will not clobber existing file \"'libs/src/str/Makefile'\"
  640. else
  641. echo shar: Extracting \"'libs/src/str/Makefile'\" \(4534 characters\)
  642. sed "s/^X//" >'libs/src/str/Makefile' <<'END_OF_FILE'
  643. X# (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  644. X# All rights reserved.  The file named COPYRIGHT specifies the terms 
  645. X# and conditions for redistribution.
  646. X
  647. X#
  648. X# $Id: Makefile,v 3.3 1993/11/12 20:15:25 panos Exp $
  649. X#
  650. X# Based on Library makefile template: *Revision: 1.15 *
  651. X#
  652. X
  653. X# 
  654. X# Available entries:
  655. X#         lib             --> creates the library
  656. X#        install        --> installs the library (archive, man page(s), header(s))
  657. X#        uninstall    --> uninstall the library
  658. X#        clean            --> removes all .o and .a files
  659. X#        spotless        --> clean + uninstall
  660. X#         lint            --> lints a file (usage: make lint MODULE=foo.c)
  661. X#        tags            --> creates a tags file (from the SOURCES and HEADERS)
  662. X#        checkout     --> checkout all files
  663. X#        dist            --> distribution support
  664. X#
  665. X
  666. XNAME                = str
  667. XVERSION            = 1.4.2
  668. X
  669. XHEADERS            = str.h strparse.h \
  670. X                        ss_impl.h ss_rk.h ss_kmp.h ss_sbm.h ss_bmh.h ss_so.h
  671. XSOURCES            = strutil.c strprint.c strparse.c strs.c \
  672. X                        ss_rk.c ss_kmp.c ss_bf.c ss_sbm.c ss_bmh.c ss_so.c
  673. XOBJECTS            = strutil.o strprint.o strparse.o strs.o \
  674. X                        ss_rk.o ss_kmp.o ss_bf.o ss_sbm.o ss_bmh.o ss_so.o
  675. X
  676. XMANFILES            = strparse.3 strprint.3 strutil.3 strs.3
  677. XINCLUDEFILES    = str.h
  678. X
  679. X# The following variables are used by the 'install' entry and
  680. X# should be customized:
  681. X#     LIBDIR:     where the library will be placed
  682. X#     INCUDEDIR:  where the include files will be placed
  683. X#     MANDIR:     where the man pages will be placed
  684. X#
  685. XLIBDIR            = $(HOME)/.links/libraries/$(ARCH)
  686. XMANDIR            = $(HOME)/.links/manpages/man3
  687. XINCLUDEDIR        = $(HOME)/.links/includes
  688. X
  689. X#
  690. X# Available flags
  691. X#    NBIC                : number of bits in a character variable (defaults to 8)
  692. X#    WIDE_INT            : widest integer supported by the CPU/compiler
  693. X#                          (defaults to 'long')
  694. X#    WIDE_INT_SIZE  : size of the WIDE_INT type in bits (defaults to 32);
  695. X#                          effective (and required) only when WIDE_INT is defined
  696. X#    NO_SIO            : if the SIO library is not available (results in turning
  697. X#                          all the string printing functions to no-ops)
  698. X#
  699. XDEFS                =         # for example, -DNO_SIO
  700. XDEBUG                = -g                # -g or -O
  701. XVERSION_DEF        = -DVERSION=\"STR\ Version\ $(VERSION)\"
  702. X
  703. XCPP_DEFS            = $(VERSION_DEF) $(DEFS)
  704. X
  705. X#
  706. X# The following variables shouldn't need to be changed
  707. X#
  708. XLINT_FLAGS        = -hbux
  709. XCPP_FLAGS        = $(CPP_DEFS) -I$(INCLUDEDIR)
  710. XCC_FLAGS            = $(DEBUG)
  711. XCFLAGS            = $(CPP_FLAGS) $(CC_FLAGS)
  712. X
  713. XINSTALL            = install -c
  714. XFMODE                = -m 640            # used by install
  715. XRANLIB            = ranlib
  716. X
  717. XPAGER                = less
  718. X
  719. X
  720. XLIBNAME            = lib$(NAME).a
  721. X
  722. Xlib: $(LIBNAME)
  723. X
  724. Xlibopt: clean
  725. X    make DEBUG=-O "DEFS=$(DEFS)" lib
  726. X    $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)-O
  727. X
  728. X$(LIBNAME): $(OBJECTS)
  729. X    ar r $@ $?
  730. X    $(RANLIB) $@
  731. X
  732. XLINT_IGNORE=possible pointer alignment|RCSid unused
  733. X
  734. Xlint:
  735. X    lint $(CPP_FLAGS) $(LINT_FLAGS) $(MODULE) 2>&1 | egrep -v '$(LINT_IGNORE)' | $(PAGER)
  736. X
  737. Xinstall: $(LIBNAME)
  738. X    @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
  739. X    then \
  740. X        $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
  741. X        echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
  742. X        for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
  743. X        echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
  744. X        for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
  745. X        echo Installed $(MANFILES) to $(MANDIR) ;\
  746. X    else \
  747. X        echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
  748. X    fi
  749. X
  750. Xuninstall:
  751. X    a=`pwd` ; cd $(INCLUDEDIR) ;\
  752. X    if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
  753. X    a=`pwd` ; cd $(LIBDIR) ;\
  754. X    if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
  755. X    a=`pwd` ; cd $(MANDIR) ;\
  756. X    if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
  757. X
  758. Xclean:
  759. X    rm -f $(OBJECTS) $(LIBNAME) core
  760. X
  761. Xspotless: clean uninstall
  762. X
  763. Xtags: $(SOURCES) $(HEADERS)
  764. X    ctags -w $(SOURCES) $(HEADERS)
  765. X
  766. Xcheckout:
  767. X    co $(SOURCES) $(HEADERS) $(MANFILES)
  768. X
  769. X#
  770. X# Distribution section
  771. X# This section contains the 2 targets for distribution support: dist, dirs
  772. X# "dist" checks out all files to be distributed
  773. X# "dirs" prints a list of directories to be included in the distribution.
  774. X# These directories should have a Makefile with a "dist" target
  775. X#
  776. XDISTRIBUTION_FILES    = $(SOURCES) $(HEADERS) $(MANFILES) COPYRIGHT README
  777. XDIRS                        =
  778. X
  779. Xdist:
  780. X    -co -q $(DISTRIBUTION_FILES)
  781. X
  782. Xdirs:
  783. X    @echo $(DIRS)
  784. X
  785. X#
  786. X# PUT HERE THE RULES TO MAKE THE OBJECT FILES
  787. X#
  788. Xstrparse.o:        strparse.h str.h
  789. Xstrprint.o:        str.h
  790. Xstrutil.o:        str.h
  791. Xstrs.o:            ss_impl.h str.h
  792. Xss_bf.o:            ss_impl.h
  793. Xss_rk.o:            ss_impl.h ss_rk.h
  794. Xss_kmp.o:        ss_impl.h ss_kmp.h
  795. Xss_sbm.o:        ss_impl.h ss_sbm.h
  796. Xss_bmh.o:        ss_impl.h ss_bmh.h
  797. Xss_so.o:            ss_impl.h ss_so.h
  798. X
  799. X
  800. X#
  801. X# Test program
  802. X#
  803. Xtt: tt.c $(LIBNAME)
  804. X    $(CC) -I$(INCDIR) -g -o $@ tt.c $(LIBNAME) -L$(LIBDIR) -lsio -lmisc
  805. X
  806. END_OF_FILE
  807. if test 4534 -ne `wc -c <'libs/src/str/Makefile'`; then
  808.     echo shar: \"'libs/src/str/Makefile'\" unpacked with wrong size!
  809. fi
  810. # end of 'libs/src/str/Makefile'
  811. fi
  812. if test -f 'libs/src/str/strparse.c' -a "${1}" != "-c" ; then 
  813.   echo shar: Will not clobber existing file \"'libs/src/str/strparse.c'\"
  814. else
  815. echo shar: Extracting \"'libs/src/str/strparse.c'\" \(4683 characters\)
  816. sed "s/^X//" >'libs/src/str/strparse.c' <<'END_OF_FILE'
  817. X/*
  818. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  819. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  820. X * and conditions for redistribution.
  821. X */
  822. X
  823. Xstatic char RCSid[] = "$Id: strparse.c,v 3.1 1993/06/13 02:48:19 panos Exp $" ;
  824. Xstatic char version[] = VERSION ;
  825. X
  826. X#include "str.h"
  827. X#include "strparse.h"
  828. X
  829. Xchar *strcpy() ;
  830. Xchar *strncpy() ;
  831. Xchar *strpbrk() ;
  832. X
  833. Xchar *malloc() ;
  834. X
  835. Xint str_errno ;
  836. X
  837. X
  838. XPRIVATE char *new_string( s )
  839. X    register char *s ;
  840. X{
  841. X    register char *p = malloc( (unsigned)strlen( s ) + 1 ) ;
  842. X
  843. X    return( p ? strcpy( p, s ) : p ) ;
  844. X}
  845. X
  846. X
  847. Xstr_h str_parse( str, separ, flags, errnop )
  848. X    register char    *str ;
  849. X    char                *separ ;
  850. X    int                flags ;
  851. X    int                *errnop ;
  852. X{
  853. X    register struct str_handle *hp ;
  854. X    int *errp = ( errnop == NULL ) ? &str_errno : errnop ;
  855. X
  856. X    if ( separ == NULL )
  857. X        HANDLE_ERROR( flags, NULL, errp, STR_ENULLSEPAR,
  858. X                                "STR str_parse: NULL separator\n" ) ;
  859. X
  860. X    hp = (struct str_handle *) malloc( sizeof( struct str_handle ) ) ;
  861. X    if ( hp == NULL )
  862. X        HANDLE_ERROR( flags, NULL, errp, STR_ENOMEM,
  863. X                                "STR str_parse: malloc failed\n" ) ;
  864. X
  865. X    hp->string = str ;
  866. X    hp->pos = str ;
  867. X    hp->separator = new_string( separ ) ;
  868. X    if ( hp->separator == NULL )
  869. X        if ( flags & STR_RETURN_ERROR )
  870. X        {
  871. X            free( (char *) hp ) ;
  872. X            *errp = STR_ENOMEM ;
  873. X            return( NULL ) ;
  874. X        }
  875. X        else
  876. X            TERMINATE( "STR str_parse: malloc failed\n" ) ;
  877. X    
  878. X    hp->flags = flags ;
  879. X    hp->errnop = errp ;
  880. X    hp->no_more = ( str == NULL ) ;
  881. X    return( (str_h) hp ) ;
  882. X}
  883. X
  884. X
  885. Xvoid str_endparse( handle )
  886. X    str_h handle ;
  887. X{
  888. X    register struct str_handle *hp = (struct str_handle *) handle ;
  889. X
  890. X    free( hp->separator ) ;
  891. X    free( (char *) handle ) ;
  892. X}
  893. X
  894. X
  895. X/*
  896. X * Change the string
  897. X */
  898. Xint str_setstr( handle, newstr )
  899. X    str_h handle ;
  900. X    char *newstr ;
  901. X{
  902. X    register struct str_handle *hp = (struct str_handle *) handle ;
  903. X    
  904. X    if ( newstr == NULL )
  905. X        HANDLE_ERROR( hp->flags, STR_ERR, hp->errnop, STR_ENULLSTRING,
  906. X                                "STR str_setstr: NULL string\n" ) ;
  907. X    
  908. X    hp->string = newstr ;
  909. X    hp->pos = newstr ;
  910. X    hp->no_more = FALSE ;
  911. X    return( STR_OK ) ;
  912. X}
  913. X
  914. X
  915. X
  916. X/*
  917. X * Change the separator
  918. X */
  919. Xint str_separator( handle, separator )
  920. X    str_h handle ;
  921. X    char *separator ;
  922. X{
  923. X    register struct str_handle *hp = (struct str_handle *) handle ;
  924. X    char *new_separator ;
  925. X
  926. X    if ( separator == NULL )
  927. X        HANDLE_ERROR( hp->flags, STR_ERR, hp->errnop, STR_ENULLSEPAR,
  928. X                                "STR str_separator: NULL separator\n" ) ;
  929. X    new_separator = new_string( separator ) ;
  930. X    if ( new_separator == NULL )
  931. X        HANDLE_ERROR( hp->flags, STR_ERR, hp->errnop, STR_ENOMEM,
  932. X            "STR str_separator: malloc failed\n" ) ;
  933. X
  934. X    free( hp->separator ) ;
  935. X    hp->separator = new_separator ;
  936. X    return( STR_OK ) ;
  937. X}
  938. X
  939. X
  940. Xchar *str_nextpos( handle )
  941. X    str_h handle ;
  942. X{
  943. X    struct str_handle *hp = (struct str_handle *) handle ;
  944. X
  945. X    if ( hp->no_more || *hp->pos == '\0' )
  946. X        return( NULL ) ;
  947. X    else
  948. X        return( hp->pos ) ;
  949. X}
  950. X
  951. X
  952. Xchar *str_component( handle )
  953. X    str_h handle ;
  954. X{
  955. X    register char                        *start ;
  956. X    register char                        *last ;
  957. X    register int                        sep_count ;
  958. X    char                                    *retval ;
  959. X    int                                    last_char ;
  960. X    register struct str_handle        *hp            = (struct str_handle *) handle ;
  961. X    register int                        first_call    = ( hp->pos == hp->string ) ;
  962. X
  963. X    if ( hp->no_more )
  964. X        return( NULL ) ;
  965. X
  966. X    /*
  967. X     * Get number of separator characters.
  968. X     * Find beginning of component.
  969. X     */
  970. X    sep_count = strspn( hp->pos, hp->separator ) ;
  971. X
  972. X    /*
  973. X     * If this is the first call, and there are separator characters
  974. X     * at the beginning of the string and the STR_NULL_START flag is set
  975. X     * we return a 0-length string.
  976. X     */
  977. X    if ( first_call && sep_count > 0 && ( hp->flags & STR_NULL_START ) )
  978. X    {
  979. X        start = hp->pos ;
  980. X        last = hp->pos ;
  981. X    }
  982. X    else
  983. X    {
  984. X        start = hp->pos + sep_count ;
  985. X
  986. X        if ( *start == '\0' )
  987. X        {
  988. X            last = start ;
  989. X            hp->no_more = TRUE ;
  990. X            if ( ! ( hp->flags & STR_NULL_END ) )
  991. X                return( NULL ) ;
  992. X        }
  993. X        else
  994. X        {
  995. X            last = strpbrk( start, hp->separator ) ;
  996. X            if ( last == NULL )
  997. X                last = start + strlen( start ) ;
  998. X        }
  999. X    }
  1000. X
  1001. X    /*
  1002. X     * At this point, the following variables must be set:
  1003. X     *        start:    beginning of component
  1004. X     *        last:       end of component + 1
  1005. X     *
  1006. X     * If STR_MALLOC is set, allocate space for the new string.
  1007. X     *
  1008. X     * NOTE: If STR_MALLOC is not set, the processed string is trashed.
  1009. X     */
  1010. X    last_char = *last ;
  1011. X    if ( hp->flags & STR_MALLOC )
  1012. X    {
  1013. X        int len = last - start ;
  1014. X
  1015. X        retval = malloc( (unsigned)len + 1 ) ;
  1016. X        if ( retval == NULL )
  1017. X            HANDLE_ERROR( hp->flags, NULL, hp->errnop, STR_ENOMEM,
  1018. X                                            "STR str_component: malloc failed\n" ) ;
  1019. X        strncpy( retval, start, len )[ len ] = '\0' ;
  1020. X    }
  1021. X    else
  1022. X    {
  1023. X        retval = start ;
  1024. X        *last = '\0' ;
  1025. X    }
  1026. X
  1027. X    /*
  1028. X     * Check if last_char is NUL to avoid setting hp->pos past the
  1029. X     * end of the string
  1030. X     */
  1031. X    hp->pos = ( last_char == '\0' ) ? last : last+1 ;
  1032. X    return( retval ) ;
  1033. X}
  1034. X
  1035. X
  1036. END_OF_FILE
  1037. if test 4683 -ne `wc -c <'libs/src/str/strparse.c'`; then
  1038.     echo shar: \"'libs/src/str/strparse.c'\" unpacked with wrong size!
  1039. fi
  1040. # end of 'libs/src/str/strparse.c'
  1041. fi
  1042. if test -f 'libs/src/str/strs.3' -a "${1}" != "-c" ; then 
  1043.   echo shar: Will not clobber existing file \"'libs/src/str/strs.3'\"
  1044. else
  1045. echo shar: Extracting \"'libs/src/str/strs.3'\" \(4394 characters\)
  1046. sed "s/^X//" >'libs/src/str/strs.3' <<'END_OF_FILE'
  1047. X.\"(c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  1048. X.\"All rights reserved.  The file named COPYRIGHT specifies the terms 
  1049. X.\"and conditions for redistribution.
  1050. X.\"
  1051. X.\" $Id: strs.3,v 3.1 1993/06/13 02:49:50 panos Exp $
  1052. X.TH STRS 3X "12 June 1993"
  1053. X.SH NAME
  1054. Xstrs_setup, strs_match, strs_done, strs_search - string matching functions
  1055. X.SH SYNOPSIS
  1056. X.LP
  1057. X.nf
  1058. X.ft B
  1059. X#include "str.h"
  1060. X.LP
  1061. X.ft B
  1062. Xstrs_h strs_setup( flags, pattern [, patlen] )
  1063. Xint flags ;
  1064. Xchar *pattern ;
  1065. X.LP
  1066. X.ft B
  1067. Xchar *strs_match( handle, str, len )
  1068. Xstrs_h handle ;
  1069. Xchar *str ;
  1070. Xint len ;
  1071. X.LP
  1072. X.ft B
  1073. Xvoid strs_done( handle )
  1074. Xstrs_h handle ;
  1075. X.LP
  1076. X.ft B
  1077. Xchar *strs_search( flags, str, len, pattern [, patlen] )
  1078. Xint flags ;
  1079. Xchar *str ;
  1080. Xint len ;
  1081. Xchar *pattern ;
  1082. X.SH DESCRIPTION
  1083. X.LP
  1084. XThese functions perform string matching. They have been designed with
  1085. Xthe assumption that one needs to find a certain pattern in a set of
  1086. Xstrings. It is also possible to use them to find if a pattern occurs
  1087. Xin a specific string.
  1088. X.LP
  1089. X.B strs_setup()
  1090. Xis used to specify the pattern to look for. It returns a
  1091. X.I handle
  1092. Xwhich is used in subsequent string matching operations against
  1093. Xthe specified
  1094. X.I pattern.
  1095. XThe
  1096. X.I flags
  1097. Xargument has two parts: a search method and generic flags.
  1098. XThe available search methods include the following algorithms:
  1099. X.RS
  1100. X.TP 15
  1101. X.SB STRS_BF
  1102. Xbrute force algorithm (also called naive in the literature). 
  1103. X.TP
  1104. X.SB STRS_RK
  1105. XRabin-Karp algorithm (probabilistic).
  1106. X.TP
  1107. X.SB STRS_KMP
  1108. XKnuth-Morris-Pratt algorithm.
  1109. X.TP
  1110. X.SB STRS_SBM
  1111. XSimple Boyer-Moore (uses only the last occurrence heuristic).
  1112. X.TP
  1113. X.SB STRS_BMH
  1114. XThis is the Boyer-Moore algorithm using the last occurrence heuristic
  1115. Xas modified by Horspool (this is faster than the simple Boyer-Moore).
  1116. X.TP
  1117. X.SB STRS_SO
  1118. XShift-Or algorithm (this algorithm works only for patterns whose length
  1119. Xdoes not exceed the number of bits in a word).
  1120. X.RE
  1121. X.LP
  1122. XThe default algorithm is the brute force method.
  1123. XIn practice, the fastest algorithm is the
  1124. XBoyer-Moore-Horspool one.
  1125. X.LP
  1126. XThe flags that can be specified include:
  1127. X.RS
  1128. X.TP 15
  1129. X.SB STRS_NOMALLOC
  1130. Xdo not allocate space for the pattern. This can be specified if
  1131. Xthe pattern space will be available during the matching phase
  1132. X(i.e. do not use this flag if the pattern space was malloc'ed and
  1133. Xyou free it before doing any matching).
  1134. X.TP
  1135. X.SB STRS_IGNCASE
  1136. Xperform case-insensitive string matching
  1137. X(the default is case-sensitive matching).
  1138. X.TP
  1139. X.SB STRS_NOSWITCH
  1140. Xdisallows switching to another search method; a switch to the brute
  1141. Xforce algorithm happens if the length of the pattern is less than 4
  1142. Xor if the initialization of the specified search algorithm fails (for
  1143. Xexample, when using the shift-or algorithm with a very long pattern).
  1144. XWhen this flag is used, no switch happens.
  1145. X.TP
  1146. X.SB STRS_PATLEN
  1147. Xis used to explicitly specify the length of the pattern
  1148. X(with the
  1149. X.I patlen
  1150. Xargument); normally the pattern is assumed to be NUL-terminated.
  1151. X.RE
  1152. X.LP
  1153. X.B strs_match()
  1154. Xtries to match the string specified by
  1155. X.I str
  1156. Xagainst the pattern identified by
  1157. X.I handle.
  1158. XSince the length of the string is given by the
  1159. X.I len
  1160. Xargument the string does not need to be NUL-terminated.
  1161. X.B strs_done()
  1162. Xshould be invoked after all matching against the pattern identified by
  1163. X.I handle
  1164. Xis done.
  1165. X.LP
  1166. X.B strs_search()
  1167. Xis equivalent to:
  1168. X.LP
  1169. X.PD .1v
  1170. X.nf
  1171. X.RS
  1172. Xh = strs_setup( flags, pattern ) ;
  1173. Xp = strs_match( h, str, len ) ;
  1174. Xstrs_done( h ) ;
  1175. Xreturn( p ) ;
  1176. X.RE
  1177. X.PD
  1178. X.SH "RETURN VALUES"
  1179. X.LP
  1180. X.B strs_setup()
  1181. Xreturns a search handle on success or
  1182. X.SM NULL
  1183. Xon failure.
  1184. X.LP
  1185. X.B strs_match()
  1186. Xand
  1187. X.B strs_search()
  1188. Xreturn a pointer to the first occurrence of the pattern in the string or
  1189. X.SM NULL
  1190. Xif the pattern does not occur in the string.
  1191. X.SH "SEE ALSO"
  1192. XDonald E. Knuth, James H. Morris, Vaughan R. Pratt.
  1193. XFast pattern matching in strings.
  1194. XSIAM Journal on Computing, 6(2):323-350, 1977.
  1195. X.LP
  1196. XRichard M. Karp, Michael O. Rabin.
  1197. XEfficient randomized pattern-matching algorithms.
  1198. XTechnical Report TR-31-81,
  1199. XAiken Computation Laboratory, Harvard University, 1981.
  1200. X.LP
  1201. XRobert S. Boyer, J. Strother Moore.
  1202. XA fast string-searching algorithm.
  1203. XCommunications of the ACM, 20(10):762-772, 1977.
  1204. X.LP
  1205. XN. Horspool.
  1206. XPractical fast searching in strings.
  1207. XSoftware - Practice and Experience, 10:501-506, 1980.
  1208. X.LP
  1209. XR. Baeza-Yates, G.H. Gonnet.
  1210. XA new approach to text searching.
  1211. XProceedings of 12th SIGIR, June 1989.
  1212. X.LP
  1213. XThomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest.
  1214. XIntroduction to Algorithms.
  1215. XMcGraw-Hill 1990.
  1216. END_OF_FILE
  1217. if test 4394 -ne `wc -c <'libs/src/str/strs.3'`; then
  1218.     echo shar: \"'libs/src/str/strs.3'\" unpacked with wrong size!
  1219. fi
  1220. # end of 'libs/src/str/strs.3'
  1221. fi
  1222. echo shar: End of archive 9 \(of 20\).
  1223. cp /dev/null ark9isdone
  1224. MISSING=""
  1225. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
  1226.     if test ! -f ark${I}isdone ; then
  1227.     MISSING="${MISSING} ${I}"
  1228.     fi
  1229. done
  1230. if test "${MISSING}" = "" ; then
  1231.     echo You have unpacked all 20 archives.
  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.