1 /**
2 * collectd - src/utils_ignorelist.h
3 * Copyright (C) 2006 Lubos Stanek <lubek at users.sourceforge.net>
4 *
5 * This program is free software; you can redistribute it and/
6 * or modify it under the terms of the GNU General Public Li-
7 * cence as published by the Free Software Foundation; either
8 * version 2 of the Licence, or any later version.
9 *
10 * This program is distributed in the hope that it will be use-
11 * ful, but WITHOUT ANY WARRANTY; without even the implied war-
12 * ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public Licence for more details.
14 *
15 * You should have received a copy of the GNU General Public
16 * Licence along with this program; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
18 * USA.
19 *
20 * Authors:
21 * Lubos Stanek <lubek at users.sourceforge.net>
22 **/
23 /**
24 * ignorelist handles plugin's list of configured collectable
25 * entries with global ignore action
26 **/
28 #ifndef UTILS_IGNORELIST_H
29 #define UTILS_IGNORELIST_H 1
31 #include "collectd.h"
33 #if HAVE_REGEX_H
34 # include <regex.h>
35 #endif
37 /* public prototypes */
39 struct ignorelist_s;
40 typedef struct ignorelist_s ignorelist_t;
42 /*
43 * create the ignorelist_t with known ignore state
44 * return pointer to ignorelist_t
45 */
46 ignorelist_t *ignorelist_create (int invert);
48 /*
49 * free memory used by ignorelist_t
50 */
51 void ignorelist_free (ignorelist_t *il);
53 /*
54 * set ignore state of the ignorelist_t
55 */
56 void ignorelist_set_invert (ignorelist_t *il, int invert);
58 /*
59 * append entry to ignorelist_t
60 * returns zero on success, non-zero upon failure.
61 */
62 int ignorelist_add (ignorelist_t *il, const char *entry);
64 /*
65 * check list for entry
66 * return 1 for ignored entry
67 */
68 int ignorelist_match (ignorelist_t *il, const char *entry);
70 #endif /* UTILS_IGNORELIST_H */