From: <svn...@op...> - 2009-03-28 17:45:48
|
Author: dgollub Date: Sat Mar 28 18:45:34 2009 New Revision: 5381 URL: http://www.opensync.org/changeset/5381 Log: Fix build of wrapper. Got broken due to API changes on hashtable and the drop of osync_plugin_info_get_configdir(). Modified: trunk/wrapper/opensync-helper.i trunk/wrapper/opensync-plugin.i Modified: trunk/wrapper/opensync-helper.i ============================================================================== --- trunk/wrapper/opensync-helper.i Sat Mar 28 17:06:02 2009 (r5380) +++ trunk/wrapper/opensync-helper.i Sat Mar 28 18:45:34 2009 (r5381) @@ -32,25 +32,10 @@ } %} - -typedef struct {} HashTable; -%extend HashTable { - HashTable(const char *path, const char *objtype) { - Error *err = NULL; - HashTable *hashtable = osync_hashtable_new(path, objtype, &err); - if (raise_exception_on_error(err)) - return NULL; - else - return hashtable; - } - - ~HashTable() { - osync_hashtable_unref(self); - } - - bool load() { +%inline %{ + static bool hashtable_slowsync(OSyncHashTable *hashtable) { Error *err = NULL; - osync_hashtable_load(self, &err); + osync_hashtable_slowsync(hashtable, &err); if (raise_exception_on_error(err)) return FALSE; @@ -58,37 +43,17 @@ return TRUE; } - bool save() { - Error *err = NULL; - osync_hashtable_save(self, &err); - - if (raise_exception_on_error(err)) - return FALSE; - - return TRUE; - } - - bool slowsync() { - Error *err = NULL; - osync_hashtable_slowsync(self, &err); - - if (raise_exception_on_error(err)) - return FALSE; - - return TRUE; - } - - int num_entries() { - return osync_hashtable_num_entries(self); + static int hashtable_num_entries(OSyncHashTable *hashtable) { + return osync_hashtable_num_entries(hashtable); } - void update_change(Change *change) { - osync_hashtable_update_change(self, change); + void hashtable_update_change(OSyncHashTable *hashtable, Change *change) { + osync_hashtable_update_change(hashtable, change); } /* returns a list of deleted UIDs as strings */ - PyObject *get_deleted() { - OSyncList *uids = osync_hashtable_get_deleted(self); + static PyObject *hashtable_get_deleted(OSyncHashTable *hashtable) { + OSyncList *uids = osync_hashtable_get_deleted(hashtable); if (uids == NULL) { wrapper_exception("osync_hashtable_get_deleted failed"); return NULL; @@ -112,15 +77,7 @@ return ret; } - ChangeType get_changetype(Change *change) { - return osync_hashtable_get_changetype(self, change); + static ChangeType hashtable_get_changetype(OSyncHashTable *hashtable, Change *change) { + return osync_hashtable_get_changetype(hashtable, change); } - -%pythoncode %{ - # extend the SWIG-generated constructor, so that we can setup our list-wrapper classes - __oldinit = __init__ - def __init__(self, *args): - self.__oldinit(*args) - self.entries = _ListWrapper(self.num_entries, self.nth_entry) %} -} Modified: trunk/wrapper/opensync-plugin.i ============================================================================== --- trunk/wrapper/opensync-plugin.i Sat Mar 28 17:06:02 2009 (r5380) +++ trunk/wrapper/opensync-plugin.i Sat Mar 28 18:45:34 2009 (r5381) @@ -182,10 +182,6 @@ osync_plugin_info_set_configdir(self, configdir); } - const char *get_configdir() { - return osync_plugin_info_get_configdir(self); - } - ObjTypeSink *find_objtype(const char *name) { return osync_plugin_info_find_objtype(self, name); } @@ -261,7 +257,6 @@ %pythoncode %{ loop = property(get_loop, set_loop) config = property(get_config, set_config) - configdir = property(get_configdir, set_configdir) main_sink = property(get_main_sink, set_main_sink) format_env = property(get_format_env, set_format_env) sink = property(get_sink, set_sink) @@ -363,6 +358,14 @@ osync_objtype_sink_remove_objformat_sink(self, format_sink); } + OSyncAnchor *get_anchor() { + return osync_objtype_sink_get_anchor(self); + } + + OSyncHashTable *get_hashtable() { + return osync_objtype_sink_get_hashtable(self); + } + /* TODO: set_functions */ /* |