Index: ossp-pkg/xds/destroy.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/destroy.c,v co -q -kk -p'1.8' '/v/ossp/cvs/ossp-pkg/xds/Attic/destroy.c,v' | diff -u - /dev/null -L'ossp-pkg/xds/destroy.c' 2>/dev/null --- ossp-pkg/xds/destroy.c +++ /dev/null 2024-05-15 04:55:00.000000000 +0200 @@ -1,58 +0,0 @@ -/* - 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. -*/ - -#include -#include "internal.h" - -void xds_destroy(xds_t* xds) - { - /* Sanity checks. */ - - assert(xds != NULL); - if (xds == NULL) - return; - - /* Free allocated memory. */ - - assert(xds->buffer != NULL || (xds->buffer_capacity == 0 && xds->buffer_len == 0)); - if (xds->buffer != NULL && xds->we_own_buffer) - free(xds->buffer); - - assert(xds->engines != NULL || xds->engines_capacity == 0); - if (xds->engines != NULL) - { - size_t i; - for (i = 0; i < xds->engines_len; ++i) - { - assert(xds->engines[i].name != NULL); - free(xds->engines[i].name); - } - free(xds->engines); - } - - free(xds); - } Index: ossp-pkg/xds/init.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/init.c,v co -q -kk -p'1.6' '/v/ossp/cvs/ossp-pkg/xds/Attic/init.c,v' | diff -u - /dev/null -L'ossp-pkg/xds/init.c' 2>/dev/null --- ossp-pkg/xds/init.c +++ /dev/null 2024-05-15 04:55:00.000000000 +0200 @@ -1,71 +0,0 @@ -/* - 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. -*/ - -#include -#include -#include "internal.h" - -xds_t* xds_init(xds_mode_t mode) - { - xds_t* ctx; - - /* Sanity check parameter. */ - - assert(mode == XDS_ENCODE || mode == XDS_DECODE); - if (mode != XDS_ENCODE && mode != XDS_DECODE) - { - errno = EINVAL; - return NULL; - } - - /* Allocate context structure. */ - - ctx = malloc(sizeof(struct xds_context)); - if (ctx == NULL) - return NULL; /* errno is set by calloc() */ - - /* Set mode of operation in context. */ - - ctx->mode = mode; - - /* Initialize buffer handling. */ - - ctx->buffer = NULL; - ctx->buffer_len = 0; - ctx->buffer_capacity = 0; - ctx->we_own_buffer = XDS_FALSE; - - /* Initialize engines map. */ - - ctx->engines = NULL; - ctx->engines_len = 0; - ctx->engines_capacity = 0; - - /* Done. */ - - return ctx; - } Index: ossp-pkg/xds/register.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/register.c,v rcsdiff -q -kk '-r1.7' '-r1.8' -u '/v/ossp/cvs/ossp-pkg/xds/Attic/register.c,v' 2>/dev/null --- register.c 2001/08/01 15:25:47 1.7 +++ register.c 2001/08/02 10:51:57 1.8 @@ -25,7 +25,6 @@ SUCH DAMAGE. */ -#include #include #include #include "internal.h" Index: ossp-pkg/xds/set-capacity.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/set-capacity.c,v co -q -kk -p'1.4' '/v/ossp/cvs/ossp-pkg/xds/Attic/set-capacity.c,v' | diff -u - /dev/null -L'ossp-pkg/xds/set-capacity.c' 2>/dev/null --- ossp-pkg/xds/set-capacity.c +++ /dev/null 2024-05-15 04:55:00.000000000 +0200 @@ -1,62 +0,0 @@ -/* - 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. -*/ - -#include -#include "internal.h" - -int xds_set_capacity(void** array, size_t* array_capacity, size_t new_capacity, size_t elem_size, size_t initial_capacity) - { - void* buf; - size_t size; - - /* Sanity checks. */ - - xds_check_parameter(array != NULL); - xds_check_parameter(array_capacity != NULL); - xds_check_parameter(elem_size != 0); - xds_check_parameter(initial_capacity != 0); - - /* Do we need to re-allocate? */ - - if (*array_capacity > new_capacity) - return XDS_OK; - - /* Find the correct capacity. */ - - for(size = (*array_capacity != 0) ? *array_capacity * 2 : initial_capacity; size < new_capacity; size *= 2) - ; - - /* Allocate the array and store the new values. */ - - buf = realloc(*array, size * elem_size); - if (buf == NULL) - return XDS_ERR_NO_MEM; - *array = buf; - *array_capacity = size; - - return XDS_OK; - } Index: ossp-pkg/xds/unregister.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/unregister.c,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/xds/Attic/unregister.c,v' 2>/dev/null --- unregister.c 2001/08/01 15:25:47 1.5 +++ unregister.c 2001/08/02 10:51:57 1.6 @@ -25,7 +25,6 @@ SUCH DAMAGE. */ -#include #include #include #include "internal.h"