X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fliboconfig%2Foconfig.h;h=840137cc25a7f4a59f5bceee43856d257e7c7795;hb=da11ce02eb202b3e01d3e2d1b40f248a84430973;hp=70fc6230fc5753916c8c03d211c78695fda3b0f7;hpb=9d15d1058b93acb7be041934acfe76548539041a;p=collectd.git diff --git a/src/liboconfig/oconfig.h b/src/liboconfig/oconfig.h index 70fc6230..3b81062e 100644 --- a/src/liboconfig/oconfig.h +++ b/src/liboconfig/oconfig.h @@ -1,40 +1,46 @@ -#ifndef OCONFIG_H -#define OCONFIG_H 1 - -#include - /** - * oconfig - src/oconfig.h - * Copyright (C) 2006-2009 Florian octo Forster + * collectd - src/liboconfig/oconfig.h + * Copyright (C) 2006-2009 Florian Forster + * + * 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: * - * 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. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * - * 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. + * 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. * - * 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 + * Authors: + * Florian Forster */ +#ifndef OCONFIG_H +#define OCONFIG_H 1 + +#include + /* * Types */ -#define OCONFIG_TYPE_STRING 0 -#define OCONFIG_TYPE_NUMBER 1 +#define OCONFIG_TYPE_STRING 0 +#define OCONFIG_TYPE_NUMBER 1 #define OCONFIG_TYPE_BOOLEAN 2 -struct oconfig_value_s -{ - union - { - char *string; +struct oconfig_value_s { + union { + char *string; double number; - int boolean; + int boolean; } value; int type; }; @@ -42,28 +48,23 @@ typedef struct oconfig_value_s oconfig_value_t; struct oconfig_item_s; typedef struct oconfig_item_s oconfig_item_t; -struct oconfig_item_s -{ - char *key; +struct oconfig_item_s { + char *key; oconfig_value_t *values; - int values_num; + int values_num; - oconfig_item_t *parent; - oconfig_item_t *children; - int children_num; + oconfig_item_t *parent; + oconfig_item_t *children; + int children_num; }; /* * Functions */ -oconfig_item_t *oconfig_parse_fh (FILE *fh); -oconfig_item_t *oconfig_parse_file (const char *file); +oconfig_item_t *oconfig_parse_file(const char *file); -oconfig_item_t *oconfig_clone (const oconfig_item_t *ci); +oconfig_item_t *oconfig_clone(const oconfig_item_t *ci); -void oconfig_free (oconfig_item_t *ci); +void oconfig_free(oconfig_item_t *ci); -/* - * vim: shiftwidth=2:tabstop=8:softtabstop=2 - */ #endif /* OCONFIG_H */