Changeset 859
- Timestamp:
- 03/03/06 15:25:22 (3 years ago)
- Location:
- branches/ipc-branch/opensync
- Files:
-
- 5 modified
-
opensync_member.c (modified) (1 diff)
-
opensync_member.h (modified) (1 diff)
-
opensync_member_internals.h (modified) (1 diff)
-
opensync_plugin.c (modified) (1 diff)
-
opensync_plugin.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/ipc-branch/opensync/opensync_member.c
r849 r859 1493 1493 } 1494 1494 1495 void osync_member_accept_objtype(OSyncMember *member, const char *objtypestr)1496 {1497 OSyncObjTypeTemplate *template = osync_plugin_find_objtype_template(member->plugin, objtypestr);1498 OSyncObjTypeSink *sink = osync_objtype_sink_from_template(member->group, template);1499 1500 member->objtype_sinks = g_list_append(member->objtype_sinks, sink);1501 }1502 1503 void osync_member_accept_objformat(OSyncMember *member, const char *objtypestr, const char *formatstr, const char *extension)1504 {1505 OSyncObjTypeTemplate *template = osync_plugin_find_objtype_template(member->plugin, objtypestr);1506 osync_assert(template, "Unable to accept objformat. Did you forget to add the objtype?");1507 1508 OSyncObjFormatTemplate *format_template = osync_plugin_find_objformat_template(template, formatstr);1509 OSyncObjFormatSink *sink = osync_objformat_sink_from_template(member->group, format_template);1510 1511 member->format_sinks = g_list_append(member->format_sinks, sink);1512 }1513 1514 void osync_member_clear_accepted_types(OSyncMember *member)1515 {1516 int i;1517 1518 for (i = 0; i < g_list_length(member->objtype_sinks); ++i)1519 osync_objtypesink_free(g_list_nth_data(member->objtype_sinks, i));1520 g_list_free(member->objtype_sinks);1521 1522 for (i = 0; i < g_list_length(member->format_sinks); ++i)1523 osync_objtypesink_free(g_list_nth_data(member->format_sinks, i));1524 g_list_free(member->format_sinks);1525 }1526 1527 void osync_objtypesink_free(OSyncObjTypeSink *sink)1528 {1529 g_list_free(sink->formatsinks);1530 g_list_free(sink->properties);1531 }1532 1533 void osync_objformatsink_free(OSyncObjFormatSink *sink)1534 {1535 g_free(sink->extension_name);1536 g_list_free(sink->commit_changes);1537 g_list_free(sink->commit_contexts);1538 }1539 1540 1495 /*@}*/ -
branches/ipc-branch/opensync/opensync_member.h
r800 r859 72 72 void *osync_member_get_plugindata(OSyncMember *member); 73 73 74 void osync_member_accept_objtype(OSyncMember *member, const char *objtypestr);75 void osync_member_accept_objformat(OSyncMember *member, const char *objtypestr, const char *formatstr, const char *extension);76 void osync_member_clear_accepted_types(OSyncMember *member);77 78 74 void *osync_member_get_loop(OSyncMember *member); 79 75 void osync_member_set_loop(OSyncMember *member, void *loop); -
branches/ipc-branch/opensync/opensync_member_internals.h
r800 r859 49 49 OSyncObjFormatSink *osync_member_make_random_data(OSyncMember *member, OSyncChange *change, const char *objtypename); 50 50 osync_bool osync_member_require_sink_info(OSyncMember *member, OSyncError **error); 51 52 void osync_objtypesink_free(OSyncObjTypeSink *sink);53 void osync_objformatsink_free(OSyncObjFormatSink *sink);54 -
branches/ipc-branch/opensync/opensync_plugin.c
r823 r859 557 557 } 558 558 559 /*! @brief Tells opensync that the plugin can accepts this object 560 * 561 * Tells opensync that the plugin can accepts this object. Used by the plugin 562 * in the get_info() function 563 * 564 * @param info The plugin info on which to operate 565 * @param objtypestr The name of the object which to accept 566 * 567 */ 568 void osync_plugin_accept_objtype(OSyncPluginInfo *info, const char *objtypestr) 569 { 570 OSyncObjTypeTemplate *template = g_malloc0(sizeof(OSyncObjTypeTemplate)); 571 template->name = g_strdup(objtypestr); 572 info->plugin->accepted_objtypes = g_list_append(info->plugin->accepted_objtypes, template); 573 } 574 575 /*! @brief Tells opensync that the plugin can accepts this format for the given object 576 * 577 * Tells opensync that the plugin can accepts this format. Used by the plugin 578 * in the get_info() function 579 * 580 * @param info The plugin info on which to operate 581 * @param objtypestr The name of the objecttype 582 * @param formatstr The name of the format to accept 583 * @param extension The name of the extension that the plugin wants. NULL if none 584 * 585 */ 586 void osync_plugin_accept_objformat(OSyncPluginInfo *info, const char *objtypestr, const char *formatstr, const char *extension) 587 { 588 OSyncObjTypeTemplate *template = osync_plugin_find_objtype_template(info->plugin, objtypestr); 589 osync_assert(template, "Unable to accept objformat. Did you forget to add the objtype?"); 590 OSyncObjFormatTemplate *format_template = g_malloc0(sizeof(OSyncObjFormatTemplate)); 591 format_template->name = g_strdup(formatstr); 592 if (extension) 593 format_template->extension_name = g_strdup(extension); 594 template->formats = g_list_append(template->formats, format_template); 595 } 596 559 597 /*@}*/ -
branches/ipc-branch/opensync/opensync_plugin.h
r800 r859 132 132 133 133 void *osync_plugin_get_function(OSyncPlugin *plugin, const char *name, OSyncError **error); 134 void osync_plugin_accept_objtype(OSyncPluginInfo *info, const char *objtypestr); 135 void osync_plugin_accept_objformat(OSyncPluginInfo *info, const char *objtypestr, const char *formatstr, const char *extension); 134 136 void osync_plugin_set_commit_objformat(OSyncPluginInfo *info, const char *objtypestr, const char *formatstr, OSyncFormatCommitFn commit_change); 135 137 void osync_plugin_set_access_objformat(OSyncPluginInfo *info, const char *objtypestr, const char *formatstr, OSyncFormatAccessFn access_fn);
