From: <dg...@su...> - 2009-01-04 22:35:51
|
Author: dgollub Date: Sun Jan 4 22:36:18 2009 New Revision: 5004 URL: http://www.opensync.org/changeset/5004 Log: Porting mock-format plugin and file-format plugin to merger/demerge function API changes. Modified: trunk/formats/file.c trunk/tests/mock-plugin/mock_format.c Modified: trunk/formats/file.c ============================================================================== --- trunk/formats/file.c Sun Jan 4 22:35:17 2009 (r5003) +++ trunk/formats/file.c Sun Jan 4 22:36:18 2009 (r5004) @@ -164,29 +164,29 @@ return printable; } -static osync_bool marshal_file(const char *input, unsigned int inpsize, OSyncMessage *message, OSyncError **error) +static osync_bool marshal_file(const char *input, unsigned int inpsize, OSyncMarshal *marshal, OSyncError **error) { OSyncFileFormat *file = (OSyncFileFormat *)input; - osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p)", __func__, input, inpsize, message, error); + osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p)", __func__, input, inpsize, marshal, error); - osync_message_write_string(message, file->path); - osync_message_write_buffer(message, file->data, file->size); + osync_marshal_write_string(marshal, file->path); + osync_marshal_write_buffer(marshal, file->data, file->size); osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; } -static osync_bool demarshal_file(OSyncMessage *message, char **output, unsigned int *outpsize, OSyncError **error) +static osync_bool demarshal_file(OSyncMarshal *marshal, char **output, unsigned int *outpsize, OSyncError **error) { OSyncFileFormat *file = NULL; - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, message, output, outpsize, error); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, marshal, output, outpsize, error); file = osync_try_malloc0(sizeof(OSyncFileFormat), error); if (!file) goto error; - osync_message_read_string(message, &(file->path)); - osync_message_read_buffer(message, (void *)&(file->data), (int *)&(file->size)); + osync_marshal_read_string(marshal, &(file->path)); + osync_marshal_read_buffer(marshal, (void *)&(file->data), (int *)&(file->size)); *output = (char *)file; *outpsize = sizeof(OSyncFileFormat); Modified: trunk/tests/mock-plugin/mock_format.c ============================================================================== --- trunk/tests/mock-plugin/mock_format.c Sun Jan 4 22:35:17 2009 (r5003) +++ trunk/tests/mock-plugin/mock_format.c Sun Jan 4 22:36:18 2009 (r5004) @@ -198,28 +198,28 @@ return printable; } -static osync_bool marshal_file(const char *input, unsigned int inpsize, OSyncMessage *message, OSyncError **error) +static osync_bool marshal_file(const char *input, unsigned int inpsize, OSyncMarshal *marshal, OSyncError **error) { - osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p)", __func__, input, inpsize, message, error); + osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p)", __func__, input, inpsize, marshal, error); OSyncFileFormat *file = (OSyncFileFormat *)input; - osync_message_write_string(message, file->path); - osync_message_write_buffer(message, file->data, file->size); + osync_marshal_write_string(marshal, file->path); + osync_marshal_write_buffer(marshal, file->data, file->size); osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; } -static osync_bool demarshal_file(OSyncMessage *message, char **output, unsigned int *outpsize, OSyncError **error) +static osync_bool demarshal_file(OSyncMarshal *marshal, char **output, unsigned int *outpsize, OSyncError **error) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, message, output, outpsize, error); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, marshal, output, outpsize, error); OSyncFileFormat *file = osync_try_malloc0(sizeof(OSyncFileFormat), error); osync_assert(file); - osync_message_read_string(message, &(file->path)); - osync_message_read_buffer(message, (void *)&(file->data), (int *)&(file->size)); + osync_marshal_read_string(marshal, &(file->path)); + osync_marshal_read_buffer(marshal, (void *)&(file->data), (int *)&(file->size)); *output = (char *)file; *outpsize = sizeof(OSyncFileFormat); |