Index: ossp-pkg/ex/Makefile
RCS File: /v/ossp/cvs/ossp-pkg/ex/Attic/Makefile,v
co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/ex/Attic/Makefile,v' | diff -u /dev/null - -L'ossp-pkg/ex/Makefile' 2>/dev/null
--- ossp-pkg/ex/Makefile
+++ - 2025-04-10 06:59:33.965854396 +0200
@@ -0,0 +1,23 @@
+
+CC = /usr/opkg/bin/gcc
+CFLAGS = -Wall -O2 -I.
+LDFLAGS =
+AR = ar
+RANLIB = ranlib
+
+all: libex.a ex_test
+
+ex_test: ex_test.o libex.a
+ $(CC) $(LDFLAGS) -o ex_test ex_test.o libex.a
+
+libex.a: ex.o
+ rm -f $@
+ $(AR) cr $@ ex.o
+ $(RANLIB) $@
+
+clean:
+ rm -f ex_test *.a *.o *.core
+
+check: ex_test
+ ./ex_test
+
Index: ossp-pkg/ex/README
RCS File: /v/ossp/cvs/ossp-pkg/ex/README,v
co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/ex/README,v' | diff -u /dev/null - -L'ossp-pkg/ex/README' 2>/dev/null
--- ossp-pkg/ex/README
+++ - 2025-04-10 06:59:33.968595036 +0200
@@ -0,0 +1 @@
+
Index: ossp-pkg/ex/TODO
RCS File: /v/ossp/cvs/ossp-pkg/ex/Attic/TODO,v
co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/ex/Attic/TODO,v' | diff -u /dev/null - -L'ossp-pkg/ex/TODO' 2>/dev/null
--- ossp-pkg/ex/TODO
+++ - 2025-04-10 06:59:33.971304097 +0200
@@ -0,0 +1,4 @@
+- default handler
+- sigsetjmp (Why can't "real" exceptions be caught?)
+- pth
+- disable throwing
Index: ossp-pkg/ex/ex.c
RCS File: /v/ossp/cvs/ossp-pkg/ex/ex.c,v
co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/ex/ex.c,v' | diff -u /dev/null - -L'ossp-pkg/ex/ex.c' 2>/dev/null
--- ossp-pkg/ex/ex.c
+++ - 2025-04-10 06:59:33.973938412 +0200
@@ -0,0 +1,29 @@
+/*
+** Copyright (c) 2001-2002 The OSSP Project
+** Copyright (c) 2001-2002 Cable & Wireless Deutschland
+**
+** This file is part of OSSP ex, an exception 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 .
+**
+** ex.c: exception handling (compiler part)
+*/
+
+#include "ex.h"
+
+ex_ctx_t __ex_ctx_global;
+
Index: ossp-pkg/ex/ex.h
RCS File: /v/ossp/cvs/ossp-pkg/ex/ex.h,v
co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/ex/ex.h,v' | diff -u /dev/null - -L'ossp-pkg/ex/ex.h' 2>/dev/null
--- ossp-pkg/ex/ex.h
+++ - 2025-04-10 06:59:33.976616806 +0200
@@ -0,0 +1,134 @@
+/*
+** Copyright (c) 2001-2002 The OSSP Project
+** Copyright (c) 2001-2002 Cable & Wireless Deutschland
+**
+** This file is part of OSSP ex, an exception 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 .
+**
+** ex.h: exception handling (pre-processor part)
+*/
+
+#ifndef __TEXAS_H__
+#define __TEXAS_H__
+
+/* the required ISO-C standard facilities */
+#include /* for NULL */
+#include /* for jmp_buf, setjmp(3), longjmp(3) */
+
+/* determine how the current function name can be fetched */
+#if ( defined(__STDC__) \
+ && defined(__STDC_VERSION__) \
+ && __STDC_VERSION__ >= 199901L)
+#define __TEXAS_FUNC__ __func__ /* ISO C99 compliant */
+#elif ( defined(__GNUC__) \
+ && defined(__GNUC_MINOR__) \
+ && ( __GNUC__ > 2 \
+ || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)))
+#define __TEXAS_FUNC__ __FUNCTION__ /* gcc >= 2.8 */
+#else
+#define __TEXAS_FUNC__ "#NA#" /* not available */
+#endif
+
+/* declare the exception type (public) */
+typedef struct {
+ /* throw value */
+ void *ex_class;
+ void *ex_object;
+ void *ex_value;
+ /* throw point */
+ char *ex_file;
+ int ex_line;
+ char *ex_func;
+} ex_t;
+
+/* declare the exception context type (private) */
+typedef struct {
+ jmp_buf *ctx_jbprev; /* previous jump buffer */
+ int ctx_caught; /* flag whether exception was caught */
+ volatile ex_t ctx_ex; /* the exception temporary storage */
+} ex_ctx_t;
+
+/* ex context (default requires linking against libex) */
+#ifndef __ex_ctx
+#define __ex_ctx (&__ex_ctx_global)
+extern ex_ctx_t __ex_ctx_global;
+#endif
+
+/* block for trying execution */
+#define ex_try \
+ { \
+ jmp_buf *__ex_jbprev; \
+ jmp_buf __ex_jbme; \
+ __ex_jbprev = __ex_ctx->ctx_jbprev; \
+ __ex_ctx->ctx_jbprev = &__ex_jbme; \
+ if (setjmp(__ex_jbme) == 0) { \
+ if (1)
+
+/* block for catching an exception */
+#define ex_catch(e) \
+ else { \
+ } \
+ __ex_ctx->ctx_caught = 0; \
+ } \
+ else { \
+ __ex_ctx->ctx_caught = 1; \
+ } \
+ __ex_ctx->ctx_jbprev = __ex_jbprev; \
+ } \
+ if (!__ex_ctx->ctx_caught || ((e) = __ex_ctx->ctx_ex, 0)) { \
+ } \
+ else
+
+/* throw a new exception */
+#define ex_throw(c,o,v) \
+ (__ex_ctx->ctx_jbprev == NULL ? \
+ (abort(), 0) : \
+ ( __ex_ctx->ctx_ex.ex_class = (void *)(c), \
+ __ex_ctx->ctx_ex.ex_object = (void *)(o), \
+ __ex_ctx->ctx_ex.ex_value = (void *)(v), \
+ __ex_ctx->ctx_ex.ex_file = __FILE__, \
+ __ex_ctx->ctx_ex.ex_line = __LINE__, \
+ __ex_ctx->ctx_ex.ex_func = __TEXAS_FUNC__, \
+ longjmp(*(__ex_ctx->ctx_jbprev), 1), \
+ 0 \
+ ) \
+ )
+
+/* re-throw a caught exception */
+#define ex_rethrow \
+ (__ex_ctx->ctx_jbprev == NULL ? \
+ (abort(), 0) : \
+ (longjmp(*(__ex_ctx->ctx_jbprev), 1), 0) \
+ )
+
+/* optional namespace mapping */
+#if !defined(__cplusplus) && !defined(__TEXAS_NO_CXX_NS__)
+#define try ex_try
+#define catch ex_catch
+#define throw ex_throw
+#define rethrow ex_rethrow
+#endif
+#if !defined(__TEXAS_NO_SIMPLE_NS__)
+#define Try ex_try
+#define Catch ex_catch
+#define Throw ex_throw
+#define Rethrow ex_rethrow
+#endif
+
+#endif /* __TEXAS_H__ */
+
Index: ossp-pkg/ex/ex.pod
RCS File: /v/ossp/cvs/ossp-pkg/ex/ex.pod,v
co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/ex/ex.pod,v' | diff -u /dev/null - -L'ossp-pkg/ex/ex.pod' 2>/dev/null
--- ossp-pkg/ex/ex.pod
+++ - 2025-04-10 06:59:33.979509560 +0200
@@ -0,0 +1,220 @@
+##
+## Copyright (c) 2001-2002 The OSSP Project
+## Copyright (c) 2001-2002 Cable & Wireless Deutschland
+##
+## This file is part of OSSP ex, an exception 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 .
+##
+## ex.pod: exception library manual page
+##
+
+=pod
+
+=head1 NAME
+
+B - Exception Library
+
+=head1 SYNOPSIS
+
+B I;
+
+B { ... } B (I) { ... }
+
+B(I, I