X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_tail_match.h;h=0217a7e80f5433ba20c795108b710e210bc91413;hb=fe5167843e22b7b1ca4c7e5ba0e1d0df387b0094;hp=53c0de797146d42fae18de7cc9a6aa5500aa8111;hpb=633c3966f770e4d46651a2fe219a18d8a9907a9f;p=collectd.git diff --git a/src/utils_tail_match.h b/src/utils_tail_match.h index 53c0de79..0217a7e8 100644 --- a/src/utils_tail_match.h +++ b/src/utils_tail_match.h @@ -3,18 +3,23 @@ * Copyright (C) 2007-2008 C-Ware, Inc. * Copyright (C) 2008 Florian Forster * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; only version 2 of the License is applicable. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. * * Authors: * Luke Heberling @@ -28,7 +33,8 @@ * regular expressions. */ -#include "utils_match.h" +#include "utils/latency/latency_config.h" +#include "utils/match/match.h" struct cu_tail_match_s; typedef struct cu_tail_match_s cu_tail_match_t; @@ -46,7 +52,7 @@ typedef struct cu_tail_match_s cu_tail_match_t; * RETURN VALUE * Returns NULL upon failure, non-NULL otherwise. */ -cu_tail_match_t *tail_match_create (const char *filename); +cu_tail_match_t *tail_match_create(const char *filename); /* * NAME @@ -58,7 +64,7 @@ cu_tail_match_t *tail_match_create (const char *filename); * PARAMETERS * The object to destroy. */ -void tail_match_destroy (cu_tail_match_t *obj); +void tail_match_destroy(cu_tail_match_t *obj); /* * NAME @@ -73,39 +79,43 @@ void tail_match_destroy (cu_tail_match_t *obj); * matched any lines recently or not. * When `tail_match_destroy' is called the `user_data' pointer is freed using * the `free_user_data' callback - if it is not NULL. - * When using this interface the `tail_match' module doesn't dispatch any values - * itself - all that has to happen in either the match-callbacks or the - * submit_match callback. + * When using this interface the `tail_match' module doesn't dispatch any + * values itself - all that has to happen in either the match-callbacks or + * the submit_match callback. * * RETURN VALUE * Zero upon success, non-zero otherwise. */ -int tail_match_add_match (cu_tail_match_t *obj, cu_match_t *match, - int (*submit_match) (cu_match_t *match, void *user_data), - void *user_data, - void (*free_user_data) (void *user_data)); +int tail_match_add_match(cu_tail_match_t *obj, cu_match_t *match, + int (*submit_match)(cu_match_t *match, + void *user_data), + void *user_data, + void (*free_user_data)(void *user_data)); /* * NAME * tail_match_add_match_simple * * DESCRIPTION - * A simplified version of `tail_match_add_match'. The regular expressen `regex' - * must match a number, which is then dispatched according to `ds_type'. See - * the `match_create_simple' function in utils_match.h for a description how - * this flag effects calculation of a new value. - * The values gathered are dispatched by the tail_match module in this case. The - * passed `plugin', `plugin_instance', `type', and `type_instance' are + * A simplified version of `tail_match_add_match'. The regular expression + * `regex' must match a number, which is then dispatched according to + * `ds_type'. + * See the `match_create_simple' function in utils_match.h for a description + * how this flag effects calculation of a new value. + * The values gathered are dispatched by the tail_match module in this case. + * The passed `plugin', `plugin_instance', `type', and `type_instance' are * directly used when submitting these values. * With excluderegex it is possible to exlude lines from the match. + * The `latency_cfg' specifies configuration for submitting latency. * * RETURN VALUE * Zero upon success, non-zero otherwise. */ -int tail_match_add_match_simple (cu_tail_match_t *obj, - const char *regex, const char *excluderegex, int ds_type, - const char *plugin, const char *plugin_instance, - const char *type, const char *type_instance, const cdtime_t interval); +int tail_match_add_match_simple(cu_tail_match_t *obj, const char *regex, + const char *excluderegex, int ds_type, + const char *plugin, const char *plugin_instance, + const char *type, const char *type_instance, + const latency_config_t latency_cfg); /* * NAME @@ -116,12 +126,10 @@ int tail_match_add_match_simple (cu_tail_match_t *obj, * from the logfile using `utils_tail' and tries to match them using all * added `utils_match' objects. * After all lines have been read and processed, the submit_match callback is - * called or, in case of tail_match_add_match_simple, the data is dispatched to - * the daemon directly. + * called or, in case of tail_match_add_match_simple, the data is dispatched + * to the daemon directly. * * RETURN VALUE * Zero on success, nonzero on failure. */ -int tail_match_read (cu_tail_match_t *obj); - -/* vim: set sw=2 sts=2 ts=8 : */ +int tail_match_read(cu_tail_match_t *obj);