| 1 | /* |
| 2 | * Copyright (C) 2004,2005 Dizzy |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; either version 2 |
| 7 | * of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | */ |
| 18 | |
| 19 | #ifndef __CONF_H_TYPES__ |
| 20 | #define __CONF_H_TYPES__cxx . . $ `src/common/conf.h:20:9`! |
| 21 | |
| 22 | namespace pvpgncxx . . $ pvpgn/ |
| 23 | { |
| 24 | |
| 25 | /* a conf entry object with a set and a get method */ |
| 26 | |
| 27 | typedef structcxx . . $ pvpgn/$anonymous_type_29e473bcbc8c3c72_0# { |
| 28 | const char *namecxx . . $ pvpgn/$anonymous_type_29e473bcbc8c3c72_0#name.; |
| 29 | int(*setcxx . . $ pvpgn/$anonymous_type_29e473bcbc8c3c72_0#set.)(const char *valstr); /* called with NULL for cleanup */ |
| 30 | const char * (*getcxx . . $ pvpgn/$anonymous_type_29e473bcbc8c3c72_0#get.)(void); |
| 31 | int(*setdefcxx . . $ pvpgn/$anonymous_type_29e473bcbc8c3c72_0#setdef.)(void); |
| 32 | } t_conf_entrycxx . . $ pvpgn/t_conf_entry#; |
| 33 | |
| 34 | } |
| 35 | |
| 36 | #endif /* __CONF_H_TYPES__ */ |
| 37 | |
| 38 | #ifndef __CONF_H_PROTOS__ |
| 39 | #define __CONF_H_PROTOS__cxx . . $ `src/common/conf.h:39:9`! |
| 40 | |
| 41 | #include <cstdio> |
| 42 | #include <ctime> |
| 43 | |
| 44 | namespace pvpgncxx . . $ pvpgn/ |
| 45 | { |
| 46 | |
| 47 | /* helpfull utility functions for common conf types like bool, int and str */ |
| 48 | extern int conf_set_boolcxx . . $ pvpgn/conf_set_bool(5db442afce5f848d).(unsigned *pbool, const char *valstr, unsigned def); |
| 49 | extern int conf_set_intcxx . . $ pvpgn/conf_set_int(5db442afce5f848d).(unsigned *pint, const char *valstr, unsigned def); |
| 50 | extern int conf_set_strcxx . . $ pvpgn/conf_set_str(ef5efe93f374dbad).(const char **pstr, const char *valstr, const char *def); |
| 51 | extern int conf_set_timestrcxx . . $ pvpgn/conf_set_timestr(e90df6d2f7bece25).(stdcxx . . $ std/::time_tcxx . . $ std/time_t#* ptime, const char *valstr, stdcxx . . $ std/::time_tcxx . . $ std/time_t# def); |
| 52 | extern const char* conf_get_intcxx . . $ pvpgn/conf_get_int(81a3ae90da26a711).(unsigned ival); |
| 53 | extern const char* conf_get_boolcxx . . $ pvpgn/conf_get_bool(81a3ae90da26a711).(unsigned ival); |
| 54 | |
| 55 | /* loading/unloading functions */ |
| 56 | extern int conf_load_filecxx . . $ pvpgn/conf_load_file(d06f02f90cf2e5b0).(stdcxx . . $ std/::FILEcxx . . $ std/FILE# *fd, t_conf_entrycxx . . $ pvpgn/t_conf_entry# *conftab); |
| 57 | extern int conf_load_cmdlinecxx . . $ pvpgn/conf_load_cmdline(8a18c527fa86306c).(int argc, char **argv, t_conf_entrycxx . . $ pvpgn/t_conf_entry# *conftab); |
| 58 | extern void conf_unloadcxx . . $ pvpgn/conf_unload(ffbf16c7007c705c).(t_conf_entrycxx . . $ pvpgn/t_conf_entry# *conftab); |
| 59 | |
| 60 | } |
| 61 | |
| 62 | #endif /* __CONF_H_PROTOS__ */ |