1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2008 Novell, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU Lesser General Public
7 * License as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 /* Manages bags of weakly-referenced GObjects. */
22 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
23 #error "Only <camel/camel.h> can be included directly."
26 #ifndef CAMEL_OBJECT_BAG_H
27 #define CAMEL_OBJECT_BAG_H
33 typedef struct _CamelObjectBag CamelObjectBag;
34 typedef gpointer (*CamelCopyFunc) (gconstpointer object);
36 CamelObjectBag *camel_object_bag_new (GHashFunc key_hash_func,
37 GEqualFunc key_equal_func,
38 CamelCopyFunc key_copy_func,
39 GFreeFunc key_free_func);
40 gpointer camel_object_bag_get (CamelObjectBag *bag,
42 gpointer camel_object_bag_peek (CamelObjectBag *bag,
44 gpointer camel_object_bag_reserve (CamelObjectBag *bag,
46 void camel_object_bag_add (CamelObjectBag *bag,
49 void camel_object_bag_abort (CamelObjectBag *bag,
51 void camel_object_bag_rekey (CamelObjectBag *bag,
53 gconstpointer new_key);
54 GPtrArray * camel_object_bag_list (CamelObjectBag *bag);
55 void camel_object_bag_remove (CamelObjectBag *bag,
57 void camel_object_bag_destroy (CamelObjectBag *bag);
61 #endif /* CAMEL_OBJECT_BAG_H */