Index: ossp-pkg/ex/00TODO RCS File: /v/ossp/cvs/ossp-pkg/ex/00TODO,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/ex/00TODO,v' 2>/dev/null --- 00TODO 2002/03/30 19:04:59 1.5 +++ 00TODO 2003/01/06 15:31:24 1.6 @@ -1,10 +1,12 @@ - _____ __ - / _ \ \/ / - | __/> < - \___/_/\_\ - + _ ___ ____ ____ ____ + |_|_ _ / _ \/ ___/ ___|| _ \ _____ __ + _|_||_| | | | \___ \___ \| |_) | / _ \ \/ / + |_||_|_| | |_| |___) |__) | __/ | __/> < + |_|_|_| \___/|____/____/|_| \___/_/\_\ + OSSP ex - Exception Handling TODO - ==== + + -none- Index: ossp-pkg/ex/AUTHORS RCS File: /v/ossp/cvs/ossp-pkg/ex/AUTHORS,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/ex/AUTHORS,v' 2>/dev/null --- AUTHORS 2002/03/30 19:04:59 1.2 +++ AUTHORS 2003/01/06 15:31:24 1.3 @@ -1,9 +1,10 @@ - _____ __ - / _ \ \/ / - | __/> < - \___/_/\_\ - - OSSP ex - Exception Handling Library + _ ___ ____ ____ ____ + |_|_ _ / _ \/ ___/ ___|| _ \ _____ __ + _|_||_| | | | \___ \___ \| |_) | / _ \ \/ / + |_||_|_| | |_| |___) |__) | __/ | __/> < + |_|_|_| \___/|____/____/|_| \___/_/\_\ + + OSSP ex - Exception Handling AUTHORS ======= Index: ossp-pkg/ex/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/ex/ChangeLog,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/ex/ChangeLog,v' 2>/dev/null --- ChangeLog 2002/03/30 19:07:29 1.3 +++ ChangeLog 2003/01/06 15:31:24 1.4 @@ -1,15 +1,28 @@ - _____ __ - / _ \ \/ / - | __/> < - \___/_/\_\ - - OSSP ex - Exception Handling Library + _ ___ ____ ____ ____ + |_|_ _ / _ \/ ___/ ___|| _ \ _____ __ + _|_||_| | | | \___ \___ \| |_) | / _ \ \/ / + |_||_|_| | |_| |___) |__) | __/ | __/> < + |_|_|_| \___/|____/____/|_| \___/_/\_\ + + OSSP ex - Exception Handling ChangeLog ========= - This is the list of all changes to the OSSP ex source tree. - + This is the list of all changes to the OSSP ex source tree. + + Changes between 0.9.1 and 1.0.0 (08-Mar-2002 to 06-Jan-2003) + + *) Adjusted copyright messages to include new year 2003. + [Ralf S. Engelschall] + + *) Upgraded build environment to GNU Shtool 1.6.2, GNU Libtool + 1.4.3 and GNU Autoconf 2.57. + [Ralf S. Engelschall] + + *) Fixed "ex-config --libs" output. + [Ralf S. Engelschall] + Changes between 0.9.1 and 1.0.0 (08-Mar-2002 to 30-Mar-2002) *) Fixed manual page code layouting. Index: ossp-pkg/ex/INSTALL RCS File: /v/ossp/cvs/ossp-pkg/ex/INSTALL,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/ex/INSTALL,v' 2>/dev/null --- INSTALL 2002/03/30 19:04:59 1.2 +++ INSTALL 2003/01/06 15:31:24 1.3 @@ -1,16 +1,17 @@ - _____ __ - / _ \ \/ / - | __/> < - \___/_/\_\ - - OSSP ex - Exception Handling Library + _ ___ ____ ____ ____ + |_|_ _ / _ \/ ___/ ___|| _ \ _____ __ + _|_||_| | | | \___ \___ \| |_) | / _ \ \/ / + |_||_|_| | |_| |___) |__) | __/ | __/> < + |_|_|_| \___/|____/____/|_| \___/_/\_\ + + OSSP ex - Exception Handling INSTALL ======= To install OSSP ex into /path/to/ex/ perform the following steps in your shell: - + $ ./configure --prefix=/path/to/ex $ make $ make check Index: ossp-pkg/ex/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/ex/Makefile.in,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/ex/Makefile.in,v' 2>/dev/null --- Makefile.in 2002/03/30 18:56:02 1.6 +++ Makefile.in 2003/01/06 15:31:24 1.7 @@ -1,8 +1,8 @@ ## -## OSSP ex - Exception Handling Library -## Copyright (c) 2002 Ralf S. Engelschall -## Copyright (c) 2002 The OSSP Project -## Copyright (c) 2002 Cable & Wireless Deutschland +## OSSP ex - Exception Handling +## Copyright (c) 2002-2003 Ralf S. Engelschall +## Copyright (c) 2002-2003 The OSSP Project +## Copyright (c) 2002-2003 Cable & Wireless Deutschland ## ## This file is part of OSSP ex, an exception handling library ## which can be found at http://www.ossp.org/pkg/lib/ex/. Index: ossp-pkg/ex/README RCS File: /v/ossp/cvs/ossp-pkg/ex/README,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/ex/README,v' 2>/dev/null --- README 2002/03/30 19:04:59 1.6 +++ README 2003/01/06 15:31:24 1.7 @@ -1,9 +1,10 @@ - _____ __ - / _ \ \/ / - | __/> < - \___/_/\_\ - - OSSP ex - Exception Handling Library + _ ___ ____ ____ ____ + |_|_ _ / _ \/ ___/ ___|| _ \ _____ __ + _|_||_| | | | \___ \___ \| |_) | / _ \ \/ / + |_||_|_| | |_| |___) |__) | __/ | __/> < + |_|_|_| \___/|____/____/|_| \___/_/\_\ + + OSSP ex - Exception Handling Version 1.0.0 (30-Mar-2002) ABSTRACT @@ -23,9 +24,9 @@ COPYRIGHT AND LICENSE - Copyright (c) 2002 Ralf S. Engelschall - Copyright (c) 2002 The OSSP Project - Copyright (c) 2002 Cable & Wireless Deutschland + Copyright (c) 2002-2003 Ralf S. Engelschall + Copyright (c) 2002-2003 The OSSP Project + Copyright (c) 2002-2003 Cable & Wireless Deutschland This file is part of OSSP ex, an exception handling library which can be found at http://www.ossp.org/pkg/lib/ex/. Index: ossp-pkg/ex/THANKS RCS File: /v/ossp/cvs/ossp-pkg/ex/THANKS,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/ex/THANKS,v' 2>/dev/null --- THANKS 2002/03/30 19:04:59 1.1 +++ THANKS 2003/01/06 15:31:24 1.2 @@ -1,9 +1,10 @@ - _____ __ - / _ \ \/ / - | __/> < - \___/_/\_\ - - OSSP ex - Exception Handling Library + _ ___ ____ ____ ____ + |_|_ _ / _ \/ ___/ ___|| _ \ _____ __ + _|_||_| | | | \___ \___ \| |_) | / _ \ \/ / + |_||_|_| | |_| |___) |__) | __/ | __/> < + |_|_|_| \___/|____/____/|_| \___/_/\_\ + + OSSP ex - Exception Handling THANKS ====== @@ -11,6 +12,7 @@ Credit has to be given to the following people who contributed ideas, bugfixes, hints, gave platform feedback, etc. (in alphabetical order): + Michael van Elst Thomas Lotterer Michael Schloh Index: ossp-pkg/ex/aclocal.m4 RCS File: /v/ossp/cvs/ossp-pkg/ex/aclocal.m4,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/ex/aclocal.m4,v' 2>/dev/null --- aclocal.m4 2002/03/30 19:04:59 1.2 +++ aclocal.m4 2003/01/06 15:31:24 1.3 @@ -1,8 +1,8 @@ dnl ## -dnl ## OSSP ex - Exception Handling Library -dnl ## Copyright (c) 2002 Ralf S. Engelschall -dnl ## Copyright (c) 2002 The OSSP Project -dnl ## Copyright (c) 2002 Cable & Wireless Deutschland +dnl ## OSSP ex - Exception Handling +dnl ## Copyright (c) 2002-2003 Ralf S. Engelschall +dnl ## Copyright (c) 2002-2003 The OSSP Project +dnl ## Copyright (c) 2002-2003 Cable & Wireless Deutschland dnl ## dnl ## This file is part of OSSP ex, an exception handling library dnl ## which can be found at http://www.ossp.org/pkg/lib/ex/. Index: ossp-pkg/ex/configure.ac RCS File: /v/ossp/cvs/ossp-pkg/ex/configure.ac,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/ex/configure.ac,v' 2>/dev/null --- configure.ac 2002/03/30 18:56:02 1.5 +++ configure.ac 2003/01/06 15:31:24 1.6 @@ -1,8 +1,8 @@ dnl ## -dnl ## OSSP ex - Exception Handling Library -dnl ## Copyright (c) 2002 Ralf S. Engelschall -dnl ## Copyright (c) 2002 The OSSP Project -dnl ## Copyright (c) 2002 Cable & Wireless Deutschland +dnl ## OSSP ex - Exception Handling +dnl ## Copyright (c) 2002-2003 Ralf S. Engelschall +dnl ## Copyright (c) 2002-2003 The OSSP Project +dnl ## Copyright (c) 2002-2003 Cable & Wireless Deutschland dnl ## dnl ## This file is part of OSSP ex, an exception handling library dnl ## which can be found at http://www.ossp.org/pkg/lib/ex/. Index: ossp-pkg/ex/devtool.conf RCS File: /v/ossp/cvs/ossp-pkg/ex/devtool.conf,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/ex/devtool.conf,v' 2>/dev/null --- devtool.conf 2002/07/28 08:03:49 1.8 +++ devtool.conf 2003/01/06 15:31:24 1.9 @@ -3,9 +3,9 @@ ## %autogen - @autogen shtool 1.6.1 "1.6.*" all - @autogen libtool 1.4.2 "1.4*" - @autogen autoconf 2.53 "2.5[3-9]*" + @autogen shtool 1.6.2 "1.6.*" all + @autogen libtool 1.4.3 "1.4*" + @autogen autoconf 2.57 "2.5[3-9]*" %autoclean @autoclean shtool @@ -22,7 +22,7 @@ %version ./shtool version -l txt -n "OSSP ex" -e VERSION V=`./shtool version -l txt -d long VERSION` - sed -e "s/Version .*(.*)/Version $V/g" README.n + sed -e "s/Version .*/Version $V/g" README.n mv README.n README %dist @@ -39,7 +39,7 @@ ./shtool fixperm -v . echo "+++ rolling" V=`./shtool version -l txt -d short VERSION` - ./shtool tarball -o ex-${V}.tar.gz -d ex-${V} -u ossp -g ossp \ + ./shtool tarball -o ex-${V}.tar.gz -d ex-${V} -u ossp -g ex \ -e 'CVS,\.cvsignore,\.[ao]$,^\.,devtool*,*.tar.gz,00TODO' -c 'gzip --best' . ls -l ex-${V}.tar.gz echo "+++ testing" Index: ossp-pkg/ex/ex-config.in RCS File: /v/ossp/cvs/ossp-pkg/ex/ex-config.in,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/ex/ex-config.in,v' 2>/dev/null --- ex-config.in 2002/03/30 18:56:02 1.3 +++ ex-config.in 2003/01/06 15:31:24 1.4 @@ -1,9 +1,9 @@ #!/bin/sh ## -## OSSP ex - Exception Handling Library -## Copyright (c) 2002 Ralf S. Engelschall -## Copyright (c) 2002 The OSSP Project -## Copyright (c) 2002 Cable & Wireless Deutschland +## OSSP ex - Exception Handling +## Copyright (c) 2002-2003 Ralf S. Engelschall +## Copyright (c) 2002-2003 The OSSP Project +## Copyright (c) 2002-2003 Cable & Wireless Deutschland ## ## This file is part of OSSP ex, an exception handling library ## which can be found at http://www.ossp.org/pkg/lib/ex/. @@ -124,7 +124,7 @@ output_extra="$output_extra $ldflags" ;; --libs) - output="$output -lxds" + output="$output -lex" output_extra="$output_extra $libs" ;; * ) Index: ossp-pkg/ex/ex.c RCS File: /v/ossp/cvs/ossp-pkg/ex/ex.c,v rcsdiff -q -kk '-r1.7' '-r1.8' -u '/v/ossp/cvs/ossp-pkg/ex/ex.c,v' 2>/dev/null --- ex.c 2002/03/30 18:56:02 1.7 +++ ex.c 2003/01/06 15:31:24 1.8 @@ -1,8 +1,8 @@ /* -** OSSP ex - Exception Handling Library -** Copyright (c) 2002 Ralf S. Engelschall -** Copyright (c) 2002 The OSSP Project -** Copyright (c) 2002 Cable & Wireless Deutschland +** OSSP ex - Exception Handling +** Copyright (c) 2002-2003 Ralf S. Engelschall +** Copyright (c) 2002-2003 The OSSP Project +** Copyright (c) 2002-2003 Cable & Wireless Deutschland ** ** This file is part of OSSP ex, an exception handling library ** which can be found at http://www.ossp.org/pkg/lib/ex/. @@ -43,7 +43,7 @@ /* default __ex_terminate callback function */ void __ex_terminate_default(ex_t *e) -{ +{ fprintf(stderr, "**EX: UNCAUGHT EXCEPTION: " "class=0x%lx object=0x%lx value=0x%lx [%s:%d@%s]\n", Index: ossp-pkg/ex/ex.h RCS File: /v/ossp/cvs/ossp-pkg/ex/ex.h,v rcsdiff -q -kk '-r1.18' '-r1.19' -u '/v/ossp/cvs/ossp-pkg/ex/ex.h,v' 2>/dev/null --- ex.h 2002/03/30 18:56:02 1.18 +++ ex.h 2003/01/06 15:31:24 1.19 @@ -1,8 +1,8 @@ /* -** OSSP ex - Exception Handling Library -** Copyright (c) 2002 Ralf S. Engelschall -** Copyright (c) 2002 The OSSP Project -** Copyright (c) 2002 Cable & Wireless Deutschland +** OSSP ex - Exception Handling +** Copyright (c) 2002-2003 Ralf S. Engelschall +** Copyright (c) 2002-2003 The OSSP Project +** Copyright (c) 2002-2003 Cable & Wireless Deutschland ** ** This file is part of OSSP ex, an exception handling library ** which can be found at http://www.ossp.org/pkg/lib/ex/. @@ -56,7 +56,7 @@ /* the machine context */ #if defined(__EX_MCTX_MCSC__) #include /* POSIX.1 ucontext(3) */ -#define __ex_mctx_struct ucontext_t uc; +#define __ex_mctx_struct ucontext_t uc; #define __ex_mctx_save(mctx) (getcontext(&(mctx)->uc) == 0) #define __ex_mctx_restored(mctx) /* noop */ #define __ex_mctx_restore(mctx) (void)setcontext(&(mctx)->uc) @@ -86,8 +86,8 @@ void *ex_object; void *ex_value; /* throw point */ - char *ex_file; - int ex_line; + char *ex_file; + int ex_line; char *ex_func; } ex_t; @@ -132,7 +132,7 @@ /* the termination handler */ typedef void (*ex_term_cb_t)(ex_t *); -extern ex_term_cb_t __ex_terminate; +extern ex_term_cb_t __ex_terminate; extern void __ex_terminate_default(ex_t *e); /* the block for trying execution */ Index: ossp-pkg/ex/ex.pod RCS File: /v/ossp/cvs/ossp-pkg/ex/ex.pod,v rcsdiff -q -kk '-r1.25' '-r1.26' -u '/v/ossp/cvs/ossp-pkg/ex/ex.pod,v' 2>/dev/null --- ex.pod 2002/04/02 17:54:09 1.25 +++ ex.pod 2003/01/06 15:31:24 1.26 @@ -1,8 +1,8 @@ ## -## OSSP ex - Exception Handling Library -## Copyright (c) 2002 Ralf S. Engelschall -## Copyright (c) 2002 The OSSP Project -## Copyright (c) 2002 Cable & Wireless Deutschland +## OSSP ex - Exception Handling +## Copyright (c) 2002-2003 Ralf S. Engelschall +## Copyright (c) 2002-2003 The OSSP Project +## Copyright (c) 2002-2003 Cable & Wireless Deutschland ## ## This file is part of OSSP ex, an exception library ## which can be found at http://www.ossp.org/pkg/lib/ex/. @@ -63,7 +63,7 @@ B is a small B style exception handling library for use in the B language. It allows you to use the paradigm of throwing and catching exceptions in order to reduce the amount of error -handling code without making your program less robust. +handling code without making your program less robust. This is achieved by directly transferring exceptional return codes (and the program control flow) from the location where the exception is @@ -124,7 +124,7 @@ this is just a numerical return code. In the complex case this can be a pointer to an arbitrary complex data structure describing the exception. -=item CI +=item CI This is the file name of the B source where the B call was performed. It is provided as an additional information about the @@ -162,7 +162,7 @@ flow in case an exception is thrown is: I (up to the statement where the exception is thrown only), optionally followed by I, followed by I. - + The B, B and B cannot be used separately, they work only in combination because they form a language clause as a whole. In contrast to B there is only one B @@ -253,7 +253,7 @@ This is a boolean flag which can be checked inside the dynamic scope of an B clause to test whether the current scope is exception -catching. +catching. =item B @@ -387,7 +387,7 @@ /* BAD EXAMPLE */ ex_try { char *cp1, *cp2, cp3; - + cp1 = mallocex(SMALLAMOUNT); globalcontext->first = cp1; cp2 = mallocex(TOOBIG); @@ -475,17 +475,17 @@ } clean { /*04*/ printf("cp3=%s", cp3 == NULL /*02*/ ? "" : cp3); - if (cp3 != NULL) + if (cp3 != NULL) free(cp3); - if (cp2 != NULL) + if (cp2 != NULL) free(cp2); - /*05 cp1 was given away */ - } - catch(ex) { - /*05 global context untouched */ - rethrow; - } - } + /*05 cp1 was given away */ + } + catch(ex) { + /*05 global context untouched */ + rethrow; + } + } An alternative fixed version could also be: @@ -500,16 +500,16 @@ /*05 keep responsibility*/ cp2 = mallocex(TOOBIG); cp3 = mallocex(SMALLAMOUNT); - strcpy(cp1, "foo"); + strcpy(cp1, "foo"); strcpy(cp2, "bar"); } clean { /*04*/ printf("cp3=%s", cp3 == NULL /*02*/ ? "" : cp3); - if (cp3 != NULL) + if (cp3 != NULL) free(cp3); - if (cp2 != NULL) + if (cp2 != NULL) free(cp2); - if (cp1 != NULL) + if (cp1 != NULL) free(cp1); } catch(ex) { @@ -588,59 +588,59 @@ free(data); return; } - + /* callback: context fetching */ static ex_ctx_t *pthread_ex_ctx(void) { return (ex_ctx_t *)pthread_getspecific(pthread_ex_ctx_key); } - + /* callback: termination */ static void pthread_ex_terminate(ex_t *e) { pthread_exit(e->ex_value); } - + /* pthread init */ int pthread_init_ex(void) { int rc; - + /* additionally create thread data key and override OSSP ex callbacks */ pthread_key_create(&pthread_ex_ctx_key, pthread_ex_ctx_destroy); __ex_ctx = pthread_ex_ctx; __ex_terminate = pthread_ex_terminate; - + return rc; } - + /* internal thread entry wrapper information */ typedef struct { void *(*entry)(void *); void *arg; } pthread_create_ex_t; - + /* internal thread entry wrapper */ static void *pthread_create_wrapper(void *arg) { pthread_create_ex_t *wrapper; ex_ctx_t *ex_ctx; - + /* create per-thread exception context */ wrapper = (pthread_create_ex_t *)arg; ex_ctx = (ex_ctx_t *)malloc(sizeof(ex_ctx_t)); EX_CTX_INITIALIZE(ex_ctx); pthread_setspecific(pthread_ex_ctx_key, ex_ctx); - + /* perform original operation */ return wrapper->entry(wrapper->arg); } - + /* pthread_create() wrapper */ int pthread_create_ex(pthread_t *thread, const pthread_attr_t *attr, void *(*entry)(void *), void *arg) { pthread_create_ex_t wrapper; - + /* spawn thread but execute start function through wrapper */ wrapper.entry = entry; wrapper.arg = arg; @@ -761,7 +761,7 @@ #include "foo.h" const char foo_id[] = "foo 1.0"; - + #ifdef WITH_EX #include "ex.h" #define FOO_RC(rv) \ Index: ossp-pkg/ex/ex_test.c RCS File: /v/ossp/cvs/ossp-pkg/ex/ex_test.c,v rcsdiff -q -kk '-r1.10' '-r1.11' -u '/v/ossp/cvs/ossp-pkg/ex/ex_test.c,v' 2>/dev/null --- ex_test.c 2002/03/30 18:56:02 1.10 +++ ex_test.c 2003/01/06 15:31:24 1.11 @@ -1,8 +1,8 @@ /* -** OSSP ex - Exception Handling Library -** Copyright (c) 2002 Ralf S. Engelschall -** Copyright (c) 2002 The OSSP Project -** Copyright (c) 2002 Cable & Wireless Deutschland +** OSSP ex - Exception Handling +** Copyright (c) 2002-2003 Ralf S. Engelschall +** Copyright (c) 2002-2003 The OSSP Project +** Copyright (c) 2002-2003 Cable & Wireless Deutschland ** ** This file is part of OSSP ex, an exception handling library ** which can be found at http://www.ossp.org/pkg/lib/ex/.