1
1
mirror of https://github.com/tstellar/bygfoot.git synced 2025-02-23 23:07:43 +01:00
bygfoot/src/option.h

87 lines
3.2 KiB
C
Raw Normal View History

2005-10-20 15:45:00 +00:00
/*
Bygfoot Football Manager -- a small and simple GTK2-based
football management game.
http://bygfoot.sourceforge.net
Copyright (C) 2005 Gyözö Both (gyboth@bygfoot.com)
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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
2005-01-09 20:21:22 +00:00
#ifndef OPTION_H
#define OPTION_H
#include <math.h>
2005-01-09 20:21:22 +00:00
#include "bygfoot.h"
2005-03-23 19:03:26 +00:00
#include "option_struct.h"
2005-01-09 20:21:22 +00:00
/** Convenience abbrevs. */
#define option_set_float(name, option_array, value) option_set_int(name, option_array, (gint)rint(value * 1000))
2005-03-23 19:03:26 +00:00
#define opt_str(name) option_string(name, &options)
#define opt_strp(name) option_string_pointer(name, &options)
#define opt_int(name) option_int(name, &options)
#define opt_intp(name) option_int_pointer(name, &options)
#define opt_float(name) option_float(name, &options)
2005-03-23 19:03:26 +00:00
#define opt_set_int(name, value) option_set_int(name, &options, value)
#define opt_set_str(name, value) option_set_string(name, &options, value)
#define opt_set_float(name, value) option_set_float(name, &options, value)
2005-03-23 19:03:26 +00:00
#define opt_user_str(name) option_string(name, &current_user.options)
#define opt_user_strp(name) option_string_pointer(name, &current_user.options)
#define opt_user_int(name) option_int(name, &current_user.options)
#define opt_user_intp(name) option_int_pointer(name, &current_user.options)
#define opt_user_float(name) option_float(name, &current_user.options)
2005-03-23 19:03:26 +00:00
#define opt_user_set_int(name, value) option_set_int(name, &current_user.options, value)
#define opt_user_set_str(name, value) option_set_string(name, &current_user.options, value)
#define opt_user_set_float(name, value) option_set_float(name, &current_user.options, value)
2005-05-06 16:35:19 +00:00
#define const_app(name) option_string(name, &constants_app)
2005-03-23 19:03:26 +00:00
#define const_str(name) option_string(name, &constants)
#define const_int(name) option_int(name, &constants)
#define const_float(name) option_float(name, &constants)
2005-06-26 11:42:01 +00:00
#define sett_int(name) option_int(name, &settings)
#define sett_set_int(name, value) option_set_int(name, &settings, value)
gfloat
2005-03-23 19:03:26 +00:00
option_float(const gchar *name, OptionList *optionlist);
gint
2005-03-23 19:03:26 +00:00
option_int(const gchar *name, OptionList *optionlist);
gint*
option_int_pointer(const gchar *name, OptionList *optionlist);
gchar*
2005-03-23 19:03:26 +00:00
option_string(const gchar *name, OptionList *optionlist);
2005-10-09 09:35:44 +00:00
gchar**
2005-03-23 19:03:26 +00:00
option_string_pointer(const gchar *name, OptionList *optionlist);
void
2005-03-23 19:03:26 +00:00
option_set_string(const gchar *name, OptionList *optionlist, const gchar *new_value);
void
2005-03-23 19:03:26 +00:00
option_set_int(const gchar *name, OptionList *optionlist, gint new_value);
2005-06-23 21:53:57 +00:00
void
option_add(OptionList *optionlist, const gchar *name, gint int_value, const gchar *string_value);
2005-01-09 20:21:22 +00:00
#endif