00001 /* 00002 ** Copyright(C) 2008 INL 00003 ** Written by Sebastien Tricaud <s.tricaud@inl.fr> 00004 ** 00005 ** $Id: config-table.h 4937 2008-09-23 15:47:05Z toady $ 00006 ** 00007 ** This program is free software; you can redistribute it and/or modify 00008 ** it under the terms of the GNU General Public License as published by 00009 ** the Free Software Foundation, version 3 of the License. 00010 ** 00011 ** This program is distributed in the hope that it will be useful, 00012 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 ** GNU General Public License for more details. 00015 ** 00016 ** You should have received a copy of the GNU General Public License 00017 ** along with this program; if not, write to the Free Software 00018 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 */ 00020 00021 #ifndef _CONFIG_TABLE_H_ 00022 #define _CONFIG_TABLE_H_ 00023 00024 #include "linuxlist.h" 00025 00026 struct config_table_t { 00027 struct llist_head list; 00028 void *key; 00029 void *value; 00030 } config_table_t; 00031 00032 char *nubase_config_table_get(char *key); 00033 char *nubase_config_table_get_alwaysstring(char *key); 00034 char *nubase_config_table_get_or_default(char *key, char *replace); 00035 int nubase_config_table_get_or_default_int(char *key, int defint); 00036 00037 struct config_table_t *nubase_config_table_append(char *key, char *value); 00038 void nubase_config_table_destroy(void); 00039 struct config_table_t *nubase_config_table_set(char *key, char *value); 00040 void nubase_config_table_print(void *userdata, void (*func)(void *data, char *keyeqval)); 00041 00042 #endif /* _CONFIG_TABLE_H_ */ 00043
1.4.7