home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-11-28 | 34.6 KB | 1,119 lines |
- Newsgroups: comp.sources.unix
- From: panos@anchor.cs.colorado.edu (Panos Tsirigotis)
- Subject: v27i108: clc - C Libraries Collection, Part02/20
- References: <1.754527080.23891@gw.home.vix.com>
- Sender: unix-sources-moderator@gw.home.vix.com
- Approved: vixie@gw.home.vix.com
-
- Submitted-By: panos@anchor.cs.colorado.edu (Panos Tsirigotis)
- Posting-Number: Volume 27, Issue 108
- Archive-Name: clc/part02
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 2 (of 20)."
- # Contents: libs/src/dict/COPYRIGHT libs/src/dict/bstcomp.c
- # libs/src/dict/dict.h libs/src/dict/ht.h libs/src/fsma/COPYRIGHT
- # libs/src/misc/COPYRIGHT libs/src/pq/COPYRIGHT
- # libs/src/pset/COPYRIGHT libs/src/sio/COPYRIGHT
- # libs/src/sio/suite/fdtest.c libs/src/sio/suite/sprint_test
- # libs/src/sio/suite/testlib libs/src/str/COPYRIGHT
- # libs/src/str/ss_bf.c libs/src/timer/COPYRIGHT
- # libs/src/timer/defs.h libs/src/xlog/COPYRIGHT
- # libs/src/xlog/filelog.h libs/src/xlog/util.c
- # Wrapped by panos@eclipse on Sun Nov 28 14:48:15 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'libs/src/dict/COPYRIGHT' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/dict/COPYRIGHT'\"
- else
- echo shar: Extracting \"'libs/src/dict/COPYRIGHT'\" \(1336 characters\)
- sed "s/^X//" >'libs/src/dict/COPYRIGHT' <<'END_OF_FILE'
- XThis software is
- X
- X(c) Copyright 1993 by Panagiotis Tsirigotis
- X
- XThe author (Panagiotis Tsirigotis) grants permission to use, copy,
- Xand distribute this software and its documentation for any purpose
- Xand without fee, provided that the above copyright notice extant in
- Xfiles in this distribution is not removed from files included in any
- Xredistribution and that this copyright notice is also included in any
- Xredistribution.
- X
- XModifications to this software may be distributed, either by distributing
- Xthe modified software or by distributing patches to the original software,
- Xunder the following additional terms:
- X
- X1. The version number will be modified as follows:
- X a. The first 3 components of the version number
- X (i.e <number>.<number>.<number>) will remain unchanged.
- X b. A new component will be appended to the version number to indicate
- X the modification level. The form of this component is up to the
- X author of the modifications.
- X
- X2. The author of the modifications will include his/her name by appending it
- X along with the new version number to this file and will be responsible for
- X any wrong behavior of the modified software.
- X
- XThe author makes no representations about the suitability of this
- Xsoftware for any purpose. It is provided "as is" without any express
- Xor implied warranty.
- X
- END_OF_FILE
- if test 1336 -ne `wc -c <'libs/src/dict/COPYRIGHT'`; then
- echo shar: \"'libs/src/dict/COPYRIGHT'\" unpacked with wrong size!
- fi
- # end of 'libs/src/dict/COPYRIGHT'
- fi
- if test -f 'libs/src/dict/bstcomp.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/dict/bstcomp.c'\"
- else
- echo shar: Extracting \"'libs/src/dict/bstcomp.c'\" \(1149 characters\)
- sed "s/^X//" >'libs/src/dict/bstcomp.c' <<'END_OF_FILE'
- X/*
- X * (c) Copyright 1993 by Panagiotis Tsirigotis
- X * All rights reserved. The file named COPYRIGHT specifies the terms
- X * and conditions for redistribution.
- X */
- X
- X
- X#define NULL 0
- X
- X#include "bst.h"
- X
- X
- Xint_comp( p1, p2 )
- X char *p1, *p2 ;
- X{
- X int i1 = *(int *)p1 ;
- X int i2 = *(int *)p2 ;
- X
- X return( i1 - i2 ) ;
- X}
- X
- X#define N 1000
- Xint nums[ N ] ;
- X
- Xint main( argc, argv )
- X int argc ;
- X char *argv[] ;
- X{
- X dict_h bh ;
- X int i ;
- X int *ip ;
- X int j ;
- X int flags = DICT_NOFLAGS ;
- X struct bst_depth d ;
- X
- X if ( argc == 3 && argv[1][0] == 'b' )
- X flags |= DICT_BALANCED_TREE ;
- X
- X bh = bst_create( int_comp, int_comp, flags, (int *)0 ) ;
- X
- X for ( i = 0 ; i < N ; i++ )
- X {
- X#ifdef notdef
- X nums[ i ] = random() % 100 ;
- X#else
- X nums[ i ] = N-i ;
- X#endif
- X if ( bst_insert( bh, &nums[ i ] ) != DICT_OK )
- X {
- X printf( "Failed at %d\n", i ) ;
- X exit( 1 ) ;
- X }
- X }
- X
- X bst_getdepth( bh, &d ) ;
- X printf( "min tree depth=%d, max tree depth=%d\n",
- X d.depth_min, d.depth_max ) ;
- X
- X for ( j = atoi( argv[ argc-1 ] ) ; j ; j-- )
- X {
- X i = 1 ;
- X ip = (int *) bst_search( bh, &i ) ;
- X if ( ip == NULL )
- X {
- X printf( "Search failed at %d\n", j ) ;
- X exit( 0 ) ;
- X }
- X }
- X
- X exit( 0 ) ;
- X}
- END_OF_FILE
- if test 1149 -ne `wc -c <'libs/src/dict/bstcomp.c'`; then
- echo shar: \"'libs/src/dict/bstcomp.c'\" unpacked with wrong size!
- fi
- # end of 'libs/src/dict/bstcomp.c'
- fi
- if test -f 'libs/src/dict/dict.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/dict/dict.h'\"
- else
- echo shar: Extracting \"'libs/src/dict/dict.h'\" \(1216 characters\)
- sed "s/^X//" >'libs/src/dict/dict.h' <<'END_OF_FILE'
- X/*
- X * (c) Copyright 1993 by Panagiotis Tsirigotis
- X * All rights reserved. The file named COPYRIGHT specifies the terms
- X * and conditions for redistribution.
- X */
- X
- X#ifndef __DICT_H
- X#define __DICT_H
- X
- X/*
- X * $Id: dict.h,v 3.3 93/09/28 21:07:33 panos Exp $
- X */
- X
- X/*
- X * Return values
- X */
- X#define DICT_OK 0
- X#define DICT_ERR (-1)
- X
- X/*
- X * Flags
- X */
- X#define DICT_NOFLAGS 0x0
- X#define DICT_RETURN_ERROR 0x1
- X#define DICT_UNIQUE_KEYS 0x2
- X#define DICT_UNORDERED 0x4
- X#define DICT_ORDERED 0x8
- X#define DICT_BALANCED_TREE 0x10
- X
- X/*
- X * Error values
- X */
- X#define DICT_ENOERROR 0
- X#define DICT_ENOMEM 1
- X#define DICT_ENOTFOUND 2
- X#define DICT_ENOOOCOMP 3
- X#define DICT_ENOKOCOMP 4
- X#define DICT_ENULLOBJECT 5
- X#define DICT_EEXISTS 6
- X#define DICT_ENOHVFUNC 7
- X#define DICT_EBADOBJECT 8
- X#define DICT_EORDER 9
- X#define DICT_EBADORDER 10
- X
- X#ifdef __ARGS
- X#undef __ARGS
- X#endif
- X
- X#ifdef PROTOTYPES
- X# define __ARGS( s ) s
- X#else
- X# define __ARGS( s ) ()
- X#endif
- X
- Xtypedef int (*dict_function)() ;
- Xtypedef void *dict_obj ;
- Xtypedef void *dict_key ;
- Xtypedef void *dict_h ;
- X
- Xenum dict_direction { DICT_FROM_START, DICT_FROM_END } ;
- X
- Xextern int dict_errno ;
- X
- X#endif /* __DICT_H */
- X
- END_OF_FILE
- if test 1216 -ne `wc -c <'libs/src/dict/dict.h'`; then
- echo shar: \"'libs/src/dict/dict.h'\" unpacked with wrong size!
- fi
- # end of 'libs/src/dict/dict.h'
- fi
- if test -f 'libs/src/dict/ht.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/dict/ht.h'\"
- else
- echo shar: Extracting \"'libs/src/dict/ht.h'\" \(1233 characters\)
- sed "s/^X//" >'libs/src/dict/ht.h' <<'END_OF_FILE'
- X/*
- X * (c) Copyright 1993 by Panagiotis Tsirigotis
- X * All rights reserved. The file named COPYRIGHT specifies the terms
- X * and conditions for redistribution.
- X */
- X
- X#ifndef __HT_H
- X#define __HT_H
- X
- X/*
- X * $Id: ht.h,v 3.1 93/04/23 17:50:15 panos Exp $
- X */
- X
- X#include "dict.h"
- X
- Xtypedef unsigned ht_val ;
- Xtypedef ht_val (*ht_func)() ;
- X
- Xstruct ht_args
- X{
- X unsigned ht_table_entries ;
- X unsigned ht_bucket_entries ;
- X ht_func ht_objvalue ;
- X ht_func ht_keyvalue ;
- X} ;
- X
- X
- Xdict_h ht_create
- X __ARGS( (
- X dict_function oo_compare,
- X dict_function ko_compare,
- X int flags,
- X int *errnop,
- X struct ht_args *args
- X ) ) ;
- Xvoid ht_destroy __ARGS( ( dict_h hh ) ) ;
- Xint ht_insert __ARGS( ( dict_h hh, dict_obj obj ) ) ;
- Xint ht_insert_uniq __ARGS( ( dict_h hh dict_obj, dict_obj *objp ) ) ;
- Xint ht_delete __ARGS( ( dict_h hh, dict_obj obj ) ) ;
- Xdict_obj ht_search __ARGS( ( dict_h hh, dict_key key ) ) ;
- Xdict_obj ht_minimum __ARGS( ( dict_h hh ) ) ;
- Xdict_obj ht_maximum __ARGS( ( dict_h hh ) ) ;
- Xdict_obj ht_successor __ARGS( ( dict_h hh, dict_obj ) ) ;
- Xdict_obj ht_predecessor __ARGS( ( dict_h hh, dict_obj ) ) ;
- Xvoid ht_iterate __ARGS( ( dict_h hh ) ) ;
- Xdict_obj ht_nextobj __ARGS( ( dict_h hh ) ) ;
- X
- X#endif /* __HT_H */
- X
- END_OF_FILE
- if test 1233 -ne `wc -c <'libs/src/dict/ht.h'`; then
- echo shar: \"'libs/src/dict/ht.h'\" unpacked with wrong size!
- fi
- # end of 'libs/src/dict/ht.h'
- fi
- if test -f 'libs/src/fsma/COPYRIGHT' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/fsma/COPYRIGHT'\"
- else
- echo shar: Extracting \"'libs/src/fsma/COPYRIGHT'\" \(1336 characters\)
- sed "s/^X//" >'libs/src/fsma/COPYRIGHT' <<'END_OF_FILE'
- XThis software is
- X
- X(c) Copyright 1992 by Panagiotis Tsirigotis
- X
- XThe author (Panagiotis Tsirigotis) grants permission to use, copy,
- Xand distribute this software and its documentation for any purpose
- Xand without fee, provided that the above copyright notice extant in
- Xfiles in this distribution is not removed from files included in any
- Xredistribution and that this copyright notice is also included in any
- Xredistribution.
- X
- XModifications to this software may be distributed, either by distributing
- Xthe modified software or by distributing patches to the original software,
- Xunder the following additional terms:
- X
- X1. The version number will be modified as follows:
- X a. The first 3 components of the version number
- X (i.e <number>.<number>.<number>) will remain unchanged.
- X b. A new component will be appended to the version number to indicate
- X the modification level. The form of this component is up to the
- X author of the modifications.
- X
- X2. The author of the modifications will include his/her name by appending it
- X along with the new version number to this file and will be responsible for
- X any wrong behavior of the modified software.
- X
- XThe author makes no representations about the suitability of this
- Xsoftware for any purpose. It is provided "as is" without any express
- Xor implied warranty.
- X
- END_OF_FILE
- if test 1336 -ne `wc -c <'libs/src/fsma/COPYRIGHT'`; then
- echo shar: \"'libs/src/fsma/COPYRIGHT'\" unpacked with wrong size!
- fi
- # end of 'libs/src/fsma/COPYRIGHT'
- fi
- if test -f 'libs/src/misc/COPYRIGHT' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/misc/COPYRIGHT'\"
- else
- echo shar: Extracting \"'libs/src/misc/COPYRIGHT'\" \(1336 characters\)
- sed "s/^X//" >'libs/src/misc/COPYRIGHT' <<'END_OF_FILE'
- XThis software is
- X
- X(c) Copyright 1992 by Panagiotis Tsirigotis
- X
- XThe author (Panagiotis Tsirigotis) grants permission to use, copy,
- Xand distribute this software and its documentation for any purpose
- Xand without fee, provided that the above copyright notice extant in
- Xfiles in this distribution is not removed from files included in any
- Xredistribution and that this copyright notice is also included in any
- Xredistribution.
- X
- XModifications to this software may be distributed, either by distributing
- Xthe modified software or by distributing patches to the original software,
- Xunder the following additional terms:
- X
- X1. The version number will be modified as follows:
- X a. The first 3 components of the version number
- X (i.e <number>.<number>.<number>) will remain unchanged.
- X b. A new component will be appended to the version number to indicate
- X the modification level. The form of this component is up to the
- X author of the modifications.
- X
- X2. The author of the modifications will include his/her name by appending it
- X along with the new version number to this file and will be responsible for
- X any wrong behavior of the modified software.
- X
- XThe author makes no representations about the suitability of this
- Xsoftware for any purpose. It is provided "as is" without any express
- Xor implied warranty.
- X
- END_OF_FILE
- if test 1336 -ne `wc -c <'libs/src/misc/COPYRIGHT'`; then
- echo shar: \"'libs/src/misc/COPYRIGHT'\" unpacked with wrong size!
- fi
- # end of 'libs/src/misc/COPYRIGHT'
- fi
- if test -f 'libs/src/pq/COPYRIGHT' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/pq/COPYRIGHT'\"
- else
- echo shar: Extracting \"'libs/src/pq/COPYRIGHT'\" \(1336 characters\)
- sed "s/^X//" >'libs/src/pq/COPYRIGHT' <<'END_OF_FILE'
- XThis software is
- X
- X(c) Copyright 1993 by Panagiotis Tsirigotis
- X
- XThe author (Panagiotis Tsirigotis) grants permission to use, copy,
- Xand distribute this software and its documentation for any purpose
- Xand without fee, provided that the above copyright notice extant in
- Xfiles in this distribution is not removed from files included in any
- Xredistribution and that this copyright notice is also included in any
- Xredistribution.
- X
- XModifications to this software may be distributed, either by distributing
- Xthe modified software or by distributing patches to the original software,
- Xunder the following additional terms:
- X
- X1. The version number will be modified as follows:
- X a. The first 3 components of the version number
- X (i.e <number>.<number>.<number>) will remain unchanged.
- X b. A new component will be appended to the version number to indicate
- X the modification level. The form of this component is up to the
- X author of the modifications.
- X
- X2. The author of the modifications will include his/her name by appending it
- X along with the new version number to this file and will be responsible for
- X any wrong behavior of the modified software.
- X
- XThe author makes no representations about the suitability of this
- Xsoftware for any purpose. It is provided "as is" without any express
- Xor implied warranty.
- X
- END_OF_FILE
- if test 1336 -ne `wc -c <'libs/src/pq/COPYRIGHT'`; then
- echo shar: \"'libs/src/pq/COPYRIGHT'\" unpacked with wrong size!
- fi
- # end of 'libs/src/pq/COPYRIGHT'
- fi
- if test -f 'libs/src/pset/COPYRIGHT' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/pset/COPYRIGHT'\"
- else
- echo shar: Extracting \"'libs/src/pset/COPYRIGHT'\" \(1342 characters\)
- sed "s/^X//" >'libs/src/pset/COPYRIGHT' <<'END_OF_FILE'
- XThis software is
- X
- X(c) Copyright 1992, 1993 by Panagiotis Tsirigotis
- X
- XThe author (Panagiotis Tsirigotis) grants permission to use, copy,
- Xand distribute this software and its documentation for any purpose
- Xand without fee, provided that the above copyright notice extant in
- Xfiles in this distribution is not removed from files included in any
- Xredistribution and that this copyright notice is also included in any
- Xredistribution.
- X
- XModifications to this software may be distributed, either by distributing
- Xthe modified software or by distributing patches to the original software,
- Xunder the following additional terms:
- X
- X1. The version number will be modified as follows:
- X a. The first 3 components of the version number
- X (i.e <number>.<number>.<number>) will remain unchanged.
- X b. A new component will be appended to the version number to indicate
- X the modification level. The form of this component is up to the
- X author of the modifications.
- X
- X2. The author of the modifications will include his/her name by appending it
- X along with the new version number to this file and will be responsible for
- X any wrong behavior of the modified software.
- X
- XThe author makes no representations about the suitability of this
- Xsoftware for any purpose. It is provided "as is" without any express
- Xor implied warranty.
- X
- END_OF_FILE
- if test 1342 -ne `wc -c <'libs/src/pset/COPYRIGHT'`; then
- echo shar: \"'libs/src/pset/COPYRIGHT'\" unpacked with wrong size!
- fi
- # end of 'libs/src/pset/COPYRIGHT'
- fi
- if test -f 'libs/src/sio/COPYRIGHT' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/sio/COPYRIGHT'\"
- else
- echo shar: Extracting \"'libs/src/sio/COPYRIGHT'\" \(1332 characters\)
- sed "s/^X//" >'libs/src/sio/COPYRIGHT' <<'END_OF_FILE'
- XThis software is
- X
- X(c) Copyright 1992, 1993 by Panagiotis Tsirigotis
- X
- XThe author (Panagiotis Tsirigotis) grants permission to use, copy,
- Xand distribute this software and its documentation for any purpose
- Xand without fee, provided that a) the above copyright notice extant in
- Xfiles in this distribution is not removed from files included in any
- Xredistribution, and b) this file is also included in any redistribution.
- X
- XModifications to this software may be distributed, either by distributing
- Xthe modified software or by distributing patches to the original software,
- Xunder the following additional terms:
- X
- X1. The version number will be modified as follows:
- X a. The first 3 components of the version number
- X (i.e. <number>.<number>.<number>) will remain unchanged.
- X b. A new component will be appended to the version number to indicate
- X the modification level. The form of this component is up to the
- X author of the modifications.
- X
- X2. The author of the modifications will include his/her name by appending it
- X along with the new version number to this file and will be responsible for
- X any wrong behavior of the modified software.
- X
- XThe author makes no representations about the suitability of this
- Xsoftware for any purpose. It is provided "as is" without any express
- Xor implied warranty.
- X
- END_OF_FILE
- if test 1332 -ne `wc -c <'libs/src/sio/COPYRIGHT'`; then
- echo shar: \"'libs/src/sio/COPYRIGHT'\" unpacked with wrong size!
- fi
- # end of 'libs/src/sio/COPYRIGHT'
- fi
- if test -f 'libs/src/sio/suite/fdtest.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/sio/suite/fdtest.c'\"
- else
- echo shar: Extracting \"'libs/src/sio/suite/fdtest.c'\" \(1150 characters\)
- sed "s/^X//" >'libs/src/sio/suite/fdtest.c' <<'END_OF_FILE'
- X/*
- X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
- X * All rights reserved. The file named COPYRIGHT specifies the terms
- X * and conditions for redistribution.
- X */
- X
- X
- X#include <sys/time.h>
- X#include <sys/resource.h>
- X
- X#include "sio.h"
- X
- X#ifndef NULL
- X#define NULL 0
- X#endif
- X
- Xint main( argc, argv )
- X int argc ;
- X char *argv[] ;
- X{
- X#ifdef RLIMIT_NOFILE
- X struct rlimit rl ;
- X int fd ;
- X int duped_fd ;
- X char *s ;
- X
- X if ( getrlimit( RLIMIT_NOFILE, &rl ) == -1 )
- X {
- X perror( "getrlimit" ) ;
- X exit( 1 ) ;
- X }
- X if ( rl.rlim_cur != getdtablesize() )
- X {
- X printf( "rl.rlim_cur != getdtablesize()\n" ) ;
- X exit( 1 ) ;
- X }
- X if ( rl.rlim_cur == rl.rlim_max )
- X exit( 0 ) ;
- X
- X rl.rlim_cur++ ;
- X if ( setrlimit( RLIMIT_NOFILE, &rl ) == -1 )
- X {
- X perror( "setrlimit" ) ;
- X exit( 1 ) ;
- X }
- X if ( Smorefds() == SIO_ERR )
- X {
- X perror( "Smorefds" ) ;
- X exit( 1 ) ;
- X }
- X fd = open( "/etc/passwd", 0 ) ;
- X if ( fd == -1 )
- X {
- X perror( "open" ) ;
- X exit( 1 ) ;
- X }
- X duped_fd = getdtablesize()-1 ;
- X if ( dup2( fd, duped_fd ) == -1 )
- X {
- X perror( "dup2" ) ;
- X exit( 1 ) ;
- X }
- X s = Srdline( duped_fd ) ;
- X if ( s == NULL )
- X {
- X perror( "Srdline" ) ;
- X exit( 1 ) ;
- X }
- X#endif
- X exit( 0 ) ;
- X}
- END_OF_FILE
- if test 1150 -ne `wc -c <'libs/src/sio/suite/fdtest.c'`; then
- echo shar: \"'libs/src/sio/suite/fdtest.c'\" unpacked with wrong size!
- fi
- # end of 'libs/src/sio/suite/fdtest.c'
- fi
- if test -f 'libs/src/sio/suite/sprint_test' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/sio/suite/sprint_test'\"
- else
- echo shar: Extracting \"'libs/src/sio/suite/sprint_test'\" \(1146 characters\)
- sed "s/^X//" >'libs/src/sio/suite/sprint_test' <<'END_OF_FILE'
- X#!/bin/sh
- X
- X# (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
- X# All rights reserved. The file named COPYRIGHT specifies the terms
- X# and conditions for redistribution.
- X
- X
- X#
- X# $Id: sprint_test,v 8.1 1993/03/13 01:21:48 panos Exp $
- X#
- X
- Xcompare()
- X{
- X cmp -s PRINTF.DATA SPRINT.DATA
- X if [ $? -ne 0 ]
- X then
- X echo TEST $1 FAILED
- X echo Check files PRINTF.DATA and SPRINT.DATA for differences
- X exit 1
- X else
- X echo TEST $1 PASSED
- X rm -f PRINTF.DATA SPRINT.DATA
- X fi
- X}
- X
- Xformat_test()
- X{
- X Sprint $@ 1>PRINTF.DATA 2>SPRINT.DATA
- X compare "$*"
- X}
- X
- Xformat_test ALL
- X
- Xformat_test -W10 -F0 -c
- Xformat_test -W10 -F- -c
- X
- Xecho
- Xecho PRECISION TEST
- Xi=13
- Xwhile test $i -ne 0
- Xdo
- X format_test -P$i -F# -X
- X i=`expr $i - 1`
- Xdone
- Xecho END OF PRECISION TEST
- Xecho
- X
- Xformat_test -Vi -4 4 1 -o "-F#"
- X
- Xformat_test -Vf -1.0 1.0 0.3 -W30 -P13 -F+ -f
- Xformat_test -Vf -1.0 1.0 0.3 -W30 -P13 -F+ -e
- Xformat_test -Vf -1.0 2.0 0.3 -W30 -P13 -F+ -g
- X
- Xformat_test -Vf -1.0 1.0 0.3 -W30 -P13 -F+- -f
- Xformat_test -Vf -1.0 1.0 0.3 -W30 -P13 -F+- -e
- Xformat_test -Vf -1.0 2.0 0.3 -W30 -P13 -F+- -g
- X
- Xformat_test -W10 "-F " -x
- X
- Xformat_test -W40 -u -Vi 8 100 3 -F0
- X
- Xformat_test -b
- Xformat_test -b -P10
- END_OF_FILE
- if test 1146 -ne `wc -c <'libs/src/sio/suite/sprint_test'`; then
- echo shar: \"'libs/src/sio/suite/sprint_test'\" unpacked with wrong size!
- fi
- # end of 'libs/src/sio/suite/sprint_test'
- fi
- if test -f 'libs/src/sio/suite/testlib' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/sio/suite/testlib'\"
- else
- echo shar: Extracting \"'libs/src/sio/suite/testlib'\" \(1172 characters\)
- sed "s/^X//" >'libs/src/sio/suite/testlib' <<'END_OF_FILE'
- X#!/bin/sh
- X
- X# (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
- X# All rights reserved. The file named COPYRIGHT specifies the terms
- X# and conditions for redistribution.
- X
- X
- X#
- X# $Id: testlib,v 8.2 1993/09/08 05:59:01 panos Exp $
- X#
- X
- X#
- X# Purpose:
- X# Invoke the tester script. This is necessary because the tester
- X# script requires functions and /bin/sh does not support functions
- X# on all OS's. This script decides what shell to use to execute
- X# tester. On Suns, it uses /bin/sh. On DECstations, it uses
- X# /usr/bin/ksh
- X# The decision is made by checking $ARCH
- X#
- X
- Xcase "$ARCH" in
- X "")
- X echo "ARCH not defined. Please define it."
- X exit 1
- X ;;
- X
- X sun4|sun3)
- X TESTSHELL=/bin/sh
- X LDFLAGS="-Bstatic -lm"
- X ;;
- X
- X dec-mips)
- X TESTSHELL=/usr/bin/ksh
- X LDFLAGS=
- X ;;
- X
- X #
- X # The following case was provided by Stephen House.
- X # It applies to HP-UX 8.0 (and later, probably).
- X #
- X # The addition of MORE_DEFS was by me (Panos Tsirigotis)
- X #
- X hp)
- X TESTSHELL=/bin/ksh
- X LDFLAGS=
- X MORE_DEFS="-DRANDOM=lrand48"
- X ;;
- X
- X *) echo "Unknown architecture: $ARCH"
- X exit 2
- X ;;
- Xesac
- X
- Xexport LDFLAGS
- Xexport TESTSHELL
- Xif test "$MORE_DEFS" ; then export MORE_DEFS ; fi
- X$TESTSHELL tester $*
- X
- END_OF_FILE
- if test 1172 -ne `wc -c <'libs/src/sio/suite/testlib'`; then
- echo shar: \"'libs/src/sio/suite/testlib'\" unpacked with wrong size!
- fi
- # end of 'libs/src/sio/suite/testlib'
- fi
- if test -f 'libs/src/str/COPYRIGHT' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/str/COPYRIGHT'\"
- else
- echo shar: Extracting \"'libs/src/str/COPYRIGHT'\" \(1329 characters\)
- sed "s/^X//" >'libs/src/str/COPYRIGHT' <<'END_OF_FILE'
- XThis software is
- X
- X(c) Copyright 1992, 1993 by Panagiotis Tsirigotis
- X
- XThe author (Panagiotis Tsirigotis) grants permission to use, copy,
- Xand distribute this software and its documentation for any purpose
- Xand without fee, provided that the above copyright notice extant in
- Xfiles in this distribution is not removed from files included in any
- Xredistribution and that this file is also included in any redistribution.
- X
- XModifications to this software may be distributed, either by distributing
- Xthe modified software or by distributing patches to the original software,
- Xunder the following additional terms:
- X
- X1. The version number will be modified as follows:
- X a. The first 3 components of the version number
- X (i.e <number>.<number>.<number>) will remain unchanged.
- X b. A new component will be appended to the version number to indicate
- X the modification level. The form of this component is up to the
- X author of the modifications.
- X
- X2. The author of the modifications will include his/her name by appending it
- X along with the new version number to this file and will be responsible for
- X any wrong behavior of the modified software.
- X
- XThe author makes no representations about the suitability of this
- Xsoftware for any purpose. It is provided "as is" without any express
- Xor implied warranty.
- X
- END_OF_FILE
- if test 1329 -ne `wc -c <'libs/src/str/COPYRIGHT'`; then
- echo shar: \"'libs/src/str/COPYRIGHT'\" unpacked with wrong size!
- fi
- # end of 'libs/src/str/COPYRIGHT'
- fi
- if test -f 'libs/src/str/ss_bf.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/str/ss_bf.c'\"
- else
- echo shar: Extracting \"'libs/src/str/ss_bf.c'\" \(1305 characters\)
- sed "s/^X//" >'libs/src/str/ss_bf.c' <<'END_OF_FILE'
- X/*
- X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
- X * All rights reserved. The file named COPYRIGHT specifies the terms
- X * and conditions for redistribution.
- X */
- X
- Xstatic char RCSid[] = "$Id" ;
- X
- X#include "ss_impl.h"
- X
- XPRIVATE int bf_setup() ;
- XPRIVATE char *bf_match() ;
- XPRIVATE void bf_done() ;
- X
- Xstruct ss_ops __strs_bfops = { bf_setup, bf_match, bf_done } ;
- X
- X
- XPRIVATE int bf_setup( hp )
- X header_s *hp ;
- X{
- X#ifdef lint
- X hp = hp ;
- X#endif
- X return( SS_OK ) ;
- X}
- X
- X
- XPRIVATE char *bf_match( hp, str, len )
- X header_s *hp ;
- X char *str ;
- X int len ;
- X{
- X register int pfc = SS_PATTERN( hp )[ 0 ] ; /* pattern first char */
- X register char *pos = str ;
- X register char *endpos = &str[ len - SS_PATLEN( hp ) + 1 ] ;
- X char *endpat = &SS_PATTERN( hp )[ SS_PATLEN( hp ) ] ;
- X
- X while ( pos < endpos )
- X {
- X register int strc = SS_MAP( hp, *pos ) ;
- X register char *pp ; /* pattern pointer */
- X register char *sp ; /* string pointer */
- X
- X pos++ ;
- X if ( strc != pfc )
- X continue ;
- X
- X for ( pp = &SS_PATTERN( hp )[ 1 ], sp = pos ;; sp++, pp++ )
- X {
- X if ( pp == endpat ) /* we are guaranteed a non-empty pattern */
- X return( pos-1 ) ;
- X if ( *pp != SS_MAP( hp, *sp ) )
- X break ;
- X }
- X }
- X return( CHAR_NULL ) ;
- X}
- X
- X
- XPRIVATE void bf_done( hp )
- X header_s *hp ;
- X{
- X#ifdef lint
- X hp = hp ;
- X#endif
- X}
- X
- END_OF_FILE
- if test 1305 -ne `wc -c <'libs/src/str/ss_bf.c'`; then
- echo shar: \"'libs/src/str/ss_bf.c'\" unpacked with wrong size!
- fi
- # end of 'libs/src/str/ss_bf.c'
- fi
- if test -f 'libs/src/timer/COPYRIGHT' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/timer/COPYRIGHT'\"
- else
- echo shar: Extracting \"'libs/src/timer/COPYRIGHT'\" \(1336 characters\)
- sed "s/^X//" >'libs/src/timer/COPYRIGHT' <<'END_OF_FILE'
- XThis software is
- X
- X(c) Copyright 1993 by Panagiotis Tsirigotis
- X
- XThe author (Panagiotis Tsirigotis) grants permission to use, copy,
- Xand distribute this software and its documentation for any purpose
- Xand without fee, provided that the above copyright notice extant in
- Xfiles in this distribution is not removed from files included in any
- Xredistribution and that this copyright notice is also included in any
- Xredistribution.
- X
- XModifications to this software may be distributed, either by distributing
- Xthe modified software or by distributing patches to the original software,
- Xunder the following additional terms:
- X
- X1. The version number will be modified as follows:
- X a. The first 3 components of the version number
- X (i.e <number>.<number>.<number>) will remain unchanged.
- X b. A new component will be appended to the version number to indicate
- X the modification level. The form of this component is up to the
- X author of the modifications.
- X
- X2. The author of the modifications will include his/her name by appending it
- X along with the new version number to this file and will be responsible for
- X any wrong behavior of the modified software.
- X
- XThe author makes no representations about the suitability of this
- Xsoftware for any purpose. It is provided "as is" without any express
- Xor implied warranty.
- X
- END_OF_FILE
- if test 1336 -ne `wc -c <'libs/src/timer/COPYRIGHT'`; then
- echo shar: \"'libs/src/timer/COPYRIGHT'\" unpacked with wrong size!
- fi
- # end of 'libs/src/timer/COPYRIGHT'
- fi
- if test -f 'libs/src/timer/defs.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/timer/defs.h'\"
- else
- echo shar: Extracting \"'libs/src/timer/defs.h'\" \(1262 characters\)
- sed "s/^X//" >'libs/src/timer/defs.h' <<'END_OF_FILE'
- X/*
- X * (c) Copyright 1993 by Panagiotis Tsirigotis
- X * All rights reserved. The file named COPYRIGHT specifies the terms
- X * and conditions for redistribution.
- X */
- X
- X
- X/*
- X * $Id: defs.h,v 5.1 93/11/26 12:07:18 panos Exp $
- X */
- X
- X#define PRIVATE static
- X
- X#ifndef NULL
- X#define NULL 0
- X#endif
- X
- X#ifndef FALSE
- X#define FALSE 0
- X#define TRUE 1
- X#endif
- X
- X#define TIMER_NULL ((timer_s *)0)
- X#define SIGVEC_NULL ((struct sigvec *)0)
- X#define SIGACTION_NULL ((struct sigaction *)0)
- X
- X#define HANDLE_ERROR( flags, retval, errp, errval, msg ) \
- X if ( flags & TIMER_RETURN_ERROR ) \
- X { \
- X *errp = errval ; \
- X return( retval ) ; \
- X } \
- X else \
- X { \
- X char *s = msg ; \
- X \
- X (void) write( 2, s, strlen( s ) ) ; \
- X abort() ; \
- X _exit( 1 ) ; \
- X /* NOTREACHED */ \
- X }
- X
- END_OF_FILE
- if test 1262 -ne `wc -c <'libs/src/timer/defs.h'`; then
- echo shar: \"'libs/src/timer/defs.h'\" unpacked with wrong size!
- fi
- # end of 'libs/src/timer/defs.h'
- fi
- if test -f 'libs/src/xlog/COPYRIGHT' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/xlog/COPYRIGHT'\"
- else
- echo shar: Extracting \"'libs/src/xlog/COPYRIGHT'\" \(1342 characters\)
- sed "s/^X//" >'libs/src/xlog/COPYRIGHT' <<'END_OF_FILE'
- XThis software is
- X
- X(c) Copyright 1992, 1993 by Panagiotis Tsirigotis
- X
- XThe author (Panagiotis Tsirigotis) grants permission to use, copy,
- Xand distribute this software and its documentation for any purpose
- Xand without fee, provided that the above copyright notice extant in
- Xfiles in this distribution is not removed from files included in any
- Xredistribution and that this copyright notice is also included in any
- Xredistribution.
- X
- XModifications to this software may be distributed, either by distributing
- Xthe modified software or by distributing patches to the original software,
- Xunder the following additional terms:
- X
- X1. The version number will be modified as follows:
- X a. The first 3 components of the version number
- X (i.e <number>.<number>.<number>) will remain unchanged.
- X b. A new component will be appended to the version number to indicate
- X the modification level. The form of this component is up to the
- X author of the modifications.
- X
- X2. The author of the modifications will include his/her name by appending it
- X along with the new version number to this file and will be responsible for
- X any wrong behavior of the modified software.
- X
- XThe author makes no representations about the suitability of this
- Xsoftware for any purpose. It is provided "as is" without any express
- Xor implied warranty.
- X
- END_OF_FILE
- if test 1342 -ne `wc -c <'libs/src/xlog/COPYRIGHT'`; then
- echo shar: \"'libs/src/xlog/COPYRIGHT'\" unpacked with wrong size!
- fi
- # end of 'libs/src/xlog/COPYRIGHT'
- fi
- if test -f 'libs/src/xlog/filelog.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/xlog/filelog.h'\"
- else
- echo shar: Extracting \"'libs/src/xlog/filelog.h'\" \(1275 characters\)
- sed "s/^X//" >'libs/src/xlog/filelog.h' <<'END_OF_FILE'
- X/*
- X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
- X * All rights reserved. The file named COPYRIGHT specifies the terms
- X * and conditions for redistribution.
- X */
- X
- X
- X/*
- X * $Id: filelog.h,v 2.2 1993/10/28 01:35:55 panos Exp $
- X */
- X
- X/*
- X * The file can be either open or closed.
- X * When the file is closed, the state is always FL_CLOSED.
- X * When the file is open, the state is:
- X * FL_OPEN: if everything is ok
- X * FL_SIZE: if the hard limit was exceeded
- X * FL_ERROR: if an error occured
- X */
- Xtypedef enum { FL_CLOSED = 0, FL_OPEN, FL_SIZE, FL_ERROR } filelog_state_e ;
- X
- Xstruct filelog
- X{
- X int fl_fd ;
- X filelog_state_e fl_state ;
- X bool_int fl_close_on_exec ;
- X int fl_error ; /* error code when in FL_ERROR */
- X bool_int fl_size_control ; /* enabled or not */
- X bool_int fl_issued_warning ; /* when the soft limit was exceeded */
- X unsigned fl_size ; /* current size */
- X unsigned fl_soft_limit ;
- X unsigned fl_hard_limit ;
- X} ;
- X
- X#define FILELOG_ENABLE_SIZE_CONTROL( flp ) (flp)->fl_size_control = TRUE
- X#define FILELOG_DISABLE_SIZE_CONTROL( flp ) (flp)->fl_size_control = FALSE
- X#define FILELOG_SIZE_CONTROL( flp ) ( (flp)->fl_size_control )
- X
- X#define FILELOG( xp ) ((struct filelog *)(xp)->xl_data)
- X
- END_OF_FILE
- if test 1275 -ne `wc -c <'libs/src/xlog/filelog.h'`; then
- echo shar: \"'libs/src/xlog/filelog.h'\" unpacked with wrong size!
- fi
- # end of 'libs/src/xlog/filelog.h'
- fi
- if test -f 'libs/src/xlog/util.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/src/xlog/util.c'\"
- else
- echo shar: Extracting \"'libs/src/xlog/util.c'\" \(1198 characters\)
- sed "s/^X//" >'libs/src/xlog/util.c' <<'END_OF_FILE'
- X/*
- X * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
- X * All rights reserved. The file named COPYRIGHT specifies the terms
- X * and conditions for redistribution.
- X */
- X
- Xstatic char RCSid[] = "$Id: util.c,v 2.1 1993/05/06 07:40:12 panos Exp $" ;
- X
- Xextern int sys_nerr;
- Xextern char *sys_errlist[];
- Xextern int errno;
- X
- Xchar *malloc() ;
- X
- X#define NUL '\0'
- X#define NULL 0
- X
- X
- X/*
- X * Search the given buffer for an occurrence of "%m"
- X */
- Xchar *__xlog_add_errno( buf, len )
- X char *buf ;
- X int len ;
- X{
- X register char *s ;
- X
- X for ( s = buf ; s < &buf[ len-1 ] ; s++ )
- X if ( *s == '%' && *(s+1) == 'm' )
- X return( s ) ;
- X return( NULL ) ;
- X}
- X
- X
- X
- Xchar *__xlog_explain_errno( buf, size )
- X char *buf ;
- X unsigned *size ;
- X{
- X register int len ;
- X char *strncpy() ;
- X
- X if ( errno < sys_nerr )
- X {
- X
- X (void) strncpy( buf, sys_errlist[ errno ], (int)*size ) ;
- X for ( len = 0 ; len < *size ; len++ )
- X if ( buf[ len ] == NUL )
- X break ;
- X *size = len ;
- X }
- X else
- X len = strx_nprint( buf, *size, "errno = %d", errno ) ;
- X return( buf ) ;
- X}
- X
- X
- Xchar *__xlog_new_string( s )
- X char *s ;
- X{
- X unsigned size = strlen( s ) + 1 ;
- X char *p = malloc( size ) ;
- X char *strcpy() ;
- X
- X return( ( p != NULL ) ? strcpy( p, s ) : p ) ;
- X}
- X
- X
- END_OF_FILE
- if test 1198 -ne `wc -c <'libs/src/xlog/util.c'`; then
- echo shar: \"'libs/src/xlog/util.c'\" unpacked with wrong size!
- fi
- # end of 'libs/src/xlog/util.c'
- fi
- echo shar: End of archive 2 \(of 20\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 20 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-