summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 403e429)
raw | patch | inline | side by side (parent: 403e429)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 20 Nov 2006 16:47:26 +0000 (17:47 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 20 Nov 2006 16:47:26 +0000 (17:47 +0100) |
src/utils_ignorelist.c | patch | blob | history | |
src/utils_ignorelist.h | patch | blob | history |
diff --git a/src/utils_ignorelist.c b/src/utils_ignorelist.c
index 1adfbc6b06899c2c58fcc66622fa643a1fe97f7f..31a3e665fd8609df3aac6df99f567729f5c5bb65 100644 (file)
--- a/src/utils_ignorelist.c
+++ b/src/utils_ignorelist.c
/**
- * 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) */
il->ignore = invert ? 0 : 1;
} /* 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 */
diff --git a/src/utils_ignorelist.h b/src/utils_ignorelist.h
index e7cce66a324d7da7eda1915f561b0d8185b05386..b47b55adb0a10ea4840e0143806b3d5e29e7bba3 100644 (file)
--- a/src/utils_ignorelist.h
+++ b/src/utils_ignorelist.h
/**
- * 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