From: <svn...@op...> - 2009-09-17 17:03:01
|
Author: dgollub Date: Thu Sep 17 19:02:46 2009 New Revision: 5784 URL: http://www.opensync.org/changeset/5784 Log: Port vformat plugin to osync_xmlformat_{assemble,sort} API changes See r5783 Modified: format-plugins/vformat/src/xmlformat-vcard.c format-plugins/vformat/src/xmlformat-vevent.c format-plugins/vformat/src/xmlformat-vnote.c Modified: format-plugins/vformat/src/xmlformat-vcard.c ============================================================================== --- format-plugins/vformat/src/xmlformat-vcard.c Thu Sep 17 19:02:06 2009 (r5783) +++ format-plugins/vformat/src/xmlformat-vcard.c Thu Sep 17 19:02:46 2009 (r5784) @@ -1056,11 +1056,15 @@ *outpsize = osync_xmlformat_size(); // XXX: remove this later? - osync_xmlformat_sort(xmlformat); + if (!osync_xmlformat_sort(xmlformat, error)) + goto error; unsigned int size; char *str; - osync_xmlformat_assemble(xmlformat, &str, &size); + + if (!osync_xmlformat_assemble(xmlformat, &str, &size, error)) + goto error; + osync_trace(TRACE_SENSITIVE, "Output XMLFormat is:\n%s", str); g_free(str); @@ -1068,6 +1072,10 @@ osync_trace(TRACE_EXIT, "%s: TRUE", __func__); return TRUE; + +error: + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + return FALSE; } static void handle_xml_assistant_x_evolution_parameter(VFormatAttribute *attr, OSyncXMLField *xmlfield) @@ -1897,7 +1905,10 @@ OSyncXMLFormat *xmlformat = (OSyncXMLFormat *)input; unsigned int size; char *str; - osync_xmlformat_assemble(xmlformat, &str, &size); + + if (!osync_xmlformat_assemble(xmlformat, &str, &size, error)) + goto error; + osync_trace(TRACE_SENSITIVE, "Input XMLFormat is:\n%s", str); g_free(str); @@ -1931,6 +1942,11 @@ osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; + +error: + + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + return FALSE; } osync_bool conv_xmlformat_to_vcard30(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, void *userdata, OSyncError **error) Modified: format-plugins/vformat/src/xmlformat-vevent.c ============================================================================== --- format-plugins/vformat/src/xmlformat-vevent.c Thu Sep 17 19:02:06 2009 (r5783) +++ format-plugins/vformat/src/xmlformat-vevent.c Thu Sep 17 19:02:46 2009 (r5784) @@ -687,11 +687,15 @@ *outpsize = osync_xmlformat_size(); // XXX: remove this later? - osync_xmlformat_sort(xmlformat); + if (!osync_xmlformat_sort(xmlformat, error)) + goto error; unsigned int size; char *str; - osync_xmlformat_assemble(xmlformat, &str, &size); + + if (!osync_xmlformat_assemble(xmlformat, &str, &size, error)) + goto error; + osync_trace(TRACE_SENSITIVE, "Output XMLFormat is:\n%s", str); g_free(str); @@ -699,6 +703,10 @@ osync_trace(TRACE_EXIT, "%s: TRUE", __func__); return TRUE; + +error: + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + return FALSE; } static osync_bool conv_xmlformat_to_vcalendar(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, OSyncError **error, int target) @@ -744,7 +752,10 @@ OSyncXMLFormat *xmlformat = (OSyncXMLFormat *)input; unsigned int size; char *str; - osync_xmlformat_assemble(xmlformat, &str, &size); + + if (!osync_xmlformat_assemble(xmlformat, &str, &size, error)) + goto error; + osync_trace(TRACE_SENSITIVE, "Input XMLFormat is:\n%s", str); g_free(str); @@ -869,6 +880,10 @@ osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; + +error: + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + return FALSE; } osync_bool conv_xmlformat_to_vjournal(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, void *userdata, OSyncError **error) Modified: format-plugins/vformat/src/xmlformat-vnote.c ============================================================================== --- format-plugins/vformat/src/xmlformat-vnote.c Thu Sep 17 19:02:06 2009 (r5783) +++ format-plugins/vformat/src/xmlformat-vnote.c Thu Sep 17 19:02:46 2009 (r5784) @@ -71,17 +71,25 @@ *output = (char *)xmlformat; *outpsize = osync_xmlformat_size(); - osync_xmlformat_sort(xmlformat); + if (!osync_xmlformat_sort(xmlformat, error)) + goto error; unsigned int size; char *str; - osync_xmlformat_assemble(xmlformat, &str, &size); + + if (!osync_xmlformat_assemble(xmlformat, &str, &size, error)) + goto error; + osync_trace(TRACE_SENSITIVE, "... Output XMLFormat is: \n%s", str); g_free(str); vformat_free(vnote); osync_trace(TRACE_EXIT, "%s: TRUE", __func__); return TRUE; + +error: + osync_trace(TRACE_EXIT, "%s: %s", __func__, osync_error_print(error)); + return FALSE; } static VFormatAttribute *handle_xml_body_attribute(VFormat *vnote, OSyncXMLField *xmlfield, const char *encoding) @@ -131,7 +139,10 @@ OSyncXMLFormat *xmlformat = (OSyncXMLFormat *)input; unsigned int size; char *str; - osync_xmlformat_assemble(xmlformat, &str, &size); + + if (!osync_xmlformat_assemble(xmlformat, &str, &size, error)) + goto error; + osync_trace(TRACE_SENSITIVE, "Input XMLFormat is:\n%s", str); g_free(str); @@ -163,6 +174,10 @@ osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; + +error: + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + return FALSE; } osync_bool conv_xmlformat_to_vnote(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, void *userdata, OSyncError **error) |