From: <svn...@op...> - 2009-09-17 18:29:42
|
Author: dgollub Date: Thu Sep 17 20:29:33 2009 New Revision: 5786 URL: http://www.opensync.org/changeset/5786 Log: Reference port of the example format plugin for the OSyncFormatFinalizeFunc, OSyncFormatCompareFunc, OSyncFormatCreateFunc, OSyncFormatDestroyFunc, OSyncFormatPrintFunc API changes. See commit r5785 Modified: trunk/docs/examples/plugins/src/format.c Modified: trunk/docs/examples/plugins/src/format.c ============================================================================== --- trunk/docs/examples/plugins/src/format.c Thu Sep 17 20:26:15 2009 (r5785) +++ trunk/docs/examples/plugins/src/format.c Thu Sep 17 20:29:33 2009 (r5786) @@ -14,7 +14,7 @@ } converter_data; -static OSyncConvCmpResult compare_format1(const char *leftdata, unsigned int leftsize, const char *rightdata, unsigned int rightsize, void *data) +static OSyncConvCmpResult compare_format1(const char *leftdata, unsigned int leftsize, const char *rightdata, unsigned int rightsize, void *data, OSyncError **error) { /* * This function can be used to compare two types of your formats. @@ -41,6 +41,10 @@ * return OSYNC_CONV_DATA_MISMATCH; * This means the objects are not the same and not similar. * + * return OSYNC_CONV_DATA_UNKNOWN; + * On any error, and set parameter error with a human readable error + * message. + * */ return OSYNC_CONV_DATA_MISMATCH; } @@ -97,12 +101,14 @@ return TRUE; } -static void destroy_format1(char *input, unsigned int size, void *data) +static osync_bool destroy_format1(char *input, unsigned int size, void *data, OSyncError **error) { /* * Here you have to free the data allocated by your format * */ + + return TRUE; } static osync_bool duplicate_format1(const char *uid, const char *input, unsigned int insize, char **newuid, char **output, unsigned int *outsize, osync_bool *dirty, void *data, OSyncError **error) @@ -120,7 +126,7 @@ return TRUE; } -static char *print_format1(const char *data, unsigned int size, void *user_data) +static char *print_format1(const char *data, unsigned int size, void *user_data, OSyncError **error) { /* * If your format is not in a human printable format already @@ -143,11 +149,13 @@ return (void *)format_specific_data; } -void finialize_format1(void *data) { +osync_bool finialize_format1(void *data, OSyncError **error) { /* * Release all format data */ osync_free(data); + + return TRUE; } osync_bool get_format_info(OSyncFormatEnv *env, OSyncError **error) |