OSSP CVS Repository

ossp - Check-in [4134]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4134
Date: 2001-Jul-02 14:18:57 (local)
2001-Jul-02 12:18:57 (UTC)
User:simons
Branch:
Comment: - The de-/encoding buffer is now of type "void*" rather than "char*".

- getbuffer() and setbuffer() now expect a parameter xds_buf_flag_t, which tells them who owns the buffer. If the library owns it (XDS_GIFT set at setbuf()-time), the library performs dynamic buffer management. If the user owns the buffer, it is static in size.

- xds_init() now ecpects a xds_mode_t parameter, telling it whether to initialize in encode or decode mode.

- The xds_register_XXX() functions are gone. We will rather export the symbols of the callbacks so that the users can register the ones he needs himself.

Tickets:
Inspections:
Files:
ossp-pkg/xds/xds.h      1.7 -> 1.8     23 inserted, 17 deleted

ossp-pkg/xds/xds.h 1.7 -> 1.8

--- xds.h        2001/06/29 13:58:53     1.7
+++ xds.h        2001/07/02 12:18:57     1.8
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/xds/Attic/xds.h,v $
-   $Revision: 1.7 $
+   $Revision: 1.8 $
 
    Copyright (c) 2001 by Cable & Wireless Deutschland.
 
@@ -26,28 +26,34 @@
 
 typedef int (*xds_fmt_cb_t)(xds_t* context,
                             void* fmt_context,
-                            char* buf, size_t buf_size,
+                            void* buf,
+                            size_t buf_size,
                             va_list args);
 
-xds_t*  xds_init(void);
-void    xds_destroy(xds_t* context);
+typedef enum
+    {
+    XDS_ENCODE,
+    XDS_DECODE
+    }
+xds_mode_t;
+
+typedef enum
+    {
+    XDS_LOAN,
+    XDS_GIFT
+    }
+xds_buf_flag_t;
 
-int xds_register(xds_t* context,
-                 const char* name, xds_fmt_cb_t callback,
-                 void* formatter_context);
-int xds_register_xdr(xds_t* context);
-int xds_register_xml(xds_t* context);
-int xds_register_asn1(xds_t* context);
+xds_t* xds_init(xds_mode_t);
+void xds_destroy(xds_t* context);
+
+int xds_register(xds_t* context, const char* name, xds_fmt_cb_t callback, void* formatter_context);
 int xds_unregister(xds_t* context, const char* name);
 
-int xds_set_encode_buffer(xds_t* context, char* buf, size_t buf_size);
-int xds_set_decode_buffer(xds_t* context, const char* buf, size_t buf_size);
-int xds_get_encode_buffer(xds_t* context, char** buf, size_t* buf_size);
+int xds_set_buffer(xds_t* context, xds_buf_flag_t flag, void* buf, size_t buf_size);
+int xds_get_buffer(xds_t* context, xds_buf_flag_t flag, void** buf, size_t* buf_size);
 
 int xds_encode(xds_t* context, const char* fmt, ...);
-int xds_decode(xds_t* context, const char* buf, const char* fmt, ...);
-
-int xds_vencode(xds_t* context, const char* fmt, va_list args);
-int xds_vdecode(xds_t* context, const char* buf, const char* fmt, va_list args);
+int xds_decode(xds_t* context, const char* fmt, ...);
 
 #endif /* !defined(__LIBXDS_H__) */

CVSTrac 2.0.1