--- xds.h.in 2001/07/31 15:27:45 1.6
+++ xds.h.in 2001/08/01 15:25:47 1.7
@@ -61,10 +61,8 @@
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,
+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);
@@ -73,7 +71,7 @@
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_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, ...);
@@ -81,44 +79,45 @@
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);
+#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);
-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);
+#undef declare_formatting_engine
#endif /* !defined(__LIBXDS_H__) */
|