/**
- * collectd - src/config_list.c
+ * collectd - src/utils_ignorelist.c
* Copyright (C) 2006 Lubos Stanek <lubek at users.sourceforge.net>
*
* This program is free software; you can redistribute it and/
struct ignorelist_s
{
int ignore; /* ignore entries */
- int num; /* number of entries */
ignorelist_item_t *head; /* pointer to the first entry */
};
item->next = il->head;
il->head = item;
-
- il->num++;
}
#if HAVE_REGEX_H
for (this = il->head; this != NULL; this = next)
{
- DBG ("free - item = 0x%p, numlist %i", (void *) this, il->num);
next = this->next;
- il->num--;
#if HAVE_REGEX_H
if (this->rmatch != NULL)
{
}
sfree (this);
}
-#if COLLECTD_DEBUG
- if (il->num != 0)
- DBG ("after free numlist: %i", il->num);
-#endif
- il->num = 0;
+
sfree (il);
il = NULL;
} /* void ignorelist_destroy (ignorelist_t *il) */
} /* void ignorelist_set_invert (ignorelist_t *il, int ignore) */
/*
- * get number of entries in the ignorelist_t
- * return int number
- */
-int ignorelist_num (ignorelist_t *il)
-{
- if (il == NULL)
- {
- DBG("get num called with ignorelist_t == NULL");
- return (0);
- }
-
- return (il->num);
-} /* int ignorelist_num (ignorelist_t *il) */
-
-/*
* append entry into ignorelist_t
* return 1 for success
*/
ignorelist_item_t *traverse;
/* if no entries, collect all */
- if (ignorelist_num(il) == 0)
+ if (il->head == NULL)
return (0);
/* traverse list and check entries */
/**
- * collectd - src/config_list.h
+ * collectd - src/utils_ignorelist.h
* Copyright (C) 2006 Lubos Stanek <lubek at users.sourceforge.net>
*
* This program is free software; you can redistribute it and/
* set ignore state of the ignorelist_t
*/
void ignorelist_set_invert (ignorelist_t *il, int invert);
-/*
- * get number of entries in the ignorelist_t
- * return int number
- */
-int ignorelist_num (ignorelist_t *il);
/*
* append entry to ignorelist_t