]> git.gag.com Git - debian/amanda/blobdiff - common-src/glib-util.c
oops, references to the server /var/log/amanda directory in rules, too
[debian/amanda] / common-src / glib-util.c
index 7ba6702259e4040867a5ff661d83c008610f3333..99f55f7aa8a91824fbb2d9202dc4fcc2fa1b9f3e 100644 (file)
@@ -38,12 +38,8 @@ glib_init(void) {
     if (did_glib_init) return;
     did_glib_init = TRUE;
 
-    /* set up libcurl (this must happen before threading 
-     * is initialized) */
+    /* set up libcurl */
 #ifdef HAVE_LIBCURL
-# ifdef G_THREADS_ENABLED
-    g_assert(!g_thread_supported()); /* assert threads aren't initialized yet */
-# endif
     g_assert(curl_global_init(CURL_GLOBAL_ALL) == 0);
 #endif
 
@@ -64,12 +60,6 @@ glib_init(void) {
     /* Initialize glib's type system.  On glib >= 2.24, this will initialize
      * threads, so it must be done after curl is initialized. */
     g_type_init();
-
-    /* And set up glib's threads */
-#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)
-    if (!g_thread_supported())
-       g_thread_init(NULL);
-#endif
 }
 
 typedef enum {
@@ -106,42 +96,19 @@ GValue* g_value_unset_copy(const GValue * from, GValue * to) {
     return to;
 }
 
-void g_list_free_full(GList * list) {
-    GList * cur = list;
-
-    while (cur != NULL) {
-        gpointer data = cur->data;
-        amfree(data);
-        cur = g_list_next(cur);
-    }
-
-    g_list_free(list);
-}
-
-void g_slist_free_full(GSList * list) {
+#if (GLIB_MAJOR_VERSION < 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 28))
+void slist_free_full(GSList * list, GDestroyNotify free_fn) {
     GSList * cur = list;
 
     while (cur != NULL) {
         gpointer data = cur->data;
-        amfree(data);
+        free_fn(data);
         cur = g_slist_next(cur);
     }
 
     g_slist_free(list);
 }
-
-void g_slist_free_full_gpointer(gpointer list) {
-    g_slist_free_full((GSList *)list);
-}
-
-void g_queue_free_full(GQueue * queue) {
-    while (!g_queue_is_empty(queue)) {
-        gpointer data;
-        data = g_queue_pop_head(queue);
-        amfree(data);
-    }
-    g_queue_free(queue);
-}
+#endif
 
 void g_ptr_array_free_full(GPtrArray * array) {
     size_t i;