Author: sveinung Date: Sun Apr 23 15:50:26 2017 New Revision: 35280 URL: http://svn.gna.org/viewcvs/freeciv?rev=35280&view=rev Log: Populate the server setting module.
Build server setting access functions on top of the functions exported in the interface. See hrm Feature #653904 Added: branches/S3_0/common/server_settings.c Modified: branches/S3_0/common/Makefile.am branches/S3_0/common/server_settings.h Modified: branches/S3_0/common/Makefile.am URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/common/Makefile.am?rev=35280&r1=35279&r2=35280&view=diff ============================================================================== --- branches/S3_0/common/Makefile.am (original) +++ branches/S3_0/common/Makefile.am Sun Apr 23 15:50:26 2017 @@ -92,6 +92,7 @@ road.c \ road.h \ server_settings.h \ + server_settings.c \ spaceship.c \ spaceship.h \ specialist.c \ Added: branches/S3_0/common/server_settings.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/common/server_settings.c?rev=35280&view=auto ============================================================================== --- branches/S3_0/common/server_settings.c (added) +++ branches/S3_0/common/server_settings.c Sun Apr 23 15:50:26 2017 @@ -0,0 +1,53 @@ +/*********************************************************************** + Freeciv - Copyright (C) 2017 - Freeciv Development Team + 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, 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. +***********************************************************************/ + +#ifdef HAVE_CONFIG_H +#include <fc_config.h> +#endif + +/* common */ +#include "fc_interface.h" + +#include "server_settings.h" + +/*************************************************************************** + Returns the server setting with the specified name. +***************************************************************************/ +server_setting_id server_setting_by_name(const char *name) +{ + return fc_funcs->server_setting_by_name(name); +} + +/*************************************************************************** + Returns the name of the server setting with the specified id. +***************************************************************************/ +const char *server_setting_name_get(server_setting_id id) +{ + return fc_funcs->server_setting_name_get(id); +} + +/*************************************************************************** + Returns the type of the server setting with the specified id. +***************************************************************************/ +enum sset_type server_setting_type_get(server_setting_id id) +{ + return fc_funcs->server_setting_type_get(id); +} + +/*************************************************************************** + Returns TRUE iff a server setting with the specified id exists. +***************************************************************************/ +bool server_setting_exists(server_setting_id id) +{ + return sset_type_is_valid(server_setting_type_get(id)); +} Modified: branches/S3_0/common/server_settings.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S3_0/common/server_settings.h?rev=35280&r1=35279&r2=35280&view=diff ============================================================================== --- branches/S3_0/common/server_settings.h (original) +++ branches/S3_0/common/server_settings.h Sun Apr 23 15:50:26 2017 @@ -34,6 +34,15 @@ /* Mark server setting id's. */ typedef int server_setting_id; + +/* Pure server settings. */ +server_setting_id server_setting_by_name(const char *name); +bool server_setting_exists(server_setting_id id); + +enum sset_type server_setting_type_get(server_setting_id id); + +const char *server_setting_name_get(server_setting_id id); + #ifdef __cplusplus } #endif /* __cplusplus */ _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits