return (old);
} /* void plugin_set_ctx */
+cdtime_t plugin_get_interval (void)
+{
+ cdtime_t interval;
+
+ const char *interval_str;
+ double interval_dbl;
+
+ interval = plugin_get_ctx().interval;
+ if (interval > 0)
+ return interval;
+
+ /* this should happen during initialization only */
+ interval_str = global_option_get ("Interval");
+ if (interval_str != NULL)
+ {
+ interval_dbl = atof (interval_str);
+ if (interval_dbl > 0.0)
+ interval = DOUBLE_TO_CDTIME_T (interval_dbl);
+ }
+
+ if (interval > 0)
+ return interval;
+ return TIME_T_TO_CDTIME_T (10);
+} /* cdtime_t plugin_get_interval */
+
typedef struct {
plugin_ctx_t ctx;
void *(*start_routine) (void *);
plugin_ctx_t plugin_set_ctx (plugin_ctx_t ctx);
/*
+ * NAME
+ * plugin_get_interval
+ *
+ * DESCRIPTION
+ * This function returns the current value of the plugin's interval. The
+ * return value will be strictly greater than zero in all cases. If
+ * everything else fails, it will fall back to 10 seconds.
+ */
+cdtime_t plugin_get_interval (void);
+
+/*
* Context-aware thread management.
*/