Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10453) remove stdinhand_info.h
Home

[Freeciv-Dev] (PR#10453) remove stdinhand_info.h

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10453) remove stdinhand_info.h
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 6 Oct 2004 17:27:18 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10453 >

This patch removes stdinhand_info.h.

sset_is_changeable is moved into settings.c.  Other settings query 
functions should be moved there but I didn't do this...

TOKEN_DELIMINETERS is moved into stdinhand.c.

SSET_MAX_LEN is removed (it is unused).

jason

? 1
? 2
? newtiles
Index: server/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/Makefile.am,v
retrieving revision 1.38
diff -u -r1.38 Makefile.am
--- server/Makefile.am  12 Sep 2004 21:19:36 -0000      1.38
+++ server/Makefile.am  7 Oct 2004 00:25:21 -0000
@@ -74,7 +74,6 @@
                srv_main.h      \
                stdinhand.c     \
                stdinhand.h     \
-               stdinhand_info.h\
                unithand.c      \
                unithand.h      \
                unittools.c     \
Index: server/settings.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/settings.c,v
retrieving revision 1.5
diff -u -r1.5 settings.c
--- server/settings.c   20 Sep 2004 16:42:31 -0000      1.5
+++ server/settings.c   7 Oct 2004 00:25:21 -0000
@@ -16,6 +16,7 @@
 #endif
 
 #include "fcintl.h"
+#include "log.h"
 
 #include "map.h"
 
@@ -975,3 +976,37 @@
 
 /* The number of settings, not including the END. */
 const int SETTINGS_NUM = ARRAY_SIZE(settings) - 1;
+
+/****************************************************************************
+  Returns whether the specified server setting (option) can currently
+  be changed.  Does not indicate whether it can be changed by clients.
+****************************************************************************/
+bool sset_is_changeable(int idx)
+{
+  struct settings_s *op = &settings[idx];
+
+  switch(op->sclass) {
+  case SSET_MAP_SIZE:
+  case SSET_MAP_GEN:
+    /* Only change map options if we don't yet have a map: */
+    return map_is_empty();
+  case SSET_MAP_ADD:
+  case SSET_PLAYERS:
+  case SSET_GAME_INIT:
+
+  case SSET_RULES:
+    /* Only change start params and most rules if we don't yet have a map,
+     * or if we do have a map but its a scenario one (ie, the game has
+     * never actually been started).
+     */
+    return (map_is_empty() || game.is_new_game);
+  case SSET_RULES_FLEXIBLE:
+  case SSET_META:
+    /* These can always be changed: */
+    return TRUE;
+  default:
+    freelog(LOG_ERROR, "Unexpected case %d in %s line %d",
+            op->sclass, __FILE__, __LINE__);
+    return FALSE;
+  }
+}
Index: server/settings.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/settings.h,v
retrieving revision 1.1
diff -u -r1.1 settings.h
--- server/settings.h   4 Sep 2004 18:29:00 -0000       1.1
+++ server/settings.h   7 Oct 2004 00:25:21 -0000
@@ -120,3 +120,5 @@
 
 extern struct settings_s settings[];
 extern const int SETTINGS_NUM;
+
+bool sset_is_changeable(int idx);
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.354
diff -u -r1.354 stdinhand.c
--- server/stdinhand.c  4 Oct 2004 04:37:34 -0000       1.354
+++ server/stdinhand.c  7 Oct 2004 00:25:21 -0000
@@ -72,6 +72,8 @@
 /* Import */
 #include "stdinhand_info.h"
 
+#define TOKEN_DELIMITERS " \t\n,"
+
 static enum cmdlevel_id default_access_level = ALLOW_INFO;
 static enum cmdlevel_id   first_access_level = ALLOW_CTRL;
 
@@ -1857,7 +1859,7 @@
 #define cmd_reply_show(string)  cmd_reply(CMD_SHOW, caller, C_COMMENT, string)
 
 #define OPTION_NAME_SPACE 13
-  /* under SSET_MAX_LEN, so it fits into 80 cols more easily - rp */
+  /* under 16, so it fits into 80 cols more easily - rp */
 
   cmd_reply_show(horiz_line);
   switch(level) {
@@ -4343,37 +4345,3 @@
 
 #endif /* HAVE_LIBREADLINE */
 
-/********************************************************************
-Returns whether the specified server setting (option) can currently
-be changed.  Does not indicate whether it can be changed by clients.
-*********************************************************************/
-bool sset_is_changeable(int idx)
-{
-  struct settings_s *op = &settings[idx];
-
-  switch(op->sclass) {
-  case SSET_MAP_SIZE:
-  case SSET_MAP_GEN:
-    /* Only change map options if we don't yet have a map: */
-    return map_is_empty();
-  case SSET_MAP_ADD:
-  case SSET_PLAYERS:
-  case SSET_GAME_INIT:
-
-  case SSET_RULES:
-    /* Only change start params and most rules if we don't yet have a map,
-     * or if we do have a map but its a scenario one (ie, the game has
-     * never actually been started).
-     */
-    return (map_is_empty() || game.is_new_game);
-  case SSET_RULES_FLEXIBLE:
-  case SSET_META:
-    /* These can always be changed: */
-    return TRUE;
-  default:
-    freelog(LOG_ERROR, "Unexpected case %d in %s line %d",
-            op->sclass, __FILE__, __LINE__);
-    return FALSE;
-  }
-}
-
Index: server/stdinhand_info.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand_info.h,v
retrieving revision 1.4
diff -u -r1.4 stdinhand_info.h
--- server/stdinhand_info.h     4 Sep 2004 20:36:10 -0000       1.4
+++ server/stdinhand_info.h     7 Oct 2004 00:25:21 -0000
@@ -1,21 +0,0 @@
-/**********************************************************************
- Freeciv - Copyright (C) 2004 - The Freeciv Project
-   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.
-***********************************************************************/
-#ifndef FC__STDINHAND_C_H
-#define FC__STDINHAND_C_H
-
-bool sset_is_changeable(int idx);
-
-#define SSET_MAX_LEN  16             /* max setting name length (plus nul) */
-#define TOKEN_DELIMITERS " \t\n,"
-
-#endif

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10453) remove stdinhand_info.h, Jason Short <=