home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / xinetd21 / part05 < prev    next >
Encoding:
Text File  |  1993-06-26  |  33.1 KB  |  1,255 lines

  1. Newsgroups: comp.sources.unix
  2. From: panos@cs.colorado.edu (Panos Tsirigotis)
  3. Subject: v26i249: xinetd-2.1.1 - inetd replacement with access control and logging, Part05/31
  4. Sender: unix-sources-moderator@gw.home.vix.com
  5. Approved: vixie@gw.home.vix.com
  6.  
  7. Submitted-By: panos@cs.colorado.edu (Panos Tsirigotis)
  8. Posting-Number: Volume 26, Issue 249
  9. Archive-Name: xinetd-2.1.1/part05
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 5 (of 31)."
  18. # Contents:  libs/src/misc/env.3 libs/src/pset/pset.h
  19. #   libs/src/sio/events.h libs/src/str/README libs/src/str/ss_impl.h
  20. #   libs/src/str/ss_so.c libs/src/str/strprint.3 libs/src/xlog/impl.h
  21. #   xinetd/options.c
  22. # Wrapped by panos@mystique on Mon Jun 21 14:51:21 1993
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'libs/src/misc/env.3' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'libs/src/misc/env.3'\"
  26. else
  27. echo shar: Extracting \"'libs/src/misc/env.3'\" \(2942 characters\)
  28. sed "s/^X//" >'libs/src/misc/env.3' <<'END_OF_FILE'
  29. X.\"(c) Copyright 1992 by Panagiotis Tsirigotis
  30. X.\"All rights reserved.  The file named COPYRIGHT specifies the terms 
  31. X.\"and conditions for redistribution.
  32. X.\"
  33. X.\" $Id: env.3,v 1.1 1992/10/20 20:44:30 panos Exp $
  34. X.TH ENV 3L "20 October 1992"
  35. X.SH NAME
  36. Xenv_create, env_destroy, env_make, env_addvar, env_addstr, env_remvar, env_lookup, env_getvars -- environment manipulation functions
  37. X.SH SYNOPSIS
  38. X.LP
  39. X.nf
  40. X.ft B
  41. X#include "env.h"
  42. X.LP
  43. X.ft B
  44. Xenv_h env_create( env )
  45. Xenv_h env ;
  46. X.LP
  47. X.ft B
  48. Xvoid env_destroy( env )
  49. Xenv_h env ;
  50. X.LP
  51. X.ft B
  52. Xenv_h env_make( env_strings )
  53. Xchar **env_strings ;
  54. X.LP
  55. X.ft B
  56. Xint env_addvar( env, from_env, var )
  57. Xenv_h env ;
  58. Xenv_h from_env ;
  59. Xchar *var ;
  60. X.LP
  61. X.ft B
  62. Xint env_addstr( env, str )
  63. Xenv_h env ;
  64. Xchar *str ;
  65. X.LP
  66. X.ft B
  67. Xint env_remvar( env, var )
  68. Xenv_h env ;
  69. Xchar *var ;
  70. X.LP
  71. X.ft B
  72. Xchar **env_getvars( env )
  73. Xenv_h env ;
  74. X.SH DESCRIPTION
  75. XThis library handles environments. An environment is a set of strings
  76. Xof the form 
  77. X.I "name=value".
  78. XIn the following, we will use the term string as a synonym of
  79. XNUL-terminated array of 
  80. X.I char.
  81. X.LP
  82. X.B env_create()
  83. Xcreates a new environment. The new environment will be empty unless
  84. Xthe argument
  85. X.I env
  86. Xis not
  87. X.SB ENV_NULL.
  88. XIn that case, the new environment will be a duplicate of 
  89. X.I env
  90. X(i.e. they will contain the same strings).
  91. X.LP
  92. X.B env_destroy()
  93. Xdestroys the specified environment.
  94. X.LP
  95. X.B env_make()
  96. Xcreates a new environment which includes the
  97. X.I env_strings.
  98. X.I env_strings
  99. Xshould be a NULL-terminated array of strings.
  100. X.LP
  101. X.B env_addvar()
  102. Xadds the specified variable
  103. X.I var
  104. Xto
  105. X.I env.
  106. XThe variable value is obtained from the environment
  107. X.I from_env.
  108. XIf the variable exists already in 
  109. X.I env
  110. Xthe old value is replaced with the new value.
  111. X.LP
  112. X.B env_addstr()
  113. Xadds a string of the form
  114. X.I "name=value"
  115. Xto
  116. X.I env.
  117. X.LP
  118. X.B env_remvar()
  119. Xremoves the specified variable
  120. X.I var
  121. Xfrom the environment
  122. X.I env.
  123. X.LP
  124. X.B env_lookup()
  125. Xsearches
  126. X.I env
  127. Xfor variable
  128. X.I var.
  129. XIt returns a string of the form
  130. X.I "name=value"
  131. Xwhere
  132. X.I name
  133. Xis the name of the variable
  134. X(i.e. it is equal to
  135. X.I var).
  136. X.LP
  137. X.B env_getvars
  138. Xreturns a NULL-terminated array of strings of the form
  139. X.I "name=value".
  140. X.SH "RETURN VALUES"
  141. XIn case of error, all calls will place an error code in the global variable
  142. X.I env_errno.
  143. XPossible error codes:
  144. X.TP 15
  145. X.SB ENV_ENOMEM
  146. Xout of memory
  147. X.TP
  148. X.SB ENV_EBADVAR
  149. Xvariable is not in environment
  150. X.TP
  151. X.SB ENV_EBADSTRING
  152. Xstring is not well-formed (i.e. is not of the form \fIname=value\fR).
  153. X.LP
  154. X.B env_create()
  155. Xreturns a handle or 
  156. X.SM ENV_NULL
  157. Xif it fails.
  158. X.LP
  159. X.B env_make()
  160. Xreturns a handle or 
  161. X.SM ENV_NULL
  162. Xif it fails.
  163. X.LP
  164. X.B env_addvar()
  165. Xreturns
  166. X.SM ENV_OK
  167. Xon success or
  168. X.SM ENV_ERR
  169. Xon failure.
  170. X.LP
  171. X.B env_addstr()
  172. Xreturns
  173. X.SM ENV_OK
  174. Xon success or
  175. X.SM ENV_ERR
  176. Xon failure.
  177. X.LP
  178. X.B env_remvar()
  179. Xreturns
  180. X.SM ENV_OK
  181. Xon success or
  182. X.SM ENV_ERR
  183. Xif the variable is not part of the environment.
  184. X.LP
  185. X.B env_loopkup()
  186. Xreturns a string on success or
  187. X.SM NULL
  188. Xon failure.
  189. X.SH "SEE ALSO"
  190. Xenviron(5)
  191. END_OF_FILE
  192. if test 2942 -ne `wc -c <'libs/src/misc/env.3'`; then
  193.     echo shar: \"'libs/src/misc/env.3'\" unpacked with wrong size!
  194. fi
  195. # end of 'libs/src/misc/env.3'
  196. fi
  197. if test -f 'libs/src/pset/pset.h' -a "${1}" != "-c" ; then 
  198.   echo shar: Will not clobber existing file \"'libs/src/pset/pset.h'\"
  199. else
  200. echo shar: Extracting \"'libs/src/pset/pset.h'\" \(3125 characters\)
  201. sed "s/^X//" >'libs/src/pset/pset.h' <<'END_OF_FILE'
  202. X/*
  203. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  204. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  205. X * and conditions for redistribution.
  206. X */
  207. X
  208. X#ifndef __PSET_H
  209. X#define __PSET_H
  210. X
  211. X/*
  212. X * $Id: pset.h,v 3.1 1993/03/06 18:50:18 panos Exp $
  213. X */
  214. X
  215. Xtypedef void *__pset_pointer ;
  216. X
  217. Xstruct __pset
  218. X{
  219. X    unsigned alloc_step ;
  220. X    __pset_pointer *ptrs ;
  221. X    unsigned max ;
  222. X    unsigned count ;
  223. X} ;
  224. X
  225. X
  226. X/*
  227. X * INTERFACE
  228. X */
  229. X
  230. X#ifdef __ARGS
  231. X#undef __ARGS
  232. X#endif
  233. X
  234. X#ifdef PROTOTYPES
  235. X#  define __ARGS( s )               s
  236. X#else
  237. X#  define __ARGS( s )               ()
  238. X#endif
  239. X
  240. Xtypedef struct __pset *pset_h ;
  241. X
  242. Xpset_h pset_create            __ARGS( ( unsigned start, unsigned step ) ) ;
  243. Xvoid pset_destroy                __ARGS( ( pset_h ) ) ;
  244. X
  245. X__pset_pointer pset_insert __ARGS( ( pset_h, __pset_pointer ) ) ;
  246. Xvoid pset_delete                __ARGS( ( pset_h, __pset_pointer ) ) ;
  247. X
  248. Xvoid pset_compact             __ARGS( ( pset_h ) ) ;
  249. Xvoid pset_uniq                 __ARGS( ( pset_h, void (*func)(), void *arg ) ) ;
  250. Xvoid pset_apply                 __ARGS( ( pset_h, void (*func)(), void *arg ) ) ;
  251. X
  252. X/*
  253. X * Macros
  254. X */
  255. X#define pset_add( pset, ptr )                                               \
  256. X      (                                                                 \
  257. X         ( (pset)->count < (pset)->max )                                \
  258. X            ? (pset)->ptrs[ (pset)->count++ ] = (__pset_pointer) ptr    \
  259. X            : pset_insert( (pset), (__pset_pointer) ptr )                    \
  260. X      )
  261. X
  262. X#define pset_remove( pset, ptr )            pset_delete( pset, (__pset_pointer)ptr )
  263. X
  264. X#define pset_remove_index( pset, i )                                                \
  265. X        {                                                                                        \
  266. X            if ( (i) < (pset)->count )                                                    \
  267. X                 (pset)->ptrs[ i ] = (pset)->ptrs[ --(pset)->count ] ;        \
  268. X        }
  269. X
  270. X#define pset_clear( pset )                (pset)->count = 0
  271. X#define pset_count( pset )                (pset)->count
  272. X#define pset_pointer( pset, i )        (pset)->ptrs[ i ]
  273. X
  274. X#define pset_sort( pset, compfunc )                                                    \
  275. X        (void) qsort( (char *) &pset_pointer( pset, 0 ),                        \
  276. X                pset_count( pset ), sizeof( __pset_pointer ), compfunc )
  277. X
  278. X/*
  279. X * PSET iterators
  280. X * 
  281. X * Note that the iterators do NOT use any knowledge about the internals
  282. X * of pset's.
  283. X */
  284. Xstruct __pset_iterator
  285. X{
  286. X    pset_h pset ;
  287. X    unsigned current ;
  288. X    int step ;
  289. X} ;
  290. X
  291. Xtypedef struct __pset_iterator *psi_h ;
  292. X
  293. X
  294. X#define __psi_current( iter )                                                            \
  295. X                        ( (iter)->current < pset_count( (iter)->pset )            \
  296. X                            ? pset_pointer( (iter)->pset, (iter)->current )        \
  297. X                            : NULL )
  298. X
  299. X#define psi_start( iter )                                                            \
  300. X                    ( (iter)->current = 0, (iter)->step = 1,                        \
  301. X                    __psi_current( iter ) )
  302. X
  303. X#define psi_next( iter )                                                             \
  304. X                    ( (iter)->current += (iter)->step, (iter)->step = 1,        \
  305. X                    __psi_current( iter ) )
  306. X
  307. X#define psi_remove( iter )                                                            \
  308. X                {                                                                                \
  309. X                    if ( (iter)->current < pset_count( (iter)->pset ) )        \
  310. X                    {                                                                            \
  311. X                        pset_remove_index( (iter)->pset, (iter)->current ) ;    \
  312. X                        (iter)->step = 0 ;                                                \
  313. X                    }                                                                            \
  314. X                }
  315. X
  316. X#define psi_reset( iter, newpset )        (iter)->pset = (newpset)
  317. X
  318. X#define psi_destroy( iter )                free( (char *) iter )
  319. X
  320. Xpsi_h psi_create __ARGS( ( pset_h ) ) ;
  321. X
  322. X#endif    /* __PSET_H */
  323. X
  324. END_OF_FILE
  325. if test 3125 -ne `wc -c <'libs/src/pset/pset.h'`; then
  326.     echo shar: \"'libs/src/pset/pset.h'\" unpacked with wrong size!
  327. fi
  328. # end of 'libs/src/pset/pset.h'
  329. fi
  330. if test -f 'libs/src/sio/events.h' -a "${1}" != "-c" ; then 
  331.   echo shar: Will not clobber existing file \"'libs/src/sio/events.h'\"
  332. else
  333. echo shar: Extracting \"'libs/src/sio/events.h'\" \(3168 characters\)
  334. sed "s/^X//" >'libs/src/sio/events.h' <<'END_OF_FILE'
  335. X/*
  336. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  337. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  338. X * and conditions for redistribution.
  339. X */
  340. X
  341. X
  342. X/*
  343. X * $Id: events.h,v 8.1 1993/03/13 01:13:58 panos Exp $
  344. X */
  345. X
  346. X/*
  347. X * Event codes
  348. X * 
  349. X * We use a 2 letter code so that events that accumulate in a buffer
  350. X * can be displayed as a string
  351. X * We follow the convention that the first event letter is a capitalized
  352. X * and the second letter is in lower case. This allows one to easily
  353. X * recognize events in an event string.
  354. X */
  355. X
  356. X/*
  357. X * The ENCODE macro takes 2 characters and creates a short integer
  358. X * The size of the short integer is assumed to be 16-bits.
  359. X * The macro makes sure that regardless of the endianess of the machine,
  360. X * the low order byte contains the 1st character and the high order byte
  361. X * contains the 2nd character.
  362. X */
  363. X#ifdef LITTLE_ENDIAN
  364. X#define ENCODE( c1, c2 )                    ( (c1) + ( (c2) << 8 ) )
  365. X#else        /* BIG_ENDIAN */
  366. X#define ENCODE( c1, c2 )                    ( (c2) + ( (c1) << 8 ) )
  367. X#endif
  368. X
  369. X/*
  370. X * Event codes for SIO interface functions
  371. X * We use the first 2 lettes after the initial 'S'
  372. X */
  373. X#define EV_SGETC                        ENCODE( 'G', 'e' )
  374. X#define EV_SPUTC                        ENCODE( 'P', 'u' )
  375. X#define EV_SREAD                        ENCODE( 'R', 'e' )
  376. X#define EV_SWRITE                        ENCODE( 'W', 'r' ) 
  377. X#define EV_SRDLINE                    ENCODE( 'R', 'd' )
  378. X#define EV_SFETCH                        ENCODE( 'F', 'e' )
  379. X#define EV_SUNDO                        ENCODE( 'U', 'n' )
  380. X#define EV_SDONE                        ENCODE( 'D', 'o' )
  381. X#define EV_SFLUSH                        ENCODE( 'F', 'l' )
  382. X#define EV_SCLOSE                        ENCODE( 'C', 'l' )
  383. X#define EV_STIE                        ENCODE( 'T', 'i' )
  384. X#define EV_SUNTIE                        ENCODE( 'U', 't' )
  385. X#define EV_SBUFTYPE                    ENCODE( 'B', 'u' )
  386. X
  387. X/*
  388. X * Event codes for internal functions
  389. X * For the __sio_<name> functions we use 'S' and the first letter of <name>
  390. X * For the rest we use the first letter from the first two components of
  391. X * their name, for example for try_memory_mapping we use Tm.
  392. X */
  393. X#define EV_SIO_INIT                    ENCODE( 'S', 'i' )
  394. X#define EV_SIO_SWITCH                ENCODE( 'S', 's' )
  395. X#define EV_SIO_READF                    ENCODE( 'S', 'r' )
  396. X#define EV_SIO_WRITEF                ENCODE( 'S', 'w' )
  397. X#define EV_SIO_EXTEND_BUFFER        ENCODE( 'S', 'e' )
  398. X#define EV_SIO_MORE                    ENCODE( 'S', 'm' )
  399. X#define EV_TRY_MEMORY_MAPPING        ENCODE( 'T', 'm' )
  400. X#define EV_INITIAL_MAP                ENCODE( 'I', 'm' )
  401. X#define EV_MAP_UNIT                    ENCODE( 'M', 'u' )
  402. X#define EV_INIT_INPUT_STREAM        ENCODE( 'I', 'i' )
  403. X#define EV_INIT_OUTPUT_STREAM        ENCODE( 'I', 'o' )
  404. X
  405. X/*
  406. X * The # of entries must be a power of 2
  407. X */
  408. X#define EVENT_ENTRIES        512
  409. X
  410. Xstruct events
  411. X{
  412. X    short next ;
  413. X    short start ;
  414. X    short *codes ;            /* malloc'ed memory */
  415. X} ;
  416. X
  417. Xtypedef struct events events_s ;
  418. X
  419. Xextern events_s *__sio_events ;
  420. X
  421. X
  422. X#define ADD( index, x )                (index) += x ;                                \
  423. X                                            (index) &= ( EVENT_ENTRIES - 1 )
  424. X
  425. X#define EVENT( fd, code )                                                            \
  426. X                    {                                                                        \
  427. X                        events_s *evp = &__sio_events[ fd ] ;                    \
  428. X                                                                                            \
  429. X                        if ( evp->codes != NULL )                                    \
  430. X                        {                                                                    \
  431. X                            evp->codes[ evp->next ] = code ;                        \
  432. X                            ADD( evp->next, 1 ) ;                                    \
  433. X                            if ( evp->next == evp->start )                        \
  434. X                            { ADD( evp->start, 1 ) ; }                                \
  435. X                        }                                                                    \
  436. X                    }
  437. X
  438. END_OF_FILE
  439. if test 3168 -ne `wc -c <'libs/src/sio/events.h'`; then
  440.     echo shar: \"'libs/src/sio/events.h'\" unpacked with wrong size!
  441. fi
  442. # end of 'libs/src/sio/events.h'
  443. fi
  444. if test -f 'libs/src/str/README' -a "${1}" != "-c" ; then 
  445.   echo shar: Will not clobber existing file \"'libs/src/str/README'\"
  446. else
  447. echo shar: Extracting \"'libs/src/str/README'\" \(3029 characters\)
  448. sed "s/^X//" >'libs/src/str/README' <<'END_OF_FILE'
  449. X======================================================================
  450. XNOTE: I use vi with a tabstop value of 3. Using the same tabstop
  451. X        value will make the text/code look properly indented.
  452. X======================================================================
  453. X
  454. X
  455. X1. What is this library about ?
  456. X
  457. XThe STR library consists of string handling functions. These
  458. Xfunctions can be separated into 4 groups:
  459. X
  460. XA. String matching functions. A variety of algorithms are available
  461. X    for string matching:
  462. X            brute force
  463. X            Rabin-Karp
  464. X            Knuth-Morris-Pratt
  465. X            Boyer-Moore
  466. X            Shift-or
  467. X
  468. XB. String printing functions (similar to sprintf). These functions offer
  469. X    2 significant advantages over sprintf:
  470. X        1) they include functions that will *not* overrun the string buffer 
  471. X            provided
  472. X        2) they include functions returning "char *" as well as functions
  473. X            returning "int" so that one can pick the most appropriate one.
  474. X
  475. XC. String parsing functions. These functions offer an easy way of breaking
  476. X    a string into pieces.
  477. X
  478. XD. String utility functions. This group includes functions that will
  479. X    convert a string to upper/lower case etc.
  480. X
  481. X
  482. X2. Setting up the STR library
  483. X
  484. XAll you need to do is type 'make'. This will create the library in the
  485. Xcurrent directory.  The string printing functions use (and therefore
  486. Xrequire) the underlying format conversion facility of my SIO (Stream
  487. XI/O) library.  If you don't want to bother with it, you can define the
  488. Xflag NO_SIO in the Makefile (check the Makefile comments on how to do
  489. Xthis) which will turn all string printing functions to no-ops.  The SIO
  490. Xlibrary is available from mystique.cs.colorado.edu in the directory
  491. Xpub/libs (it may also be available at other places).  Make sure you get
  492. XSIO version 1.6.2 or later; versions prior to 1.6.2 will result in
  493. Xidentical behavior between the strx_*print* and the str_*print*
  494. Xfunctions.
  495. X
  496. XTo install the library and the associated man pages and include files
  497. Xtype 'make install'. This will install the library in LIBDIR, the man
  498. Xpages in MANDIR and the include files in INCLUDEDIR.  LIBDIR,
  499. XINCLUDEDIR, and MANDIR are Makefile variables that you can edit in the
  500. XMakefile or override when you invoke 'make'.
  501. X
  502. X
  503. X
  504. X3. Epilogue
  505. X
  506. XPlease send bug-reports/comments to panos@cs.colorado.edu
  507. X
  508. XYou can obtain the latest version of this library from
  509. Xmystique.cs.colorado.edu in the directory pub/libs.
  510. X
  511. XFeel free to modify the library to suit your needs.  If you want to
  512. Xdistribute modifications to this library, please read the COPYRIGHT
  513. Xfile.  It basically says that you are free to redistribute as long as
  514. Xyou retain the original copyright notice and you make sure that your
  515. Xmodifications are identifiable. In order to achieve this I have
  516. Xreserved the first 3 components of the version number (for example,
  517. X1.4.2) and you can identify your mods by appending another component to
  518. Xthat version number (for example, 1.4.2.A2). Also, if you distribute a
  519. Xmodified version of the library, you take full responsibility for any
  520. Xbugs in the code (not just your code; the whole thing).
  521. X
  522. END_OF_FILE
  523. if test 3029 -ne `wc -c <'libs/src/str/README'`; then
  524.     echo shar: \"'libs/src/str/README'\" unpacked with wrong size!
  525. fi
  526. # end of 'libs/src/str/README'
  527. fi
  528. if test -f 'libs/src/str/ss_impl.h' -a "${1}" != "-c" ; then 
  529.   echo shar: Will not clobber existing file \"'libs/src/str/ss_impl.h'\"
  530. else
  531. echo shar: Extracting \"'libs/src/str/ss_impl.h'\" \(2969 characters\)
  532. sed "s/^X//" >'libs/src/str/ss_impl.h' <<'END_OF_FILE'
  533. X/*
  534. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  535. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  536. X * and conditions for redistribution.
  537. X */
  538. X
  539. X#ifndef SS_IMPL_H
  540. X#define SS_IMPL_H
  541. X
  542. X/*
  543. X * $Id: ss_impl.h,v 3.2 1993/06/16 00:06:34 panos Exp $
  544. X */
  545. X
  546. X/*
  547. X * NBIC is the Number-of-Bits-In-a-Char
  548. X */
  549. X#ifndef NBIC
  550. X#define NBIC                                8
  551. X#endif
  552. X
  553. X#define ALPHABET_SIZE                    ( 1 << NBIC )
  554. X
  555. X#ifndef WIDE_INT
  556. X#define WIDE_INT                 long
  557. X#define WIDE_INT_SIZE            32       /* bits */
  558. X#endif
  559. X
  560. Xtypedef WIDE_INT wide_int ;
  561. Xtypedef unsigned WIDE_INT u_wide_int ;
  562. X
  563. X
  564. X#include "ss_rk.h"
  565. X#include "ss_kmp.h"
  566. X#include "ss_sbm.h"
  567. X#include "ss_bmh.h"
  568. X#include "ss_so.h"
  569. X
  570. X#include "str.h"
  571. X
  572. Xstruct ss_ops
  573. X{
  574. X    int    (*so_setup)() ;
  575. X    char    *(*so_match)() ;
  576. X    void    (*so_done)() ;
  577. X} ;
  578. X
  579. X
  580. Xstruct ss_header
  581. X{
  582. X    char                 *ss_pattern ;
  583. X    int                ss_patlen ;
  584. X    int                ss_flags ;
  585. X    char                *ss_map ;                /* either identity or upper->lower */
  586. X    struct ss_ops    *ss_ops ;
  587. X    union ss_headers
  588. X    {
  589. X        struct rk_header    rkh ;
  590. X        struct kmp_header kmph ;
  591. X        struct sbm_header sbmh ;
  592. X        struct bmh_header bmhh ;
  593. X        struct so_header    soh ;
  594. X    } ss_h ;
  595. X} ;
  596. X
  597. Xtypedef struct ss_header header_s ;
  598. X
  599. X#define HP( p )                            ((header_s *)(p))
  600. X
  601. X/*
  602. X * Structure field access
  603. X */
  604. X#define SS_PATTERN( hp )                (hp)->ss_pattern
  605. X#define SS_PATLEN( hp )                    (hp)->ss_patlen
  606. X#define SS_FLAGS( hp )                    (hp)->ss_flags
  607. X#define SS_OPS( hp )                        (hp)->ss_ops
  608. X#define SS_SETMAP( hp, map )            (hp)->ss_map = map
  609. X#define SS_MAP( hp, c )                    (hp)->ss_map[ (unsigned char) (c) ]
  610. X
  611. X/*
  612. X * Predicates
  613. X */
  614. X#define SS_MALLOC( hp )                ( ! ( SS_FLAGS( hp ) & STRS_NOMALLOC ) )
  615. X#define SS_IGNCASE( hp )            ( SS_FLAGS( hp ) & STRS_IGNCASE )
  616. X#define SS_SWITCH( hp )                ( ! ( SS_FLAGS( hp ) & STRS_NOSWITCH ) )
  617. X#define SS_SETMALLOC( hp )            SS_FLAGS( hp ) &= ~ STRS_NOMALLOC
  618. X
  619. X/*
  620. X * Indirect op invocation
  621. X */
  622. X#define SS_SETUP( hp )                    (*SS_OPS( hp )->so_setup)( hp )
  623. X#define SS_MATCH( hp, str, len )        (*SS_OPS( hp )->so_match)( hp, str, len )
  624. X#define SS_DONE( hp )                    (*SS_OPS( hp )->so_done)( hp )
  625. X
  626. X/*
  627. X * Header extraction
  628. X */
  629. X#define RK_HEADER( hp )                    (&(hp)->ss_h.rkh)
  630. X#define KMP_HEADER( hp )                (&(hp)->ss_h.kmph)
  631. X#define SBM_HEADER( hp )                (&(hp)->ss_h.sbmh)
  632. X#define BMH_HEADER( hp )                (&(hp)->ss_h.bmhh)
  633. X#define SO_HEADER( hp )                    (&(hp)->ss_h.soh)
  634. X
  635. X/*
  636. X * Macros to extract method and flags from the 'flags' argument
  637. X */
  638. X#define METHOD_BITS                        5        /* flag bits devoted to methods */
  639. X#define METHOD_MASK                        ( ( 1 << METHOD_BITS ) - 1 )
  640. X#define SS_GETMETHOD( x )                ( (x) & METHOD_MASK )
  641. X#define SS_GETFLAGS( x )                ( (x) & ~METHOD_MASK )
  642. X
  643. X
  644. Xstruct ss_select
  645. X{
  646. X    int                sel_method ;
  647. X    struct ss_ops    *sel_ops ;
  648. X} ;
  649. X
  650. X
  651. X#ifndef NULL
  652. X#define NULL                                0
  653. X#endif
  654. X
  655. X#ifndef FALSE
  656. X#define FALSE                                0
  657. X#define TRUE                                1
  658. X#endif
  659. X
  660. X#define CHAR_NULL                            ((char *)0)
  661. X#define NULL_HANDLE                        ((strs_h)0)
  662. X
  663. X#define PRIVATE                            static
  664. X
  665. X
  666. X/*
  667. X * Return values
  668. X */
  669. X#define SS_OK                                0
  670. X#define SS_ERR                                (-1)
  671. X
  672. X#endif    /* SS_IMPL_H */
  673. X
  674. END_OF_FILE
  675. if test 2969 -ne `wc -c <'libs/src/str/ss_impl.h'`; then
  676.     echo shar: \"'libs/src/str/ss_impl.h'\" unpacked with wrong size!
  677. fi
  678. # end of 'libs/src/str/ss_impl.h'
  679. fi
  680. if test -f 'libs/src/str/ss_so.c' -a "${1}" != "-c" ; then 
  681.   echo shar: Will not clobber existing file \"'libs/src/str/ss_so.c'\"
  682. else
  683. echo shar: Extracting \"'libs/src/str/ss_so.c'\" \(2898 characters\)
  684. sed "s/^X//" >'libs/src/str/ss_so.c' <<'END_OF_FILE'
  685. X/*
  686. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  687. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  688. X * and conditions for redistribution.
  689. X */
  690. X
  691. Xstatic char RCSid[] = "$Id: ss_so.c,v 3.1 1993/06/13 02:46:12 panos Exp $" ;
  692. X
  693. Xchar *malloc() ;
  694. X
  695. X#include "ss_impl.h"
  696. X
  697. XPRIVATE int so_setup() ;
  698. XPRIVATE char *so_match() ;
  699. XPRIVATE void so_done() ;
  700. X
  701. Xstruct ss_ops __strs_soops = { so_setup, so_match, so_done } ;
  702. X
  703. X/*
  704. X * There is a single twist in this implementation of the shift-or algorithm:
  705. X * To make the check for complete match faster, we are using the sign-bit
  706. X * of the word. This means that everything is shifted to the left by
  707. X *             (word_size - pattern_length)
  708. X */
  709. X
  710. XPRIVATE int so_setup( hp )
  711. X    header_s *hp ;
  712. X{
  713. X    register wide_int        *maskbuf ;
  714. X    register wide_int        mask ;
  715. X    register wide_int        offset_mask ;
  716. X    register int            i ;
  717. X    int                        offset ;
  718. X    register int            patlen    = SS_PATLEN( hp ) ;
  719. X    register char            *pattern = SS_PATTERN( hp ) ;
  720. X
  721. X    if ( patlen > WIDE_INT_SIZE )
  722. X        return( SS_ERR ) ;
  723. X    
  724. X    maskbuf = (wide_int *) malloc( ALPHABET_SIZE * sizeof( wide_int ) ) ;
  725. X    if ( maskbuf == (wide_int *)NULL )
  726. X        return( SS_ERR ) ;
  727. X    
  728. X    offset = WIDE_INT_SIZE - patlen ;
  729. X    offset_mask = ( (~0) << offset ) ;
  730. X    
  731. X    /*
  732. X     * The bits of each word that won't be used must be set to 0
  733. X     */
  734. X    for ( i = 0 ; i < ALPHABET_SIZE ; i++ )
  735. X        maskbuf[ i ] = offset_mask ;
  736. X
  737. X    for ( i = 0, mask = 1 << offset ; i < patlen ; i++, mask <<= 1 )
  738. X        maskbuf[ (unsigned char) pattern[ i ] ] &= ~mask ;
  739. X
  740. X    SO_HEADER( hp )->mask = maskbuf ;
  741. X    SO_HEADER( hp )->offset_mask = offset_mask ;
  742. X    return( SS_OK ) ;
  743. X}
  744. X
  745. X
  746. XPRIVATE char *so_match( hp, str, len )
  747. X    register header_s        *hp ;
  748. X    char                        *str ;
  749. X    int                        len ;
  750. X{
  751. X    register char            *p ;
  752. X    register char            pfc                = SS_PATTERN( hp )[ 0 ] ;
  753. X    register wide_int        *mask                = SO_HEADER( hp )->mask ;
  754. X    register char            *endmatch        = &str[ len - SS_PATLEN( hp ) + 1 ] ;
  755. X    char                        *endstr            = &str[ len ] ;
  756. X    wide_int                    no_match_state = ~0 & SO_HEADER( hp )->offset_mask ;
  757. X
  758. X    /*
  759. X     * The shift-or algorithm can be described by the following for-loop:
  760. X     *
  761. X     *    for ( p = str ; p < endstr ; p++ )
  762. X     *    {
  763. X     *        state = ( state << 1 ) | mask[ (unsigned char) SS_MAP( hp, *p ) ] ;
  764. X     *        if ( state >= 0 )
  765. X     *            return( &p[ -SS_PATLEN( hp ) + 1 ] ) ;
  766. X     *    }
  767. X     *
  768. X     * For efficiency reasons, the algorithm is used only after the first 
  769. X     * character of the pattern is matched against a character of the string.
  770. X     */
  771. X
  772. X    for ( p = str ; p < endmatch ; p++ )
  773. X    {
  774. X        register wide_int state ;
  775. X
  776. X        if ( SS_MAP( hp, *p ) != pfc )
  777. X            continue ;
  778. X
  779. X        for ( state = no_match_state ; p < endstr ; p++ )
  780. X        {
  781. X            state = ( state << 1 ) | mask[ (unsigned char) SS_MAP( hp, *p ) ] ;
  782. X            if ( state >= 0 )
  783. X                return( &p[ -SS_PATLEN( hp ) + 1 ] ) ;
  784. X            if ( state == no_match_state )
  785. X                break ;
  786. X        }
  787. X    }
  788. X    return( CHAR_NULL ) ;
  789. X}
  790. X
  791. X
  792. XPRIVATE void so_done( hp )
  793. X    header_s *hp ;
  794. X{
  795. X    (void) free( (char *) SO_HEADER( hp )->mask ) ;
  796. X}
  797. X
  798. END_OF_FILE
  799. if test 2898 -ne `wc -c <'libs/src/str/ss_so.c'`; then
  800.     echo shar: \"'libs/src/str/ss_so.c'\" unpacked with wrong size!
  801. fi
  802. # end of 'libs/src/str/ss_so.c'
  803. fi
  804. if test -f 'libs/src/str/strprint.3' -a "${1}" != "-c" ; then 
  805.   echo shar: Will not clobber existing file \"'libs/src/str/strprint.3'\"
  806. else
  807. echo shar: Extracting \"'libs/src/str/strprint.3'\" \(3148 characters\)
  808. sed "s/^X//" >'libs/src/str/strprint.3' <<'END_OF_FILE'
  809. X.\"(c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  810. X.\"All rights reserved.  The file named COPYRIGHT specifies the terms 
  811. X.\"and conditions for redistribution.
  812. X.\"
  813. X.\" $Id: strprint.3,v 3.1 1993/06/13 02:48:55 panos Exp $
  814. X.TH STRPRINT 3X "30 September 1992"
  815. X.SH NAME
  816. Xstr_sprint, tr_sprintv, str_nprint, str_nprintv, str_print, str_printv, strx_sprint, strx_sprintv, strx_nprint, strx_nprintv, strx_print, strx_printv -- formatted conversion to string
  817. X.SH SYNOPSIS
  818. X.LP
  819. X.nf
  820. X.ft B
  821. X#include "str.h"
  822. X.LP
  823. X.ft B
  824. Xchar *str_sprint( buf, format, ... )
  825. Xchar *buf ;
  826. Xchar *format ;
  827. X.LP
  828. X.ft B
  829. Xchar *str_sprintv( buf, format, ap )
  830. Xchar *buf ;
  831. Xchar *format ;
  832. Xva_list ap ;
  833. X.LP
  834. X.ft B
  835. Xint str_nprint( buf, format, ... )
  836. Xchar *buf ;
  837. Xchar *format ;
  838. X.LP
  839. X.ft B
  840. Xint str_nprintv( buf, format, ap )
  841. Xchar *buf ;
  842. Xchar *format ;
  843. Xva_list ap ;
  844. X.LP
  845. X.ft B
  846. Xvoid str_print( countp, buf, format, ... )
  847. Xint *countp ;
  848. Xchar *buf ;
  849. Xchar *format ;
  850. X.LP
  851. X.ft B
  852. Xvoid str_printv( countp, buf, format, ap )
  853. Xint *countp ;
  854. Xchar *buf ;
  855. Xchar *format ;
  856. Xva_list ap ;
  857. X.LP
  858. X.ft B
  859. Xchar *strx_sprint( buf, len, format, ... )
  860. Xchar *buf ;
  861. Xint len ;
  862. Xchar *format ;
  863. X.LP
  864. X.ft B
  865. Xchar *strx_sprintv( buf, len, format, ap )
  866. Xchar *buf ;
  867. Xint len ;
  868. Xchar *format ;
  869. Xva_list ap ;
  870. X.LP
  871. X.ft B
  872. Xint strx_nprint( buf, len, format, ... )
  873. Xchar *buf ;
  874. Xint len ;
  875. Xchar *format ;
  876. X.LP
  877. X.ft B
  878. Xint strx_nprintv( buf, len, format, ap )
  879. Xchar *buf ;
  880. Xint len ;
  881. Xchar *format ;
  882. Xva_list ap ;
  883. X.LP
  884. X.ft B
  885. Xvoid strx_print( countp, buf, len, format, ... )
  886. Xint *countp ;
  887. Xchar *buf ;
  888. Xint len ;
  889. Xchar *format ;
  890. X.LP
  891. X.ft B
  892. Xvoid strx_printv( countp, buf, len, format, ap )
  893. Xint *countp ;
  894. Xchar *buf ;
  895. Xint len ;
  896. Xchar *format ;
  897. Xva_list ap ;
  898. X.SH DESCRIPTION
  899. X.LP
  900. XAll functions are similar in functionality to \fIsprintf()\fR.
  901. XTheir only difference is in their return values. For information about their
  902. Xconversion capabilities, check \fISprint(3)\fR.
  903. X.LP
  904. XThe difference between the \fIstr_*\fR and the \fIstrx_*\fR functions
  905. Xis that the latter take an extra argument, the size of the buffer, so
  906. Xthat they will never write beyond the end of the buffer. Writing
  907. Xbeyond the end of the buffer is possible with the \fIstr_*\fR functions.
  908. XInvoking any of the \fIstrx_*\fR functions with the
  909. X.I len
  910. Xargument set to 0
  911. Xis the same as calling the equivalent \fIstr_*\fR function.
  912. X.LP
  913. XAll functions will append a
  914. X.SM NUL
  915. Xat the end of
  916. X.I buf
  917. X(the \fIstrx_*\fR functions will not do this if it would cause 
  918. Xa buffer overrun).
  919. X.LP
  920. X.B str_print(),
  921. X.B str_printv(),
  922. X.B strx_print(),
  923. Xand
  924. X.B strx_printv()
  925. Xwill put in
  926. X.I "*countp"
  927. Xthe number of characters placed in 
  928. X.I buf
  929. Xexcluding the ending
  930. X.SM NUL
  931. X(this happens only if
  932. X.I "*countp"
  933. Xis not
  934. X.SM NULL
  935. X).
  936. X.LP
  937. XThe functions that have a name ending in 'v' are similar to those without
  938. Xthe 'v' at the end of their name
  939. Xexcept that instead of accepting a variable number of arguments, they
  940. Xexpect a \fIvarargs(3)\fR argument list.
  941. X.SH "RETURN VALUES"
  942. X.LP
  943. X.B str_sprint(),
  944. X.B str_sprintv(),
  945. X.B strx_sprint(),
  946. Xand
  947. X.B strx_sprintv()
  948. Xreturn
  949. X.I buf.
  950. X.LP
  951. X.B str_nprint(),
  952. X.B str_nprintv(),
  953. X.B strx_nprint(),
  954. Xand
  955. X.B strx_nprintv()
  956. Xreturn the number of characters placed in 
  957. X.I buf
  958. Xexcluding the ending
  959. X.SM NUL.
  960. X.SH "SEE ALSO"
  961. XSprint(3)
  962. END_OF_FILE
  963. if test 3148 -ne `wc -c <'libs/src/str/strprint.3'`; then
  964.     echo shar: \"'libs/src/str/strprint.3'\" unpacked with wrong size!
  965. fi
  966. # end of 'libs/src/str/strprint.3'
  967. fi
  968. if test -f 'libs/src/xlog/impl.h' -a "${1}" != "-c" ; then 
  969.   echo shar: Will not clobber existing file \"'libs/src/xlog/impl.h'\"
  970. else
  971. echo shar: Extracting \"'libs/src/xlog/impl.h'\" \(2862 characters\)
  972. sed "s/^X//" >'libs/src/xlog/impl.h' <<'END_OF_FILE'
  973. X/*
  974. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  975. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  976. X * and conditions for redistribution.
  977. X */
  978. X
  979. X
  980. X/*
  981. X * $Id: impl.h,v 2.1 1993/05/06 07:40:05 panos Exp $
  982. X */
  983. X
  984. X
  985. X#define DEFINE_LINK_TYPE( type, name )        struct { type *next, *prev ; } name
  986. X
  987. X
  988. X#define NEXT( obj, field )                        (obj)->field.next
  989. X#define PREV( obj, field )                        (obj)->field.prev
  990. X
  991. X#define INIT_LINKS( obj, field )                                                            \
  992. X                    {                                                                                \
  993. X                        NEXT( obj, field ) = obj ;                                            \
  994. X                        PREV( obj, field ) = obj ;                                            \
  995. X                    }
  996. X
  997. X/*
  998. X * Link new object after object using the specified field
  999. X */
  1000. X#define LINK( obj, new_obj, field )                                                        \
  1001. X            {                                                                                        \
  1002. X                NEXT( new_obj, field ) = NEXT( obj, field ) ;                        \
  1003. X                PREV( new_obj, field ) = obj ;                                            \
  1004. X                NEXT( obj, field ) = new_obj ;                                            \
  1005. X                PREV( NEXT( obj, field ), field ) = new_obj ;                        \
  1006. X            }
  1007. X
  1008. X#define UNLINK( obj, field )                                                                \
  1009. X                    {                                                                                \
  1010. X                        NEXT( PREV( obj, field ), field ) = NEXT( obj, field ) ;    \
  1011. X                        PREV( NEXT( obj, field ), field ) = PREV( obj, field ) ;    \
  1012. X                    }
  1013. X
  1014. X
  1015. X/*
  1016. X * xlog linking:
  1017. X *     When xlog1 is linked to xlog2 (i.e. errors on xlog1 are reported to 
  1018. X *        xlog2) we use the xl_clients field on xlog2 and the xl_other_users 
  1019. X *        field on xlog1
  1020. X */
  1021. Xstruct xlog
  1022. X{
  1023. X    xlog_e             xl_type ;
  1024. X    char                 *xl_id ;
  1025. X    int                 xl_flags ;
  1026. X    void                 (*xl_callback)() ;
  1027. X    void                 *xl_callback_arg ;
  1028. X    struct xlog     *xl_use ;                /* xlog we report errors to         */
  1029. X    struct xlog     *xl_clients ;            /* linked list of xlogs that use */
  1030. X                                                    /* this xlog to report errors     */
  1031. X    DEFINE_LINK_TYPE( struct xlog, xl_other_users ) ;
  1032. X    struct xlog_ops
  1033. X    {
  1034. X        int     (*init)        __ARGS( ( struct xlog *, va_list ) ) ;
  1035. X        void    (*fini)         __ARGS( ( struct xlog * ) ) ;
  1036. X        int    (*write)        __ARGS( ( struct xlog *, char *, int, int, va_list ) ) ;
  1037. X        int    (*control)    __ARGS( ( struct xlog *, xlog_cmd_e, va_list ) ) ;
  1038. X        int    (*parms)     __ARGS( ( va_list ) ) ;
  1039. X    }                     *xl_ops ;
  1040. X    void                 *xl_data ;
  1041. X} ;
  1042. X
  1043. X#define XL_INIT( xp, ap )                    (*(xp)->xl_ops->init)( (xp), (ap) )
  1044. X#define XL_FINI( xp )                        (*(xp)->xl_ops->fini)( xp )
  1045. X#define XL_WRITE( xp, buf, size, flags, ap ) \
  1046. X                    (*(xp)->xl_ops->write)( (xp), (buf), (size), (flags), (ap ) )
  1047. X#define XL_CONTROL( xp, cmd, ap ) \
  1048. X                    (*(xp)->xl_ops->control)( (xp), (cmd), (ap) )
  1049. X
  1050. Xtypedef struct xlog xlog_s ;
  1051. X
  1052. Xtypedef void (*voidfunc)() ;
  1053. Xtypedef int bool_int ;
  1054. X
  1055. X#define XP( p )                        ((struct xlog *)(p))
  1056. X
  1057. X#define XLOG_NULL                        XP( NULL )
  1058. X
  1059. X#ifndef FALSE
  1060. X#define FALSE        0
  1061. X#define TRUE        1
  1062. X#endif
  1063. X
  1064. X#ifndef NULL
  1065. X#define NULL        0
  1066. X#endif
  1067. X
  1068. X#define NEW( type )                    (type *) malloc( sizeof( type ) )
  1069. X#define FREE( p )                        (void) free( (char *)p )
  1070. X
  1071. X#define PRIVATE        static
  1072. X
  1073. Xchar *__xlog_add_errno() ;
  1074. Xchar *__xlog_explain_errno() ;
  1075. Xchar *__xlog_new_string() ;
  1076. X
  1077. Xchar *malloc() ;
  1078. X
  1079. END_OF_FILE
  1080. if test 2862 -ne `wc -c <'libs/src/xlog/impl.h'`; then
  1081.     echo shar: \"'libs/src/xlog/impl.h'\" unpacked with wrong size!
  1082. fi
  1083. # end of 'libs/src/xlog/impl.h'
  1084. fi
  1085. if test -f 'xinetd/options.c' -a "${1}" != "-c" ; then 
  1086.   echo shar: Will not clobber existing file \"'xinetd/options.c'\"
  1087. else
  1088. echo shar: Extracting \"'xinetd/options.c'\" \(3203 characters\)
  1089. sed "s/^X//" >'xinetd/options.c' <<'END_OF_FILE'
  1090. X/*
  1091. X * (c) Copyright 1992 by Panagiotis Tsirigotis
  1092. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  1093. X * and conditions for redistribution.
  1094. X */
  1095. X
  1096. X#include "options.h"
  1097. X
  1098. X/*
  1099. X * $Id: options.opt,v 6.2 1993/04/22 23:37:23 panos Exp $
  1100. X */
  1101. X
  1102. X
  1103. X#define NULL         0
  1104. X
  1105. Xvoid exit() ;
  1106. X
  1107. Xint d_option ;
  1108. Xint f_option ;
  1109. Xchar * f_option_arg_1 ;
  1110. Xint filelog_option ;
  1111. Xchar * filelog_option_arg_1 ;
  1112. Xint syslog_option ;
  1113. Xchar * syslog_option_arg_1 ;
  1114. Xint reuse_option ;
  1115. Xint limit_option ;
  1116. Xunsigned limit_option_arg_1 ;
  1117. Xint loop_option ;
  1118. Xunsigned loop_option_arg_1 ;
  1119. Xint pid_option ;
  1120. Xint logprocs_option ;
  1121. Xunsigned logprocs_option_arg_1 ;
  1122. Xint shutdownprocs_option ;
  1123. Xunsigned shutdownprocs_option_arg_1 ;
  1124. Xint cc_option ;
  1125. Xunsigned cc_option_arg_1 ;
  1126. X
  1127. Xchar *program_name ;
  1128. X
  1129. Xint opt_recognize( argc, argv )
  1130. X    int argc ;
  1131. X    char *argv[] ;
  1132. X{
  1133. X    int arg ;
  1134. X    char *strrchr() ;
  1135. X
  1136. X    program_name = strrchr( argv[ 0 ], '/' ) ;
  1137. X    program_name = ( program_name == NULL ) ? argv[ 0 ] : program_name + 1 ;
  1138. X
  1139. X    for ( arg = 1 ; arg < argc ; arg++ )
  1140. X        if ( argv[ arg ][ 0 ] == '-' && argv[ arg ][ 1 ] != 0 )
  1141. X        {
  1142. X            if ( strcmp( &argv[ arg ][ 1 ], "d" ) == 0 ) 
  1143. X                d_option = 1 ;
  1144. X            else if ( strcmp( &argv[ arg ][ 1 ], "f" ) == 0 ) 
  1145. X            {
  1146. X                if ( ++arg == argc )
  1147. X                    usage() ;
  1148. X                f_option_arg_1 = ( argv[ arg ] ) ;
  1149. X                f_option = 1 ;
  1150. X            }
  1151. X            else if ( strcmp( &argv[ arg ][ 1 ], "filelog" ) == 0 ) 
  1152. X            {
  1153. X                if ( ++arg == argc )
  1154. X                    usage() ;
  1155. X                filelog_option_arg_1 = ( argv[ arg ] ) ;
  1156. X                filelog_option = 1 ;
  1157. X            }
  1158. X            else if ( strcmp( &argv[ arg ][ 1 ], "syslog" ) == 0 ) 
  1159. X            {
  1160. X                if ( ++arg == argc )
  1161. X                    usage() ;
  1162. X                syslog_option_arg_1 = ( argv[ arg ] ) ;
  1163. X                syslog_option = 1 ;
  1164. X            }
  1165. X            else if ( strcmp( &argv[ arg ][ 1 ], "reuse" ) == 0 ) 
  1166. X                reuse_option = 1 ;
  1167. X            else if ( strcmp( &argv[ arg ][ 1 ], "limit" ) == 0 ) 
  1168. X            {
  1169. X                int atoi() ;
  1170. X
  1171. X                if ( ++arg == argc )
  1172. X                    usage() ;
  1173. X                limit_option_arg_1 = atoi( argv[ arg ] ) ;
  1174. X                limit_option = 1 ;
  1175. X            }
  1176. X            else if ( strcmp( &argv[ arg ][ 1 ], "loop" ) == 0 ) 
  1177. X            {
  1178. X                int atoi() ;
  1179. X
  1180. X                if ( ++arg == argc )
  1181. X                    usage() ;
  1182. X                loop_option_arg_1 = atoi( argv[ arg ] ) ;
  1183. X                loop_option = 1 ;
  1184. X            }
  1185. X            else if ( strcmp( &argv[ arg ][ 1 ], "pid" ) == 0 ) 
  1186. X                pid_option = 1 ;
  1187. X            else if ( strcmp( &argv[ arg ][ 1 ], "logprocs" ) == 0 ) 
  1188. X            {
  1189. X                int atoi() ;
  1190. X
  1191. X                if ( ++arg == argc )
  1192. X                    usage() ;
  1193. X                logprocs_option_arg_1 = atoi( argv[ arg ] ) ;
  1194. X                logprocs_option = 1 ;
  1195. X            }
  1196. X            else if ( strcmp( &argv[ arg ][ 1 ], "shutdownprocs" ) == 0 ) 
  1197. X            {
  1198. X                int atoi() ;
  1199. X
  1200. X                if ( ++arg == argc )
  1201. X                    usage() ;
  1202. X                shutdownprocs_option_arg_1 = atoi( argv[ arg ] ) ;
  1203. X                shutdownprocs_option = 1 ;
  1204. X            }
  1205. X            else if ( strcmp( &argv[ arg ][ 1 ], "cc" ) == 0 ) 
  1206. X            {
  1207. X                int atoi() ;
  1208. X
  1209. X                if ( ++arg == argc )
  1210. X                    usage() ;
  1211. X                cc_option_arg_1 = atoi( argv[ arg ] ) ;
  1212. X                cc_option = 1 ;
  1213. X            }
  1214. X        }
  1215. X        else
  1216. X            break ;
  1217. X
  1218. X    if ( filelog_option + syslog_option > 1 )
  1219. X        usage() ;
  1220. X
  1221. X
  1222. X    if ( argc - arg != 0 )
  1223. X        usage() ;
  1224. X    return( arg ) ;
  1225. X}
  1226. X
  1227. Xvoid usage()
  1228. X{
  1229. X    Sprint( 2, "Usage: %s [-d] [-f config_file] [-filelog filename] [-syslog facility] [-reuse] [-limit proc_limit] [-loop loop_rate] [-pid] [-logprocs limit] [-shutdownprocs limit] [-cc interval]\n", program_name ) ;
  1230. X    exit( 1 ) ;
  1231. X}
  1232. END_OF_FILE
  1233. if test 3203 -ne `wc -c <'xinetd/options.c'`; then
  1234.     echo shar: \"'xinetd/options.c'\" unpacked with wrong size!
  1235. fi
  1236. # end of 'xinetd/options.c'
  1237. fi
  1238. echo shar: End of archive 5 \(of 31\).
  1239. cp /dev/null ark5isdone
  1240. MISSING=""
  1241. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ; do
  1242.     if test ! -f ark${I}isdone ; then
  1243.     MISSING="${MISSING} ${I}"
  1244.     fi
  1245. done
  1246. if test "${MISSING}" = "" ; then
  1247.     echo You have unpacked all 31 archives.
  1248.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1249. else
  1250.     echo You still need to unpack the following archives:
  1251.     echo "        " ${MISSING}
  1252. fi
  1253. ##  End of shell archive.
  1254. exit 0
  1255.