Index: ossp-pkg/xds/register.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/register.c,v co -q -kk -p'1.8' '/v/ossp/cvs/ossp-pkg/xds/Attic/register.c,v' | diff -u - /dev/null -L'ossp-pkg/xds/register.c' 2>/dev/null --- ossp-pkg/xds/register.c +++ /dev/null 2024-05-14 22:22:10.000000000 +0200 @@ -1,82 +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" - -int xds_register(xds_t* xds, const char* name, xds_engine_t engine, void* engine_context) - { - size_t pos; - - /* Sanity checks. */ - - xds_check_parameter(xds != NULL); - xds_check_parameter(name != NULL); - xds_check_parameter(engine != NULL); - for(pos = 0; name[pos] != '\0'; ++pos) - { - if (!isalnum(name[pos]) && name[pos] != '-' && name[pos] != '_') - return XDS_ERR_INVALID_ARG; - } - - /* Copy the name argument into our own memory. */ - - name = strdup(name); - if (name == NULL) - return XDS_ERR_NO_MEM; - - /* Search engines for the entry. */ - - if (xds_find_engine(xds->engines, xds->engines_len, name, &pos)) - { /* overwrite existing entry */ - free(xds->engines[pos].name); - } - else - { /* insert new entry */ - int rc = xds_set_capacity((void**)&xds->engines, - &xds->engines_capacity, - xds->engines_len + 1, - sizeof(engine_map_t), - XDS_INITIAL_ENGINES_CAPACITY); - assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); - if (rc != XDS_OK) - return rc; - memmove(&xds->engines[pos+1], &xds->engines[pos], (xds->engines_len - pos) * sizeof(engine_map_t)); - ++xds->engines_len; - } - - /* Insert entry. */ - - xds->engines[pos].name = (char*)name; - xds->engines[pos].engine = engine; - xds->engines[pos].context = engine_context; - - /* Everything is fine. */ - - return XDS_OK; - } Index: ossp-pkg/xds/unregister.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/unregister.c,v co -q -kk -p'1.6' '/v/ossp/cvs/ossp-pkg/xds/Attic/unregister.c,v' | diff -u - /dev/null -L'ossp-pkg/xds/unregister.c' 2>/dev/null --- ossp-pkg/xds/unregister.c +++ /dev/null 2024-05-14 22:22:10.000000000 +0200 @@ -1,72 +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" - -int xds_unregister(xds_t* xds, const char* name) - { - size_t pos; - int rc; - - /* Sanity checks. */ - - xds_check_parameter(xds != NULL); - xds_check_parameter(name != NULL); - for(pos = 0; name[pos] != '\0'; ++pos) - { - if (!isalnum(name[pos]) && name[pos] != '-' && name[pos] != '_') - return XDS_ERR_INVALID_ARG; - } - - /* Find the entry we're supposed to delete. */ - - if (!xds_find_engine(xds->engines, xds->engines_len, name, &pos)) - return XDS_ERR_UNKNOWN_ENGINE; - - /* Free the memory allocated for this entry and move the entries - behind it back if necessary. */ - - assert(xds->engines[pos].name != NULL); - free(xds->engines[pos].name); - memmove(&xds->engines[pos], &xds->engines[pos+1], (xds->engines_len - (pos + 1)) * sizeof(engine_map_t)); - --xds->engines_len; - - /* Lower capacity if necessary. */ - - rc = xds_set_capacity((void**)&xds->engines, - &xds->engines_capacity, - xds->engines_len, - sizeof(engine_map_t), - XDS_INITIAL_ENGINES_CAPACITY); - assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); - if (rc != XDS_OK) - return rc; - - return XDS_OK; - } Index: ossp-pkg/xds/vdecode.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/vdecode.c,v co -q -kk -p'1.5' '/v/ossp/cvs/ossp-pkg/xds/Attic/vdecode.c,v' | diff -u - /dev/null -L'ossp-pkg/xds/vdecode.c' 2>/dev/null --- ossp-pkg/xds/vdecode.c +++ /dev/null 2024-05-14 22:22:10.000000000 +0200 @@ -1,102 +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" - -int xds_vdecode(xds_t* xds, const char* fmt_arg, va_list args) - { - size_t buffer_len_backup; - char* name; - char* p; - char* fmt; - int rc; - - /* Sanity checks. */ - - xds_check_parameter(xds != NULL); - xds_check_parameter(fmt_arg != NULL); - assert(xds->mode == XDS_DECODE); - if (xds->mode != XDS_DECODE) - return XDS_ERR_INVALID_MODE; - - /* Ensure we have a buffer to decode. */ - - if (xds->buffer == NULL || xds->buffer_capacity == 0) - return XDS_ERR_UNDERFLOW; - - /* Iterate through the items in the format string and execute the - apropriate engines. */ - - fmt = p = strdup(fmt_arg); - if (fmt == NULL) - return XDS_ERR_NO_MEM; - buffer_len_backup = xds->buffer_len; - for(name = p; *p != '\0'; name = p) - { - while(isalnum(*p) || *p == '-' || *p == '_') - ++p; - if (*p) - *p++ = '\0'; - else - *p = '\0'; - - if (strlen(name) > 0) - { - size_t pos; - size_t used_buffer_size = 0; - if (xds_find_engine(xds->engines, xds->engines_len, name, &pos)) - { - rc = (*xds->engines[pos].engine)(xds, - xds->engines[pos].context, - xds->buffer + xds->buffer_len, - xds->buffer_capacity - xds->buffer_len, - &used_buffer_size, - &args); - assert(rc <= 0); - if (rc == XDS_OK) - xds->buffer_len += used_buffer_size; - else - goto leave; - } - else - { - rc = XDS_ERR_UNKNOWN_ENGINE; - goto leave; - } - } - } - rc = XDS_OK; - - /* Clean up and leave. */ - leave: - free(fmt); - if (rc != XDS_OK) - xds->buffer_len = buffer_len_backup; - return rc; - } Index: ossp-pkg/xds/vencode.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/vencode.c,v co -q -kk -p'1.13' '/v/ossp/cvs/ossp-pkg/xds/Attic/vencode.c,v' | diff -u - /dev/null -L'ossp-pkg/xds/vencode.c' 2>/dev/null --- ossp-pkg/xds/vencode.c +++ /dev/null 2024-05-14 22:22:10.000000000 +0200 @@ -1,165 +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" - -int xds_vencode(xds_t* xds, const char* fmt_arg, va_list args) - { - va_list args_backup; - size_t buffer_len_backup; - char* name; - char* p; - char* fmt; - int rc; - - /* Sanity checks. */ - - xds_check_parameter(xds != NULL); - xds_check_parameter(fmt_arg != NULL); - assert(xds->mode == XDS_ENCODE); - if (xds->mode != XDS_ENCODE) - return XDS_ERR_INVALID_MODE; - - /* Ensure we have a buffer allocated ready for use. */ - - if (xds->buffer == NULL) - { /* allocate a new buffer */ - rc = xds_set_capacity((void**)&xds->buffer, - &xds->buffer_capacity, - XDS_INITIAL_BUFFER_CAPACITY, - sizeof(char), - XDS_INITIAL_BUFFER_CAPACITY); - assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); - if (rc != XDS_OK) - return rc; - xds->buffer_len = 0; - xds->we_own_buffer = XDS_TRUE; - } - - /* Iterate through the items in the format string and execute the - apropriate engines. */ - - fmt = p = strdup(fmt_arg); - if (fmt == NULL) - return XDS_ERR_NO_MEM; - buffer_len_backup = xds->buffer_len; - for(name = p; *p != '\0'; name = p) - { - while(isalnum(*p) || *p == '-' || *p == '_') - ++p; - if (*p) - *p++ = '\0'; - else - *p = '\0'; - - if (strlen(name) > 0) - { - int restart_engine; - size_t used_buffer_size; - size_t pos; - - if (xds_find_engine(xds->engines, xds->engines_len, name, &pos) == XDS_FALSE) - { - rc = XDS_ERR_UNKNOWN_ENGINE; - goto leave; - } - - do - { - /* Ensure the buffer has free space. */ - - assert(xds->buffer_len <= xds->buffer_capacity); - if (xds->buffer_len == xds->buffer_capacity) - { - if (xds->we_own_buffer) - { - rc = xds_set_capacity((void**)&xds->buffer, - &xds->buffer_capacity, - xds->buffer_len + 1, - sizeof(char), - XDS_INITIAL_BUFFER_CAPACITY); - assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); - if (rc != XDS_OK) - goto leave; - } - else - { - rc = XDS_ERR_OVERFLOW; - goto leave; - } - } - - /* Execute the engine. */ - - used_buffer_size = 0; - args_backup = args; - rc = (*xds->engines[pos].engine)(xds, - xds->engines[pos].context, - xds->buffer + xds->buffer_len, - xds->buffer_capacity - xds->buffer_len, - &used_buffer_size, - &args); - assert(rc <= 0); - if (rc == XDS_OK) - { - restart_engine = XDS_FALSE; - xds->buffer_len += used_buffer_size; - } - else if (rc == XDS_ERR_OVERFLOW) - { /* enlarge buffer */ - if (!xds->we_own_buffer) - goto leave; - - restart_engine = XDS_TRUE; - args = args_backup; - - rc = xds_set_capacity((void**)&xds->buffer, - &xds->buffer_capacity, - xds->buffer_capacity + ((used_buffer_size == 0) ? 1 : used_buffer_size), - sizeof(char), - XDS_INITIAL_BUFFER_CAPACITY); - assert(rc == XDS_OK || rc == XDS_ERR_NO_MEM); - if (rc != XDS_OK) - goto leave; - } - else - goto leave; - } - while (restart_engine); - } - } - rc = XDS_OK; - - /* Clean up and leave. */ - leave: - free(fmt); - if (rc != XDS_OK) - xds->buffer_len = buffer_len_backup; - return rc; - } Index: ossp-pkg/xds/xml-decode-int32.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/xml-decode-int32.c,v co -q -kk -p'1.4' '/v/ossp/cvs/ossp-pkg/xds/Attic/xml-decode-int32.c,v' | diff -u - /dev/null -L'ossp-pkg/xds/xml-decode-int32.c' 2>/dev/null --- ossp-pkg/xds/xml-decode-int32.c +++ /dev/null 2024-05-14 22:22:10.000000000 +0200 @@ -1,78 +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 "xds.h" - -int xml_decode_int32(xds_t* xds, void* engine_context, - void* buffer, size_t buffer_size, size_t* used_buffer_size, - va_list* args) - { - xds_int32_t* value; - char* p; - int negative; - - xds_init_decoding_engine(7 + 8 + 1); - - /* Does the opening XML tag match? */ - - if (strncasecmp(buffer, "", 7) != 0) - return XDS_ERR_TYPE_MISMATCH; - - /* Decode the representation of the value. */ - - value = va_arg(*args, xds_int32_t*); - *value = 0; - p = (char*)buffer + 7; - if (*p == '-') - { - negative = XDS_TRUE; - ++p; - } - else - negative = XDS_FALSE; - while(isdigit(*p)) - { - if (p >= (char*)buffer + buffer_size) - return XDS_ERR_UNDERFLOW; - *value *= 10; - *value += *p++ - '0'; - } - if (negative) - *value = 0 - *value; - - /* Does the closing XML tag match? */ - - if (p+8 > (char*)buffer + buffer_size) - return XDS_ERR_UNDERFLOW; - else if (strncasecmp(p, "", 8) != 0) - return XDS_ERR_TYPE_MISMATCH; - - *used_buffer_size = p + 8 - (char*)buffer; - return XDS_OK; - } Index: ossp-pkg/xds/xml-decode-int64.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/xml-decode-int64.c,v co -q -kk -p'1.5' '/v/ossp/cvs/ossp-pkg/xds/Attic/xml-decode-int64.c,v' | diff -u - /dev/null -L'ossp-pkg/xds/xml-decode-int64.c' 2>/dev/null --- ossp-pkg/xds/xml-decode-int64.c +++ /dev/null 2024-05-14 22:22:10.000000000 +0200 @@ -1,78 +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 "xds.h" - -int xml_decode_int64(xds_t* xds, void* engine_context, - void* buffer, size_t buffer_size, size_t* used_buffer_size, - va_list* args) - { - xds_int64_t* value; - char* p; - int negative; - - xds_init_decoding_engine(7 + 8 + 1); - - /* Does the opening XML tag match? */ - - if (strncasecmp(buffer, "", 7) != 0) - return XDS_ERR_TYPE_MISMATCH; - - /* Decode the representation of the value. */ - - value = va_arg(*args, xds_int64_t*); - *value = 0; - p = (char*)buffer + 7; - if (*p == '-') - { - negative = XDS_TRUE; - ++p; - } - else - negative = XDS_FALSE; - while(isdigit(*p)) - { - if (p >= (char*)buffer + buffer_size) - return XDS_ERR_UNDERFLOW; - *value *= 10; - *value += *p++ - '0'; - } - if (negative) - *value = 0 - *value; - - /* Does the closing XML tag match? */ - - if (p+8 > (char*)buffer + buffer_size) - return XDS_ERR_UNDERFLOW; - else if (strncasecmp(p, "", 8) != 0) - return XDS_ERR_TYPE_MISMATCH; - - *used_buffer_size = p + 8 - (char*)buffer; - return XDS_OK; - } Index: ossp-pkg/xds/xml-decode-uint32.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/xml-decode-uint32.c,v co -q -kk -p'1.4' '/v/ossp/cvs/ossp-pkg/xds/Attic/xml-decode-uint32.c,v' | diff -u - /dev/null -L'ossp-pkg/xds/xml-decode-uint32.c' 2>/dev/null --- ossp-pkg/xds/xml-decode-uint32.c +++ /dev/null 2024-05-14 22:22:10.000000000 +0200 @@ -1,68 +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 "xds.h" - -int xml_decode_uint32(xds_t* xds, void* engine_context, - void* buffer, size_t buffer_size, size_t* used_buffer_size, - va_list* args) - { - xds_uint32_t* value; - char* p; - - xds_init_decoding_engine(8 + 9 + 1); - - /* Does the opening XML tag match? */ - - if (strncasecmp(buffer, "", 8) != 0) - return XDS_ERR_TYPE_MISMATCH; - - /* Decode the representation of the value. */ - - value = va_arg(*args, xds_uint32_t*); - *value = 0; - p = (char*)buffer + 8; - while(isdigit(*p)) - { - if (p >= (char*)buffer + buffer_size) - return XDS_ERR_UNDERFLOW; - *value *= 10; - *value += *p++ - '0'; - } - - /* Does the closing XML tag match? */ - - if (p+9 > (char*)buffer + buffer_size) - return XDS_ERR_UNDERFLOW; - else if (strncasecmp(p, "", 9) != 0) - return XDS_ERR_TYPE_MISMATCH; - - *used_buffer_size = p + 9 - (char*)buffer; - return XDS_OK; - } Index: ossp-pkg/xds/xml-decode-uint64.c RCS File: /v/ossp/cvs/ossp-pkg/xds/Attic/xml-decode-uint64.c,v co -q -kk -p'1.5' '/v/ossp/cvs/ossp-pkg/xds/Attic/xml-decode-uint64.c,v' | diff -u - /dev/null -L'ossp-pkg/xds/xml-decode-uint64.c' 2>/dev/null --- ossp-pkg/xds/xml-decode-uint64.c +++ /dev/null 2024-05-14 22:22:10.000000000 +0200 @@ -1,68 +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 "xds.h" - -int xml_decode_uint64(xds_t* xds, void* engine_context, - void* buffer, size_t buffer_size, size_t* used_buffer_size, - va_list* args) - { - xds_uint64_t* value; - char* p; - - xds_init_decoding_engine(8 + 9 + 1); - - /* Does the opening XML tag match? */ - - if (strncasecmp(buffer, "", 8) != 0) - return XDS_ERR_TYPE_MISMATCH; - - /* Decode the representation of the value. */ - - value = va_arg(*args, xds_uint64_t*); - *value = 0; - p = (char*)buffer + 8; - while(isdigit(*p)) - { - if (p >= (char*)buffer + buffer_size) - return XDS_ERR_UNDERFLOW; - *value *= 10; - *value += *p++ - '0'; - } - - /* Does the closing XML tag match? */ - - if (p+9 > (char*)buffer + buffer_size) - return XDS_ERR_UNDERFLOW; - else if (strncasecmp(p, "", 9) != 0) - return XDS_ERR_TYPE_MISMATCH; - - *used_buffer_size = p + 9 - (char*)buffer; - return XDS_OK; - }