|
From: Chris F. <cd...@fo...> - 2010-07-09 02:14:26
|
Hi,
What is the difference between these two blocks of code?
OSyncFormatEnv *formatenv1 = osync_plugin_info_get_format_env(info);
format = osync_format_env_find_objformat(formatenv1,
"xmlformat-event-doc");
if( !format ) {
osync_trace(TRACE_ERROR, "%s",
"Failed to find objformat xmlformat-event-doc!");
goto error;
}
And...
OSyncPluginConfig *config = osync_plugin_info_get_config(info);
OSyncPluginResource *resource = osync_plugin_config_find_active_resource(config, "event");
OSyncList *objformatsinks = osync_plugin_resource_get_objformat_sinks(resource);
osync_bool has_format = false;
OSyncList *r;
for( r = objformatsinks; r ;r = r->next ) {
OSyncObjFormatSink *objformatsink = (OSyncObjFormatSink *) r->data;
if( !strcmp("xmlformat-event-doc", osync_objformat_sink_get_objformat(objformatsink))) {
has_format = true;
break;
}
}
if( !has_format ) {
osync_trace(TRACE_ERROR, "%s",
"Failed to find objformat xmlformat-event-doc!");
goto error;
}
I'm confused. :-)
Thanks,
- Chris
|