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

  1. Newsgroups: comp.sources.unix
  2. From: panos@cs.colorado.edu (Panos Tsirigotis)
  3. Subject: v26i251: xinetd-2.1.1 - inetd replacement with access control and logging, Part07/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 251
  9. Archive-Name: xinetd-2.1.1/part07
  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 7 (of 31)."
  18. # Contents:  libs/src/misc/Makefile libs/src/misc/ftwx.c
  19. #   libs/src/str/str.h libs/src/str/strprint.c libs/src/str/strutil.c
  20. #   libs/src/timer/timemacros.h libs/src/xlog/Makefile
  21. # Wrapped by panos@mystique on Mon Jun 21 14:51:22 1993
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'libs/src/misc/Makefile' -a "${1}" != "-c" ; then 
  24.   echo shar: Will not clobber existing file \"'libs/src/misc/Makefile'\"
  25. else
  26. echo shar: Extracting \"'libs/src/misc/Makefile'\" \(3674 characters\)
  27. sed "s/^X//" >'libs/src/misc/Makefile' <<'END_OF_FILE'
  28. X# (c) Copyright 1992 by Panagiotis Tsirigotis
  29. X# All rights reserved.  The file named COPYRIGHT specifies the terms 
  30. X# and conditions for redistribution.
  31. X
  32. X#
  33. X# $Id: Makefile,v 2.9 1992/11/06 02:20:41 panos Exp $
  34. X#
  35. X# Based on Library makefile template: *Revision: 1.15 *
  36. X#
  37. X
  38. X# 
  39. X# Available entries:
  40. X#         lib             --> creates the library
  41. X#        install        --> installs the library (archive, man page(s), header(s))
  42. X#        uninstall    --> uninstall the library
  43. X#        clean            --> removes all .o and .a files
  44. X#        spotless        --> clean + uninstall
  45. X#         lint            --> lints a file (usage: make lint MODULE=foo.c)
  46. X#        tags            --> creates a tags file (from the SOURCES and HEADERS)
  47. X#        checkout     --> checkout all files
  48. X#        dist            --> distribution support
  49. X#
  50. X
  51. XNAME                = misc
  52. XVERSION            = 1.2.2
  53. X
  54. XHEADERS            = misc.h ftwx.h env.h
  55. XSOURCES            = misc.c ftwx.c env.c
  56. XOBJECTS            = misc.o ftwx.o env.o
  57. X
  58. XMANFILES            = misc.3 ftwx.3 env.3
  59. XINCLUDEFILES    = $(HEADERS)
  60. X
  61. X# The following variables are used by the 'install' entry and
  62. X# should be customized:
  63. X#     LIBDIR:     where the library will be placed
  64. X#     INCUDEDIR:  where the include files will be placed
  65. X#     MANDIR:     where the man pages will be placed
  66. X#
  67. XLIBDIR            = $(HOME)/.links/libraries/$(ARCH)
  68. XMANDIR            = $(HOME)/.links/manpages/man3
  69. XINCLUDEDIR        = $(HOME)/.links/includes
  70. X
  71. X#
  72. X# Possible flags:
  73. X#     -DOLD_DIR         : must include <sys/dir.h> instead of <dirent.h>
  74. X#     -D__FTWX_NO_FTW   : does not have <ftw.h>
  75. X#
  76. XDEFS                =                # used for command line defined flags
  77. X
  78. XDEBUG                = -g                # -g or -O
  79. XVERSION_DEF        = -DVERSION=\"MISC\ Version\ $(VERSION)\"
  80. X
  81. XCPP_DEFS            = $(VERSION_DEF) $(DEFS)
  82. X
  83. X#
  84. X# The following variables shouldn't need to be changed
  85. X#
  86. XLINT_FLAGS        = -hbux
  87. XCPP_FLAGS        = $(CPP_DEFS)
  88. XCC_FLAGS            = $(DEBUG)
  89. XCFLAGS            = $(CPP_FLAGS) $(CC_FLAGS)
  90. X
  91. XINSTALL            = install -c
  92. XFMODE                = -m 640            # used by install
  93. XRANLIB            = ranlib
  94. X
  95. XPAGER                = less
  96. X
  97. X
  98. XLIBNAME            = lib$(NAME).a
  99. X
  100. Xlib: $(LIBNAME)
  101. X
  102. Xlibopt: clean
  103. X    make DEBUG=-O lib
  104. X    mv $(LIBNAME) $(LIBDIR)/optimized
  105. X
  106. X
  107. X$(LIBNAME): $(OBJECTS)
  108. X    ar r $@ $?
  109. X    $(RANLIB) $@
  110. X
  111. Xlint:
  112. X    lint $(CPP_FLAGS) $(LINT_FLAGS) $(MODULE) 2>&1 | $(PAGER)
  113. X
  114. Xinstall: $(LIBNAME)
  115. X    @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
  116. X    then \
  117. X        $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
  118. X        echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
  119. X        for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
  120. X        echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
  121. X        for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
  122. X        echo Installed $(MANFILES) to $(MANDIR) ;\
  123. X    else \
  124. X        echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
  125. X    fi
  126. X
  127. Xuninstall:
  128. X    a=`pwd` ; cd $(INCLUDEDIR) ;\
  129. X    if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
  130. X    a=`pwd` ; cd $(LIBDIR) ;\
  131. X    if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
  132. X    a=`pwd` ; cd $(MANDIR) ;\
  133. X    if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
  134. X
  135. Xclean:
  136. X    rm -f $(OBJECTS) $(LIBNAME) core
  137. X
  138. Xspotless: clean uninstall
  139. X
  140. Xtags: $(SOURCES) $(HEADERS)
  141. X    ctags -w $(SOURCES) $(HEADERS)
  142. X
  143. Xcheckout:
  144. X    co $(SOURCES) $(HEADERS) $(MANFILES)
  145. X
  146. X#
  147. X# Distribution section
  148. X# This section contains the 2 targets for distribution support: dist, dirs
  149. X# "dist" checks out all files to be distributed
  150. X# "dirs" prints a list of directories to be included in the distribution.
  151. X# These directories should have a Makefile with a "dist" target
  152. X#
  153. XDISTRIBUTION_FILES    = $(HEADERS) $(SOURCES) $(MANFILES) README
  154. XDIRS                        =
  155. X
  156. Xdist:
  157. X    -co -q $(DISTRIBUTION_FILES)
  158. X
  159. Xdirs:
  160. X    @echo $(DIRS)
  161. X
  162. X#
  163. X# PUT HERE THE RULES TO MAKE THE OBJECT FILES
  164. X#
  165. Xmisc.o:        misc.h
  166. Xftwx.o:        ftwx.h misc.h
  167. Xenv.o:        env.h misc.h
  168. X
  169. X
  170. X#
  171. X# Test program
  172. X#
  173. Xtt: tt.c $(LIBNAME)
  174. X    $(CC) -g tt.c -o $@ $(LIBNAME) -L$(LIBDIR) -ltest
  175. X
  176. END_OF_FILE
  177. if test 3674 -ne `wc -c <'libs/src/misc/Makefile'`; then
  178.     echo shar: \"'libs/src/misc/Makefile'\" unpacked with wrong size!
  179. fi
  180. # end of 'libs/src/misc/Makefile'
  181. fi
  182. if test -f 'libs/src/misc/ftwx.c' -a "${1}" != "-c" ; then 
  183.   echo shar: Will not clobber existing file \"'libs/src/misc/ftwx.c'\"
  184. else
  185. echo shar: Extracting \"'libs/src/misc/ftwx.c'\" \(3822 characters\)
  186. sed "s/^X//" >'libs/src/misc/ftwx.c' <<'END_OF_FILE'
  187. X/*
  188. X * (c) Copyright 1992 by Panagiotis Tsirigotis
  189. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  190. X * and conditions for redistribution.
  191. X */
  192. X
  193. Xstatic char RCSid[] = "$Id: ftwx.c,v 2.1 1992/10/01 00:41:02 panos Exp $" ;
  194. X
  195. X#include <sys/types.h>
  196. X#include <sys/stat.h>
  197. X#include <sys/file.h>
  198. X#ifndef OLD_DIR
  199. X#include <dirent.h>
  200. X#else
  201. X#include <sys/dir.h>
  202. X#define dirent direct
  203. X#endif
  204. X
  205. Xextern int errno ;
  206. X
  207. X#include "misc.h"
  208. X#include "ftwx.h"
  209. X
  210. X#define PRIVATE            static
  211. X
  212. X#define NUL                    '\0'
  213. X
  214. X
  215. Xtypedef enum { NO, YES } boolean_e ;
  216. X
  217. Xstatic struct
  218. X{
  219. X    int (*stat_func)() ;
  220. X    int (*user_func)() ;
  221. X} ftwx_data ;
  222. X
  223. X/*
  224. X * ftwx is an extension to ftw, that optionally follows symlinks (the
  225. X * default is NOT to follow them).
  226. X *
  227. X * Possible flag values:
  228. X *        FTWX_FOLLOW:         follow symlinks
  229. X *
  230. X * Possible depth values:
  231. X *        0            : means only the specified path
  232. X *        positive : means go as deep as specified
  233. X *        FTWX_ALL : no depth limitation
  234. X *
  235. X * User function return value:
  236. X *        negative : means an error occured and the traversal should stop
  237. X *        0            : OK
  238. X *        positive : means that if the current object is a directory it
  239. X *                      should not be traversed.
  240. X *
  241. X * Return value:
  242. X *        -1         : if an error occurs
  243. X *  frv            : frv is the function return value if it is negative (it
  244. X *                      should not be -1).
  245. X *        0            : if successful
  246. X */
  247. Xint ftwx( path, func, depth, flags )
  248. X    char *path ;
  249. X    int (*func)() ;
  250. X    int depth ;
  251. X    int flags ;
  252. X{
  253. X    int stat(), lstat() ;
  254. X
  255. X    /*
  256. X     * Initialize the data structure
  257. X     */
  258. X    ftwx_data.stat_func = ( flags & FTWX_FOLLOW ) ? stat : lstat ;
  259. X    ftwx_data.user_func = func ;
  260. X
  261. X    return( ftwx_traverse( path, depth ) ) ;
  262. X}
  263. X
  264. X
  265. X
  266. X
  267. X/*
  268. X * ftwx_traverse works in two phases:
  269. X *
  270. X * Phase 1: process the current path
  271. X *
  272. X * Phase 2: if the current path is a directory, it invokes ftwx_traverse
  273. X *                for each directory entry
  274. X */
  275. XPRIVATE int ftwx_traverse( path, depth )
  276. X    char *path ;
  277. X    int depth ;
  278. X{
  279. X    DIR *dirp ;
  280. X    struct stat st ;
  281. X    int ftw_flag = 0 ;
  282. X    boolean_e traverse = YES ;
  283. X    int retval ;
  284. X    int save_errno ;
  285. X
  286. X    if ( (*ftwx_data.stat_func)( path, &st ) == -1 )
  287. X        ftw_flag = FTW_NS ;
  288. X    else
  289. X    {
  290. X        /*
  291. X         * If it is a directory and determine if it is readable
  292. X         * (if it is not readable, we don't traverse it
  293. X         */
  294. X        if ( S_ISDIR( st.st_mode ) )
  295. X            if ( access( path, R_OK ) == 0 )
  296. X                ftw_flag = FTW_D ;
  297. X            else
  298. X                ftw_flag = FTW_DNR ;
  299. X        else
  300. X            ftw_flag = FTW_F ;
  301. X    }
  302. X    retval = (*ftwx_data.user_func)( path, &st, ftw_flag ) ;
  303. X    if ( retval < 0 )
  304. X        return( retval ) ;
  305. X    else if ( retval > 0 && ftw_flag == FTW_D )
  306. X        traverse = NO ;
  307. X
  308. X    /*
  309. X     * Stop traversal if:
  310. X     *        a. depth reached 0
  311. X     *        b. the current path is not a readable directory
  312. X     *        c. the user doesn't want us to traverse this directory tree
  313. X     */
  314. X    if ( depth == 0 || ftw_flag != FTW_D || traverse == NO )
  315. X        return( 0 ) ;
  316. X
  317. X    if ( depth != FTWX_ALL )
  318. X        depth-- ;
  319. X
  320. X    if ( ( dirp = opendir( path ) ) == NULL )
  321. X        return( -1 ) ;
  322. X
  323. X    for ( ;; )
  324. X    {
  325. X        struct dirent *dp ;
  326. X        char *filename ;
  327. X
  328. X        errno = 0 ;            /* to detect readdir errors */
  329. X        dp = readdir( dirp ) ;
  330. X        if ( dp == NULL )
  331. X        {
  332. X            retval = ( errno == 0 ) ? 0 : -1 ;
  333. X            break ;
  334. X        }
  335. X
  336. X        /*
  337. X         * The special names: "." and ".." are skipped
  338. X         */
  339. X        if ( dp->d_name[ 0 ] == '.' )
  340. X            if ( dp->d_name[ 1 ] == NUL ||
  341. X                        dp->d_name[ 1 ] == '.' && dp->d_name[ 2 ] == NUL )
  342. X                continue ;
  343. X
  344. X        filename = make_pathname( 2, path, dp->d_name ) ;
  345. X        if ( filename == NULL )
  346. X        {
  347. X            retval = -1 ;
  348. X            break ;
  349. X        }
  350. X        
  351. X        retval = ftwx_traverse( filename, depth ) ;
  352. X        free( filename ) ;
  353. X
  354. X        /*
  355. X         * Check for a negative value instead of -1 because the
  356. X         * user function may use any negative value
  357. X         */
  358. X        if ( retval < 0 )
  359. X            break ;
  360. X    }
  361. X    /*
  362. X     * Make sure we don't trash errno; we should only do this if
  363. X     * retval is negative, but we are lazy...
  364. X     */
  365. X    save_errno = errno ;
  366. X    (void) closedir( dirp ) ;
  367. X    errno = save_errno ;
  368. X    return( retval ) ;
  369. X}
  370. X
  371. END_OF_FILE
  372. if test 3822 -ne `wc -c <'libs/src/misc/ftwx.c'`; then
  373.     echo shar: \"'libs/src/misc/ftwx.c'\" unpacked with wrong size!
  374. fi
  375. # end of 'libs/src/misc/ftwx.c'
  376. fi
  377. if test -f 'libs/src/str/str.h' -a "${1}" != "-c" ; then 
  378.   echo shar: Will not clobber existing file \"'libs/src/str/str.h'\"
  379. else
  380. echo shar: Extracting \"'libs/src/str/str.h'\" \(3551 characters\)
  381. sed "s/^X//" >'libs/src/str/str.h' <<'END_OF_FILE'
  382. X/*
  383. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  384. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  385. X * and conditions for redistribution.
  386. X */
  387. X
  388. X
  389. X#ifndef __STR_H
  390. X#define __STR_H
  391. X
  392. X/*
  393. X * $Id: str.h,v 3.1 1993/06/13 02:47:14 panos Exp $
  394. X */
  395. X
  396. X#include <varargs.h>
  397. X
  398. X
  399. X#ifdef __ARGS
  400. X#undef __ARGS
  401. X#endif
  402. X
  403. X#ifdef PROTOTYPES
  404. X#   define __ARGS( s )               s
  405. X#else
  406. X#   define __ARGS( s )               ()
  407. X#endif
  408. X
  409. X
  410. X/*
  411. X * strprint(3) functions
  412. X */
  413. Xchar *str_sprint __ARGS( ( char *buf, char *fmt, ... ) ) ;
  414. Xint str_nprint __ARGS( ( char *buf, char *fmt, ... ) ) ;
  415. Xvoid str_print __ARGS( ( int *count, char *buf, char *fmt, ... ) ) ;
  416. X
  417. Xchar *str_sprintv __ARGS( ( char *buf, char *fmt, va_list ) ) ;
  418. Xint str_nprintv __ARGS( ( char *buf, char *fmt, va_list ) ) ;
  419. Xvoid str_printv __ARGS( ( int *count, char *buf, char *fmt, va_list ) ) ;
  420. X
  421. Xchar *strx_sprint __ARGS( ( char *buf, int len, char *fmt, ... ) ) ;
  422. Xint strx_nprint __ARGS( ( char *buf, int len, char *fmt, ... ) ) ;
  423. Xvoid strx_print __ARGS( ( int *count, char *buf, int len, char *fmt, ... ) ) ;
  424. X
  425. Xchar *strx_sprintv __ARGS( ( char *buf, int len, char *fmt, va_list ) ) ;
  426. Xint strx_nprintv __ARGS( ( char *buf, int len, char *fmt, va_list ) ) ;
  427. Xvoid strx_printv __ARGS(( int *cnt, char *buf, int len, char *fmt, va_list )) ;
  428. X
  429. X
  430. X/*
  431. X * strparse(3) functions
  432. X */
  433. X
  434. X/*
  435. X * Return values
  436. X */
  437. X#define STR_OK                        0
  438. X#define STR_ERR                    (-1)
  439. X
  440. X
  441. X/* 
  442. X * Flags for the string parsing functions
  443. X */
  444. X#define STR_NOFLAGS                0x0
  445. X#define STR_RETURN_ERROR        0x1
  446. X#define STR_NULL_START            0x2
  447. X#define STR_NULL_END                0x4
  448. X#define STR_MALLOC                0x8
  449. X
  450. Xextern int str_errno ;
  451. X
  452. X/*
  453. X * Error values
  454. X */
  455. X#define STR_ENULLSEPAR            1
  456. X#define STR_ENULLSTRING            2
  457. X#define STR_ENOMEM                3
  458. X
  459. Xtypedef void *str_h ;
  460. X
  461. Xstr_h str_parse __ARGS( ( char *str, char *separ, int flags, int *errnop ) ) ;
  462. Xvoid str_endparse __ARGS( ( str_h handle ) ) ;
  463. Xchar *str_component __ARGS( ( str_h handle ) ) ;
  464. Xint str_setstr __ARGS( ( str_h handle, char *newstr ) ) ;
  465. Xint str_separator __ARGS( ( str_h handle, char *separ ) ) ;
  466. Xchar *str_nextpos __ARGS( ( str_h handle ) ) ;
  467. X
  468. X/*
  469. X * For backwards compatibility
  470. X */
  471. X#define str_process( s, sep, flags )    str_parse( s, sep, flags, (int *)0 )
  472. X#define str_endprocess( handle )            str_endparse( handle )
  473. X
  474. X
  475. X/*
  476. X * strutil(3) functions
  477. X */
  478. Xchar *str_find __ARGS( ( char *s1, char *s2 ) ) ;
  479. Xchar *str_casefind __ARGS( ( char *s1, char *s2 ) ) ;
  480. Xvoid str_fill __ARGS( ( char *s, char c ) ) ;
  481. Xchar *str_lower __ARGS( ( char *s ) ) ;
  482. Xchar *str_upper __ARGS( ( char *s ) ) ;
  483. X
  484. X
  485. X/*
  486. X * strsearch(3) functions
  487. X */
  488. X
  489. X/*
  490. X * Methods
  491. X */
  492. X#define STRS_BF                                0            /* brute force                */
  493. X#define STRS_RK                                1            /* Rabin-Karp                */
  494. X#define STRS_KMP                                2            /* Knuth-Morris-Pratt    */
  495. X#define STRS_SBM                                3            /* Simple Boyer-Moore    */
  496. X#define STRS_BMH                                4            /* Boyer-Moore-Horspool */
  497. X#define STRS_SO                                5            /* Shift-Or                    */
  498. X
  499. X#define __STRS_METHOD_BITS                    5
  500. X#define STRS_METHODS_MAX                    ( 1 << __STRS_METHOD_BITS )
  501. X
  502. X/*
  503. X * Flags
  504. X */
  505. X#define __STRS_MAKEFLAG( v )                ( (v) << __STRS_METHOD_BITS )
  506. X#define STRS_IGNCASE                            __STRS_MAKEFLAG( 0x1 )
  507. X#define STRS_NOMALLOC                        __STRS_MAKEFLAG( 0x2 )
  508. X#define STRS_NOSWITCH                        __STRS_MAKEFLAG( 0x4 )
  509. X#define STRS_PATLEN                            __STRS_MAKEFLAG( 0x8 )
  510. X
  511. X
  512. Xtypedef void *strs_h ;
  513. X
  514. Xchar *strs_search __ARGS( ( int flags, char *str, int len, char *pat, ... ) ) ;
  515. Xstrs_h strs_setup __ARGS( ( int flags, char *pattern, ... ) ) ;
  516. Xchar *strs_match    __ARGS( ( strs_h handle, char *str, int len ) ) ;
  517. Xvoid strs_done        __ARGS( ( strs_h handle ) ) ;
  518. X
  519. X#endif     /* __STR_H */
  520. X
  521. END_OF_FILE
  522. if test 3551 -ne `wc -c <'libs/src/str/str.h'`; then
  523.     echo shar: \"'libs/src/str/str.h'\" unpacked with wrong size!
  524. fi
  525. # end of 'libs/src/str/str.h'
  526. fi
  527. if test -f 'libs/src/str/strprint.c' -a "${1}" != "-c" ; then 
  528.   echo shar: Will not clobber existing file \"'libs/src/str/strprint.c'\"
  529. else
  530. echo shar: Extracting \"'libs/src/str/strprint.c'\" \(3569 characters\)
  531. sed "s/^X//" >'libs/src/str/strprint.c' <<'END_OF_FILE'
  532. X/*
  533. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  534. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  535. X * and conditions for redistribution.
  536. X */
  537. X
  538. Xstatic char RCSid[] = "$Id: strprint.c,v 3.1 1993/06/13 02:50:11 panos Exp $" ;
  539. X
  540. X#ifndef NO_SIO
  541. X#include "sio.h"
  542. X#endif
  543. X
  544. X#include "str.h"
  545. X
  546. X#define INT_NULL                        ((int *)0)
  547. X
  548. X/*
  549. X * The strx_* functions will never overwrite the buffer
  550. X * The str_* functions may overwrite the buffer
  551. X */
  552. X
  553. X/*
  554. X * Group 1: the strx_* functions
  555. X */
  556. X
  557. X/*
  558. X * This is the general purpose conversion function. It is invoked
  559. X * by all the other str[x]_* functions
  560. X */
  561. Xvoid strx_printv( ccp, buf, len, format, ap )
  562. X    int *ccp ;
  563. X    char *buf ;
  564. X    int len ;
  565. X    char *format ;
  566. X    va_list ap ;
  567. X{
  568. X#ifndef NO_SIO
  569. X    __sio_od_t od ;
  570. X    int cc ;
  571. X
  572. X   /*
  573. X    * First initialize the descriptor
  574. X     * Notice that if no length is given, we initialize buf_end to the
  575. X     * highest possible address.
  576. X    */
  577. X   od.buf = buf ;                                        /* NOT NEEDED        */
  578. X   od.buf_end = len ? &buf[ len ] : (char *) ~0 ;    /* NEEDED                */
  579. X   od.buffer_size = 0 ;                                  /* NOT NEEDED        */
  580. X   od.start = buf ;                                      /* NOT NEEDED        */
  581. X   od.nextb = buf ;                                      /* NEEDED            */
  582. X   od.buftype = 0 ;                                      /* NOT NEEDED        */
  583. X
  584. X   /*
  585. X    * Do the conversion
  586. X    */
  587. X   cc = __sio_converter( &od, -1, format, ap ) ;
  588. X    if ( len == 0 || od.nextb < od.buf_end )
  589. X        *(od.nextb) = '\0' ;
  590. X   if ( ccp )
  591. X      *ccp = cc ;
  592. X#endif    /* ! NO_SIO */
  593. X}
  594. X
  595. X
  596. Xvoid strx_print( ccp, buf, len, format, va_alist )
  597. X    int *ccp ;
  598. X    char *buf ;
  599. X    int len ;
  600. X    char *format ;
  601. X    va_dcl
  602. X{
  603. X    va_list ap ;
  604. X
  605. X    va_start( ap ) ;
  606. X    strx_printv( ccp, buf, len, format, ap ) ;
  607. X    va_end( ap ) ;
  608. X}
  609. X
  610. X
  611. Xchar *strx_sprint( buf, len, format, va_alist )
  612. X    char *buf ;
  613. X    int len ;
  614. X    char *format ;
  615. X    va_dcl
  616. X{
  617. X    va_list ap ;
  618. X
  619. X    va_start( ap ) ;
  620. X    strx_printv( INT_NULL, buf, len, format, ap ) ;
  621. X    va_end( ap ) ;
  622. X    return( buf ) ;
  623. X}
  624. X
  625. X
  626. Xchar *strx_sprintv( buf, len, format, ap )
  627. X    char *buf ;
  628. X    int len ;
  629. X    char *format ;
  630. X    va_list ap ;
  631. X{
  632. X    strx_printv( INT_NULL, buf, len, format, ap ) ;
  633. X    return( buf ) ;
  634. X}
  635. X
  636. X
  637. Xint strx_nprint( buf, len, format, va_alist )
  638. X    char *buf ;
  639. X    int len ;
  640. X    char *format ;
  641. X    va_dcl
  642. X{
  643. X    int cc ;
  644. X    va_list ap ;
  645. X
  646. X    va_start( ap ) ;
  647. X    strx_printv( &cc, buf, len, format, ap ) ;
  648. X    va_end( ap ) ;
  649. X    return( cc ) ;
  650. X}
  651. X
  652. X
  653. Xint strx_nprintv( buf, len, format, ap )
  654. X    char *buf ;
  655. X    int len ;
  656. X    char *format ;
  657. X    va_list ap ;
  658. X{
  659. X    int cc ;
  660. X
  661. X    strx_printv( &cc, buf, len, format, ap ) ;
  662. X    return( cc ) ;
  663. X}
  664. X
  665. X
  666. X
  667. X/*
  668. X * Group 2: the str_* functions
  669. X */
  670. X
  671. Xvoid str_print( ccp, buf, format, va_alist )
  672. X    int *ccp ;
  673. X    char *buf ;
  674. X    char *format ;
  675. X    va_dcl
  676. X{
  677. X    va_list ap ;
  678. X
  679. X    va_start( ap ) ;
  680. X    strx_printv( ccp, buf, 0, format, ap ) ;
  681. X    va_end( ap ) ;
  682. X}
  683. X
  684. X
  685. Xvoid str_printv( ccp, buf, format, ap )
  686. X    int *ccp ;
  687. X    char *buf ;
  688. X    char *format ;
  689. X    va_list ap ;
  690. X{
  691. X    strx_printv( ccp, buf, 0, format, ap ) ;
  692. X}
  693. X
  694. X
  695. Xchar *str_sprint( buf, format, va_alist )
  696. X    char *buf ;
  697. X    char *format ;
  698. X    va_dcl
  699. X{
  700. X    va_list ap ;
  701. X
  702. X    va_start( ap ) ;
  703. X    strx_printv( INT_NULL, buf, 0, format, ap ) ;
  704. X    va_end( ap ) ;
  705. X    return( buf ) ;
  706. X}
  707. X
  708. X
  709. Xchar *str_sprintv( buf, format, ap )
  710. X    char *buf ;
  711. X    char *format ;
  712. X    va_list ap ;
  713. X{
  714. X    strx_printv( INT_NULL, buf, 0, format, ap ) ;
  715. X    return( buf ) ;
  716. X}
  717. X
  718. X
  719. Xint str_nprint( buf, format, va_alist )
  720. X    char *buf ;
  721. X    char *format ;
  722. X    va_dcl
  723. X{
  724. X    int cc ;
  725. X    va_list ap ;
  726. X
  727. X    va_start( ap ) ;
  728. X    strx_printv( &cc, buf, 0, format, ap ) ;
  729. X    va_end( ap ) ;
  730. X    return( cc ) ;
  731. X}
  732. X
  733. X
  734. X
  735. Xint str_nprintv( buf, format, ap )
  736. X    char *buf ;
  737. X    char *format ;
  738. X    va_list ap ;
  739. X{
  740. X    int cc ;
  741. X
  742. X    strx_printv( &cc, buf, 0, format, ap ) ;
  743. X    return( cc ) ;
  744. X}
  745. X
  746. X
  747. END_OF_FILE
  748. if test 3569 -ne `wc -c <'libs/src/str/strprint.c'`; then
  749.     echo shar: \"'libs/src/str/strprint.c'\" unpacked with wrong size!
  750. fi
  751. # end of 'libs/src/str/strprint.c'
  752. fi
  753. if test -f 'libs/src/str/strutil.c' -a "${1}" != "-c" ; then 
  754.   echo shar: Will not clobber existing file \"'libs/src/str/strutil.c'\"
  755. else
  756. echo shar: Extracting \"'libs/src/str/strutil.c'\" \(3554 characters\)
  757. sed "s/^X//" >'libs/src/str/strutil.c' <<'END_OF_FILE'
  758. X/*
  759. X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  760. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  761. X * and conditions for redistribution.
  762. X */
  763. X
  764. Xstatic char RCSid[] = "$Id: strutil.c,v 3.1 1993/06/13 02:50:22 panos Exp $" ;
  765. X
  766. X
  767. X#include <ctype.h>
  768. X
  769. X#define NULL                0
  770. X
  771. X
  772. X#ifndef TRIVIAL_STR_FIND
  773. X
  774. X/*
  775. X * look for an instance of s2 in s1
  776. X * Returns a pointer to the beginning of s2 in s1
  777. X */
  778. Xchar *str_find( str, sstr )
  779. X    register char *str ;
  780. X    register char *sstr ;
  781. X{
  782. X   register int ssfc = *sstr++ ;    /* sub-string first char */
  783. X
  784. X    if ( ssfc == 0 )            /* empty string is always a match */
  785. X        return( str ) ;
  786. X
  787. X    while ( *str )
  788. X    {
  789. X        char *current = str ;
  790. X        register int strc = *str++ ;
  791. X        register char *sp ;                    /* string pointer */
  792. X        register char *ssp ;                   /* sub-string pointer */
  793. X
  794. X        if ( strc != ssfc )
  795. X            continue ;
  796. X        
  797. X        /*
  798. X         * We don't need to make the end of str a special case since
  799. X         * the comparison of *sp against *ssp is guaranteed to fail
  800. X         */
  801. X        for ( sp = str, ssp = sstr ;; sp++, ssp++ )
  802. X        {
  803. X            if ( *ssp == 0 )
  804. X                return( current ) ;
  805. X            if ( *sp != *ssp )
  806. X                break ;
  807. X        }
  808. X    }
  809. X
  810. X    return( 0 ) ;
  811. X}
  812. X
  813. X
  814. X#define LOWER_CASE( c )                    ( (c) + 'a' - 'A' )
  815. X
  816. X/*
  817. X * str_casefind is similar to str_find except that it ignores the
  818. X * case of the alphabetic characters
  819. X */
  820. Xchar *str_casefind( str, sstr )
  821. X    register char *str ;
  822. X    char *sstr ;
  823. X{
  824. X    register int ssfc = *sstr++ ;        /* sub-string first char */
  825. X
  826. X    if ( ssfc == 0 )
  827. X        return( str ) ;
  828. X
  829. X    if ( isalpha( ssfc ) && isupper( ssfc ) )
  830. X        ssfc = LOWER_CASE( ssfc ) ;
  831. X
  832. X    while ( *str )
  833. X    {
  834. X        char *current = str ;
  835. X        register int strc = *str++ ;
  836. X        char *sp ;                            /* string pointer */
  837. X        char *ssp ;                            /* sub-string pointer */
  838. X
  839. X        if ( isalpha( strc ) && isupper( strc ) )
  840. X            strc = LOWER_CASE( strc ) ;
  841. X        if ( strc != ssfc )
  842. X            continue ;
  843. X        
  844. X        for ( sp = str, ssp = sstr ;; sp++, ssp++ )
  845. X        {
  846. X            register int sc = *sp ;                /* string char */
  847. X            register int ssc = *ssp ;            /* substring char */
  848. X
  849. X            /*
  850. X             * End-of-substring means we got a match
  851. X             */
  852. X            if ( ssc == 0 )
  853. X                return( current ) ;
  854. X
  855. X            /*
  856. X             * Convert to lower case if alphanumeric
  857. X             */
  858. X            if ( isalpha( sc ) && isupper( sc ) )
  859. X                sc = LOWER_CASE( sc ) ;
  860. X            if ( isalpha( ssc ) && isupper( ssc ) )
  861. X                ssc = LOWER_CASE( ssc ) ;
  862. X            if ( sc != ssc )
  863. X                break ;
  864. X        }
  865. X    }
  866. X
  867. X    return( 0 ) ;
  868. X}
  869. X
  870. X
  871. X#else        /* defined( TRIVIAL_STR_FIND ) */
  872. X
  873. X/*
  874. X * look for an instance of s2 in s1
  875. X * Returns a pointer to the beginning of s2 in s1
  876. X */
  877. Xchar *str_find( s1, s2 )
  878. X    char *s1 ;
  879. X    char *s2 ;
  880. X{
  881. X   int i ;
  882. X   int l1 = strlen( s1 ) ;
  883. X   int l2 = strlen( s2 ) ;
  884. X
  885. X   for ( i = 0 ; i < l1 - l2 + 1 ; i++ )
  886. X      if ( strncmp( &s1[ i ], s2, l2 ) == 0 )
  887. X         return( &s1[ i ] ) ;
  888. X   return( NULL ) ;
  889. X}
  890. X
  891. X
  892. Xchar *str_casefind( s1, s2 )
  893. X    char *s1 ;
  894. X    char *s2 ;
  895. X{
  896. X   int i ;
  897. X   int l1 = strlen( s1 ) ;
  898. X   int l2 = strlen( s2 ) ;
  899. X
  900. X   for ( i = 0 ; i < l1 - l2 + 1 ; i++ )
  901. X      if ( strncasecmp( &s1[ i ], s2, l2 ) == 0 )
  902. X         return( &s1[ i ] ) ;
  903. X   return( NULL ) ;
  904. X}
  905. X
  906. X#endif     /* TRIVIAL_STR_FIND */
  907. X
  908. X
  909. X/*
  910. X * Fill string s with character c
  911. X */
  912. Xvoid str_fill( s, c )
  913. X    register char *s ;
  914. X    register char c ;
  915. X{
  916. X    while ( *s ) *s++ = c ;
  917. X}
  918. X
  919. X
  920. Xchar *str_lower( s )
  921. X    char *s ;
  922. X{
  923. X    register char *p ;
  924. X    register int offset = 'a' - 'A' ;
  925. X
  926. X    for ( p = s ; *p ; p++ )
  927. X        if ( isascii( *p ) && isupper( *p ) )
  928. X            *p += offset ;
  929. X    return( s ) ;
  930. X}
  931. X
  932. X
  933. Xchar *str_upper( s )
  934. X    char *s ;
  935. X{
  936. X    register char *p ;
  937. X    register int offset = 'a' - 'A' ;
  938. X
  939. X    for ( p = s ; *p ; p++ )
  940. X        if ( isascii( *p ) && islower( *p ) )
  941. X            *p -= offset ;
  942. X    return( s ) ;
  943. X}
  944. X
  945. X
  946. END_OF_FILE
  947. if test 3554 -ne `wc -c <'libs/src/str/strutil.c'`; then
  948.     echo shar: \"'libs/src/str/strutil.c'\" unpacked with wrong size!
  949. fi
  950. # end of 'libs/src/str/strutil.c'
  951. fi
  952. if test -f 'libs/src/timer/timemacros.h' -a "${1}" != "-c" ; then 
  953.   echo shar: Will not clobber existing file \"'libs/src/timer/timemacros.h'\"
  954. else
  955. echo shar: Extracting \"'libs/src/timer/timemacros.h'\" \(3580 characters\)
  956. sed "s/^X//" >'libs/src/timer/timemacros.h' <<'END_OF_FILE'
  957. X/*
  958. X * (c) Copyright 1993 by Panagiotis Tsirigotis
  959. X * All rights reserved.  The file named COPYRIGHT specifies the terms 
  960. X * and conditions for redistribution.
  961. X */
  962. X
  963. X#ifndef __TIMEMACROS_H
  964. X#define __TIMEMACROS_H
  965. X
  966. X/*
  967. X * $Id: timemacros.h,v 3.1 1992/11/23 16:22:53 panos Exp $
  968. X */
  969. X
  970. X#include <sys/types.h>
  971. X#include <sys/time.h>
  972. X
  973. X/*
  974. X * Define a few relevant NULL values
  975. X */
  976. X#ifndef TIMEZONE_NULL
  977. X#define TIMEZONE_NULL        ((struct timezone *)0)
  978. X#endif
  979. X#ifndef TIMEVAL_NULL
  980. X#define TIMEVAL_NULL            ((struct timeval *)0)
  981. X#endif
  982. X#ifndef ITIMERVAL_NULL
  983. X#define ITIMERVAL_NULL        ((struct itimerval *)0)
  984. X#endif
  985. X
  986. X/*
  987. X * The TV_* macros work with timeval structures.
  988. X * The TVP_* macros work with pointers to timeval structures.
  989. X *
  990. X * We support the following operations:
  991. X *
  992. X *            EQ( tv1, tv2 )            : tv1 == tv2
  993. X *            NE( tv1, tv2 )            : tv1 != tv2
  994. X *            LT( tv1, tv2 )            : tv1 <  tv2
  995. X *            LE( tv1, tv2 )            : tv1 <= tv2
  996. X *            GT( tv1, tv2 )            : tv1 >  tv2
  997. X *            GE( tv1, tv2 )            : tv1 >= tv2
  998. X *            ISZERO( tv )            : tv == 0
  999. X *            ZERO( tv )                : tv = 0
  1000. X *            ADD( res, tv1, tv2 ) : res = tv1 + tv2
  1001. X *            SUB( res, tv1, tv2 ) : res = tv1 = tv2
  1002. X *
  1003. X * We normalize the result after addition and subtraction.
  1004. X */
  1005. X
  1006. X#define __ONE_MILLION                    1000000
  1007. X
  1008. X#define TV_ADD( tv_res, tv1, tv2 )                                    \
  1009. X    {                                                                            \
  1010. X        (tv_res).tv_sec = (tv1).tv_sec + (tv2).tv_sec ;            \
  1011. X        (tv_res).tv_usec = (tv1).tv_usec + (tv2).tv_usec ;        \
  1012. X        if ( (tv_res).tv_usec >= __ONE_MILLION )                    \
  1013. X        {                                                                        \
  1014. X            (tv_res).tv_sec++ ;                                            \
  1015. X            (tv_res).tv_usec -= __ONE_MILLION ;                        \
  1016. X        }                                                                        \
  1017. X    }
  1018. X
  1019. X#define TV_SUB( tv_res, tv1, tv2 )                                    \
  1020. X    {                                                                            \
  1021. X        (tv_res).tv_sec = (tv1).tv_sec - (tv2).tv_sec ;            \
  1022. X        (tv_res).tv_usec = (tv1).tv_usec - (tv2).tv_usec ;        \
  1023. X        if ( (tv_res).tv_usec < 0 )                                    \
  1024. X        {                                                                        \
  1025. X            (tv_res).tv_usec += __ONE_MILLION ;                        \
  1026. X            (tv_res).tv_sec-- ;                                            \
  1027. X        }                                                                        \
  1028. X    }
  1029. X
  1030. X#define TV_LT( tv1, tv2 )                                                                    \
  1031. X        ( (tv1).tv_sec < (tv2).tv_sec ||                                                    \
  1032. X          (tv1).tv_sec == (tv2).tv_sec && (tv1).tv_usec < (tv2).tv_usec )
  1033. X
  1034. X#define TV_LE( tv1, tv2 )                                                                    \
  1035. X        ( (tv1).tv_sec < (tv2).tv_sec ||                                                    \
  1036. X          (tv1).tv_sec == (tv2).tv_sec && (tv1).tv_usec <= (tv2).tv_usec )
  1037. X
  1038. X#define TV_GT( tv1, tv2 )                                                                    \
  1039. X        ( (tv1).tv_sec > (tv2).tv_sec ||                                                    \
  1040. X          (tv1).tv_sec == (tv2).tv_sec && (tv1).tv_usec > (tv2).tv_usec )
  1041. X
  1042. X#define TV_GE( tv1, tv2 )                                                                    \
  1043. X        ( (tv1).tv_sec > (tv2).tv_sec ||                                                    \
  1044. X          (tv1).tv_sec == (tv2).tv_sec && (tv1).tv_usec >= (tv2).tv_usec )
  1045. X
  1046. X#define TV_EQ( tv1, tv2 )                                                                    \
  1047. X        ( (tv1).tv_sec == (tv2).tv_sec && (tv1).tv_usec == (tv2).tv_usec )
  1048. X
  1049. X#define TV_NE( tv1, tv2 )                                                                    \
  1050. X        ( (tv1).tv_sec != (tv2).tv_sec || (tv1).tv_usec != (tv2).tv_usec )
  1051. X
  1052. X#define TV_ISZERO( tv )            ( (tv).tv_sec == 0 && (tv).tv_usec == 0 )
  1053. X
  1054. X#define TV_ZERO( tv )            (tv).tv_sec = (tv).tv_usec = 0
  1055. X
  1056. X
  1057. X/*
  1058. X * Pointer macros
  1059. X */
  1060. X
  1061. X#define TVP_ADD( tvp_res, tvp1, tvp2 )    TV_ADD( *(tvp_res), *(tvp1), *(tvp2) )
  1062. X#define TVP_SUB( tvp_res, tvp1, tvp2 )    TV_SUB( *(tvp_res), *(tvp1), *(tvp2) )
  1063. X#define TVP_LT( tvp1, tvp2 )                TV_LT( *(tvp1), *(tvp2) )
  1064. X#define TVP_LE( tvp1, tpv2 )                TV_LE( *(tvp1), *(tvp2) )
  1065. X#define TVP_GT( tvp1, tvp2 )                TV_GT( *(tvp1), *(tvp2) )
  1066. X#define TVP_GE( tvp1, tvp2 )                TV_GE( *(tvp1), *(tvp2) )
  1067. X#define TVP_EQ( tvp1, tvp2 )                TV_EQ( *(tvp1), *(tvp2) )
  1068. X#define TVP_NE( tvp1, tvp2 )                TV_NE( *(tvp1), *(tvp2) )
  1069. X#define TVP_ISZERO( tvp )                    TV_ISZERO( *(tvp) )
  1070. X#define TVP_ZERO( tvp )                        TV_ZERO( *(tvp) )
  1071. X
  1072. X#endif    /* __TIMEMACROS_H */
  1073. END_OF_FILE
  1074. if test 3580 -ne `wc -c <'libs/src/timer/timemacros.h'`; then
  1075.     echo shar: \"'libs/src/timer/timemacros.h'\" unpacked with wrong size!
  1076. fi
  1077. # end of 'libs/src/timer/timemacros.h'
  1078. fi
  1079. if test -f 'libs/src/xlog/Makefile' -a "${1}" != "-c" ; then 
  1080.   echo shar: Will not clobber existing file \"'libs/src/xlog/Makefile'\"
  1081. else
  1082. echo shar: Extracting \"'libs/src/xlog/Makefile'\" \(3670 characters\)
  1083. sed "s/^X//" >'libs/src/xlog/Makefile' <<'END_OF_FILE'
  1084. X# (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  1085. X# All rights reserved.  The file named COPYRIGHT specifies the terms 
  1086. X# and conditions for redistribution.
  1087. X
  1088. X#
  1089. X# $Id: Makefile,v 2.3 1993/06/15 18:08:29 panos Exp $
  1090. X#
  1091. X# Based on Library makefile template: *Revision: 1.15 *
  1092. X#
  1093. X
  1094. X# 
  1095. X# Available entries:
  1096. X#         lib             --> creates the library
  1097. X#        install        --> installs the library (archive, man page(s), header(s))
  1098. X#        uninstall    --> uninstall the library
  1099. X#        clean            --> removes all .o and .a files
  1100. X#        spotless        --> clean + uninstall
  1101. X#         lint            --> lints a file (usage: make lint MODULE=foo.c)
  1102. X#        tags            --> creates a tags file (from the SOURCES and HEADERS)
  1103. X#        checkout     --> checkout all files
  1104. X#        dist            --> distribution support
  1105. X#
  1106. X
  1107. XNAME                = xlog
  1108. XVERSION            = 1.1.2
  1109. X
  1110. XHEADERS            = xlog.h impl.h slog.h filelog.h
  1111. XSOURCES            = xlog.c filelog.c slog.c util.c
  1112. XOBJECTS            = xlog.o filelog.o slog.o util.o
  1113. X
  1114. XMANFILES            = xlog.3
  1115. XINCLUDEFILES    = xlog.h
  1116. X
  1117. X# The following variables are used by the 'install' entry and
  1118. X# should be customized:
  1119. X#     LIBDIR:     where the library will be placed
  1120. X#     INCUDEDIR:  where the include files will be placed
  1121. X#     MANDIR:     where the man pages will be placed
  1122. X#
  1123. XLIBDIR            = $(HOME)/.links/libraries/$(ARCH)
  1124. XMANDIR            = $(HOME)/.links/manpages/man3
  1125. XINCLUDEDIR        = $(HOME)/.links/includes
  1126. X
  1127. X#
  1128. X# Flags:
  1129. X#     -DNO_SYSLOG
  1130. X#
  1131. XDEFS                =
  1132. X
  1133. XDEBUG                = -g            # -g or -O
  1134. XVERSION_DEF        = -DVERSION=\"XLOG\ Version\ $(VERSION)\"
  1135. X
  1136. XCPP_DEFS            = $(VERSION_DEF) $(DEFS)
  1137. X
  1138. X#
  1139. X# The following variables shouldn't need to be changed
  1140. X#
  1141. XLINT_FLAGS        = -hbux
  1142. XCPP_FLAGS        = $(CPP_DEFS) -I$(INCLUDEDIR)
  1143. XCC_FLAGS            = $(DEBUG)
  1144. XCFLAGS            = $(CPP_FLAGS) $(CC_FLAGS)
  1145. X
  1146. XINSTALL            = install -c
  1147. XFMODE                = -m 640            # used by install
  1148. XRANLIB            = ranlib
  1149. X
  1150. XPAGER                = less
  1151. X
  1152. X
  1153. XLIBNAME            = lib$(NAME).a
  1154. X
  1155. Xlib: $(LIBNAME)
  1156. X
  1157. Xlibopt: clean
  1158. X    make DEBUG=-O "DEFS=$(DEFS)" lib
  1159. X    $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized
  1160. X
  1161. X$(LIBNAME): $(OBJECTS)
  1162. X    ar r $@ $?
  1163. X    $(RANLIB) $@
  1164. X
  1165. Xlint:
  1166. X    lint $(CPP_FLAGS) $(LINT_FLAGS) $(MODULE) 2>&1 | grep -v 'possible pointer alignment' | $(PAGER)
  1167. X
  1168. Xinstall: $(LIBNAME)
  1169. X    @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
  1170. X    then \
  1171. X        $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
  1172. X        echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
  1173. X        for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
  1174. X        echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
  1175. X        for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
  1176. X        echo Installed $(MANFILES) to $(MANDIR) ;\
  1177. X    else \
  1178. X        echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
  1179. X    fi
  1180. X
  1181. Xuninstall:
  1182. X    a=`pwd` ; cd $(INCLUDEDIR) ;\
  1183. X    if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
  1184. X    a=`pwd` ; cd $(LIBDIR) ;\
  1185. X    if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
  1186. X    a=`pwd` ; cd $(MANDIR) ;\
  1187. X    if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
  1188. X
  1189. Xclean:
  1190. X    rm -f $(OBJECTS) $(LIBNAME) core
  1191. X
  1192. Xspotless: clean uninstall
  1193. X
  1194. Xtags: $(SOURCES) $(HEADERS)
  1195. X    ctags -w $(SOURCES) $(HEADERS)
  1196. X
  1197. Xcheckout:
  1198. X    co $(SOURCES) $(HEADERS) $(MANFILES)
  1199. X
  1200. X#
  1201. X# Distribution section
  1202. X# This section contains the 2 targets for distribution support: dist, dirs
  1203. X# "dist" checks out all files to be distributed
  1204. X# "dirs" prints a list of directories to be included in the distribution.
  1205. X# These directories should have a Makefile with a "dist" target
  1206. X#
  1207. XDISTRIBUTION_FILES    = $(SOURCES) $(HEADERS) $(MANFILES) COPYRIGHT
  1208. XDIRS                        =
  1209. X
  1210. Xdist:
  1211. X    -co -q $(DISTRIBUTION_FILES)
  1212. X
  1213. Xdirs:
  1214. X    @echo $(DIRS)
  1215. X
  1216. X#
  1217. X# PUT HERE THE RULES TO MAKE THE OBJECT FILES
  1218. X#
  1219. Xxlog.o:            xlog.h impl.h
  1220. Xfilelog.o:        xlog.h impl.h filelog.h
  1221. Xslog.o:            xlog.h impl.h slog.h
  1222. X
  1223. X#
  1224. X# Test program
  1225. X#
  1226. Xxlt: xlt.c $(LIBNAME)
  1227. X    $(CC) -g -o $@ xlt.c $(LIBNAME) -L$(LIBDIR) -lstr -lsio
  1228. X
  1229. X
  1230. END_OF_FILE
  1231. if test 3670 -ne `wc -c <'libs/src/xlog/Makefile'`; then
  1232.     echo shar: \"'libs/src/xlog/Makefile'\" unpacked with wrong size!
  1233. fi
  1234. # end of 'libs/src/xlog/Makefile'
  1235. fi
  1236. echo shar: End of archive 7 \(of 31\).
  1237. cp /dev/null ark7isdone
  1238. MISSING=""
  1239. 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
  1240.     if test ! -f ark${I}isdone ; then
  1241.     MISSING="${MISSING} ${I}"
  1242.     fi
  1243. done
  1244. if test "${MISSING}" = "" ; then
  1245.     echo You have unpacked all 31 archives.
  1246.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1247. else
  1248.     echo You still need to unpack the following archives:
  1249.     echo "        " ${MISSING}
  1250. fi
  1251. ##  End of shell archive.
  1252. exit 0
  1253.