Index: ossp-pkg/xds/.cvsignore RCS File: /v/ossp/cvs/ossp-pkg/xds/.cvsignore,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/xds/.cvsignore,v' 2>/dev/null --- .cvsignore 2001/07/20 10:08:26 1.3 +++ .cvsignore 2001/07/20 10:42:34 1.4 @@ -1,2 +1,2 @@ xds.3 -Makefile configure +xds.h Makefile configure Index: ossp-pkg/xds/configure.ac RCS File: /v/ossp/cvs/ossp-pkg/xds/configure.ac,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/xds/configure.ac,v' | diff -u /dev/null - -L'ossp-pkg/xds/configure.ac' 2>/dev/null --- ossp-pkg/xds/configure.ac +++ - 2024-05-11 08:09:50.685214778 +0200 @@ -0,0 +1,61 @@ +dnl configure.in -- Process this file with autoconf to produce a configure script. + +AC_INIT(libxds, [$Revision$]) + +dnl Get rid of the lousy -g and -O defaults in CFLAGS. +dnl +CFLAGS=${CFLAGS:-} + +dnl Checks for paths and programs. +dnl +AC_PROG_CC +AC_PROG_RANLIB + +dnl Set special flags for gcc. +dnl +if test "$GCC" = yes; then + CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-long-long" +fi + +dnl Check for exact data types. +dnl +AC_CHECK_TYPE(u_int8_t, [xds_uint8_t=u_int8_t], + [AC_CHECK_TYPE(uint8_t, [xds_uint8_t=uint8_t], + [AC_MSG_ERROR([no unsigned 8 bit data type found])] + )] + ) +AC_SUBST([xds_uint8_t]) +AC_CHECK_TYPE(u_int16_t, [xds_uint16_t=u_int16_t], + [AC_CHECK_TYPE(uint16_t, [xds_uint16_t=uint16_t], + [AC_MSG_ERROR([no unsigned 16 bit data type found])] + )] + ) +AC_SUBST([xds_uint16_t]) +AC_CHECK_TYPE(u_int32_t, [xds_uint32_t=u_int32_t], + [AC_CHECK_TYPE(uint32_t, [xds_uint32_t=uint32_t], + [AC_MSG_ERROR([no unsigned 32 bit data type found])] + )] + ) +AC_SUBST([xds_uint32_t]) +AC_CHECK_TYPE(int8_t, [xds_int8_t=int8_t], + [AC_CHECK_TYPE(int8_t, [xds_int8_t=int8_t], + [AC_MSG_ERROR([no signed 8 bit data type found])] + )] + ) +AC_SUBST([xds_int8_t]) +AC_CHECK_TYPE(int16_t, [xds_int16_t=int16_t], + [AC_CHECK_TYPE(int16_t, [xds_int16_t=int16_t], + [AC_MSG_ERROR([no signed 16 bit data type found])] + )] + ) +AC_SUBST([xds_int16_t]) +AC_CHECK_TYPE(int32_t, [xds_int32_t=int32_t], + [AC_CHECK_TYPE(int32_t, [xds_int32_t=int32_t], + [AC_MSG_ERROR([no signed 32 bit data type found])] + )] + ) +AC_SUBST([xds_int32_t]) + +dnl Write results. +dnl +AC_OUTPUT(xds.h Makefile regression-tests/Makefile) Index: ossp-pkg/xds/configure.in RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/configure.in,v co -q -kk -p'1.3' '/v/ossp/cvs/ossp-pkg/xds/Attic/configure.in,v' | diff -u /dev/null - -L'ossp-pkg/xds/configure.in' 2>/dev/null --- ossp-pkg/xds/configure.in +++ - 2024-05-11 08:09:50.687957119 +0200 @@ -0,0 +1,22 @@ +dnl configure.in -- Process this file with autoconf to produce a configure script. + +AC_INIT(libxds, [$Revision$]) + +dnl Get rid of the lousy -g and -O defaults in CFLAGS. +dnl +CFLAGS=${CFLAGS:-} + +dnl Checks for paths and programs. +dnl +AC_PROG_CC +AC_PROG_RANLIB + +dnl Set special flags for gcc. +dnl +if test "$GCC" = yes; then + CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-long-long" +fi + +dnl Write results. +dnl +AC_OUTPUT(Makefile regression-tests/Makefile) Index: ossp-pkg/xds/xds.h RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/xds.h,v co -q -kk -p'1.23' '/v/ossp/cvs/ossp-pkg/xds/Attic/xds.h,v' | diff -u /dev/null - -L'ossp-pkg/xds/xds.h' 2>/dev/null --- ossp-pkg/xds/xds.h +++ - 2024-05-11 08:09:50.690550464 +0200 @@ -0,0 +1,89 @@ +/* + XDS - OSSP Extensible Data Serialization Library + Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) + Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) + + This file is part of OSSP XDS, an extensible data serialization + library which can be found at http://www.ossp.com/pkg/xds/. + + 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. + + xds.h: C API +*/ + +#ifndef __LIBXDS_H__ +#define __LIBXDS_H__ + +#include +#include + +enum + { + XDS_OK = 0, + XDS_ERR_NO_MEM = -1, + XDS_ERR_OVERFLOW = -2, + XDS_ERR_INVALID_ARG = -3, + XDS_ERR_TYPE_MISMATCH = -4, + XDS_ERR_UNKNOWN_ENGINE = -5, + XDS_ERR_INVALID_MODE = -6, + XDS_ERR_UNDERFLOW = -7 + }; +typedef enum { XDS_ENCODE, XDS_DECODE } xds_mode_t; +typedef enum { XDS_LOAN, XDS_GIFT } xds_scope_t; + +struct xds_context; +typedef struct xds_context xds_t; + +typedef int (*xds_engine_t)(xds_t* xds, + void* engine_context, + void* buffer, + size_t buffer_size, + va_list* args); + +xds_t* xds_init(xds_mode_t); +void xds_destroy(xds_t* xds); + +int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context); +int xds_unregister(xds_t* xds, const char* name); + +int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len); +int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_len); + +int xds_encode(xds_t* xds, const char* fmt, ...); +int xds_decode(xds_t* xds, const char* fmt, ...); +int xds_vencode(xds_t* xds, const char* fmt, va_list args); +int xds_vdecode(xds_t* xds, const char* fmt, va_list args); + +int xdr_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + +int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + +int xdr_encode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + +int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + +#endif /* !defined(__LIBXDS_H__) */ Index: ossp-pkg/xds/xds.h.in RCS File: /v/ossp/cvs/ossp-pkg/xds/xds.h.in,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/xds/xds.h.in,v' | diff -u /dev/null - -L'ossp-pkg/xds/xds.h.in' 2>/dev/null --- ossp-pkg/xds/xds.h.in +++ - 2024-05-11 08:09:50.693180620 +0200 @@ -0,0 +1,97 @@ +/* + XDS - OSSP Extensible Data Serialization Library + Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) + Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) + + This file is part of OSSP XDS, an extensible data serialization + library which can be found at http://www.ossp.com/pkg/xds/. + + 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. + + xds.h: C API +*/ + +#ifndef __LIBXDS_H__ +#define __LIBXDS_H__ + +#include +#include +#include + +typedef @xds_uint8_t@ xds_uint8_t; +typedef @xds_uint16_t@ xds_uint16_t; +typedef @xds_uint32_t@ xds_uint32_t; +typedef @xds_int8_t@ xds_int8_t; +typedef @xds_int16_t@ xds_int16_t; +typedef @xds_int32_t@ xds_int32_t; + +enum + { + XDS_OK = 0, + XDS_ERR_NO_MEM = -1, + XDS_ERR_OVERFLOW = -2, + XDS_ERR_INVALID_ARG = -3, + XDS_ERR_TYPE_MISMATCH = -4, + XDS_ERR_UNKNOWN_ENGINE = -5, + XDS_ERR_INVALID_MODE = -6, + XDS_ERR_UNDERFLOW = -7 + }; +typedef enum { XDS_ENCODE, XDS_DECODE } xds_mode_t; +typedef enum { XDS_LOAN, XDS_GIFT } xds_scope_t; + +struct xds_context; +typedef struct xds_context xds_t; + +typedef int (*xds_engine_t)(xds_t* xds, + void* engine_context, + void* buffer, + size_t buffer_size, + va_list* args); + +xds_t* xds_init(xds_mode_t); +void xds_destroy(xds_t* xds); + +int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context); +int xds_unregister(xds_t* xds, const char* name); + +int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len); +int xds_getbuffer(xds_t* xds, xds_scope_t flag, void** buffer, size_t* buffer_len); + +int xds_encode(xds_t* xds, const char* fmt, ...); +int xds_decode(xds_t* xds, const char* fmt, ...); +int xds_vencode(xds_t* xds, const char* fmt, va_list args); +int xds_vdecode(xds_t* xds, const char* fmt, va_list args); + +int xdr_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + +int xdr_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + +int xdr_encode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_octetstream(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + +int xdr_encode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); +int xdr_decode_string(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); + +#endif /* !defined(__LIBXDS_H__) */