From: <svn...@op...> - 2009-03-29 21:46:36
|
Author: dgollub Date: Sun Mar 29 23:46:29 2009 New Revision: 5433 URL: http://www.opensync.org/changeset/5433 Log: Ported file-sync plugin to OSyncObjTypeSinkFunctions API change (r5432) refs #1086 Modified: plugins/file-sync/src/file_sync.c Modified: plugins/file-sync/src/file_sync.c ============================================================================== --- plugins/file-sync/src/file_sync.c Sun Mar 29 23:44:10 2009 (r5432) +++ plugins/file-sync/src/file_sync.c Sun Mar 29 23:46:29 2009 (r5433) @@ -564,19 +564,16 @@ } /* All sinks have the same functions of course */ - OSyncObjTypeSinkFunctions functions; - memset(&functions, 0, sizeof(functions)); - functions.connect = osync_filesync_connect; - functions.get_changes = osync_filesync_get_changes; - functions.commit = osync_filesync_commit_change; - functions.read = osync_filesync_read; - functions.write = osync_filesync_write; - functions.sync_done = osync_filesync_sync_done; + osync_objtype_sink_set_connect_func(dir->sink, osync_filesync_connect); + osync_objtype_sink_set_get_changes_func(dir->sink, osync_filesync_get_changes); + osync_objtype_sink_set_commit_func(dir->sink, osync_filesync_commit_change); + osync_objtype_sink_set_read_func(dir->sink, osync_filesync_read); + osync_objtype_sink_set_write_func(dir->sink, osync_filesync_write); + osync_objtype_sink_set_sync_done_func(dir->sink, osync_filesync_sync_done); /* We pass the OSyncFileDir object to the sink, so we dont have to look it up * again once the functions are called */ - osync_objtype_sink_set_functions(dir->sink, functions, dir); - + osync_objtype_sink_set_userdata(dir->sink, dir); /* Request an anchor from the framework. */ osync_objtype_sink_enable_anchor(dir->sink, TRUE); |