/* * 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; either version 2 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 Library 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef OPTION_H #define OPTION_H #include #include #include #include "chain.h" typedef enum { OPTION_STRING, OPTION_INT, OPTION_CHAIN } option_type; struct option { char *name; void *value; option_type type; }; typedef struct option option; option *option_new(const char *, option_type, const void *); void option_destroy(option *); option *option_copy(const option *); void drop_all_option(void); struct chain *get_root_option(); void set_root_option(void *); void *get_option(const char *, option_type *); int set_option(const char *, option_type, const void *); int add_option(const char *, option_type, const void *); struct chain *find_option_byname(const char *); /* Uniquement pour le débuggage */ void dump_option(int, option *); void dump_all_option(int); #endif