From: <svn...@op...> - 2010-09-08 02:50:20
|
Author: cdfrey Date: Wed Sep 8 04:50:10 2010 New Revision: 6120 URL: http://www.opensync.org/changeset/6120 Log: API and compile changes Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Mon Sep 6 01:22:51 2010 (r6119) +++ format-plugins/xsltformat/src/xsltformat.c Wed Sep 8 04:50:10 2010 (r6120) @@ -45,7 +45,7 @@ if ((result = xslt_transform(converter, input))) goto exit; - if (!(*output = strdup(converter->xml_str))) + if (!(*output = strdup((char*)converter->xml_str))) goto exit; *free_input = TRUE; @@ -68,7 +68,7 @@ if ((result = xslt_transform(converter, input))) goto exit; - if (!(*output = strdup(converter->xml_str))) + if (!(*output = strdup((char*)converter->xml_str))) goto exit; *free_input = TRUE; @@ -83,13 +83,14 @@ } +/* static void destroy_format1(char *input, unsigned int inpsize, void *user_data) { - /* - * Here you have to free the data allocated by your format - * - */ + // + // Here you have to free the data allocated by your format + // } +*/ osync_bool get_format_info(OSyncFormatEnv *env, OSyncError **error) { @@ -97,7 +98,8 @@ if (!format) return FALSE; - osync_format_env_register_objformat(env, format); + if( !osync_format_env_register_objformat(env, format, error) ) + return FALSE; osync_objformat_unref(format); return TRUE; @@ -118,15 +120,15 @@ } -void finalize_xslt(void *userdata) +static osync_bool finalize_xslt(void *userdata, OSyncError **error) { struct xslt_resources *converter = NULL; if (!userdata) - return; + return FALSE; converter = (struct xslt_resources *)userdata; xslt_delete(converter); - + return TRUE; } static osync_bool reg_conv(OSyncFormatEnv *env, @@ -140,15 +142,22 @@ from, to, convert_func, &error); if (!conv) - return FALSE; + goto error; osync_converter_set_initialize_func(conv, initialize_func); osync_converter_set_finalize_func(conv, finalize_func); - osync_format_env_register_converter(env, conv); + if( !osync_format_env_register_converter(env, conv, &error) ) + goto error; osync_converter_unref(conv); return TRUE; +error: + if( conv ) + osync_converter_unref(conv); + osync_trace(TRACE_INTERNAL, "%s", osync_error_print(&error)); + osync_error_unref(&error); + return FALSE; } osync_bool get_conversion_info(OSyncFormatEnv *env, OSyncError **error) |