From: <svn...@op...> - 2009-03-27 08:24:30
|
Author: bricks Date: Fri Mar 27 09:24:18 2009 New Revision: 5357 URL: http://www.opensync.org/changeset/5357 Log: removed osync_plugin_info_get_sink and osync_objtype_sink_get_slowsync from the public api Added: trunk/opensync/plugin/opensync_plugin_info_internals.h Modified: trunk/opensync.sym trunk/opensync/client/opensync_client.c trunk/opensync/engine/opensync_obj_engine.c trunk/opensync/plugin/opensync_objtype_sink.c trunk/opensync/plugin/opensync_objtype_sink.h trunk/opensync/plugin/opensync_objtype_sink_internals.h trunk/opensync/plugin/opensync_plugin_info.h trunk/tests/mock-plugin/mock_sync.c trunk/tools/osyncplugin.c trunk/wrapper/opensync-plugin.i Modified: trunk/opensync.sym ============================================================================== --- trunk/opensync.sym Thu Mar 26 22:30:35 2009 (r5356) +++ trunk/opensync.sym Fri Mar 27 09:24:18 2009 (r5357) @@ -390,7 +390,6 @@ osync_objtype_sink_get_objformat_sinks osync_objtype_sink_get_preferred_format osync_objtype_sink_get_read -osync_objtype_sink_get_slowsync osync_objtype_sink_get_write osync_objtype_sink_is_available osync_objtype_sink_is_enabled @@ -554,7 +553,6 @@ osync_plugin_info_get_groupname osync_plugin_info_get_loop osync_plugin_info_get_main_sink -osync_plugin_info_get_sink osync_plugin_info_get_version osync_plugin_info_new osync_plugin_info_nth_objtype Modified: trunk/opensync/client/opensync_client.c ============================================================================== --- trunk/opensync/client/opensync_client.c Thu Mar 26 22:30:35 2009 (r5356) +++ trunk/opensync/client/opensync_client.c Fri Mar 27 09:24:18 2009 (r5357) @@ -25,6 +25,7 @@ #include "opensync-plugin.h" #include "plugin/opensync_plugin_internals.h" #include "plugin/opensync_objtype_sink_internals.h" +#include "plugin/opensync_plugin_info_internals.h" #include "opensync-ipc.h" #include "ipc/opensync_serializer_internals.h" Modified: trunk/opensync/engine/opensync_obj_engine.c ============================================================================== --- trunk/opensync/engine/opensync_obj_engine.c Thu Mar 26 22:30:35 2009 (r5356) +++ trunk/opensync/engine/opensync_obj_engine.c Fri Mar 27 09:24:18 2009 (r5357) @@ -1211,7 +1211,7 @@ OSyncSinkEngine *osync_obj_engine_find_proxy_sinkengine(OSyncObjEngine *engine, OSyncClientProxy *proxy) { OSyncList *s; - OSyncSinkEngine *sinkengine; + OSyncSinkEngine *sinkengine = NULL; osync_return_val_if_fail(engine, NULL); osync_return_val_if_fail(proxy, NULL); Modified: trunk/opensync/plugin/opensync_objtype_sink.c ============================================================================== --- trunk/opensync/plugin/opensync_objtype_sink.c Thu Mar 26 22:30:35 2009 (r5356) +++ trunk/opensync/plugin/opensync_objtype_sink.c Fri Mar 27 09:24:18 2009 (r5357) @@ -29,6 +29,7 @@ #include "opensync_plugin_info.h" /* due to osync_plugin_info_get_configdir() */ #include "opensync_objtype_sink.h" +#include "opensync_objtype_sink_internals.h" #include "opensync_objtype_sink_private.h" OSyncObjTypeSink *osync_objtype_main_sink_new(OSyncError **error) Modified: trunk/opensync/plugin/opensync_objtype_sink.h ============================================================================== --- trunk/opensync/plugin/opensync_objtype_sink.h Thu Mar 26 22:30:35 2009 (r5356) +++ trunk/opensync/plugin/opensync_objtype_sink.h Fri Mar 27 09:24:18 2009 (r5357) @@ -319,24 +319,6 @@ */ OSYNC_EXPORT void osync_objtype_sink_set_read(OSyncObjTypeSink *sink, osync_bool read); - -/** @brief Checks if slow-sync has been requested - * - * When slow-sync is requested, OpenSync synchronizes all entries rather than - * just the changes. - * - * If you are using hashtables, you should call this function in your sink's - * get_changes() function and if slow-sync has been requested, call - * osync_hashtable_slowsync() on your hashtable. If you don't do this, OpenSync - * will assume that all entries should be deleted, which is usually not what - * the user wants. - * - * @param sink Pointer to the sink - * @returns TRUE if slow-sync has been requested, FALSE for normal sync - * - */ -OSYNC_EXPORT osync_bool osync_objtype_sink_get_slowsync(OSyncObjTypeSink *sink); - /** @brief Sets the slow-sync state of a sink * * When slow-sync is requested, OpenSync synchronizes all entries rather than Modified: trunk/opensync/plugin/opensync_objtype_sink_internals.h ============================================================================== --- trunk/opensync/plugin/opensync_objtype_sink_internals.h Thu Mar 26 22:30:35 2009 (r5356) +++ trunk/opensync/plugin/opensync_objtype_sink_internals.h Fri Mar 27 09:24:18 2009 (r5357) @@ -272,6 +272,23 @@ */ void *osync_objtype_sink_get_userdata(OSyncObjTypeSink *sink); +/** @brief Checks if slow-sync has been requested + * + * When slow-sync is requested, OpenSync synchronizes all entries rather than + * just the changes. + * + * If you are using hashtables, you should call this function in your sink's + * get_changes() function and if slow-sync has been requested, call + * osync_hashtable_slowsync() on your hashtable. If you don't do this, OpenSync + * will assume that all entries should be deleted, which is usually not what + * the user wants. + * + * @param sink Pointer to the sink + * @returns TRUE if slow-sync has been requested, FALSE for normal sync + * + */ +osync_bool osync_objtype_sink_get_slowsync(OSyncObjTypeSink *sink); + /*@}*/ #endif /*OPENSYNC_SINK_INTERNALS_H_*/ Modified: trunk/opensync/plugin/opensync_plugin_info.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin_info.h Thu Mar 26 22:30:35 2009 (r5356) +++ trunk/opensync/plugin/opensync_plugin_info.h Fri Mar 27 09:24:18 2009 (r5357) @@ -170,15 +170,6 @@ */ OSYNC_EXPORT void osync_plugin_info_set_format_env(OSyncPluginInfo *info, OSyncFormatEnv *env); - -/** @brief Returns the currently running sink - * - * @param info Pointer to the plugin info object - * @returns the current sink - * - */ -OSYNC_EXPORT OSyncObjTypeSink *osync_plugin_info_get_sink(OSyncPluginInfo *info); - /** @brief Sets the current OSyncObjTypeSink * * @param info Pointer to the plugin info object Added: trunk/opensync/plugin/opensync_plugin_info_internals.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/opensync/plugin/opensync_plugin_info_internals.h Fri Mar 27 09:24:18 2009 (r5357) @@ -0,0 +1,42 @@ +/* + * libopensync - A synchronization framework + * Copyright (C) 2009 Bjoern Ricks <bjo...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _OPENSYNC_PLUGIN_INFO_INTERNALS_H_ +#define _OPENSYNC_PLUGIN_INFO_INTERNALS_H_ + +/** + * @defgroup OSyncPluginInfoInternalAPI OpenSync Plugin Info Internals + * @ingroup OSyncPluginPrivate + */ + +/*@{*/ + +/** @brief Returns the currently running sink + * + * @param info Pointer to the plugin info object + * @returns the current sink + * + */ +OSyncObjTypeSink *osync_plugin_info_get_sink(OSyncPluginInfo *info); + +/*@}*/ + + +#endif /* _OPENSYNC_PLUGIN_INFO_INTERNALS_H_ */ Modified: trunk/tests/mock-plugin/mock_sync.c ============================================================================== --- trunk/tests/mock-plugin/mock_sync.c Thu Mar 26 22:30:35 2009 (r5356) +++ trunk/tests/mock-plugin/mock_sync.c Fri Mar 27 09:24:18 2009 (r5357) @@ -278,7 +278,7 @@ * start with a slash. See note above. * */ -static void mock_report_dir(MockDir *directory, const char *subdir, OSyncContext *ctx, OSyncPluginInfo *info) +static void mock_report_dir(MockDir *directory, const char *subdir, OSyncContext *ctx, OSyncPluginInfo *info, OSyncObjTypeSink *sink) { GError *gerror = NULL; const char *de = NULL; @@ -286,10 +286,7 @@ GDir *dir = NULL; OSyncError *error = NULL; - osync_trace(TRACE_ENTRY, "%s(%p, %s, %p)", __func__, directory, subdir, ctx); - - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - osync_assert(sink); + osync_trace(TRACE_ENTRY, "%s(%p, %s, %p, %p)", __func__, directory, subdir, ctx, sink); OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); osync_assert(formatenv); @@ -403,14 +400,14 @@ if (mock_get_error(info->memberid, "GET_CHANGES_TIMEOUT2")) g_usleep(8*G_USEC_PER_SEC); - if (osync_objtype_sink_get_slowsync(sink)) { + if (slow_sync) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); osync_assert(osync_hashtable_slowsync(dir->hashtable, &error)); } osync_trace(TRACE_INTERNAL, "get_changes for %s", osync_objtype_sink_get_name(sink)); - mock_report_dir(dir, NULL, ctx, info); + mock_report_dir(dir, NULL, ctx, info, sink); OSyncList *u, *uids = osync_hashtable_get_deleted(dir->hashtable); for (u = uids; u; u = u->next) { Modified: trunk/tools/osyncplugin.c ============================================================================== --- trunk/tools/osyncplugin.c Thu Mar 26 22:30:35 2009 (r5356) +++ trunk/tools/osyncplugin.c Fri Mar 27 09:24:18 2009 (r5357) @@ -648,6 +648,7 @@ goto error; } + /* if (osync_objtype_sink_get_slowsync(sink)) { printf("SlowSync got requested by CONNECT function"); if (osync_objtype_sink_get_name(sink)) @@ -655,6 +656,7 @@ printf(".\n"); } + */ g_mutex_lock(cmd->mutex); g_cond_signal(cmd->cond); Modified: trunk/wrapper/opensync-plugin.i ============================================================================== --- trunk/wrapper/opensync-plugin.i Thu Mar 26 22:30:35 2009 (r5356) +++ trunk/wrapper/opensync-plugin.i Fri Mar 27 09:24:18 2009 (r5357) @@ -224,13 +224,6 @@ osync_plugin_info_set_format_env(self, env); } - ObjTypeSink *get_sink() { - ObjTypeSink *ret = osync_plugin_info_get_sink(self); - if (ret) - osync_objtype_sink_ref(ret); - return ret; - } - void set_sink(ObjTypeSink *sink) { osync_plugin_info_set_sink(self, sink); } @@ -444,11 +437,7 @@ void set_read(bool read) { osync_objtype_sink_set_read(self, read); } - - bool get_slowsync() { - return osync_objtype_sink_get_slowsync(self); - } - + void set_slowsync(bool slowsync) { osync_objtype_sink_set_slowsync(self, slowsync); } |