head 1.25; access; symbols XDS_0_9_3:1.25 XDS_0_9_2:1.25 XDS_0_9_1:1.23 XDS_0_9_0:1.22 last-version-in-peti-style:1.10 callback-semantic-rewrite:1.6.0.2; locks; strict; comment @# @; 1.25 date 2005.06.02.18.51.44; author rse; state Exp; branches; next 1.24; 1.24 date 2005.03.30.19.22.50; author rse; state Exp; branches; next 1.23; 1.23 date 2004.09.12.17.32.14; author rse; state Exp; branches; next 1.22; 1.22 date 2003.02.17.12.36.02; author rse; state Exp; branches; next 1.21; 1.21 date 2003.02.17.12.27.51; author rse; state Exp; branches; next 1.20; 1.20 date 2002.03.17.10.25.53; author rse; state Exp; branches; next 1.19; 1.19 date 2002.01.02.17.13.44; author rse; state Exp; branches; next 1.18; 1.18 date 2001.08.30.14.47.41; author simons; state Exp; branches; next 1.17; 1.17 date 2001.08.30.11.21.54; author simons; state Exp; branches; next 1.16; 1.16 date 2001.08.23.08.42.50; author simons; state Exp; branches; next 1.15; 1.15 date 2001.08.22.20.19.50; author simons; state Exp; branches; next 1.14; 1.14 date 2001.08.12.11.31.45; author rse; state Exp; branches; next 1.13; 1.13 date 2001.08.09.19.58.35; author rse; state Exp; branches; next 1.12; 1.12 date 2001.08.08.19.32.02; author rse; state Exp; branches; next 1.11; 1.11 date 2001.08.08.19.29.26; author rse; state Exp; branches; next 1.10; 1.10 date 2001.08.02.17.24.49; author simons; state Exp; branches; next 1.9; 1.9 date 2001.08.02.14.39.15; author simons; state Exp; branches; next 1.8; 1.8 date 2001.08.02.08.12.26; author simons; state Exp; branches; next 1.7; 1.7 date 2001.08.01.15.25.47; author simons; state Exp; branches; next 1.6; 1.6 date 2001.07.31.15.27.45; author simons; state Exp; branches 1.6.2.1; next 1.5; 1.5 date 2001.07.23.16.33.03; author simons; state Exp; branches; next 1.4; 1.4 date 2001.07.23.16.17.43; author simons; state Exp; branches; next 1.3; 1.3 date 2001.07.23.15.33.23; author simons; state Exp; branches; next 1.2; 1.2 date 2001.07.20.10.56.01; author simons; state Exp; branches; next 1.1; 1.1 date 2001.07.20.10.42.34; author simons; state Exp; branches; next ; 1.6.2.1 date 2001.08.01.09.36.08; author simons; state Exp; branches; next 1.6.2.2; 1.6.2.2 date 2001.08.01.09.43.53; author simons; state Exp; branches; next 1.6.2.3; 1.6.2.3 date 2001.08.01.11.24.00; author simons; state Exp; branches; next ; desc @@ 1.25 log @Bumped year in copyright messages for year 2005. @ text @/* ** OSSP xds - Extensible Data Serialization ** Copyright (c) 2001-2005 Ralf S. Engelschall ** Copyright (c) 2001-2005 The OSSP Project ** Copyright (c) 2001-2005 Cable & Wireless ** ** This file is part of OSSP xds, an extensible data serialization ** library which can be found at http://www.ossp.org/pkg/lib/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: XDS library API */ #ifndef __XDS_H__ #define __XDS_H__ #include #include #include #include #define XDS_TRUE (1==1) #define XDS_FALSE (1!=1) @@have_64_bit_support@@ typedef @@xds_uint8_t@@ xds_uint8_t; typedef @@xds_int8_t@@ xds_int8_t; typedef @@xds_uint16_t@@ xds_uint16_t; typedef @@xds_int16_t@@ xds_int16_t; typedef @@xds_uint32_t@@ xds_uint32_t; typedef @@xds_int32_t@@ xds_int32_t; #ifdef XDS_HAVE_64_BIT_SUPPORT typedef @@xds_uint64_t@@ xds_uint64_t; typedef @@xds_int64_t@@ xds_int64_t; #endif typedef float xds_float_t; typedef double xds_double_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, XDS_ERR_UNKNOWN = -8, XDS_ERR_SYSTEM = -9 }; 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, size_t *used_buffer_size, va_list *args); int xds_init (xds_t **xds, xds_mode_t); int 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); #define xds_check_parameter(condition) \ do { \ assert(condition); \ if (!(condition)) \ return XDS_ERR_INVALID_ARG; \ } while (XDS_FALSE) #define xds_init_encoding_engine(size) \ do { \ xds_check_parameter(xds != NULL); \ xds_check_parameter(buffer != NULL); \ xds_check_parameter(buffer_size != 0); \ xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ xds_check_parameter(args != NULL); \ *used_buffer_size = (size); \ if (buffer_size < (size)) \ return XDS_ERR_OVERFLOW; \ } while (XDS_FALSE) #define xds_init_decoding_engine(size) \ do { \ xds_check_parameter(xds != NULL); \ xds_check_parameter(buffer != NULL); \ xds_check_parameter(buffer_size != 0); \ xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ xds_check_parameter(args != NULL); \ *used_buffer_size = (size); \ if (buffer_size < (size)) \ return XDS_ERR_UNDERFLOW; \ } while (XDS_FALSE) #define xds_declare_formatting_engine(func) \ int func(xds_t *, void *, void *, size_t, size_t *, va_list *) xds_declare_formatting_engine(xdr_encode_uint32); xds_declare_formatting_engine(xdr_decode_uint32); xds_declare_formatting_engine(xdr_encode_int32); xds_declare_formatting_engine(xdr_decode_int32); #ifdef XDS_HAVE_64_BIT_SUPPORT xds_declare_formatting_engine(xdr_encode_uint64); xds_declare_formatting_engine(xdr_decode_uint64); xds_declare_formatting_engine(xdr_encode_int64); xds_declare_formatting_engine(xdr_decode_int64); #endif xds_declare_formatting_engine(xdr_encode_float); xds_declare_formatting_engine(xdr_decode_float); xds_declare_formatting_engine(xdr_encode_double); xds_declare_formatting_engine(xdr_decode_double); xds_declare_formatting_engine(xdr_encode_octetstream); xds_declare_formatting_engine(xdr_decode_octetstream); xds_declare_formatting_engine(xdr_encode_string); xds_declare_formatting_engine(xdr_decode_string); xds_declare_formatting_engine(xml_encode_begin); xds_declare_formatting_engine(xml_decode_begin); xds_declare_formatting_engine(xml_encode_end); xds_declare_formatting_engine(xml_decode_end); xds_declare_formatting_engine(xml_encode_uint32); xds_declare_formatting_engine(xml_decode_uint32); xds_declare_formatting_engine(xml_encode_int32); xds_declare_formatting_engine(xml_decode_int32); #ifdef XDS_HAVE_64_BIT_SUPPORT xds_declare_formatting_engine(xml_encode_uint64); xds_declare_formatting_engine(xml_decode_uint64); xds_declare_formatting_engine(xml_encode_int64); xds_declare_formatting_engine(xml_decode_int64); #endif xds_declare_formatting_engine(xml_encode_float); xds_declare_formatting_engine(xml_decode_float); xds_declare_formatting_engine(xml_encode_double); xds_declare_formatting_engine(xml_decode_double); xds_declare_formatting_engine(xml_encode_octetstream); xds_declare_formatting_engine(xml_decode_octetstream); xds_declare_formatting_engine(xml_encode_string); xds_declare_formatting_engine(xml_decode_string); #endif /* __XDS_H__ */ @ 1.24 log @follow FlexeLint suggestion and surround parameter usage in macro with parenthesis @ text @d3 3 a5 3 ** Copyright (c) 2001-2004 Ralf S. Engelschall ** Copyright (c) 2001-2004 The OSSP Project ** Copyright (c) 2001-2004 Cable & Wireless @ 1.23 log @Bumped year in copyright messages for year 2004. @ text @d105 2 a106 2 *used_buffer_size = size; \ if (buffer_size < size) \ d117 2 a118 2 *used_buffer_size = size; \ if (buffer_size < size) \ @ 1.22 log @upgrade to standard OSSP copyright and bump year to 2003 @ text @d3 3 a5 3 ** Copyright (c) 2001-2003 Ralf S. Engelschall ** Copyright (c) 2001-2003 The OSSP Project ** Copyright (c) 2001-2003 Cable & Wireless Germany @ 1.21 log @cleanup API by returning xds_rc_t in xds_init, too @ text @d3 3 a5 2 ** Copyright (c) 2001-2002 The OSSP Project (http://www.ossp.org/) ** Copyright (c) 2001-2002 Cable & Wireless Deutschland (http://www.cw.com/de/) @ 1.20 log @update texts @ text @d65 2 a66 1 XDS_ERR_UNKNOWN = -8 d79 2 a80 2 xds_t *xds_init (xds_mode_t); void xds_destroy (xds_t *xds); d95 1 a95 1 } while(XDS_FALSE) d107 1 a107 1 } while(XDS_FALSE) d119 1 a119 1 } while(XDS_FALSE) d167 1 @ 1.19 log @bump copyright year @ text @d2 1 a2 1 ** XDS - OSSP Extensible Data Serialization Library d6 2 a7 2 ** This file is part of OSSP XDS, an extensible data serialization ** library which can be found at http://www.ossp.org/pkg/xds/. @ 1.18 log @Added prototypes for xml_encode_float() and xml_decode_float(). @ text @d3 2 a4 2 ** Copyright (c) 2001 The OSSP Project (http://www.ossp.org/) ** Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/) @ 1.17 log @Added typedef for xds_float_t, just for consistency. @ text @d156 2 @ 1.16 log @- Moved all float-related stuff into xds_engine_xdr.c so that we don't need any prototypes or structure declarations in the public header file. - Renamed xds_float_t to my_float. - Renamed float2xds_float() to float2myfloat(). @ text @d53 1 @ 1.15 log @Added the data structure declaration needed in float2xds_float(). It does not really belong here, but for the moment it should be fine. @ text @a161 10 typedef struct { unsigned int sign :1; unsigned int fraction :23; int exponent :8; } xds_float_t; int float2xds_float(xds_float_t* new_num, float num); @ 1.14 log @Hhmm... who has introduced ossp.com?! Our project's domain is ossp.org, of course. @ text @d132 2 d162 10 a172 1 @ 1.13 log @Use the license consistently. @ text @d7 1 a7 1 ** library which can be found at http://www.ossp.com/pkg/xds/. @ 1.12 log @Do not export internal things. @ text @d27 1 a27 1 ** xds.h: C API @ 1.11 log @Mmanual style cleanups to header files. @ text @a159 5 extern const char xds_xml_begin_text[]; extern const char xds_xml_end_text[]; extern const char xds_base64[]; extern const char xds_pad64; @ 1.10 log @Implemented XML engines for octet streams. The base64-encoding code still needs some work, though: The test with an empty string currently fails. Also we had to do some weird work-arounds in the decoding routine because base64_decode does not honor srclen. @ text @d2 26 a27 26 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 d30 2 a31 2 #ifndef __LIBXDS_H__ #define __LIBXDS_H__ d38 1 a38 1 #define XDS_TRUE (1==1) d43 2 a44 2 typedef @@xds_uint8_t@@ xds_uint8_t; typedef @@xds_int8_t@@ xds_int8_t; d46 1 a46 1 typedef @@xds_int16_t@@ xds_int16_t; d48 1 a48 1 typedef @@xds_int32_t@@ xds_int32_t; d51 1 a51 1 typedef @@xds_int64_t@@ xds_int64_t; d53 1 a53 1 typedef double xds_double_t; d55 1 a55 2 enum { d65 2 a66 1 }; d73 20 a92 24 typedef int (*xds_engine_t)(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_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); #define xds_check_parameter(condition) \ do \ { \ assert(condition); \ if (!(condition)) \ return XDS_ERR_INVALID_ARG; \ d95 10 a104 11 #define xds_init_encoding_engine(size) \ do \ { \ xds_check_parameter(xds != NULL); \ xds_check_parameter(buffer != NULL); \ xds_check_parameter(buffer_size != 0); \ xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ xds_check_parameter(args != NULL); \ *used_buffer_size = size; \ if (buffer_size < size) \ return XDS_ERR_OVERFLOW; \ d107 10 a116 11 #define xds_init_decoding_engine(size) \ do \ { \ xds_check_parameter(xds != NULL); \ xds_check_parameter(buffer != NULL); \ xds_check_parameter(buffer_size != 0); \ xds_check_parameter(used_buffer_size != NULL && *used_buffer_size == 0); \ xds_check_parameter(args != NULL); \ *used_buffer_size = size; \ if (buffer_size < size) \ return XDS_ERR_UNDERFLOW; \ d119 2 a120 4 #define xds_declare_formatting_engine(x) \ int x(xds_t* xds, void* engine_context, \ void* buffer, size_t buffer_size, size_t* used_buffer_size, \ va_list* args) d159 1 d165 2 a166 1 #endif /* !defined(__LIBXDS_H__) */ @ 1.9 log @The configure script will now recognize when any of the 64-bit data types is missing. In this case, the define XDS_HAVE_64_BIT_SUPPORT will _not_ be defined in xds.h; it will be defined otherwise. Depending on whether the define is there or not, the 64-bit engines will not be defined. @ text @d64 2 a65 1 XDS_ERR_UNDERFLOW = -7 d169 2 @ 1.8 log @- Moved definition of xds_check_parameter(), xds_init_encoding_engine(), and xds_init_decoding_engine() from internal.h to xds.h so that the callbacks don't need to include internal.h. - Renamed declare_formatting_engine() to xds_declare_formatting_engine(). @ text @d41 2 d44 1 d46 1 d48 2 a50 3 typedef @@xds_int8_t@@ xds_int8_t; typedef @@xds_int16_t@@ xds_int16_t; typedef @@xds_int32_t@@ xds_int32_t; d52 1 d133 1 d138 1 d154 1 d159 1 @ 1.7 log @Merged the whole contents of branch "callback-semantic-rewrite" into the main branch. The changes there include: - A change of the callback semantics; callbacks do now return XDS_ERR_(UNDER|OVER)FLOW in case the buffer size doesn't fit. Rather than passing the differing byte size through the return code, it is stored in the location used_buffer_size points to -- a new parameter provided to all callbacks. In order to implement this, the framework, all callbacks and most of the test suits had to be adapted. - internal.h now provides the macro xds_check_parameter(), which can be used to verify the contents of function parameters with assert() and if in one line. If assert()s are deactivated, the routine will still return XDS_ERR_INVALID_ARG. Because of this change, internal.h now includes the system header assert.h. This means that this include coulde be removed from almost all modules. - internal.h now provides the macros xds_init_(en|de)coding_engine(). These can be used to comfortably verify a callback's parameters and to verify the buffer size. All engines have been rewritten to use these. @ text @d36 4 d86 37 a122 3 #define declare_formatting_engine(x) \ int x(xds_t* xds, void* engine_context, \ void* buffer, size_t buffer_size, size_t* used_buffer_size, \ d125 35 a159 35 declare_formatting_engine(xdr_encode_uint32); declare_formatting_engine(xdr_decode_uint32); declare_formatting_engine(xdr_encode_int32); declare_formatting_engine(xdr_decode_int32); declare_formatting_engine(xdr_encode_uint64); declare_formatting_engine(xdr_decode_uint64); declare_formatting_engine(xdr_encode_int64); declare_formatting_engine(xdr_decode_int64); declare_formatting_engine(xdr_encode_double); declare_formatting_engine(xdr_decode_double); declare_formatting_engine(xdr_encode_octetstream); declare_formatting_engine(xdr_decode_octetstream); declare_formatting_engine(xdr_encode_string); declare_formatting_engine(xdr_decode_string); declare_formatting_engine(xml_encode_begin); declare_formatting_engine(xml_decode_begin); declare_formatting_engine(xml_encode_end); declare_formatting_engine(xml_decode_end); declare_formatting_engine(xml_encode_uint32); declare_formatting_engine(xml_decode_uint32); declare_formatting_engine(xml_encode_int32); declare_formatting_engine(xml_decode_int32); declare_formatting_engine(xml_encode_uint64); declare_formatting_engine(xml_decode_uint64); declare_formatting_engine(xml_encode_int64); declare_formatting_engine(xml_decode_int64); declare_formatting_engine(xml_encode_double); declare_formatting_engine(xml_decode_double); declare_formatting_engine(xml_encode_octetstream); declare_formatting_engine(xml_decode_octetstream); declare_formatting_engine(xml_encode_string); declare_formatting_engine(xml_decode_string); #undef declare_formatting_engine @ 1.6 log @Implemented xml_encode_begin(), xml_decode_begin(), xml_encode_end(), and xml_decode_end(). @ text @d64 2 a65 4 typedef int (*xds_engine_t)(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, d74 1 a74 1 int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len); d82 38 a119 4 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); d121 1 a121 34 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); int xdr_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xdr_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_encode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_decode_int32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_encode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_decode_uint32(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_encode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_decode_int64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_encode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_decode_uint64(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_encode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_decode_double(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_encode_begin(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_decode_begin(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_encode_end(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); int xml_decode_end(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, va_list* args); @ 1.6.2.1 log @Added the macro declare_formatting_engine() in order to make the declaration of all those engines shorter and easier to read. @ text @d76 1 a76 1 int xds_setbuffer(xds_t* xds, xds_scope_t flag, void* buffer, size_t buffer_len); d84 39 a122 38 #define declare_formatting_engine(x) \ int x(xds_t* xds, void* engine_context, \ void* buffer, size_t buffer_size, /* size_t* used_buffer_size, */ \ va_list* args) declare_formatting_engine(xdr_encode_uint32); declare_formatting_engine(xdr_decode_uint32); declare_formatting_engine(xdr_encode_int32); declare_formatting_engine(xdr_decode_int32); declare_formatting_engine(xdr_encode_uint64); declare_formatting_engine(xdr_decode_uint64); declare_formatting_engine(xdr_encode_int64); declare_formatting_engine(xdr_decode_int64); declare_formatting_engine(xdr_encode_double); declare_formatting_engine(xdr_decode_double); declare_formatting_engine(xdr_encode_octetstream); declare_formatting_engine(xdr_decode_octetstream); declare_formatting_engine(xdr_encode_string); declare_formatting_engine(xdr_decode_string); declare_formatting_engine(xml_encode_begin); declare_formatting_engine(xml_decode_begin); declare_formatting_engine(xml_encode_end); declare_formatting_engine(xml_decode_end); declare_formatting_engine(xml_encode_uint32); declare_formatting_engine(xml_decode_uint32); declare_formatting_engine(xml_encode_int32); declare_formatting_engine(xml_decode_int32); declare_formatting_engine(xml_encode_uint64); declare_formatting_engine(xml_decode_uint64); declare_formatting_engine(xml_encode_int64); declare_formatting_engine(xml_decode_int64); declare_formatting_engine(xml_encode_double); declare_formatting_engine(xml_decode_double); declare_formatting_engine(xml_encode_octetstream); declare_formatting_engine(xml_decode_octetstream); declare_formatting_engine(xml_encode_string); declare_formatting_engine(xml_decode_string); @ 1.6.2.2 log @- Use new callback semantics in declare_formatting_engine(). - Undefine the macro after all callbacks are declared. @ text @d86 1 a86 1 void* buffer, size_t buffer_size, size_t* used_buffer_size, \ a121 2 #undef declare_formatting_engine @ 1.6.2.3 log @Added used_buffer_size parameter to xds_engine_t. @ text @d64 4 a67 2 typedef int (*xds_engine_t)(xds_t* xds, void* engine_context, void* buffer, size_t buffer_size, size_t* used_buffer_size, @ 1.5 log @Implemented encoding and decoding of doubles in XML. @ text @d119 5 @ 1.4 log @Added XML implementations for uint32, int64, and uint64. @ text @d45 1 d115 3 @ 1.3 log @Added prototypes for xdr_encode_double(), xdr_decode_double(), xml_encode_int32(), and xml_decode_int32(). @ text @d106 9 @ 1.2 log @Use xds_(u)int(8|16|32|64) instead of the system defines. @ text @d99 7 @ 1.1 log @- Renamed configure.in to configure.ac for autoconf 2.50 and later. - Added tests that will find the exact data types and typedef our versions to them. @ text @d40 1 d44 1 @