#endif /* STRPTIME_NEEDS_STANDARDS */
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "configfile.h"
time_t current_time, void *user_data)
{
translation_table_ptr_t *table = (translation_table_ptr_t *) user_data;
- size_t i;
if (table == NULL)
return (-1);
- for (i = 0; i < table->table_length; i++)
+ for (size_t i = 0; i < table->table_length; i++)
{
if (strcmp (table->table[i].xml_name, name) != 0)
continue;
{
xmlXPathObject *xpathObj = NULL;
int num_entries;
- int i;
xpathObj = xmlXPathEvalExpression(BAD_CAST xpath_expression, xpathCtx);
if (xpathObj == NULL)
num_entries = 0;
/* Iterate over all matching nodes. */
- for (i = 0; xpathObj->nodesetval && (i < xpathObj->nodesetval->nodeNr); i++)
+ for (int i = 0; xpathObj->nodesetval && (i < xpathObj->nodesetval->nodeNr); i++)
{
xmlNode *name_node = NULL;
xmlNode *counter = NULL;
xmlNode *parent;
- xmlNode *child;
parent = xpathObj->nodesetval->nodeTab[i];
DEBUG ("bind plugin: bind_parse_generic_name_value: parent->name = %s;",
(char *) parent->name);
/* Iterate over all child nodes. */
- for (child = parent->xmlChildrenNode;
+ for (xmlNode *child = parent->xmlChildrenNode;
child != NULL;
child = child->next)
{
{
xmlXPathObject *xpathObj = NULL;
int num_entries;
- int i;
xpathObj = xmlXPathEvalExpression(BAD_CAST xpath_expression, xpathCtx);
if (xpathObj == NULL)
num_entries = 0;
/* Iterate over all matching nodes. */
- for (i = 0; xpathObj->nodesetval && (i < xpathObj->nodesetval->nodeNr); i++)
+ for (int i = 0; xpathObj->nodesetval && (i < xpathObj->nodesetval->nodeNr); i++)
{
- xmlNode *child;
-
/* Iterate over all child nodes. */
- for (child = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode;
+ for (xmlNode *child = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode;
child != NULL;
child = child->next)
{
{
xmlXPathObject *xpathObj = NULL;
int num_entries;
- int i;
xpathObj = xmlXPathEvalExpression(BAD_CAST xpath_expression, xpathCtx);
if (xpathObj == NULL)
num_entries = 0;
/* Iterate over all matching nodes. */
- for (i = 0; xpathObj->nodesetval && (i < xpathObj->nodesetval->nodeNr); i++)
+ for (int i = 0; xpathObj->nodesetval && (i < xpathObj->nodesetval->nodeNr); i++)
{
- xmlNode *child;
-
/* Iterate over all child nodes. */
- for (child = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode;
+ for (xmlNode *child = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode;
child != NULL;
child = child->next)
{
{
xmlXPathObject *path_obj;
char *zone_name = NULL;
- int i;
size_t j;
if (version >= 3)
return (-1);
}
- for (i = 0; path_obj->nodesetval && (i < path_obj->nodesetval->nodeNr); i++)
+ for (int i = 0; path_obj->nodesetval && (i < path_obj->nodesetval->nodeNr); i++)
{
zone_name = (char *) xmlNodeListGetString (doc,
path_obj->nodesetval->nodeTab[i]->xmlChildrenNode, 1);
{
xmlXPathObject *zone_nodes = NULL;
xmlXPathContext *zone_path_context;
- int i;
zone_path_context = xmlXPathNewContext (doc);
if (zone_path_context == NULL)
return (-1);
}
- for (i = 0; i < zone_nodes->nodesetval->nodeNr; i++)
+ for (int i = 0; i < zone_nodes->nodesetval->nodeNr; i++)
{
node = zone_nodes->nodesetval->nodeTab[i];
assert (node != NULL);
{
char *view_name = NULL;
cb_view_t *view;
- int i;
size_t j;
if (version == 3)
return (-1);
}
- for (i = 0; path_obj->nodesetval && (i < path_obj->nodesetval->nodeNr); i++)
+ for (int i = 0; path_obj->nodesetval && (i < path_obj->nodesetval->nodeNr); i++)
{
view_name = (char *) xmlNodeListGetString (doc,
path_obj->nodesetval->nodeTab[i]->xmlChildrenNode, 1);
{
xmlXPathObject *view_nodes = NULL;
xmlXPathContext *view_path_context;
- int i;
view_path_context = xmlXPathNewContext (doc);
if (view_path_context == NULL)
return (-1);
}
- for (i = 0; i < view_nodes->nodesetval->nodeNr; i++)
+ for (int i = 0; i < view_nodes->nodesetval->nodeNr; i++)
{
xmlNode *node;
xmlXPathContext *xpathCtx = NULL;
xmlXPathObject *xpathObj = NULL;
int ret = -1;
- int i;
doc = xmlParseMemory (data, strlen (data));
if (doc == NULL)
}
else
{
- for (i = 0; i < xpathObj->nodesetval->nodeNr; i++)
+ for (int i = 0; i < xpathObj->nodesetval->nodeNr; i++)
{
xmlNode *node;
char *attr_version;
return (-1);
}
- for (i = 0; i < xpathObj->nodesetval->nodeNr; i++)
+ for (int i = 0; i < xpathObj->nodesetval->nodeNr; i++)
{
xmlNode *node;
char *attr_version;
static int bind_config_add_view (oconfig_item_t *ci) /* {{{ */
{
cb_view_t *tmp;
- int i;
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING))
{
return (-1);
}
- for (i = 0; i < ci->children_num; i++)
+ for (int i = 0; i < ci->children_num; i++)
{
oconfig_item_t *child = ci->children + i;
static int bind_config (oconfig_item_t *ci) /* {{{ */
{
- int i;
-
- for (i = 0; i < ci->children_num; i++)
+ for (int i = 0; i < ci->children_num; i++)
{
oconfig_item_t *child = ci->children + i;