aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/gnunet_container_lib.h68
-rw-r--r--src/util/plugin.c68
2 files changed, 42 insertions, 94 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index ae6c34f2b..93a88f239 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -766,7 +766,8 @@ enum GNUNET_CONTAINER_MultiHashMapOption
766 * iterate, 766 * iterate,
767 * #GNUNET_NO if not. 767 * #GNUNET_NO if not.
768 */ 768 */
769typedef int (*GNUNET_CONTAINER_MulitHashMapIteratorCallback) ( 769typedef enum GNUNET_GenericReturnValue
770(*GNUNET_CONTAINER_MulitHashMapIteratorCallback)(
770 void *cls, 771 void *cls,
771 const struct GNUNET_HashCode *key, 772 const struct GNUNET_HashCode *key,
772 void *value); 773 void *value);
@@ -834,7 +835,7 @@ GNUNET_CONTAINER_multihashmap_get (
834 * @return #GNUNET_YES on success, #GNUNET_NO if the key-value pair 835 * @return #GNUNET_YES on success, #GNUNET_NO if the key-value pair
835 * is not in the map 836 * is not in the map
836 */ 837 */
837int 838enum GNUNET_GenericReturnValue
838GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap *map, 839GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap *map,
839 const struct GNUNET_HashCode *key, 840 const struct GNUNET_HashCode *key,
840 const void *value); 841 const void *value);
@@ -876,7 +877,7 @@ GNUNET_CONTAINER_multihashmap_clear (struct GNUNET_CONTAINER_MultiHashMap *map);
876 * @return #GNUNET_YES if such a value exists, 877 * @return #GNUNET_YES if such a value exists,
877 * #GNUNET_NO if not 878 * #GNUNET_NO if not
878 */ 879 */
879int 880enum GNUNET_GenericReturnValue
880GNUNET_CONTAINER_multihashmap_contains ( 881GNUNET_CONTAINER_multihashmap_contains (
881 const struct GNUNET_CONTAINER_MultiHashMap *map, 882 const struct GNUNET_CONTAINER_MultiHashMap *map,
882 const struct GNUNET_HashCode *key); 883 const struct GNUNET_HashCode *key);
@@ -893,7 +894,7 @@ GNUNET_CONTAINER_multihashmap_contains (
893 * @return #GNUNET_YES if such a value exists, 894 * @return #GNUNET_YES if such a value exists,
894 * #GNUNET_NO if not 895 * #GNUNET_NO if not
895 */ 896 */
896int 897enum GNUNET_GenericReturnValue
897GNUNET_CONTAINER_multihashmap_contains_value ( 898GNUNET_CONTAINER_multihashmap_contains_value (
898 const struct GNUNET_CONTAINER_MultiHashMap *map, 899 const struct GNUNET_CONTAINER_MultiHashMap *map,
899 const struct GNUNET_HashCode *key, 900 const struct GNUNET_HashCode *key,
@@ -913,7 +914,7 @@ GNUNET_CONTAINER_multihashmap_contains_value (
913 * #GNUNET_SYSERR if #GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY was the option and the 914 * #GNUNET_SYSERR if #GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY was the option and the
914 * value already exists 915 * value already exists
915 */ 916 */
916int 917enum GNUNET_GenericReturnValue
917GNUNET_CONTAINER_multihashmap_put ( 918GNUNET_CONTAINER_multihashmap_put (
918 struct GNUNET_CONTAINER_MultiHashMap *map, 919 struct GNUNET_CONTAINER_MultiHashMap *map,
919 const struct GNUNET_HashCode *key, 920 const struct GNUNET_HashCode *key,
@@ -982,7 +983,7 @@ GNUNET_CONTAINER_multihashmap_iterator_create (
982 * @return #GNUNET_YES we returned an element, 983 * @return #GNUNET_YES we returned an element,
983 * #GNUNET_NO if we are out of elements 984 * #GNUNET_NO if we are out of elements
984 */ 985 */
985int 986enum GNUNET_GenericReturnValue
986GNUNET_CONTAINER_multihashmap_iterator_next ( 987GNUNET_CONTAINER_multihashmap_iterator_next (
987 struct GNUNET_CONTAINER_MultiHashMapIterator *iter, 988 struct GNUNET_CONTAINER_MultiHashMapIterator *iter,
988 struct GNUNET_HashCode *key, 989 struct GNUNET_HashCode *key,
@@ -1050,7 +1051,8 @@ GNUNET_CONTAINER_multihashmap_get_random (
1050 * iterate, 1051 * iterate,
1051 * #GNUNET_NO if not. 1052 * #GNUNET_NO if not.
1052 */ 1053 */
1053typedef int (*GNUNET_CONTAINER_PeerMapIterator) ( 1054typedef enum GNUNET_GenericReturnValue
1055(*GNUNET_CONTAINER_PeerMapIterator)(
1054 void *cls, 1056 void *cls,
1055 const struct GNUNET_PeerIdentity *key, 1057 const struct GNUNET_PeerIdentity *key,
1056 void *value); 1058 void *value);
@@ -1123,7 +1125,7 @@ GNUNET_CONTAINER_multipeermap_get (
1123 * @return #GNUNET_YES on success, #GNUNET_NO if the key-value pair 1125 * @return #GNUNET_YES on success, #GNUNET_NO if the key-value pair
1124 * is not in the map 1126 * is not in the map
1125 */ 1127 */
1126int 1128enum GNUNET_GenericReturnValue
1127GNUNET_CONTAINER_multipeermap_remove (struct GNUNET_CONTAINER_MultiPeerMap *map, 1129GNUNET_CONTAINER_multipeermap_remove (struct GNUNET_CONTAINER_MultiPeerMap *map,
1128 const struct GNUNET_PeerIdentity *key, 1130 const struct GNUNET_PeerIdentity *key,
1129 const void *value); 1131 const void *value);
@@ -1153,7 +1155,7 @@ GNUNET_CONTAINER_multipeermap_remove_all (
1153 * @return #GNUNET_YES if such a value exists, 1155 * @return #GNUNET_YES if such a value exists,
1154 * #GNUNET_NO if not 1156 * #GNUNET_NO if not
1155 */ 1157 */
1156int 1158enum GNUNET_GenericReturnValue
1157GNUNET_CONTAINER_multipeermap_contains ( 1159GNUNET_CONTAINER_multipeermap_contains (
1158 const struct GNUNET_CONTAINER_MultiPeerMap *map, 1160 const struct GNUNET_CONTAINER_MultiPeerMap *map,
1159 const struct GNUNET_PeerIdentity *key); 1161 const struct GNUNET_PeerIdentity *key);
@@ -1170,7 +1172,7 @@ GNUNET_CONTAINER_multipeermap_contains (
1170 * @return #GNUNET_YES if such a value exists, 1172 * @return #GNUNET_YES if such a value exists,
1171 * #GNUNET_NO if not 1173 * #GNUNET_NO if not
1172 */ 1174 */
1173int 1175enum GNUNET_GenericReturnValue
1174GNUNET_CONTAINER_multipeermap_contains_value ( 1176GNUNET_CONTAINER_multipeermap_contains_value (
1175 const struct GNUNET_CONTAINER_MultiPeerMap *map, 1177 const struct GNUNET_CONTAINER_MultiPeerMap *map,
1176 const struct GNUNET_PeerIdentity *key, 1178 const struct GNUNET_PeerIdentity *key,
@@ -1261,7 +1263,7 @@ GNUNET_CONTAINER_multipeermap_iterator_create (
1261 * @return #GNUNET_YES we returned an element, 1263 * @return #GNUNET_YES we returned an element,
1262 * #GNUNET_NO if we are out of elements 1264 * #GNUNET_NO if we are out of elements
1263 */ 1265 */
1264int 1266enum GNUNET_GenericReturnValue
1265GNUNET_CONTAINER_multipeermap_iterator_next ( 1267GNUNET_CONTAINER_multipeermap_iterator_next (
1266 struct GNUNET_CONTAINER_MultiPeerMapIterator *iter, 1268 struct GNUNET_CONTAINER_MultiPeerMapIterator *iter,
1267 struct GNUNET_PeerIdentity *key, 1269 struct GNUNET_PeerIdentity *key,
@@ -1329,7 +1331,8 @@ GNUNET_CONTAINER_multipeermap_get_random (
1329 * iterate, 1331 * iterate,
1330 * #GNUNET_NO if not. 1332 * #GNUNET_NO if not.
1331 */ 1333 */
1332typedef int (*GNUNET_CONTAINER_ShortmapIterator) ( 1334typedef enum GNUNET_GenericReturnValue
1335(*GNUNET_CONTAINER_ShortmapIterator)(
1333 void *cls, 1336 void *cls,
1334 const struct GNUNET_ShortHashCode *key, 1337 const struct GNUNET_ShortHashCode *key,
1335 void *value); 1338 void *value);
@@ -1470,7 +1473,7 @@ GNUNET_CONTAINER_multishortmap_contains_value (
1470 * #GNUNET_SYSERR if #GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY was the option and the 1473 * #GNUNET_SYSERR if #GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY was the option and the
1471 * value already exists 1474 * value already exists
1472 */ 1475 */
1473int 1476enum GNUNET_GenericReturnValue
1474GNUNET_CONTAINER_multishortmap_put ( 1477GNUNET_CONTAINER_multishortmap_put (
1475 struct GNUNET_CONTAINER_MultiShortmap *map, 1478 struct GNUNET_CONTAINER_MultiShortmap *map,
1476 const struct GNUNET_ShortHashCode *key, 1479 const struct GNUNET_ShortHashCode *key,
@@ -1543,7 +1546,7 @@ GNUNET_CONTAINER_multishortmap_iterator_create (
1543 * @return #GNUNET_YES we returned an element, 1546 * @return #GNUNET_YES we returned an element,
1544 * #GNUNET_NO if we are out of elements 1547 * #GNUNET_NO if we are out of elements
1545 */ 1548 */
1546int 1549enum GNUNET_GenericReturnValue
1547GNUNET_CONTAINER_multishortmap_iterator_next ( 1550GNUNET_CONTAINER_multishortmap_iterator_next (
1548 struct GNUNET_CONTAINER_MultiShortmapIterator *iter, 1551 struct GNUNET_CONTAINER_MultiShortmapIterator *iter,
1549 struct GNUNET_ShortHashCode *key, 1552 struct GNUNET_ShortHashCode *key,
@@ -1612,7 +1615,8 @@ GNUNET_CONTAINER_multishortmap_get_random (
1612 * iterate, 1615 * iterate,
1613 * #GNUNET_NO if not. 1616 * #GNUNET_NO if not.
1614 */ 1617 */
1615typedef int (*GNUNET_CONTAINER_MultiUuidmapIteratorCallback) ( 1618typedef enum GNUNET_GenericReturnValue
1619(*GNUNET_CONTAINER_MultiUuidmapIteratorCallback)(
1616 void *cls, 1620 void *cls,
1617 const struct GNUNET_Uuid *key, 1621 const struct GNUNET_Uuid *key,
1618 void *value); 1622 void *value);
@@ -1685,7 +1689,7 @@ GNUNET_CONTAINER_multiuuidmap_get (
1685 * @return #GNUNET_YES on success, #GNUNET_NO if the key-value pair 1689 * @return #GNUNET_YES on success, #GNUNET_NO if the key-value pair
1686 * is not in the map 1690 * is not in the map
1687 */ 1691 */
1688int 1692enum GNUNET_GenericReturnValue
1689GNUNET_CONTAINER_multiuuidmap_remove (struct GNUNET_CONTAINER_MultiUuidmap *map, 1693GNUNET_CONTAINER_multiuuidmap_remove (struct GNUNET_CONTAINER_MultiUuidmap *map,
1690 const struct GNUNET_Uuid *key, 1694 const struct GNUNET_Uuid *key,
1691 const void *value); 1695 const void *value);
@@ -1715,7 +1719,7 @@ GNUNET_CONTAINER_multiuuidmap_remove_all (
1715 * @return #GNUNET_YES if such a value exists, 1719 * @return #GNUNET_YES if such a value exists,
1716 * #GNUNET_NO if not 1720 * #GNUNET_NO if not
1717 */ 1721 */
1718int 1722enum GNUNET_GenericReturnValue
1719GNUNET_CONTAINER_multiuuidmap_contains ( 1723GNUNET_CONTAINER_multiuuidmap_contains (
1720 const struct GNUNET_CONTAINER_MultiUuidmap *map, 1724 const struct GNUNET_CONTAINER_MultiUuidmap *map,
1721 const struct GNUNET_Uuid *key); 1725 const struct GNUNET_Uuid *key);
@@ -1732,7 +1736,7 @@ GNUNET_CONTAINER_multiuuidmap_contains (
1732 * @return #GNUNET_YES if such a value exists, 1736 * @return #GNUNET_YES if such a value exists,
1733 * #GNUNET_NO if not 1737 * #GNUNET_NO if not
1734 */ 1738 */
1735int 1739enum GNUNET_GenericReturnValue
1736GNUNET_CONTAINER_multiuuidmap_contains_value ( 1740GNUNET_CONTAINER_multiuuidmap_contains_value (
1737 const struct GNUNET_CONTAINER_MultiUuidmap *map, 1741 const struct GNUNET_CONTAINER_MultiUuidmap *map,
1738 const struct GNUNET_Uuid *key, 1742 const struct GNUNET_Uuid *key,
@@ -1752,7 +1756,7 @@ GNUNET_CONTAINER_multiuuidmap_contains_value (
1752 * #GNUNET_SYSERR if #GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY was the option and the 1756 * #GNUNET_SYSERR if #GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY was the option and the
1753 * value already exists 1757 * value already exists
1754 */ 1758 */
1755int 1759enum GNUNET_GenericReturnValue
1756GNUNET_CONTAINER_multiuuidmap_put ( 1760GNUNET_CONTAINER_multiuuidmap_put (
1757 struct GNUNET_CONTAINER_MultiUuidmap *map, 1761 struct GNUNET_CONTAINER_MultiUuidmap *map,
1758 const struct GNUNET_Uuid *key, 1762 const struct GNUNET_Uuid *key,
@@ -1825,7 +1829,7 @@ GNUNET_CONTAINER_multiuuidmap_iterator_create (
1825 * @return #GNUNET_YES we returned an element, 1829 * @return #GNUNET_YES we returned an element,
1826 * #GNUNET_NO if we are out of elements 1830 * #GNUNET_NO if we are out of elements
1827 */ 1831 */
1828int 1832enum GNUNET_GenericReturnValue
1829GNUNET_CONTAINER_multiuuidmap_iterator_next ( 1833GNUNET_CONTAINER_multiuuidmap_iterator_next (
1830 struct GNUNET_CONTAINER_MultiUuidmapIterator *iter, 1834 struct GNUNET_CONTAINER_MultiUuidmapIterator *iter,
1831 struct GNUNET_Uuid *key, 1835 struct GNUNET_Uuid *key,
@@ -1908,9 +1912,11 @@ struct GNUNET_CONTAINER_MultiHashMap32Iterator;
1908 * iterate, 1912 * iterate,
1909 * #GNUNET_NO if not. 1913 * #GNUNET_NO if not.
1910 */ 1914 */
1911typedef int (*GNUNET_CONTAINER_MulitHashMapIterator32Callback) (void *cls, 1915typedef enum GNUNET_GenericReturnValue
1912 uint32_t key, 1916(*GNUNET_CONTAINER_MulitHashMapIterator32Callback)(
1913 void *value); 1917 void *cls,
1918 uint32_t key,
1919 void *value);
1914 1920
1915 1921
1916/** 1922/**
@@ -1994,7 +2000,7 @@ GNUNET_CONTAINER_multihashmap32_iterate (
1994 * @return #GNUNET_YES on success, #GNUNET_NO if the key-value pair 2000 * @return #GNUNET_YES on success, #GNUNET_NO if the key-value pair
1995 * is not in the map 2001 * is not in the map
1996 */ 2002 */
1997int 2003enum GNUNET_GenericReturnValue
1998GNUNET_CONTAINER_multihashmap32_remove ( 2004GNUNET_CONTAINER_multihashmap32_remove (
1999 struct GNUNET_CONTAINER_MultiHashMap32 *map, 2005 struct GNUNET_CONTAINER_MultiHashMap32 *map,
2000 uint32_t key, 2006 uint32_t key,
@@ -2026,7 +2032,7 @@ GNUNET_CONTAINER_multihashmap32_remove_all (
2026 * @return #GNUNET_YES if such a value exists, 2032 * @return #GNUNET_YES if such a value exists,
2027 * #GNUNET_NO if not 2033 * #GNUNET_NO if not
2028 */ 2034 */
2029int 2035enum GNUNET_GenericReturnValue
2030GNUNET_CONTAINER_multihashmap32_contains ( 2036GNUNET_CONTAINER_multihashmap32_contains (
2031 const struct GNUNET_CONTAINER_MultiHashMap32 *map, 2037 const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2032 uint32_t key); 2038 uint32_t key);
@@ -2043,7 +2049,7 @@ GNUNET_CONTAINER_multihashmap32_contains (
2043 * @return #GNUNET_YES if such a value exists, 2049 * @return #GNUNET_YES if such a value exists,
2044 * #GNUNET_NO if not 2050 * #GNUNET_NO if not
2045 */ 2051 */
2046int 2052enum GNUNET_GenericReturnValue
2047GNUNET_CONTAINER_multihashmap32_contains_value ( 2053GNUNET_CONTAINER_multihashmap32_contains_value (
2048 const struct GNUNET_CONTAINER_MultiHashMap32 *map, 2054 const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2049 uint32_t key, 2055 uint32_t key,
@@ -2063,7 +2069,7 @@ GNUNET_CONTAINER_multihashmap32_contains_value (
2063 * #GNUNET_SYSERR if #GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY was the option and the 2069 * #GNUNET_SYSERR if #GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY was the option and the
2064 * value already exists 2070 * value already exists
2065 */ 2071 */
2066int 2072enum GNUNET_GenericReturnValue
2067GNUNET_CONTAINER_multihashmap32_put ( 2073GNUNET_CONTAINER_multihashmap32_put (
2068 struct GNUNET_CONTAINER_MultiHashMap32 *map, 2074 struct GNUNET_CONTAINER_MultiHashMap32 *map,
2069 uint32_t key, 2075 uint32_t key,
@@ -2121,7 +2127,7 @@ GNUNET_CONTAINER_multihashmap32_iterator_create (
2121 * @return #GNUNET_YES we returned an element, 2127 * @return #GNUNET_YES we returned an element,
2122 * #GNUNET_NO if we are out of elements 2128 * #GNUNET_NO if we are out of elements
2123 */ 2129 */
2124int 2130enum GNUNET_GenericReturnValue
2125GNUNET_CONTAINER_multihashmap32_iterator_next ( 2131GNUNET_CONTAINER_multihashmap32_iterator_next (
2126 struct GNUNET_CONTAINER_MultiHashMap32Iterator *iter, 2132 struct GNUNET_CONTAINER_MultiHashMap32Iterator *iter,
2127 uint32_t *key, 2133 uint32_t *key,
@@ -2568,7 +2574,7 @@ GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap);
2568 * @return #GNUNET_YES if an element is returned, 2574 * @return #GNUNET_YES if an element is returned,
2569 * #GNUNET_NO if the heap is empty. 2575 * #GNUNET_NO if the heap is empty.
2570 */ 2576 */
2571int 2577enum GNUNET_GenericReturnValue
2572GNUNET_CONTAINER_heap_peek2 (const struct GNUNET_CONTAINER_Heap *heap, 2578GNUNET_CONTAINER_heap_peek2 (const struct GNUNET_CONTAINER_Heap *heap,
2573 void **element, 2579 void **element,
2574 GNUNET_CONTAINER_HeapCostType *cost); 2580 GNUNET_CONTAINER_HeapCostType *cost);
@@ -2608,8 +2614,8 @@ GNUNET_CONTAINER_heap_node_get_cost (
2608 * @return #GNUNET_YES if we should continue to iterate, 2614 * @return #GNUNET_YES if we should continue to iterate,
2609 * #GNUNET_NO if not. 2615 * #GNUNET_NO if not.
2610 */ 2616 */
2611typedef int 2617typedef enum GNUNET_GenericReturnValue
2612(*GNUNET_CONTAINER_HeapIterator) ( 2618(*GNUNET_CONTAINER_HeapIterator)(
2613 void *cls, 2619 void *cls,
2614 struct GNUNET_CONTAINER_HeapNode *node, 2620 struct GNUNET_CONTAINER_HeapNode *node,
2615 void *element, 2621 void *element,
diff --git a/src/util/plugin.c b/src/util/plugin.c
index 6ee41eec9..ffbae06ff 100644
--- a/src/util/plugin.c
+++ b/src/util/plugin.c
@@ -124,7 +124,8 @@ plugin_fini (void)
124 GNUNET_free (old_dlsearchpath); 124 GNUNET_free (old_dlsearchpath);
125 old_dlsearchpath = NULL; 125 old_dlsearchpath = NULL;
126 } 126 }
127 lt_dlexit (); 127 if (NULL == getenv ("VALGRINDING_PLUGINS"))
128 lt_dlexit ();
128} 129}
129 130
130 131
@@ -162,16 +163,7 @@ resolve_function (struct PluginList *plug,
162} 163}
163 164
164 165
165/** 166enum GNUNET_GenericReturnValue
166 * Test if a plugin exists.
167 *
168 * Note that the library must export a symbol called
169 * `library_name_init` for the test to succeed.
170 *
171 * @param library_name name of the plugin to test if it is installed
172 * @return #GNUNET_YES if the plugin exists, #GNUNET_NO if not
173 */
174int
175GNUNET_PLUGIN_test (const char *library_name) 167GNUNET_PLUGIN_test (const char *library_name)
176{ 168{
177 void *libhandle; 169 void *libhandle;
@@ -201,18 +193,6 @@ GNUNET_PLUGIN_test (const char *library_name)
201} 193}
202 194
203 195
204/**
205 * Setup plugin (runs the `init` callback and returns whatever `init`
206 * returned). If `init` returns NULL, the plugin is unloaded.
207 *
208 * Note that the library must export symbols called
209 * `library_name_init` and `library_name_done`. These will be called
210 * when the library is loaded and unloaded respectively.
211 *
212 * @param library_name name of the plugin to load
213 * @param arg argument to the plugin initialization function
214 * @return whatever the initialization function returned
215 */
216void * 196void *
217GNUNET_PLUGIN_load (const char *library_name, 197GNUNET_PLUGIN_load (const char *library_name,
218 void *arg) 198 void *arg)
@@ -257,14 +237,6 @@ GNUNET_PLUGIN_load (const char *library_name,
257} 237}
258 238
259 239
260/**
261 * Unload plugin (runs the `done` callback and returns whatever `done`
262 * returned). The plugin is then unloaded.
263 *
264 * @param library_name name of the plugin to unload
265 * @param arg argument to the plugin shutdown function
266 * @return whatever the shutdown function returned
267 */
268void * 240void *
269GNUNET_PLUGIN_unload (const char *library_name, 241GNUNET_PLUGIN_unload (const char *library_name,
270 void *arg) 242 void *arg)
@@ -295,7 +267,8 @@ GNUNET_PLUGIN_unload (const char *library_name,
295 prev->next = pos->next; 267 prev->next = pos->next;
296 if (NULL != done) 268 if (NULL != done)
297 ret = done (arg); 269 ret = done (arg);
298 lt_dlclose (pos->handle); 270 if (NULL == getenv ("VALGRINDING_PLUGINS"))
271 lt_dlclose (pos->handle);
299 GNUNET_free (pos->name); 272 GNUNET_free (pos->name);
300 GNUNET_free (pos); 273 GNUNET_free (pos);
301 if (NULL == plugins) 274 if (NULL == plugins)
@@ -381,23 +354,6 @@ find_libraries (void *cls,
381} 354}
382 355
383 356
384/**
385 * Load all compatible plugins with the given base name.
386 *
387 * Note that the library must export symbols called
388 * `basename_ANYTHING_init` and `basename_ANYTHING__done`. These will
389 * be called when the library is loaded and unloaded respectively.
390 *
391 * If you are writing a service to which third-party applications can connect,
392 * like GNUnet's own GNS service for example, you should use
393 * #GNUNET_PLUGIN_load_all_in_context instead of this function, passing your
394 * service's project data as context.
395 *
396 * @param basename basename of the plugins to load
397 * @param arg argument to the plugin initialization function
398 * @param cb function to call for each plugin found
399 * @param cb_cls closure for @a cb
400 */
401void 357void
402GNUNET_PLUGIN_load_all (const char *basename, 358GNUNET_PLUGIN_load_all (const char *basename,
403 void *arg, 359 void *arg,
@@ -425,20 +381,6 @@ GNUNET_PLUGIN_load_all (const char *basename,
425} 381}
426 382
427 383
428/**
429 * Load all compatible plugins with the given base name while inside the given
430 * context (i.e. a specific project data structure.)
431 *
432 * Note that the library must export symbols called `basename_ANYTHING_init`
433 * and `basename_ANYTHING__done`. These will be called when the library is
434 * loaded and unloaded respectively.
435 *
436 * @param ctx the context used to find the plugins
437 * @param basename basename of the plugins to load
438 * @param arg argument to the plugin initialization function
439 * @param cb function to call for each plugin found
440 * @param cb_cls closure for @a cb
441 */
442void 384void
443GNUNET_PLUGIN_load_all_in_context (const struct GNUNET_OS_ProjectData *ctx, 385GNUNET_PLUGIN_load_all_in_context (const struct GNUNET_OS_ProjectData *ctx,
444 const char *basename, 386 const char *basename,