ossp-pkg/xds/xml-encode-end.c 1.1 -> 1.2
--- xml-encode-end.c 2001/07/31 15:28:14 1.1
+++ xml-encode-end.c 2001/08/01 15:25:47 1.2
@@ -26,24 +26,15 @@
*/
#include <string.h>
-#include <assert.h>
#include "internal.h"
const char xds_xml_end_text[] = "</xds>\n";
-int xml_encode_end(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, size_t* used_buffer_size,
+ va_list* args)
{
- /* Consistency checks. */
-
- assert(xds != NULL);
- assert(buffer != NULL);
- assert(buffer_size != 0);
- assert(args != NULL);
- if (xds == NULL || buffer == NULL || buffer_size == 0 || args == NULL)
- return XDS_ERR_INVALID_ARG;
-
- if (buffer_size >= strlen(xds_xml_end_text))
- memmove(buffer, xds_xml_end_text, strlen(xds_xml_end_text));
-
- return strlen(xds_xml_end_text);
+ xds_init_encoding_engine(strlen(xds_xml_end_text));
+ memmove(buffer, xds_xml_end_text, strlen(xds_xml_end_text));
+ return XDS_OK;
}
|
|