|
From: <svn...@op...> - 2009-11-05 18:56:49
|
Author: dgollub Date: Thu Nov 5 19:56:39 2009 New Revision: 5936 URL: http://www.opensync.org/changeset/5936 Log: By default the format-plugin should fail on any conversion, otherwise this cause unexpected conversion path once the example format plugin got installed in the system-environment Modified: trunk/docs/examples/plugins/src/format.c Modified: trunk/docs/examples/plugins/src/format.c ============================================================================== --- trunk/docs/examples/plugins/src/format.c Thu Nov 5 19:44:57 2009 (r5935) +++ trunk/docs/examples/plugins/src/format.c Thu Nov 5 19:56:39 2009 (r5936) @@ -90,7 +90,13 @@ * */ - return TRUE; + /* XXX: your conversion code */ + /* return TRUE; */ + + + /* on any conversion error: */ + osync_error_set(error, OSYNC_ERROR_CONVERT, "Conversion of format1 to format2 failed."); + return FALSE; } static osync_bool conv_format2_to_format1(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, void *userdata, OSyncError **error) @@ -102,7 +108,13 @@ * */ - return TRUE; + /* XXX: your conversion code */ + /* return TRUE; */ + + + /* on any conversion error: */ + osync_error_set(error, OSYNC_ERROR_CONVERT, "Conversion of format2 to format1 failed."); + return FALSE; } static osync_bool destroy_format1(char *input, unsigned int size, void *data, OSyncError **error) |