|
From: Henrik /K. <he...@ka...> - 2009-10-30 17:11:30
|
Just for reference, the external process basically boils down to this
function:
static int run_plugin(BZOpenSyncPlugin *pbz) {
osync_trace(TRACE_ENTRY, "%s", __func__);
OSyncError *error = NULL;
OSyncQueue *incoming = NULL;
OSyncQueue *outgoing = NULL;
OSyncClient *client = NULL;
client = osync_client_new(&error);
if (!client)
goto done;
osync_client_set_overriding_plugin_dir(client, pbz->mySzPathToLib);
/* Create connection pipes **/
incoming = osync_queue_new(pbz->mySzPathToPipe, &error);
if (!incoming)
goto error;
if (!osync_queue_create(incoming, &error))
goto error;
/* We now connect to our incoming queue */
if (!osync_queue_connect(incoming, OSYNC_QUEUE_RECEIVER, &error))
goto error;
if (!osync_client_set_incoming_queue(client, incoming, &error))
goto error;
osync_queue_unref(incoming);
osync_client_run_and_block(client);
osync_client_unref(client);
printf("blueZync synchronization client thread complete\n");
osync_trace(TRACE_EXIT, "%s", __func__);
return NS_OK;
error:
osync_client_unref(client);
done:
osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__,
osync_error_print(&error));
fprintf(stderr, "Unable to initialize environment: %s\n",
osync_error_print(&error));
osync_error_unref(&error);
return NS_ERROR_FAILURE;
}
Henrik /KaarPoSoft wrote:
> Hi all,
>
> I have earlier provided a patch so a plugin of type
> OSYNC_START_TYPE_EXTERNAL can set
> osync_plugin_set_start_external_command.
>
> However, after some thought, I actually think it should be on the
> OSyncPluginConfig.
>
> In this way, different members can have different external commands
> with the same plugin.
>
> I.e. the config for mozilla-sync plugin could specify thunderbird or
> sunbird or even the Debian ice-*.
>
> Please find attached a combined patch.
>
> Comments?
>
> /Henrik
>
|