extended load api
authorChristian Grothoff <christian@grothoff.org>
Thu, 21 Oct 2010 09:40:33 +0000 (09:40 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 21 Oct 2010 09:40:33 +0000 (09:40 +0000)
src/include/gnunet_load_lib.h
src/util/load.c

index 7d3ec353e82ed370dd7a1dd741616ed8211fc01d..ea2ad588edceb1659d6645e77513a21ba2cdf90c 100644 (file)
@@ -55,6 +55,17 @@ struct GNUNET_LOAD_Value *
 GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline);
 
 
+/**
+ * Change the value by which the load automatically declines.
+ *
+ * @param load load to update
+ * @param autodecline frequency of load decline
+ */
+void
+GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load,
+                              struct GNUNET_TIME_Relative autodecline);
+
+
 /**
  * Free a load value.
  *
index be33ac1afe6b809fe84f1ec755814c782e7833bb..b7ab01540b18c540921872dea78abc55a07da71d 100644 (file)
@@ -127,6 +127,21 @@ GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline)
 }
 
 
+/**
+ * Change the value by which the load automatically declines.
+ *
+ * @param load load to update
+ * @param autodecline frequency of load decline
+ */
+void
+GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load,
+                              struct GNUNET_TIME_Relative autodecline)
+{
+  internal_update (load);
+  load->autodecline = autodecline;  
+}
+
+
 /**
  * Recalculate our load value.
  *