OSSP CVS Repository

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

Check-in Number: 4264
Date: 2001-Aug-01 15:25:20 (local)
2001-Aug-01 13:25:20 (UTC)
User:simons
Branch:callback-semantic-rewrite
Comment: - Added xds_init_encoding_engine() and xds_init_decoding_engine() macros.

- Include assert.h since we use the assert() function in our header.

Tickets:
Inspections:
Files:
ossp-pkg/xds/internal.h      1.7.2.1->removed

ossp-pkg/xds/internal.h 1.7.2.1 -> 1.7.2.2

--- internal.h   2001/08/01 09:55:58     1.7.2.1
+++ internal.h   2001/08/01 13:25:20     1.7.2.2
@@ -30,6 +30,7 @@
 #ifndef __INTERNAL_H__
 #define __INTERNAL_H__
 
+#include <assert.h>
 #include "xds.h"
 
 #define XDS_TRUE (1==1)
@@ -71,7 +72,33 @@
     {                                     \
     assert(condition);                    \
     if (!(condition))                     \
-        return XDS_ERR_INVALID_ARG;       \
+        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)
 
 #endif /* !defined(__INTERNAL_H__) */

CVSTrac 2.0.1