X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fgraph_instance.c;h=0b71e15e1fdf897ba2a8e477533092c7ff3eebea;hb=f393a5cc0a2a7b0cd1d5b06166966d7af6f9daf5;hp=2d12873e7624b037852bc40e685ed7ff2b0bb711;hpb=7d659a7188dd2012d9e7a90168750757b4ef97ba;p=collection4.git diff --git a/src/graph_instance.c b/src/graph_instance.c index 2d12873..0b71e15 100644 --- a/src/graph_instance.c +++ b/src/graph_instance.c @@ -1,3 +1,26 @@ +/** + * collection4 - graph_instance.c + * Copyright (C) 2010 Florian octo Forster + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * Authors: + * Florian octo Forster + **/ + #include #include #include @@ -26,7 +49,7 @@ struct graph_instance_s /* {{{ */ struct def_callback_data_s { graph_instance_t *inst; - str_array_t *args; + rrd_args_t *args; }; typedef struct def_callback_data_s def_callback_data_t; @@ -124,7 +147,7 @@ static int gl_instance_get_rrdargs_cb (graph_def_t *def, void *user_data) /* {{{ { def_callback_data_t *data = user_data; graph_instance_t *inst = data->inst; - str_array_t *args = data->args; + rrd_args_t *args = data->args; size_t i; @@ -311,7 +334,7 @@ int inst_get_all_selected (graph_config_t *cfg, /* {{{ */ int inst_get_rrdargs (graph_config_t *cfg, /* {{{ */ graph_instance_t *inst, - str_array_t *args) + rrd_args_t *args) { def_callback_data_t data = { inst, args }; graph_def_t *defs; @@ -419,13 +442,24 @@ int inst_compare_ident (graph_instance_t *inst, /* {{{ */ return (ident_compare (inst->select, ident)); } /* }}} int inst_compare_ident */ -_Bool inst_matches_ident (graph_instance_t *inst, /* {{{ */ +_Bool inst_ident_matches (graph_instance_t *inst, /* {{{ */ const graph_ident_t *ident) { +#if C4_DEBUG if ((inst == NULL) || (ident == NULL)) return (0); +#endif return (ident_matches (inst->select, ident)); +} /* }}} _Bool inst_ident_matches */ + +_Bool inst_matches_ident (graph_instance_t *inst, /* {{{ */ + const graph_ident_t *ident) +{ + if ((inst == NULL) || (ident == NULL)) + return (0); + + return (ident_matches (ident, inst->select)); } /* }}} _Bool inst_matches_ident */ _Bool inst_matches_string (graph_config_t *cfg, /* {{{ */