[Openvas-commits] r2724 - in trunk/openvas-client: . src/util

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Mar 10 15:39:53 CET 2009


Author: felix
Date: 2009-03-10 15:39:50 +0100 (Tue, 10 Mar 2009)
New Revision: 2724

Modified:
   trunk/openvas-client/ChangeLog
   trunk/openvas-client/src/util/priority_filter.c
   trunk/openvas-client/src/util/priority_filter.h
Log:
Added function to remove an override from a priority_filter.

* src/util/priority_filter.c, src/util/priority_filter.h
(priority_filter_remove): New function. Removes and frees an override
from a filter.


Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog	2009-03-10 13:56:32 UTC (rev 2723)
+++ trunk/openvas-client/ChangeLog	2009-03-10 14:39:50 UTC (rev 2724)
@@ -1,5 +1,13 @@
 2009-03-10  Felix Wolfsteller <felix.wolfsteller at intevation.de>
 
+	Added function to remove an override from a priority_filter.
+
+	* src/util/priority_filter.c, src/util/priority_filter.h
+	(priority_filter_remove): New function. Removes and frees an override
+	from a filter.
+
+2009-03-10  Felix Wolfsteller <felix.wolfsteller at intevation.de>
+
 	Added stub for new module priority_override_form that acts as a Viewer
 	and editor for a priority_override much in the same fashion as in the
 	SSH Credentials Manager. An actual own widget implementation might grow

Modified: trunk/openvas-client/src/util/priority_filter.c
===================================================================
--- trunk/openvas-client/src/util/priority_filter.c	2009-03-10 13:56:32 UTC (rev 2723)
+++ trunk/openvas-client/src/util/priority_filter.c	2009-03-10 14:39:50 UTC (rev 2724)
@@ -234,6 +234,9 @@
 /**
  * @brief Adds a priority_override to a priority_filter.
  * 
+ * It is assumed that an override is added only once to a filter
+ * - priority_filter_remove might otherwise create a mess.
+ * 
  * @param filter   The priority_filter to add a override to.
  * @param override The priority_override to add to the filter.
  *                 The object is used directly, no copy created.
@@ -256,6 +259,22 @@
 
 
 /**
+ * @brief Removes and frees a override from a filter.
+ * 
+ * Note that is assumed that the same override has not been added twice to
+ * a priority_filter.
+ * 
+ * @param filter   The filter from wich to remove the override.
+ * @param override The override to remove from the filter.
+ */
+void
+priority_filter_remove (priority_filter_t* filter, priority_override_t* override)
+{
+  filter->overrides = g_slist_remove (filter->overrides, override);
+  priority_override_free (override);
+}
+
+/**
  * @brief In a list- callback write a priority override xml-element to file.
  * 
  * @param override The override to write an xml-element for.

Modified: trunk/openvas-client/src/util/priority_filter.h
===================================================================
--- trunk/openvas-client/src/util/priority_filter.h	2009-03-10 13:56:32 UTC (rev 2723)
+++ trunk/openvas-client/src/util/priority_filter.h	2009-03-10 14:39:50 UTC (rev 2724)
@@ -81,6 +81,7 @@
 gboolean priority_filter_add(priority_filter_t *, const priority_override_t *);
 const gchar * priority_filter_apply(const gchar *, const gchar *, const gchar *,
                                     const gchar *);
+void priority_filter_remove (priority_filter_t* filter, priority_override_t* override);
 
 const priority_override_t * priority_override_new (const gchar *, const gchar *,
                     const gchar *, const gchar *, const gchar *, const gchar *,



More information about the Openvas-commits mailing list