OSSP CVS Repository

ossp - Check-in [1643]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1643
Date: 2002-Jan-26 21:12:19 (local)
2002-Jan-26 20:12:19 (UTC)
User:rse
Branch:
Comment: switch to our standard build environment
Tickets:
Inspections:
Files:
ossp-pkg/ex/.cvsignore      1.1 -> 1.2     9 inserted, 0 deleted
ossp-pkg/ex/Makefile      1.1->removed
ossp-pkg/ex/Makefile.in      added-> 1.1
ossp-pkg/ex/README      1.1 -> 1.2     55 inserted, 0 deleted
ossp-pkg/ex/TODO      1.3 -> 1.4     0 inserted, 1 deleted
ossp-pkg/ex/VERSION      added-> 1.1
ossp-pkg/ex/aclocal.m4      added-> 1.1
ossp-pkg/ex/configure.ac      added-> 1.1
ossp-pkg/ex/devtool      added-> 1.1
ossp-pkg/ex/devtool.conf      added-> 1.1
ossp-pkg/ex/devtool.func      added-> 1.1
ossp-pkg/ex/ex-config.in      added-> 1.1
ossp-pkg/ex/ex.c      1.1 -> 1.2     5 inserted, 3 deleted
ossp-pkg/ex/ex.h      1.4 -> 1.5     5 inserted, 3 deleted
ossp-pkg/ex/ts.c      added-> 1.1
ossp-pkg/ex/ts.h      added-> 1.1

ossp-pkg/ex/.cvsignore 1.1 -> 1.2

--- .cvsignore   2002/01/25 15:44:09     1.1
+++ .cvsignore   2002/01/26 20:12:19     1.2
@@ -1 +1,10 @@
+shtool
+config.guess
+config.sub
+ltmain.sh
+libtool.m4
+configure
+config.h.in
+ex-config
+config.h
 ex_test


ossp-pkg/ex/Makefile 1.1 -> 1.2



ossp-pkg/ex/Makefile.in -> 1.1

*** /dev/null    Sat Nov 23 01:00:16 2024
--- -    Sat Nov 23 01:00:16 2024
***************
*** 0 ****
--- 1,109 ----
+ ##
+ ##  OSSP ex - Exception Handling Library
+ ##  Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com>
+ ##  Copyright (c) 2002 The OSSP Project <http://www.ossp.org/>
+ ##  Copyright (c) 2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+ ##
+ ##  This file is part of OSSP ex, an exception handling library
+ ##  which can be found at http://www.ossp.org/pkg/ex/.
+ ##
+ ##  This program is free software; you can redistribute it and/or
+ ##  modify it under the terms of the GNU General Public  License
+ ##  as published by the Free Software Foundation; either version
+ ##  2.0 of the License, or (at your option) any later version.
+ ##
+ ##  This program is distributed in the hope that it will be useful,
+ ##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ##  General Public License for more details.
+ ##
+ ##  You should have received a copy of the GNU General Public License
+ ##  along with this file; if not, write to the Free Software
+ ##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ##  USA, or contact the OSSP project <ossp@ossp.org>.
+ ##
+ ##  Makefile.in: make(1) build procedure
+ ##
+ 
+ @SET_MAKE@
+ 
+ DESTDIR     =
+ prefix      = @prefix@
+ exec_prefix = @exec_prefix@
+ bindir      = @bindir@
+ libdir      = @libdir@
+ includedir  = @includedir@
+ mandir      = @mandir@
+ 
+ CC          = @CC@
+ CPPFLAGS    = @CPPFLAGS@
+ CFLAGS      = @DEFS@ @CFLAGS@
+ LDFLAGS     = @LDFLAGS@
+ LIBS        = @LIBS@
+ RM          = rm -f
+ RMDIR       = rmdir
+ SHTOOL      = ./shtool
+ LIBTOOL     = ./libtool
+ TRUE        = true
+ 
+ LIB_NAME    = libex.la
+ LIB_OBJS    = ex.lo
+ 
+ TST_NAME    = ex_test
+ TST_OBJS    = ex_test.o ts.o
+ 
+ .SUFFIXES:
+ .SUFFIXES: .c .o .lo
+ 
+ all: $(LIB_NAME) $(TST_NAME)
+ 
+ .c.o:
+        $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
+ 
+ .c.lo:
+        @$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
+ 
+ $(LIB_NAME): $(LIB_OBJS)
+        @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
+            -version-info `$(SHTOOL) version -l txt -d libtool VERSION`
+ 
+ $(TST_NAME): $(TST_OBJS) $(LIB_NAME)
+        @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(TST_NAME) $(TST_OBJS) $(LIB_NAME) $(LIBS)
+ 
+ check: $(TST_NAME)
+        @$(LIBTOOL) --mode=execute ./$(TST_NAME)
+ 
+ install:
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(prefix)
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir)
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(includedir)
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(libdir)
+        $(SHTOOL) install -c -m 755 ex-config $(DESTDIR)$(bindir)/
+        $(SHTOOL) install -c -m 644 ex.h $(DESTDIR)$(includedir)/
+        @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 libex.la $(DESTDIR)$(libdir)/
+ 
+ uninstall:
+        @$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/libex.la
+        -$(RM) $(DESTDIR)$(includedir)/ex.h
+        -$(RM) $(DESTDIR)$(bindir)/ex-config
+        -$(RMDIR) $(DESTDIR)$(libdir) >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(includedir) >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(bindir) >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(prefix) >/dev/null 2>&1 || $(TRUE)
+ 
+ clean:
+        -$(RM) $(LIB_NAME) $(LIB_OBJS)
+        -$(RM) $(TST_NAME) $(TST_OBJS)
+        -$(RM) -r .libs >/dev/null 2>&1 || $(TRUE)
+        -$(RM) *.o *.lo
+ 
+ distclean: clean
+        -$(RM) config.log config.status config.cache
+        -$(RM) Makefile config.h ex-config
+        -$(RM) libtool
+ 
+ realclean: distclean
+        -$(RM) configure config.h.in
+        -$(RM) shtool
+        -$(RM) ltmain.sh libtool.m4 config.guess config.sub
+ 


ossp-pkg/ex/README 1.1 -> 1.2

--- README       2002/01/25 15:25:51     1.1
+++ README       2002/01/26 20:12:19     1.2
@@ -1 +1,56 @@
+   _____  __
+  / _ \ \/ /
+ |  __/>  < 
+  \___/_/\_\
+               
+  OSSP ex - Exception Handling Library
+  Version 0.1.0 (26-Jan-2002)
+
+  ABSTRACT
+
+  The OSSP ex library is a small ISO-C++ style exception handling
+  library for use in the ISO-C language. It allows you to use the
+  paradigm of throwing and catching exceptions in order to reduce the
+  amount of error handling code in without making your program less
+  robust. This is achieved by directly transferring exceptional return
+  codes (and the program control flow) from the location where it was
+  raised (throw point) to the location where it is handled (catch point)
+  - usually from a deeply nested sub-routine to a parent routine. All
+  intermediate routines no longer have to make sure that the exceptional
+  return codes from sub-routines are correctly passed back to the
+  parent.
+
+  COPYRIGHT AND LICENSE
+
+  Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com>
+  Copyright (c) 2002 The OSSP Project <http://www.ossp.org/>
+  Copyright (c) 2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+
+  This file is part of OSSP ex, an exception handling library which
+  can be found at http://www.ossp.org/pkg/ex/.
+
+  Permission to use, copy, modify, and distribute this software for
+  any purpose with or without fee is hereby granted, provided that
+  the above copyright notice and this permission notice appear in all
+  copies.
+
+  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  SUCH DAMAGE.
+
+  HOME AND DOCUMENTATION
+
+  The documentation and latest release can be found on
+
+  o http://www.ossp.org/pkg/ex/
+  o  ftp://ftp.ossp.org/pkg/ex/
 


ossp-pkg/ex/TODO 1.3 -> 1.4

--- TODO 2002/01/25 22:23:17     1.3
+++ TODO 2002/01/26 20:12:19     1.4
@@ -1,3 +1,2 @@
-- devtool environment
 - test thread examples 
 - overhault ex_text.c


ossp-pkg/ex/VERSION -> 1.1

*** /dev/null    Sat Nov 23 01:00:16 2024
--- -    Sat Nov 23 01:00:16 2024
***************
*** 0 ****
--- 1,6 ----
+ 
+   VERSION -- Version Information for OSSP ex (syntax: Text)
+   [automatically generated and maintained by GNU shtool]
+ 
+   This is OSSP ex, Version 0.1.0 (26-Jan-2002)
+ 


ossp-pkg/ex/aclocal.m4 -> 1.1

*** /dev/null    Sat Nov 23 01:00:16 2024
--- -    Sat Nov 23 01:00:16 2024
***************
*** 0 ****
--- 1,117 ----
+ dnl ##
+ dnl ##  SA - OSSP Socket Abstraction Library
+ dnl ##  Copyright (c) 2001-2002 Ralf S. Engelschall <rse@engelschall.com>
+ dnl ##  Copyright (c) 2001-2002 The OSSP Project <http://www.ossp.org/>
+ dnl ##  Copyright (c) 2001-2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+ dnl ##
+ dnl ##  This file is part of OSSP SA, a socket abstraction library which
+ dnl ##  can be found at http://www.ossp.org/pkg/sa/.
+ dnl ##
+ dnl ##  Permission to use, copy, modify, and distribute this software for
+ dnl ##  any purpose with or without fee is hereby granted, provided that
+ dnl ##  the above copyright notice and this permission notice appear in all
+ dnl ##  copies.
+ dnl ##
+ dnl ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ dnl ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ dnl ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ dnl ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+ dnl ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ dnl ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ dnl ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ dnl ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ dnl ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ dnl ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ dnl ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ dnl ##  SUCH DAMAGE.
+ dnl ##
+ dnl ##  aclocal.m4: GNU Autoconf local macro definitions
+ dnl ##
+ 
+ dnl ##
+ dnl ##  Check whether compiler option works
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_COMPILER_OPTION(<name>, <display>, <option>,
+ dnl ##                       <action-success>, <action-failure>)
+ dnl ##
+ 
+ AC_DEFUN(AC_COMPILER_OPTION,[dnl
+ AC_MSG_CHECKING(whether compiler option(s) $2 work)
+ AC_CACHE_VAL(ac_cv_compiler_option_$1,[
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $3"
+ AC_TRY_COMPILE([],[], ac_cv_compiler_option_$1=yes, ac_cv_compiler_option_$1=no)
+ CFLAGS="$SAVE_CFLAGS"
+ ])dnl
+ if test ".$ac_cv_compiler_option_$1" = .yes; then
+     ifelse([$4], , :, [$4])
+ else
+     ifelse([$5], , :, [$5])
+ fi
+ AC_MSG_RESULT([$ac_cv_compiler_option_$1])
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Debugging Support
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_DEBUGGING
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_DEBUGGING,[dnl
+ AC_ARG_ENABLE(debug,dnl
+ [  --enable-debug          build for debugging (default=no)],
+ [dnl
+ if test ".$ac_cv_prog_gcc" = ".yes"; then
+     case "$CFLAGS" in
+         *-O* ) ;;
+            * ) CFLAGS="$CFLAGS -O2" ;;
+     esac
+     case "$CFLAGS" in
+         *-g* ) ;;
+            * ) CFLAGS="$CFLAGS -g" ;;
+     esac
+     case "$CFLAGS" in
+         *-pipe* ) ;;
+               * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;;
+     esac
+     AC_COMPILER_OPTION(defdbg, -DDEBUG, -DDEBUG, CFLAGS="$CFLAGS -DDEBUG")
+     AC_COMPILER_OPTION(ggdb3, -ggdb3, -ggdb3, CFLAGS="$CFLAGS -ggdb3")
+     CFLAGS="$CFLAGS -pedantic"
+     CFLAGS="$CFLAGS -Wall"
+     WMORE="-Wshadow -Wpointer-arith -Wcast-align -Winline"
+     WMORE="$WMORE -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
+     AC_COMPILER_OPTION(wmore, -W<xxx>, $WMORE, CFLAGS="$CFLAGS $WMORE")
+     AC_COMPILER_OPTION(wnolonglong, -Wno-long-long, -Wno-long-long, CFLAGS="$CFLAGS -Wno-long-long")
+ else
+     case "$CFLAGS" in
+         *-g* ) ;;
+            * ) CFLAGS="$CFLAGS -g" ;;
+     esac
+ fi
+ msg="enabled"
+ ],[
+ if test ".$ac_cv_prog_gcc" = ".yes"; then
+ case "$CFLAGS" in
+     *-pipe* ) ;;
+           * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;;
+ esac
+ fi
+ case "$CFLAGS" in
+     *-g* ) CFLAGS=`echo "$CFLAGS" |\
+                    sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
+ esac
+ case "$CXXFLAGS" in
+     *-g* ) CXXFLAGS=`echo "$CXXFLAGS" |\
+                      sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
+ esac
+ msg=disabled
+ ])dnl
+ AC_MSG_CHECKING(for compilation debug mode)
+ AC_MSG_RESULT([$msg])
+ if test ".$msg" = .enabled; then
+     enable_shared=no
+ fi
+ ])
+ 


ossp-pkg/ex/configure.ac -> 1.1

*** /dev/null    Sat Nov 23 01:00:16 2024
--- -    Sat Nov 23 01:00:16 2024
***************
*** 0 ****
--- 1,49 ----
+ dnl ##
+ dnl ##  OSSP ex - Exception Handling Library
+ dnl ##  Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com>
+ dnl ##  Copyright (c) 2002 The OSSP Project <http://www.ossp.org/>
+ dnl ##  Copyright (c) 2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+ dnl ##
+ dnl ##  This file is part of OSSP ex, an exception handling library
+ dnl ##  which can be found at http://www.ossp.org/pkg/ex/.
+ dnl ##
+ dnl ##  This program is free software; you can redistribute it and/or
+ dnl ##  modify it under the terms of the GNU General Public  License
+ dnl ##  as published by the Free Software Foundation; either version
+ dnl ##  2.0 of the License, or (at your option) any later version.
+ dnl ##
+ dnl ##  This program is distributed in the hope that it will be useful,
+ dnl ##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ dnl ##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ dnl ##  General Public License for more details.
+ dnl ##
+ dnl ##  You should have received a copy of the GNU General Public License
+ dnl ##  along with this file; if not, write to the Free Software
+ dnl ##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ dnl ##  USA, or contact the OSSP project <ossp@ossp.org>.
+ dnl ##
+ dnl ##  configure.ac: GNU Autoconf source script
+ dnl ##
+ 
+ AC_PREREQ(2.52)
+ AC_REVISION(1.0)
+ AC_INIT(README)
+ 
+ AC_DIVERT_PUSH(NOTICE)
+ V=`./shtool version -l txt -d long VERSION`
+ ./shtool echo -e "Configuring %BOSSP ex%b (Exception Handling), Version %B${V}%b"
+ AC_DIVERT_POP()
+ 
+ AC_SET_MAKE
+ AC_PROG_CC
+ AC_CHECK_DEBUGGING
+ 
+ sinclude(libtool.m4)
+ AC_PROG_LIBTOOL
+ 
+ AC_CONFIG_HEADERS(config.h)
+ AC_CONFIG_FILES(Makefile ex-config)
+ AC_OUTPUT
+ 
+ chmod a+x ex-config
+ 


ossp-pkg/ex/devtool -> 1.1

*** /dev/null    Sat Nov 23 01:00:16 2024
--- -    Sat Nov 23 01:00:16 2024
***************
*** 0 ****
--- 1,47 ----
+ #!/bin/sh
+ ##
+ ##  devtool -- Development Tool
+ ##  Copyright (c) 2001 Ralf S. Engelschall <rse@engelschall.com> 
+ ##
+ 
+ if [ $# -eq 0 ]; then
+     echo "devtool:USAGE: devtool <command> [<arg> ...]" 1>&2
+     exit 1
+ fi
+ 
+ cmd="$1"
+ shift
+ 
+ devtoolfunc="./devtool.func"
+ 
+ if [ ! -f devtool.conf ]; then
+     echo "devtool:ERROR: no devtool.conf in current directory" 1>&2
+     exit 1
+ fi
+ 
+ cmdline=`grep "^%$cmd" devtool.conf`
+ if [ ".$cmdline" = . ]; then
+     echo "devtool:ERROR: command $cmd not found in devtool.conf" 1>&2
+     exit 1
+ fi
+ 
+ if [ ".$TMPDIR" != . ]; then
+     tmpdir="$TMPDIR"
+ elif [ ".$TEMPDIR" != . ]; then
+     tmpdir="$TEMPDIR"
+ else
+     tmpdir="/tmp"
+ fi
+ tmpfile="$tmpdir/rc.$$.tmp"
+ 
+ rm -f $tmpfile
+ touch $tmpfile
+ echo ". $devtoolfunc" >>$tmpfile
+ ( sed <devtool.conf -e "1,/^%common/d" -e '/^%.*/,$d'
+   sed <devtool.conf -e "1,/^%$cmd/d" -e '/^%.*/,$d' ) |\
+ sed -e 's;\([  ]\)@\([a-zA-Z_][a-zA-Z0-9_]*\);\1devtool_\2;' >>$tmpfile
+ 
+ sh $tmpfile "$@"
+ 
+ rm -f $tmpfile >/dev/null 2>&1 || true
+ 


ossp-pkg/ex/devtool.conf -> 1.1

*** /dev/null    Sat Nov 23 01:00:16 2024
--- -    Sat Nov 23 01:00:16 2024
***************
*** 0 ****
--- 1,31 ----
+ ##
+ ##  devtool.conf -- Development Tool Configuration
+ ##
+ 
+ %autogen
+     @autogen shtool   1.5.4 "1.5.*" all
+     @autogen libtool  1.4.2 "1.4*"
+     @autogen autoconf 2.52  "2.5.*"
+ 
+ %autoclean
+     @autoclean shtool
+     @autoclean libtool
+     @autoclean autoconf
+ 
+ %configure
+     ./configure \
+         --prefix=/tmp/ex \
+         --disable-shared \
+         --enable-debug \
+         "$@"
+ 
+ %version
+     ./shtool version -l txt -n "OSSP ex" -e VERSION
+ 
+ %dist
+     make distclean >/dev/null 2>&1
+     ./shtool fixperm -v .
+     V=`./shtool version -l txt -d short VERSION`
+     ./shtool tarball -o ex-${V}.tar.gz -d ex-${V} -u ossp -g ossp \
+                      -e 'CVS,\.cvsignore,\.[ao],^\.,devtool.conf' -c 'gzip --best' .
+ 


ossp-pkg/ex/devtool.func -> 1.1

*** /dev/null    Sat Nov 23 01:00:16 2024
--- -    Sat Nov 23 01:00:16 2024
***************
*** 0 ****
--- 1,72 ----
+ ##
+ ##  devtool.func -- Development Tool Functions
+ ##  Copyright (c) 2001 Ralf S. Engelschall <rse@engelschall.com> 
+ ##
+ 
+ devtool_require () {
+     t="$1"; o="$2"; p="$3"; e="$4"; a="$5"
+     v=`($t $o | head -1 | awk "{ print \\\$$p; }") 2>/dev/null`
+     if [ ".$v" = . ]; then
+         echo "devtool:ERROR: unable to determine version of $t" 1>&2
+         exit 1
+     fi
+     case "$v" in
+         $e )
+             ;;
+         $a )
+             echo "devtool:WARNING: $t version $v still accepted, although expected $e." 1>&2
+             ;;
+         * )
+             echo "devtool:ERROR: $t version $e expected, but found $v." 1>&2
+             exit 1
+             ;;
+     esac
+     echo "$v"
+ }
+ 
+ devtool_autogen () {
+     tool=$1
+     shift
+     case $tool in
+         autoconf )
+             autoconf_version=`devtool_require autoconf --version 4 "$1" "$2"`
+             echo "generating (GNU Autoconf $autoconf_version): configure config.h.in"
+             autoconf
+             autoheader 2>&1 | grep -v "is unchanged"
+             ;;
+         libtool )
+             libtoolize_version=`devtool_require libtoolize --version 4 "$1" "$2"`
+             echo "generating (GNU Libtool $libtoolize_version): ltmain.sh, libtool.m4, config.guess, config.sub"
+             libtoolize --force --copy >/dev/null 2>&1
+             cp `libtoolize --force --copy --dry-run | grep "add the contents of" |\
+                 sed -e 's;^[^\`]*\`;;' -e "s;'.*;;"` libtool.m4
+             ;;
+         shtool )
+             shtoolize_version=`devtool_require shtoolize -v 3 "$1" "$2"`
+             echo "generating (GNU Shtool $shtoolize_version): shtool"
+             shift
+             shift
+             shtoolize -q "$@"
+             ;;
+     esac
+ }
+ 
+ devtool_autoclean () {
+     tool=$1
+     shift
+     case $tool in
+         autoconf )
+             echo "removing: configure config.h.in"
+             rm -f configure config.h.in
+             ;;
+         libtool )
+             echo "removing: ltmain.sh libtool.m4 config.guess config.sub"
+             rm -f ltmain.sh libtool.m4 config.guess config.sub
+             ;;
+         shtool )
+             echo "removing: shtool"
+             rm -f shtool
+             ;;
+     esac
+ }
+ 


ossp-pkg/ex/ex-config.in -> 1.1

*** /dev/null    Sat Nov 23 01:00:16 2024
--- -    Sat Nov 23 01:00:16 2024
***************
*** 0 ****
--- 1,145 ----
+ #!/bin/sh
+ ##
+ ##  OSSP ex - Exception Handling Library
+ ##  Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com>
+ ##  Copyright (c) 2002 The OSSP Project <http://www.ossp.org/>
+ ##  Copyright (c) 2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+ ##
+ ##  This file is part of OSSP ex, an exception handling library
+ ##  which can be found at http://www.ossp.org/pkg/ex/.
+ ##
+ ##  This program is free software; you can redistribute it and/or
+ ##  modify it under the terms of the GNU General Public  License
+ ##  as published by the Free Software Foundation; either version
+ ##  2.0 of the License, or (at your option) any later version.
+ ##
+ ##  This program is distributed in the hope that it will be useful,
+ ##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ##  General Public License for more details.
+ ##
+ ##  You should have received a copy of the GNU General Public License
+ ##  along with this file; if not, write to the Free Software
+ ##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ##  USA, or contact the OSSP project <ossp@ossp.org>.
+ ##
+ ##  ex-config.in: library build utility
+ ##
+ 
+ DIFS=' 
+ '
+ 
+ #   tool
+ tool_name="ex-config"
+ 
+ #   library version
+ lib_name="OSSP ex"
+ lib_version="@EX_VERSION_STR@"
+ 
+ #   build paths
+ prefix="@prefix@"
+ exec_prefix="@exec_prefix@"
+ bindir="@bindir@"
+ libdir="@libdir@"
+ includedir="@includedir@"
+ mandir="@mandir@"
+ datadir="@datadir@"
+ 
+ #   build options
+ cflags="@CFLAGS@"
+ ldflags="@LDFLAGS@"
+ libs="@LIBS@"
+ 
+ #   option defaults
+ help=no
+ version=no
+ 
+ usage="$tool_name"
+ usage="$usage [--help] [--version] [--all]"
+ usage="$usage [--prefix] [--exec-prefix] [--bindir] [--libdir] [--includedir] [--mandir] [--datadir]"
+ usage="$usage [--cflags] [--ldflags] [--libs]"
+ if [ $# -eq 0 ]; then
+     echo "$tool_name:Error: Invalid option" 1>&2
+     echo "$tool_name:Usage: $usage" 1>&2
+     exit 1
+ fi
+ output=''
+ output_extra=''
+ all=no
+ prev=''
+ OIFS="$IFS" IFS="$DIFS"
+ for option
+ do
+     if [ ".$prev" != . ]; then
+         eval "$prev=\$option"
+         prev=''
+         continue
+     fi
+     case "$option" in
+         -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+            *) optarg='' ;;
+     esac
+     case "$option" in
+         --help|-h)
+             echo "Usage: $usage"
+             exit 0
+             ;;
+         --version|-v)
+             echo "$lib_name $lib_version"
+             exit 0
+             ;;
+         --all)
+             all=yes
+             ;;
+         --prefix)
+             output="$output $prefix"
+             ;;
+         --exec-prefix)
+             output="$output $exec_prefix"
+             ;;
+         --bindir)
+             output="$output $bindir"
+             ;;
+         --libdir)
+             output="$output $libdir"
+             ;;
+         --includedir)
+             output="$output $includedir"
+             ;;
+         --mandir)
+             output="$output $mandir"
+             ;;
+         --datadir)
+             output="$output $datadir"
+             ;;
+         --cflags)
+             output="$output -I$includedir"
+             output_extra="$output_extra $cflags"
+             ;;
+         --ldflags)
+             output="$output -L$libdir"
+             output_extra="$output_extra $ldflags"
+             ;;
+         --libs)
+             output="$output -lxds"
+             output_extra="$output_extra $libs"
+             ;;
+         * )
+             echo "$tool_name:Error: Invalid option" 1>&2
+             echo "$tool_name:Usage: $usage" 1>&2
+             exit 1;
+             ;;
+     esac
+ done
+ IFS="$OIFS"
+ if [ ".$prev" != . ]; then
+     echo "$tool_name:Error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2
+     exit 1
+ fi
+ if [ ".$output" != . ]; then
+     if [ ".$all" = .yes ]; then
+         output="$output $output_extra"
+     fi
+     echo $output
+ fi
+ 


ossp-pkg/ex/ex.c 1.1 -> 1.2

--- ex.c 2002/01/25 15:25:51     1.1
+++ ex.c 2002/01/26 20:12:19     1.2
@@ -1,8 +1,10 @@
 /*
-**  Copyright (c) 2001-2002 The OSSP Project <http://www.ossp.org/>
-**  Copyright (c) 2001-2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+**  OSSP ex - Exception Handling Library
+**  Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com>
+**  Copyright (c) 2002 The OSSP Project <http://www.ossp.org/>
+**  Copyright (c) 2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
 **
-**  This file is part of OSSP ex, an exception library
+**  This file is part of OSSP ex, an exception handling library
 **  which can be found at http://www.ossp.org/pkg/ex/.
 **
 **  This program is free software; you can redistribute it and/or


ossp-pkg/ex/ex.h 1.4 -> 1.5

--- ex.h 2002/01/25 22:23:17     1.4
+++ ex.h 2002/01/26 20:12:19     1.5
@@ -1,8 +1,10 @@
 /*
-**  Copyright (c) 2001-2002 The OSSP Project <http://www.ossp.org/>
-**  Copyright (c) 2001-2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+**  OSSP ex - Exception Handling Library
+**  Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com>
+**  Copyright (c) 2002 The OSSP Project <http://www.ossp.org/>
+**  Copyright (c) 2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
 **
-**  This file is part of OSSP ex, an exception library
+**  This file is part of OSSP ex, an exception handling library
 **  which can be found at http://www.ossp.org/pkg/ex/.
 **
 **  This program is free software; you can redistribute it and/or


ossp-pkg/ex/ts.c -> 1.1

*** /dev/null    Sat Nov 23 01:00:16 2024
--- -    Sat Nov 23 01:00:16 2024
***************
*** 0 ****
--- 1,463 ----
+ /*
+ **  TS - OSSP Test Suite Library
+ **  Copyright (c) 2001-2002 Ralf S. Engelschall <rse@engelschall.com>
+ **  Copyright (c) 2001-2002 The OSSP Project <http://www.ossp.org/>
+ **  Copyright (c) 2001-2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+ **
+ **  This file is part of OSSP TS, a small test suite library which
+ **  can be found at http://www.ossp.org/pkg/ts/.
+ **
+ **  Permission to use, copy, modify, and distribute this software for
+ **  any purpose with or without fee is hereby granted, provided that
+ **  the above copyright notice and this permission notice appear in all
+ **  copies.
+ **
+ **  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ **  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ **  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ **  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+ **  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ **  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ **  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ **  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ **  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ **  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ **  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ **  SUCH DAMAGE.
+ **
+ **  ts.c: test suite library
+ */
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdarg.h>
+ 
+ #include "ts.h"
+ 
+ /* embedded ring data structure library */
+ #define RING_ENTRY(elem) \
+     struct { elem *next; elem *prev; }
+ #define RING_HEAD(elem) \
+     struct { elem *next; elem *prev; }
+ #define RING_SENTINEL(hp, elem, link) \
+     (elem *)((char *)(hp) - ((size_t)(&((elem *)0)->link)))
+ #define RING_FIRST(hp) \
+     (hp)->next
+ #define RING_LAST(hp) \
+     (hp)->prev
+ #define RING_NEXT(ep, link) \
+     (ep)->link.next
+ #define RING_PREV(ep, link) \
+     (ep)->link.prev
+ #define RING_INIT(hp, elem, link) \
+     do { RING_FIRST((hp)) = RING_SENTINEL((hp), elem, link); \
+          RING_LAST((hp))  = RING_SENTINEL((hp), elem, link); } while (0)
+ #define RING_EMPTY(hp, elem, link) \
+     (RING_FIRST((hp)) == RING_SENTINEL((hp), elem, link))
+ #define RING_ELEM_INIT(ep, link) \
+     do { RING_NEXT((ep), link) = (ep); \
+          RING_PREV((ep), link) = (ep); } while (0)
+ #define RING_SPLICE_BEFORE(lep, ep1, epN, link) \
+     do { RING_NEXT((epN), link) = (lep); \
+          RING_PREV((ep1), link) = RING_PREV((lep), link); \
+          RING_NEXT(RING_PREV((lep), link), link) = (ep1); \
+          RING_PREV((lep), link) = (epN); } while (0)
+ #define RING_SPLICE_TAIL(hp, ep1, epN, elem, link) \
+     RING_SPLICE_BEFORE(RING_SENTINEL((hp), elem, link), (ep1), (epN), link)
+ #define RING_INSERT_TAIL(hp, nep, elem, link) \
+     RING_SPLICE_TAIL((hp), (nep), (nep), elem, link)
+ #define RING_FOREACH(ep, hp, elem, link) \
+     for ((ep)  = RING_FIRST((hp)); \
+          (ep) != RING_SENTINEL((hp), elem, link); \
+          (ep)  = RING_NEXT((ep), link))
+ 
+ /* test suite test log */
+ struct tstl_st;
+ typedef struct tstl_st tstl_t;
+ struct tstl_st {
+     RING_ENTRY(tstl_t) next;
+     char              *text;
+     const char        *file;
+     int                line;
+ };
+ 
+ /* test suite test check */
+ struct tstc_st;
+ typedef struct tstc_st tstc_t;
+ struct tstc_st {
+     RING_ENTRY(tstc_t) next;
+     char              *title;
+     int                failed;
+     const char        *file;
+     int                line;
+     RING_HEAD(tstl_t)  logs;
+ };
+ 
+ /* test suite test */
+ struct ts_test_st {
+     RING_ENTRY(ts_test_t)  next;
+     char              *title;
+     ts_test_cb_t         func;
+     const char        *file;
+     int                line;
+     RING_HEAD(tstc_t)  checks;
+ };
+ 
+ /* test suite */
+ struct ts_suite_st {
+     char              *title;
+     RING_HEAD(ts_test_t)   tests;
+ };
+ 
+ /* minimal output-independent vprintf(3) variant which supports %{c,s,d,%} only */
+ static int ts_suite_mvxprintf(char *buffer, size_t bufsize, const char *format, va_list ap)
+ {
+     /* sufficient integer buffer: <available-bits> x log_10(2) + safety */
+     char ibuf[((sizeof(int)*8)/3)+10]; 
+     char *cp;
+     char c;
+     int d;
+     int n;
+     int bytes;
+ 
+     if (format == NULL || ap == NULL)
+         return -1;
+     bytes = 0;
+     while (*format != '\0') {
+         if (*format == '%') {
+             c = *(format+1);
+             if (c == '%') {
+                 /* expand "%%" */
+                 cp = &c;
+                 n = sizeof(char);
+             }
+             else if (c == 'c') {
+                 /* expand "%c" */
+                 c = (char)va_arg(ap, int);
+                 cp = &c;
+                 n = sizeof(char);
+             }
+             else if (c == 's') {
+                 /* expand "%s" */
+                 if ((cp = (char *)va_arg(ap, char *)) == NULL)
+                     cp = "(null)";
+                 n = strlen(cp);
+             }
+             else if (c == 'd') {
+                 /* expand "%d" */
+                 d = (int)va_arg(ap, int);
+ #ifdef HAVE_SNPRINTF
+                 snprintf(ibuf, sizeof(ibuf), "%d", d); /* explicitly secure */
+ #else
+                 sprintf(ibuf, "%d", d);                /* implicitly secure */
+ #endif
+                 cp = ibuf;
+                 n = strlen(cp);
+             }
+             else {
+                 /* any other "%X" */
+                 cp = (char *)format;
+                 n  = 2;
+             }
+             format += 2;
+         }
+         else {
+             /* plain text */
+             cp = (char *)format;
+             if ((format = strchr(cp, '%')) == NULL)
+                 format = strchr(cp, '\0');
+             n = format - cp;
+         }
+         /* perform output operation */
+         if (buffer != NULL) {
+             if (n > bufsize)
+                 return -1;
+             memcpy(buffer, cp, n);
+             buffer  += n;
+             bufsize -= n;
+         }
+         bytes += n;
+     }
+     /* nul-terminate output */
+     if (buffer != NULL) {
+         if (bufsize == 0)
+             return -1;
+         *buffer = '\0';
+     }
+     return bytes;
+ }
+ 
+ /* minimal vasprintf(3) variant which supports %{c,s,d} only */
+ static char *ts_suite_mvasprintf(const char *format, va_list ap)
+ {
+     char *buffer;
+     int n;
+     va_list ap2;
+ 
+     if (format == NULL || ap == NULL)
+         return NULL;
+     ap2 = ap;
+     if ((n = ts_suite_mvxprintf(NULL, 0, format, ap)) == -1)
+         return NULL;
+     if ((buffer = (char *)malloc(n+1)) == NULL)
+         return NULL;
+     ts_suite_mvxprintf(buffer, n+1, format, ap2);
+     return buffer;
+ }
+ 
+ /* minimal asprintf(3) variant which supports %{c,s,d} only */
+ static char *ts_suite_masprintf(const char *format, ...)
+ {
+     va_list ap;
+     char *cp;
+ 
+     va_start(ap, format);
+     cp = ts_suite_mvasprintf(format, ap);
+     va_end(ap);
+     return cp;
+ }
+ 
+ /* create test suite */
+ ts_suite_t *ts_suite_new(const char *fmt, ...)
+ {
+     ts_suite_t *ts;
+     va_list ap;
+ 
+     if ((ts = (ts_suite_t *)malloc(sizeof(ts_suite_t))) == NULL)
+         return NULL;
+     va_start(ap, fmt);
+     ts->title = ts_suite_mvasprintf(fmt, ap);
+     RING_INIT(&ts->tests, ts_test_t, next);
+     va_end(ap);
+     return ts;
+ }
+ 
+ /* add test case to test suite */
+ void ts_suite_test(ts_suite_t *ts, ts_test_cb_t func, const char *fmt, ...)
+ {
+     ts_test_t *tst;
+     va_list ap;
+ 
+     if (ts == NULL || func == NULL || fmt == NULL)
+         return;
+     if ((tst = (ts_test_t *)malloc(sizeof(ts_test_t))) == NULL)
+         return;
+     RING_ELEM_INIT(tst, next);
+     va_start(ap, fmt);
+     tst->title = ts_suite_mvasprintf(fmt, ap);
+     va_end(ap);
+     tst->func = func;
+     tst->file = NULL;
+     tst->line = 0;
+     RING_INIT(&tst->checks, tstc_t, next);
+     RING_INSERT_TAIL(&ts->tests, tst, ts_test_t, next);
+     return;
+ }
+ 
+ /* run test suite */
+ int ts_suite_run(ts_suite_t *ts)
+ {
+     ts_test_t *tst;
+     tstc_t *tstc;
+     tstl_t *tstl;
+     int total_tests, total_tests_suite_failed;
+     int total_checks, total_checks_failed;
+     int test_checks, test_checks_failed;
+     const char *file;
+     int line;
+     char *cp;
+ 
+     if (ts == NULL)
+         return 0;
+ 
+     /* init total counters */
+     total_tests         = 0;
+     total_tests_suite_failed  = 0;
+     total_checks        = 0;
+     total_checks_failed = 0;
+ 
+     fprintf(stdout, "\n");
+     fprintf(stdout, " Test Suite: %s\n", ts->title);
+     fprintf(stdout, " __________________________________________________________________\n");
+     fprintf(stdout, "\n");
+     fflush(stdout);
+ 
+     /* iterate through all test cases */
+     RING_FOREACH(tst, &ts->tests, ts_test_t, next) {
+         cp = ts_suite_masprintf(" Test: %s ........................................"
+                                     "........................................", tst->title);
+         cp[60] = '\0';
+         fprintf(stdout, "%s", cp);
+         free(cp);
+         fflush(stdout);
+ 
+         /* init test case counters */
+         test_checks        = 0;
+         test_checks_failed = 0;
+ 
+         /* run the test case function */
+         tst->func(tst);
+ 
+         /* iterate through all performed checks to determine status */
+         RING_FOREACH(tstc, &tst->checks, tstc_t, next) {
+             test_checks++;
+             if (tstc->failed)
+                 test_checks_failed++;
+         }
+ 
+         if (test_checks_failed > 0) {
+             /* some checks failed, so do detailed reporting of test case */
+             fprintf(stdout, " FAILED\n");
+             fprintf(stdout, "       Ops, %d/%d checks failed! Detailed report follows:\n",
+                     test_checks_failed, test_checks);
+             RING_FOREACH(tstc, &tst->checks, tstc_t, next) {
+                 file = (tstc->file != NULL ? tstc->file : tst->file);
+                 line = (tstc->line != 0    ? tstc->line : tst->line);
+                 if (file != NULL)
+                     fprintf(stdout, "       Check: %s [%s:%d]\n", tstc->title, file, line);
+                 else
+                     fprintf(stdout, "       Check: %s\n", tstc->title);
+                 RING_FOREACH(tstl, &tstc->logs, tstl_t, next) {
+                     file = (tstl->file != NULL ? tstl->file : file);
+                     line = (tstl->line != 0    ? tstl->line : line);
+                     if (file != NULL)
+                         fprintf(stdout, "              Log: %s [%s:%d]\n", tstl->text, file, line);
+                     else
+                         fprintf(stdout, "              Log: %s\n", tstl->text);
+                 }
+             }
+         }
+         else {
+             /* test case ran successfully */
+             fprintf(stdout, ".... OK\n");
+         }
+         fflush(stdout);
+ 
+         /* accumulate counters */
+         total_checks += test_checks;
+         total_tests++;
+         if (test_checks_failed > 0) {
+             total_checks_failed += test_checks_failed;
+             total_tests_suite_failed++;
+         }
+     }
+ 
+     /* print test suite summary */
+     fprintf(stdout, " __________________________________________________________________\n");
+     fprintf(stdout, "\n");
+     fprintf(stdout, " Test Summary: %d tests (%d ok, %d failed), %d checks (%d ok, %d failed)\n", 
+             total_tests, (total_tests - total_tests_suite_failed), total_tests_suite_failed, 
+             total_checks, (total_checks - total_checks_failed), total_checks_failed); 
+     if (total_tests_suite_failed > 0)
+         fprintf(stdout, " Test Suite: FAILED\n");
+     else
+         fprintf(stdout, " Test Suite: OK\n");
+     fprintf(stdout, "\n");
+     fflush(stdout);
+ 
+     return total_checks_failed;
+ }
+ 
+ /* destroy test suite */
+ void ts_suite_free(ts_suite_t *ts)
+ {
+     ts_test_t *tst;
+     tstc_t *tstc;
+     tstl_t *tstl;
+ 
+     if (ts == NULL)
+         return;
+     RING_FOREACH(tst, &ts->tests, ts_test_t, next) {
+         RING_FOREACH(tstc, &tst->checks, tstc_t, next) {
+             RING_FOREACH(tstl, &tstc->logs, tstl_t, next) {
+                 free(tstl->text);
+             }
+             free(tstc->title);
+             free(tstc);
+         }
+         free(tst->title);
+         free(tst);
+     }
+     free(tst->title);
+     free(ts);
+     return;
+ }
+ 
+ /* annotate test case with file name and line number */
+ ts_test_t *ts_test_ctx(ts_test_t *tst, const char *file, int line)
+ {
+     if (tst != NULL && file != NULL) {
+         tst->file = file;
+         tst->line = line;
+     }
+     return tst;
+ }
+ 
+ /* annotate test case with check */
+ void ts_test_check(ts_test_t *tst, const char *fmt, ...)
+ {
+     tstc_t *tstc;
+     va_list ap;
+ 
+     if (tst == NULL || fmt == NULL)
+         return;
+     if ((tstc = (tstc_t *)malloc(sizeof(tstc_t))) == NULL)
+         return;
+     va_start(ap, fmt);
+     RING_ELEM_INIT(tstc, next);
+     tstc->title = ts_suite_mvasprintf(fmt, ap);
+     tstc->failed = 0;
+     tstc->file = tst->file;
+     tstc->line = tst->line;
+     RING_INIT(&tstc->logs, tstl_t, next);
+     RING_INSERT_TAIL(&tst->checks, tstc, tstc_t, next);
+     va_end(ap);
+     return;
+ }
+ 
+ /* annotate test case with log message and failure */
+ void ts_test_fail(ts_test_t *tst, const char *fmt, ...)
+ {
+     tstc_t *tstc;
+     tstl_t *tstl;
+     va_list ap;
+ 
+     if (tst == NULL || fmt == NULL)
+         return;
+     if ((tstl = (tstl_t *)malloc(sizeof(tstl_t))) == NULL)
+         return;
+     va_start(ap, fmt);
+     tstl->text = ts_suite_mvasprintf(fmt, ap);
+     tstl->file = tst->file;
+     tstl->line = tst->line;
+     RING_ELEM_INIT(tstl, next);
+     tstc = RING_LAST(&tst->checks);
+     RING_INSERT_TAIL(&tstc->logs, tstl, tstl_t, next);
+     tstc->failed = 1;
+     va_end(ap);
+     return;
+ }
+ 
+ /* annotate test case with log message only */
+ void ts_test_log(ts_test_t *tst, const char *fmt, ...)
+ {
+     tstc_t *tstc;
+     tstl_t *tstl;
+     va_list ap;
+ 
+     if (tst == NULL || fmt == NULL)
+         return;
+     if ((tstl = (tstl_t *)malloc(sizeof(tstl_t))) == NULL)
+         return;
+     va_start(ap, fmt);
+     tstl->text = ts_suite_mvasprintf(fmt, ap);
+     tstl->file = tst->file;
+     tstl->line = tst->line;
+     RING_ELEM_INIT(tstl, next);
+     tstc = RING_LAST(&tst->checks);
+     RING_INSERT_TAIL(&tstc->logs, tstl, tstl_t, next);
+     va_end(ap);
+     return;
+ }
+ 


ossp-pkg/ex/ts.h -> 1.1

*** /dev/null    Sat Nov 23 01:00:16 2024
--- -    Sat Nov 23 01:00:16 2024
***************
*** 0 ****
--- 1,64 ----
+ /*
+ **  TS - OSSP Test Suite Library
+ **  Copyright (c) 2001-2002 Ralf S. Engelschall <rse@engelschall.com>
+ **  Copyright (c) 2001-2002 The OSSP Project <http://www.ossp.org/>
+ **  Copyright (c) 2001-2002 Cable & Wireless Deutschland <http://www.cw.com/de/>
+ **
+ **  This file is part of OSSP TS, a small test suite library which
+ **  can be found at http://www.ossp.org/pkg/ts/.
+ **
+ **  Permission to use, copy, modify, and distribute this software for
+ **  any purpose with or without fee is hereby granted, provided that
+ **  the above copyright notice and this permission notice appear in all
+ **  copies.
+ **
+ **  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ **  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ **  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ **  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+ **  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ **  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ **  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ **  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ **  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ **  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ **  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ **  SUCH DAMAGE.
+ **
+ **  ts.h: test suite library API
+ */
+ 
+ #ifndef _TS_H_
+ #define _TS_H_
+ 
+ /* test suite object type */
+ struct ts_suite_st;
+ typedef struct ts_suite_st ts_suite_t;
+ 
+ /* test object type */
+ struct ts_test_st;
+ typedef struct ts_test_st ts_test_t;
+ 
+ /* test callback function type */
+ typedef void (*ts_test_cb_t)(ts_test_t *);
+ 
+ /* test suite operations */
+ ts_suite_t *ts_suite_new  (const char *fmt, ...);
+ void        ts_suite_test (ts_suite_t *s, ts_test_cb_t func, const char *fmt, ...);
+ int         ts_suite_run  (ts_suite_t *s);
+ void        ts_suite_free (ts_suite_t *s);
+ 
+ /* test operations */
+ ts_test_t  *ts_test_ctx   (ts_test_t *t, const char *file, int line);
+ void        ts_test_check (ts_test_t *t, const char *fmt, ...);
+ void        ts_test_fail  (ts_test_t *t, const char *fmt, ...);
+ void        ts_test_log   (ts_test_t *t, const char *fmt, ...);
+ 
+ /* test suite short-cut macros */
+ #define TS_TEST(name) \
+     static void name(ts_test_t *_t)
+ #define TS_CTX \
+     ts_test_ctx(_t, __FILE__, __LINE__)
+ 
+ #endif /* _TS_H_ */
+ 

CVSTrac 2.0.1