[gupnp] Add gupnp_white_list_add_entryv



commit 5f31dc3d2671ff0ac7dbee53c435e899d6e414ed
Author: Jens Georg <mail jensge org>
Date:   Wed Oct 23 13:22:26 2013 +0200

    Add gupnp_white_list_add_entryv
    
    Convenience method for adding white list entries from a string array (usually
    aquired via commandline args or such)

 doc/gupnp-sections.txt      |    1 +
 libgupnp/gupnp-white-list.c |   23 +++++++++++++++++++++++
 libgupnp/gupnp-white-list.h |    3 +++
 3 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/doc/gupnp-sections.txt b/doc/gupnp-sections.txt
index e0cd73c..30b3381 100644
--- a/doc/gupnp-sections.txt
+++ b/doc/gupnp-sections.txt
@@ -451,6 +451,7 @@ gupnp_windows_context_manager_get_type
 <TITLE>GUPnPWhiteList</TITLE>
 GUPnPWhiteList
 gupnp_white_list_add_entry
+gupnp_white_list_add_entryv
 gupnp_white_list_check_context
 gupnp_white_list_clear
 gupnp_white_list_set_enabled
diff --git a/libgupnp/gupnp-white-list.c b/libgupnp/gupnp-white-list.c
index 599bd2e..4431236 100644
--- a/libgupnp/gupnp-white-list.c
+++ b/libgupnp/gupnp-white-list.c
@@ -272,6 +272,29 @@ gupnp_white_list_add_entry (GUPnPWhiteList *white_list, gchar* entry)
 }
 
 /**
+ * gupnp_white_list_add_entryv:
+ * @white_list: A #GUPnPWhiteList
+ * @entries: (array zero-terminated=1): A %NULL-terminated list of strings
+ *
+ * Add a list of entries to a #GUPnPWhiteList. This is a helper function to
+ * directly add a %NULL-terminated array of string usually aquired from
+ * commandline args.
+ *
+ * Since: 0.20.8
+ */
+void
+gupnp_white_list_add_entryv (GUPnPWhiteList *white_list, gchar **entries)
+{
+        gchar * const * iter = entries;
+
+        g_return_if_fail (GUPNP_IS_WHITE_LIST (white_list));
+        g_return_if_fail ((entries != NULL));
+
+        for (; *iter != NULL; iter++)
+                gupnp_white_list_add_entry (white_list, *iter);
+ }
+
+/**
  * gupnp_white_list_remove_entry:
  * @white_list: A #GUPnPWhiteList
  * @entry: A value to remove from the filter list.
diff --git a/libgupnp/gupnp-white-list.h b/libgupnp/gupnp-white-list.h
index 9b21b12..8c3ad5d 100644
--- a/libgupnp/gupnp-white-list.h
+++ b/libgupnp/gupnp-white-list.h
@@ -87,6 +87,9 @@ gupnp_white_list_is_empty       (GUPnPWhiteList *white_list);
 gboolean
 gupnp_white_list_add_entry      (GUPnPWhiteList *white_list,
                                  gchar* entry);
+void
+gupnp_white_list_add_entryv     (GUPnPWhiteList *white_list,
+                                 gchar** entries);
 
 gboolean
 gupnp_white_list_remove_entry   (GUPnPWhiteList *white_list,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]