From: Florian Forster Date: Sun, 29 Aug 2010 07:50:59 +0000 (+0200) Subject: perl plugin: Remove deprecated compatibility code from "Collectd_plugin_dispatch_values". X-Git-Tag: collectd-5.0.0-beta0~41 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3ea3b96ec7fe3e2f907bfe6e471d1eaf35b49eee;p=collectd.git perl plugin: Remove deprecated compatibility code from "Collectd_plugin_dispatch_values". --- diff --git a/src/collectd-perl.pod b/src/collectd-perl.pod index 5c11b652..bacf8850 100644 --- a/src/collectd-perl.pod +++ b/src/collectd-perl.pod @@ -376,11 +376,6 @@ is found (and the number of values matches the number of data-sources) then the type, data-set and value-list is passed to all write-callbacks that are registered with the daemon. -B: Prior to version 4.4 of collectd, the data-set type used to be passed -as the first argument to B. This syntax is still supported -for backwards compatibility but has been deprecated and will be removed in -some future version of collectd. - =item B ([B => I<...>][, B => I<...>], B => I<...>) diff --git a/src/perl.c b/src/perl.c index a2f5da29..afb3ba7e 100644 --- a/src/perl.c +++ b/src/perl.c @@ -1610,40 +1610,29 @@ static XS (Collectd_plugin_unregister_ds) static XS (Collectd_plugin_dispatch_values) { SV *values = NULL; - int values_idx = 0; int ret = 0; dXSARGS; - if (2 == items) { - log_warn ("Collectd::plugin_dispatch_values with two arguments " - "is deprecated - pass the type through values->{type}."); - values_idx = 1; - } - else if (1 != items) { + if (1 != items) { log_err ("Usage: Collectd::plugin_dispatch_values(values)"); XSRETURN_EMPTY; } log_debug ("Collectd::plugin_dispatch_values: values=\"%s\"", - SvPV_nolen (ST (values_idx))); + SvPV_nolen (ST (/* stack index = */ 0))); - values = ST (values_idx); + values = ST (/* stack index = */ 0); + /* Make sure the argument is a hash reference. */ if (! (SvROK (values) && (SVt_PVHV == SvTYPE (SvRV (values))))) { log_err ("Collectd::plugin_dispatch_values: Invalid values."); XSRETURN_EMPTY; } - if (((2 == items) && (NULL == ST (0))) || (NULL == values)) - XSRETURN_EMPTY; - - if ((2 == items) && (NULL == hv_store ((HV *)SvRV (values), "type", 4, - newSVsv (ST (0)), 0))) { - log_err ("Collectd::plugin_dispatch_values: Could not store type."); + if (NULL == values) XSRETURN_EMPTY; - } ret = pplugin_dispatch_values (aTHX_ (HV *)SvRV (values));