aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-object.h
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-04-23 09:34:03 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-04-23 09:34:03 +0800
commit41e808deca2ad8654b6f8528ae3492013951fcbd (patch)
tree352295bf10079041170d50b585f5bb44ecf0ad61 /camel/camel-object.h
parent36875999d7315e9f36eb9d9b8f657a0bd38a0751 (diff)
downloadgsoc2013-evolution-41e808deca2ad8654b6f8528ae3492013951fcbd.tar
gsoc2013-evolution-41e808deca2ad8654b6f8528ae3492013951fcbd.tar.gz
gsoc2013-evolution-41e808deca2ad8654b6f8528ae3492013951fcbd.tar.bz2
gsoc2013-evolution-41e808deca2ad8654b6f8528ae3492013951fcbd.tar.lz
gsoc2013-evolution-41e808deca2ad8654b6f8528ae3492013951fcbd.tar.xz
gsoc2013-evolution-41e808deca2ad8654b6f8528ae3492013951fcbd.tar.zst
gsoc2013-evolution-41e808deca2ad8654b6f8528ae3492013951fcbd.zip
** Should fix #41629, #41448, et al.
2003-04-22 Not Zed <NotZed@Ximian.com> ** Should fix #41629, #41448, et al. * tests/folder/test10.c: a new torture test for object bag creation/unreffing. * camel-url.c (camel_url_copy): new function to copy a url. * camel-object.c (camel_object_bag_new): add arguments for key copy and key free functions. Fixed all callers. (camel_object_bag_destroy): fix a memleak, free the bag key. (camel_object_bag_get, camel_object_bag_reserve) (camel_object_bag_abort, save_bag, save_object): Make the key a void type, rather than char *. (camel_object_bag_add): As above, and also copy the key. (camel_object_bag_remove_unlocked): free the key using bag->free_key. * camel-session.c (register_provider) (camel_session_destroy_provider, get_service): Changed to use an object bag instead of a hash table for the service 'cache'. (service_cache_remove): Removed, no longer required. svn path=/trunk/; revision=20930
Diffstat (limited to 'camel/camel-object.h')
-rw-r--r--camel/camel-object.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/camel/camel-object.h b/camel/camel-object.h
index 5c5b4ca253..5aa9d3157f 100644
--- a/camel/camel-object.h
+++ b/camel/camel-object.h
@@ -216,12 +216,13 @@ void camel_object_free(void *vo, guint32 tag, void *value);
/* for managing bags of weakly-ref'd 'child' objects */
typedef struct _CamelObjectBag CamelObjectBag;
+typedef void *(*CamelCopyFunc)(const void *vo);
-CamelObjectBag *camel_object_bag_new(GHashFunc hash, GEqualFunc equal);
-void *camel_object_bag_get(CamelObjectBag *bag, const char *key);
-void *camel_object_bag_reserve(CamelObjectBag *bag, const char *key);
-void camel_object_bag_add(CamelObjectBag *bag, const char *key, void *o);
-void camel_object_bag_abort(CamelObjectBag *bag, const char *key);
+CamelObjectBag *camel_object_bag_new(GHashFunc hash, GEqualFunc equal, CamelCopyFunc keycopy, GFreeFunc keyfree);
+void *camel_object_bag_get(CamelObjectBag *bag, const void *key);
+void *camel_object_bag_reserve(CamelObjectBag *bag, const void *key);
+void camel_object_bag_add(CamelObjectBag *bag, const void *key, void *o);
+void camel_object_bag_abort(CamelObjectBag *bag, const void *key);
GPtrArray *camel_object_bag_list(CamelObjectBag *bag);
void camel_object_bag_remove(CamelObjectBag *bag, void *o);
void camel_object_bag_destroy(CamelObjectBag *bag);