| 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 License along |
| 16 |
* with this program; if not, write to the Free Software Foundation, Inc., |
| 17 |
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 |
* |
| 19 |
* Authors: |
| 20 |
* Lubos Stanek <lubek at users.sourceforge.net> |
| 21 |
**/ |
| 22 |
/** |
| 23 |
* ignorelist handles plugin's list of configured collectable |
| 24 |
* entries with global ignore action |
| 25 |
**/ |
| 26 |
|
| 27 |
#ifndef UTILS_IGNORELIST_H |
| 28 |
#define UTILS_IGNORELIST_H 1 |
| 29 |
|
| 30 |
#include "collectd.h" |
| 31 |
|
| 32 |
#if HAVE_REGEX_H |
| 33 |
#include <regex.h> |
| 34 |
#endif |
| 35 |
|
| 36 |
/* public prototypes */ |
| 37 |
|
| 38 |
struct ignorelist_s; |
| 39 |
typedef struct ignorelist_s ignorelist_t; |
| 40 |
|
| 41 |
/* |
| 42 |
* create the ignorelist_t with known ignore state |
| 43 |
* return pointer to ignorelist_t |
| 44 |
*/ |
| 45 |
ignorelist_t *ignorelist_create(int invert); |
| 46 |
|
| 47 |
/* |
| 48 |
* free memory used by ignorelist_t |
| 49 |
*/ |
| 50 |
void ignorelist_free(ignorelist_t *il); |
| 51 |
|
| 52 |
/* |
| 53 |
* set ignore state of the ignorelist_t |
| 54 |
*/ |
| 55 |
void ignorelist_set_invert(ignorelist_t *il, int invert); |
| 56 |
|
| 57 |
/* |
| 58 |
* append entry to ignorelist_t |
| 59 |
* returns zero on success, non-zero upon failure. |
| 60 |
*/ |
| 61 |
int ignorelist_add(ignorelist_t *il, const char *entry); |
| 62 |
|
| 63 |
/* |
| 64 |
* remote entry from ignorelist_t |
| 65 |
* returns zero on success, non-zero upon failure. |
| 66 |
*/ |
| 67 |
int ignorelist_remove(ignorelist_t *il, const char *entry); |
| 68 |
|
| 69 |
/* |
| 70 |
* check list for entry |
| 71 |
* return 1 for ignored entry |
| 72 |
*/ |
| 73 |
int ignorelist_match(ignorelist_t *il, const char *entry); |
| 74 |
|
| 75 |
#endif /* UTILS_IGNORELIST_H */ |