Re: [PATCH]: rename plugin set_xxx callbacks to use _func suffix
Chris Frey <cdfrey <at> foursquare.net>
2011-09-02 20:53:13 GMT
Merged. Thanks!
- Chris
On Sat, Aug 27, 2011 at 05:55:19PM -0300, Luiz Angelo Daros de Luca wrote:
> Chris,
>
> Now I createad all github repos, each project patch and I'm submitting
> the rename again:
>
> git://github.com/luizluca/opensync-akonadi.git
> git://github.com/luizluca/opensync-barry.git
> git://github.com/luizluca/opensync-evolution2.git
> git://github.com/luizluca/opensync-file-sync.git
> git://github.com/luizluca/opensync-google-calendar.git
> git://github.com/luizluca/opensync-kdepim.git
> git://github.com/luizluca/opensync-luizluca.git
>
> All using branch rename_plugin_callbacks
>
> Is it the best way to submit patches?
>
> Regards,
>
> ---
> ?? ???? Luiz Angelo Daros de Luca, Me.
> ?? ?? ?? ?? ?? ?? luizluca <at> gmail.com
>
>
>
> 2011/7/3 Luiz Angelo Daros de Luca <luizluca <at> gmail.com>:
> > Hello Chris,
> >
> > I'm back online (back from FISL12). Maybe in the future I can present
> > some stuff about opensync on it
> >
> > git://github.com/luizluca/opensync-luizluca.git branch rename_plugin_callbacks
> >
> > I also have some other branches on it that I might discuss in the
> > future. I don't know how I could proceed with the plugin's code. The
> > fix on them is trivial.
> >
> > Feel free to comment the patch.
> >
> > Regards,
> >
> > ---
> > ?? ???? Luiz Angelo Daros de Luca, Me.
> > ?? ?? ?? ?? ?? ?? luizluca <at> gmail.com
> >
> >
> >
> > 2011/6/30 Chris Frey <cdfrey <at> foursquare.net>:
> >> Hi Luiz,
> >>
> >> Talk about dropping the ball on this one. ??Sorry about that.
> >> Just getting to this now.
> >>
> >> Unfortunately, the patch is encoded as utf-8, and even when using
> >> utf-8 here, git am complains.
> >>
> >> Seems to be using odd characters on the tabs, or the context lines of
> >> the diff.
> >>
> >> Could you send the patch again, or even better, point me to your git
> >> repo?
> >>
> >> Thanks
> >> - Chris
> >>
> >>
> >>
> >> On Fri, Jun 10, 2011 at 03:10:53AM -0300, Luiz Angelo Daros de Luca wrote:
> >>> Renames the methods that define plugin callbacks:
> >>>
> >>> osync_plugin_set_initialize??->??osync_plugin_set_initialize_func
> >>> osync_plugin_set_finalize??->??osync_plugin_set_finalize_func
> >>> osync_plugin_set_discover??->??osync_plugin_set_discover_func
> >>>
> >>> This makes the callback definition methods similar to the respective
> >>> methods in plugin, format and sink.
> >>>
> >>>
> >>> >From 625b78ba3888ed99235ff71a07e656f4b29d6909 Mon Sep 17 00:00:00 2001
> >>> From: Luiz Angelo Daros de Luca <luizluca <at> gmail.com>
> >>> Date: Wed, 8 Jun 2011 03:34:45 -0300
> >>> Subject: [PATCH 1/1] - Renamed osync_plugin_set_xxx callbacks function
> >>> to use _func suffix
> >>>
> >>> Signed-off-by: Luiz Angelo Daros de Luca <luizluca <at> gmail.com>
> >>> ---
> >>> ??docs/examples/plugins/src/external_demo.c ?? ?? ?? ?? ??| ?? ??6 ++--
> >>> ??docs/examples/plugins/src/plugin.c ?? ?? ?? ?? ?? ?? ?? ?? | ?? ??6 ++--
> >>> ??docs/examples/plugins/src/simple_plugin.c ?? ?? ?? ?? ??| ?? ??6 ++--
> >>> ??.../plugins/src/simple_plugin_static_caps.c ?? ?? ?? ??| ?? ??6 ++--
> >>> ??opensync/plugin/opensync_plugin.c ?? ?? ?? ?? ?? ?? ?? ?? ??| ?? ??6 ++--
> >>> ??opensync/plugin/opensync_plugin.h ?? ?? ?? ?? ?? ?? ?? ?? ??| ?? ??6 ++--
> >>> ??tests/engine-tests/check_engine.c ?? ?? ?? ?? ?? ?? ?? ?? ??| ?? 28 ++++++++++----------
> >>> ??tests/engine-tests/check_engine_error.c ?? ?? ?? ?? ?? ??| ?? ??8 +++---
> >>> ??tests/mock-plugin/mock_sync.c ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??| ?? ??6 ++--
> >>> ??9 files changed, 39 insertions(+), 39 deletions(-)
> >>> diff --git a/docs/examples/plugins/src/external_demo.c
> >>> b/docs/examples/plugins/src/external_demo.c
> >>> index adfbd5e..df59d6d 100644
> >>> --- a/docs/examples/plugins/src/external_demo.c
> >>> +++ b/docs/examples/plugins/src/external_demo.c
> >>> @@ -122,9 +122,9 @@ int main(int argc, char **argv)
> >>> ?? if (!plugin)
> >>> ?? goto error;
> >>>
> >>> - osync_plugin_set_initialize(plugin, initialize);
> >>> - osync_plugin_set_finalize(plugin, finalize);
> >>> - osync_plugin_set_discover(plugin, discover);
> >>> + osync_plugin_set_initialize_func(plugin, initialize);
> >>> + osync_plugin_set_finalize_func(plugin, finalize);
> >>> + osync_plugin_set_discover_func(plugin, discover);
> >>>
> >>>
> >>> ?? /** Client */
> >>> diff --git a/docs/examples/plugins/src/plugin.c
> >>> b/docs/examples/plugins/src/plugin.c
> >>> index eb3edb5..99dcdbf 100644
> >>> --- a/docs/examples/plugins/src/plugin.c
> >>> +++ b/docs/examples/plugins/src/plugin.c
> >>> @@ -402,9 +402,9 @@ osync_bool get_sync_info(OSyncPluginEnv
> >>> *pluginenv, OSyncError **error)
> >>> ?? osync_plugin_set_description(plugin, "A longer description. < 200 chars");
> >>>
> >>> ?? //Now set the function we made earlier
> >>> - osync_plugin_set_initialize(plugin, initialize);
> >>> - osync_plugin_set_finalize(plugin, finalize);
> >>> - osync_plugin_set_discover(plugin, discover);
> >>> + osync_plugin_set_initialize_func(plugin, initialize);
> >>> + osync_plugin_set_finalize_func(plugin, finalize);
> >>> + osync_plugin_set_discover_func(plugin, discover);
> >>>
> >>> ?? if (!osync_plugin_env_register_plugin(pluginenv, plugin, error))
> >>> ?? goto error;
> >>> diff --git a/docs/examples/plugins/src/simple_plugin.c
> >>> b/docs/examples/plugins/src/simple_plugin.c
> >>> index 0b37770..313d859 100644
> >>> --- a/docs/examples/plugins/src/simple_plugin.c
> >>> +++ b/docs/examples/plugins/src/simple_plugin.c
> >>> @@ -322,9 +322,9 @@ osync_bool get_sync_info(OSyncPluginEnv *env,
> >>> OSyncError **error)
> >>> ?? osync_plugin_set_description(plugin, "A longer description. < 200 chars");
> >>>
> >>> ?? //Now set the function we made earlier
> >>> - osync_plugin_set_initialize(plugin, initialize);
> >>> - osync_plugin_set_finalize(plugin, finalize);
> >>> - osync_plugin_set_discover(plugin, discover);
> >>> + osync_plugin_set_initialize_func(plugin, initialize);
> >>> + osync_plugin_set_finalize_func(plugin, finalize);
> >>> + osync_plugin_set_discover_func(plugin, discover);
> >>>
> >>> ?? if (!osync_plugin_env_register_plugin(env, plugin, error))
> >>> ?? goto error;
> >>> diff --git a/docs/examples/plugins/src/simple_plugin_static_caps.c
> >>> b/docs/examples/plugins/src/simple_plugin_static_caps.c
> >>> index c70847d..091fcfc 100644
> >>> --- a/docs/examples/plugins/src/simple_plugin_static_caps.c
> >>> +++ b/docs/examples/plugins/src/simple_plugin_static_caps.c
> >>> @@ -321,9 +321,9 @@ osync_bool get_sync_info(OSyncPluginEnv *env,
> >>> OSyncError **error)
> >>> ?? osync_plugin_set_description(plugin, "A longer description. < 200 chars");
> >>>
> >>> ?? //Now set the function we made earlier
> >>> - osync_plugin_set_initialize(plugin, initialize);
> >>> - osync_plugin_set_finalize(plugin, finalize);
> >>> - osync_plugin_set_discover(plugin, discover);
> >>> + osync_plugin_set_initialize_func(plugin, initialize);
> >>> + osync_plugin_set_finalize_func(plugin, finalize);
> >>> + osync_plugin_set_discover_func(plugin, discover);
> >>>
> >>> ?? if (!osync_plugin_env_register_plugin(env, plugin, error))
> >>> ?? goto error;
> >>> diff --git a/opensync/plugin/opensync_plugin.c
> >>> b/opensync/plugin/opensync_plugin.c
> >>> index b22200d..3afb93a 100644
> >>> --- a/opensync/plugin/opensync_plugin.c
> >>> +++ b/opensync/plugin/opensync_plugin.c
> >>> @@ -165,20 +165,20 @@ void osync_plugin_set_start_type(OSyncPlugin
> >>> *plugin, OSyncStartType start_type)
> >>> ?? plugin->start_type = start_type;
> >>> ??}
> >>>
> >>> -void osync_plugin_set_initialize(OSyncPlugin *plugin, initialize_fn init)
> >>> +void osync_plugin_set_initialize_func(OSyncPlugin *plugin, initialize_fn init)
> >>> ??{
> >>> ?? osync_assert(plugin);
> >>> ?? plugin->initialize = init;
> >>> ??}
> >>>
> >>> -void osync_plugin_set_finalize(OSyncPlugin *plugin, finalize_fn fin)
> >>> +void osync_plugin_set_finalize_func(OSyncPlugin *plugin, finalize_fn fin)
> >>> ??{
> >>> ?? osync_assert(plugin);
> >>>
> >>> ?? plugin->finalize = fin;
> >>> ??}
> >>>
> >>> -void osync_plugin_set_discover(OSyncPlugin *plugin, discover_fn discover)
> >>> +void osync_plugin_set_discover_func(OSyncPlugin *plugin, discover_fn discover)
> >>> ??{
> >>> ?? osync_assert(plugin);
> >>> ?? plugin->discover = discover;
> >>> diff --git a/opensync/plugin/opensync_plugin.h
> >>> b/opensync/plugin/opensync_plugin.h
> >>> index dcfb19e..2ce79e3 100644
> >>> --- a/opensync/plugin/opensync_plugin.h
> >>> +++ b/opensync/plugin/opensync_plugin.h
> >>> @@ -210,7 +210,7 @@ OSYNC_EXPORT void
> >>> osync_plugin_set_description(OSyncPlugin *plugin, const char *
> >>> ?? * @param plugin Pointer to the plugin
> >>> ?? * @param init The initialize function for the plugin
> >>> ?? */
> >>> -OSYNC_EXPORT void osync_plugin_set_initialize(OSyncPlugin *plugin,
> >>> initialize_fn init);
> >>> +OSYNC_EXPORT void osync_plugin_set_initialize_func(OSyncPlugin
> >>> *plugin, initialize_fn init);
> >>>
> >>> ??/** @brief Sets the finalize function for a plugin
> >>> ?? *
> >>> @@ -220,7 +220,7 @@ OSYNC_EXPORT void
> >>> osync_plugin_set_initialize(OSyncPlugin *plugin, initialize_fn
> >>> ?? * @param plugin Pointer to the plugin
> >>> ?? * @param fin The finalize function for the plugin
> >>> ?? */
> >>> -OSYNC_EXPORT void osync_plugin_set_finalize(OSyncPlugin *plugin,
> >>> finalize_fn fin);
> >>> +OSYNC_EXPORT void osync_plugin_set_finalize_func(OSyncPlugin *plugin,
> >>> finalize_fn fin);
> >>>
> >>> ??/** @brief Sets the optional discover function for a plugin
> >>> ?? *
> >>> @@ -234,7 +234,7 @@ OSYNC_EXPORT void
> >>> osync_plugin_set_finalize(OSyncPlugin *plugin, finalize_fn fin
> >>> ?? * @param plugin Pointer to the plugin
> >>> ?? * @param discover The discover function for the plugin
> >>> ?? */
> >>> -OSYNC_EXPORT void osync_plugin_set_discover(OSyncPlugin *plugin,
> >>> discover_fn discover);
> >>> +OSYNC_EXPORT void osync_plugin_set_discover_func(OSyncPlugin *plugin,
> >>> discover_fn discover);
> >>>
> >>>
> >>> ??/** @brief Returns the plugin_info data, set by the plugin
> >>> diff --git a/tests/engine-tests/check_engine.c
> >>> b/tests/engine-tests/check_engine.c
> >>> index b7cb9e5..03bf2e8 100644
> >>> --- a/tests/engine-tests/check_engine.c
> >>> +++ b/tests/engine-tests/check_engine.c
> >>> @@ -289,8 +289,8 @@ static OSyncDebugGroup *_create_group(char *testbed)
> >>> ?? osync_plugin_set_start_type(debug->plugin, OSYNC_START_TYPE_EXTERNAL);
> >>> ?? osync_plugin_set_config_type(debug->plugin, OSYNC_PLUGIN_NO_CONFIGURATION);
> >>>
> >>> - osync_plugin_set_initialize(debug->plugin, initialize);
> >>> - osync_plugin_set_finalize(debug->plugin, finalize);
> >>> + osync_plugin_set_initialize_func(debug->plugin, initialize);
> >>> + osync_plugin_set_finalize_func(debug->plugin, finalize);
> >>>
> >>> ?? debug->client1 = osync_client_new(&error);
> >>> ?? fail_unless(debug->client1 != NULL, NULL);
> >>> @@ -636,8 +636,8 @@ static OSyncDebugGroup *_create_group2(char *testbed)
> >>> ?? osync_plugin_set_start_type(debug->plugin, OSYNC_START_TYPE_EXTERNAL);
> >>> ?? osync_plugin_set_config_type(debug->plugin, OSYNC_PLUGIN_NO_CONFIGURATION);
> >>>
> >>> - osync_plugin_set_initialize(debug->plugin, initialize_multi);
> >>> - osync_plugin_set_finalize(debug->plugin, finalize_multi);
> >>> + osync_plugin_set_initialize_func(debug->plugin, initialize_multi);
> >>> + osync_plugin_set_finalize_func(debug->plugin, finalize_multi);
> >>>
> >>> ?? debug->client1 = osync_client_new(&error);
> >>> ?? fail_unless(debug->client1 != NULL, NULL);
> >>> @@ -1037,8 +1037,8 @@ static OSyncDebugGroup *_create_group3(char *testbed)
> >>> ?? osync_plugin_set_start_type(debug->plugin, OSYNC_START_TYPE_EXTERNAL);
> >>> ?? osync_plugin_set_config_type(debug->plugin, OSYNC_PLUGIN_NO_CONFIGURATION);
> >>>
> >>> - osync_plugin_set_initialize(debug->plugin, initialize_order);
> >>> - osync_plugin_set_finalize(debug->plugin, finalize_order);
> >>> + osync_plugin_set_initialize_func(debug->plugin, initialize_order);
> >>> + osync_plugin_set_finalize_func(debug->plugin, finalize_order);
> >>>
> >>>
> >>> ?? debug->client1 = osync_client_new(&error);
> >>> @@ -1271,8 +1271,8 @@ static OSyncDebugGroup *_create_group4(char *testbed)
> >>> ?? osync_plugin_set_start_type(debug->plugin, OSYNC_START_TYPE_EXTERNAL);
> >>> ?? osync_plugin_set_config_type(debug->plugin, OSYNC_PLUGIN_NO_CONFIGURATION);
> >>>
> >>> - osync_plugin_set_initialize(debug->plugin, initialize_reuse);
> >>> - osync_plugin_set_finalize(debug->plugin, finalize_reuse);
> >>> + osync_plugin_set_initialize_func(debug->plugin, initialize_reuse);
> >>> + osync_plugin_set_finalize_func(debug->plugin, finalize_reuse);
> >>>
> >>> ?? debug->client1 = osync_client_new(&error);
> >>> ?? fail_unless(debug->client1 != NULL, NULL);
> >>> @@ -1550,8 +1550,8 @@ static OSyncDebugGroup *_create_group5(char *testbed)
> >>> ?? osync_plugin_set_start_type(debug->plugin, OSYNC_START_TYPE_EXTERNAL);
> >>> ?? osync_plugin_set_config_type(debug->plugin, OSYNC_PLUGIN_NO_CONFIGURATION);
> >>>
> >>> - osync_plugin_set_initialize(debug->plugin, initialize5);
> >>> - osync_plugin_set_finalize(debug->plugin, finalize5);
> >>> + osync_plugin_set_initialize_func(debug->plugin, initialize5);
> >>> + osync_plugin_set_finalize_func(debug->plugin, finalize5);
> >>>
> >>> ?? debug->client1 = osync_client_new(&error);
> >>> ?? fail_unless(debug->client1 != NULL, NULL);
> >>> @@ -1758,8 +1758,8 @@ static OSyncDebugGroup *_create_group6(char *testbed)
> >>> ?? osync_plugin_set_start_type(debug->plugin, OSYNC_START_TYPE_EXTERNAL);
> >>> ?? osync_plugin_set_config_type(debug->plugin, OSYNC_PLUGIN_NO_CONFIGURATION);
> >>>
> >>> - osync_plugin_set_initialize(debug->plugin, initialize6);
> >>> - osync_plugin_set_finalize(debug->plugin, finalize6);
> >>> + osync_plugin_set_initialize_func(debug->plugin, initialize6);
> >>> + osync_plugin_set_finalize_func(debug->plugin, finalize6);
> >>>
> >>> ?? debug->client1 = osync_client_new(&error);
> >>> ?? fail_unless(debug->client1 != NULL, NULL);
> >>> @@ -1961,8 +1961,8 @@ static OSyncDebugGroup *_create_group7(char *testbed)
> >>> ?? osync_plugin_set_start_type(debug->plugin, OSYNC_START_TYPE_EXTERNAL);
> >>> ?? osync_plugin_set_config_type(debug->plugin, OSYNC_PLUGIN_NO_CONFIGURATION);
> >>>
> >>> - osync_plugin_set_initialize(debug->plugin, initialize7);
> >>> - osync_plugin_set_finalize(debug->plugin, finalize7);
> >>> + osync_plugin_set_initialize_func(debug->plugin, initialize7);
> >>> + osync_plugin_set_finalize_func(debug->plugin, finalize7);
> >>>
> >>> ?? debug->client1 = osync_client_new(&error);
> >>> ?? fail_unless(debug->client1 != NULL, NULL);
> >>> diff --git a/tests/engine-tests/check_engine_error.c
> >>> b/tests/engine-tests/check_engine_error.c
> >>> index 4eb3f1d..6dd8b40 100644
> >>> --- a/tests/engine-tests/check_engine_error.c
> >>> +++ b/tests/engine-tests/check_engine_error.c
> >>> @@ -210,8 +210,8 @@ static OSyncDebugGroup *_create_group5(char *testbed)
> >>> ?? osync_plugin_set_start_type(debug->plugin, OSYNC_START_TYPE_EXTERNAL);
> >>> ?? osync_plugin_set_config_type(debug->plugin, OSYNC_PLUGIN_NO_CONFIGURATION);
> >>>
> >>> - osync_plugin_set_initialize(debug->plugin, initialize_connect_error);
> >>> - osync_plugin_set_finalize(debug->plugin, finalize);
> >>> + osync_plugin_set_initialize_func(debug->plugin, initialize_connect_error);
> >>> + osync_plugin_set_finalize_func(debug->plugin, finalize);
> >>>
> >>>
> >>> ?? debug->plugin2 = osync_plugin_new(&error);
> >>> @@ -223,8 +223,8 @@ static OSyncDebugGroup *_create_group5(char *testbed)
> >>> ?? osync_plugin_set_description(debug->plugin2, "This is a pseudo plugin");
> >>> ?? osync_plugin_set_start_type(debug->plugin2, OSYNC_START_TYPE_EXTERNAL);
> >>>
> >>> - osync_plugin_set_initialize(debug->plugin2, initialize_connect_error);
> >>> - osync_plugin_set_finalize(debug->plugin2, finalize);
> >>> + osync_plugin_set_initialize_func(debug->plugin2, initialize_connect_error);
> >>> + osync_plugin_set_finalize_func(debug->plugin2, finalize);
> >>>
> >>>
> >>> ?? debug->client1 = osync_client_new(&error);
> >>> diff --git a/tests/mock-plugin/mock_sync.c b/tests/mock-plugin/mock_sync.c
> >>> index ecdde36..78f3c32 100644
> >>> --- a/tests/mock-plugin/mock_sync.c
> >>> +++ b/tests/mock-plugin/mock_sync.c
> >>> @@ -794,9 +794,9 @@ osync_bool get_sync_info(OSyncPluginEnv *env,
> >>> OSyncError **error)
> >>> ?? osync_plugin_set_description(plugin, "Plugin to synchronize files on
> >>> the local filesystem for unit tests");
> >>> ?? osync_plugin_set_start_type(plugin, OSYNC_START_TYPE_EXTERNAL);
> >>>
> >>> - osync_plugin_set_initialize(plugin, mock_initialize);
> >>> - osync_plugin_set_finalize(plugin, mock_finalize);
> >>> - osync_plugin_set_discover(plugin, mock_discover);
> >>> + osync_plugin_set_initialize_func(plugin, mock_initialize);
> >>> + osync_plugin_set_finalize_func(plugin, mock_finalize);
> >>> + osync_plugin_set_discover_func(plugin, mock_discover);
> >>>
> >>> ?? if (!osync_plugin_env_register_plugin(env, plugin, error))
> >>> ?? goto error;
> >>> --
> >>> 1.7.4.1
> >>>
> >>> ------------------------------------------------------------------------------
> >>> EditLive Enterprise is the world's most technically advanced content
> >>> authoring tool. Experience the power of Track Changes, Inline Image
> >>> Editing and ensure content is compliant with Accessibility Checking.
> >>> http://p.sf.net/sfu/ephox-dev2dev
> >>> _______________________________________________
> >>> Opensync-devel mailing list
> >>> Opensync-devel <at> lists.sourceforge.net
> >>> https://lists.sourceforge.net/lists/listinfo/opensync-devel
> >>
> >> ------------------------------------------------------------------------------
> >> All of the data generated in your IT infrastructure is seriously valuable.
> >> Why? It contains a definitive record of application performance, security
> >> threats, fraudulent activity, and more. Splunk takes this data and makes
> >> sense of it. IT sense. And common sense.
> >> http://p.sf.net/sfu/splunk-d2d-c2
> >> _______________________________________________
> >> Opensync-devel mailing list
> >> Opensync-devel <at> lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/opensync-devel
> >>
> >
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev