(keymatch): Replace member km_func by km_type. Initializers adapted.

(emp_config, print_config): Cope with km_type.
(worldxset, intset, floatset, optstrset, doubleset, longset): Unused,
remove.

(emp_config): Fail if specified file can't be read or contains errors.
Used to succeed always, returning RET_OK.  RET_OK is not appropriate,
since this is not a command.  Return 0 on success, -1 on failure.
Callers ignore failure at the moment.  A missing or unreadable econfig
file used to be silently ignored.  It is still ignored, but no longer
silently.  It is questionable whether ignoring is wise, but that's
left for another day.

(emp_config): Improve diagnostic messages.

(set_option): Move diagnostics to caller.

(emp_config): Ignore leading whitespace in `#' comment lines.

(print_config): Simplify printing of km_comment.

(set_option): New parameter val, so it can set and clear options.
(delete_option): Remove.

(KM_ALLOC): Turn macro into enumeration constant.

(KM_INTERNAL): New.
(xdump, xdver): New version dump.

(keymatch, infodir, datadir, teldir, upfil, downfil, disablefil,
telfil, annfil, banfil, timestampfil, privname, privlog, update_times,
update_demandtimes, game_days, game_hours): Use plain char * instead
of s_char * for strings, void * for generic pointers.
This commit is contained in:
Markus Armbruster 2004-09-04 08:07:51 +00:00
parent 4798d1466b
commit d89c268b8b
6 changed files with 282 additions and 319 deletions

View file

@ -38,8 +38,8 @@
#include "misc.h"
#include "xy.h"
s_char *privname = PRVNAM; /* name of priv user */
s_char *privlog = PRVLOG; /* logname of priv user */
char *privname = PRVNAM; /* name of priv user */
char *privlog = PRVLOG; /* logname of priv user */
int WORLD_X = DEF_WORLD_X; /* World size - x */
int WORLD_Y = DEF_WORLD_Y; /* World size - y */
@ -53,15 +53,15 @@ int etu_per_update = ETUS; /* # of etu's per update, from misc.h */
int adj_update = 0; /* update time adjustment */
int update_window = 0; /* update window adjustment */
int hourslop = 5; /* amount of slop to match update times */
s_char *update_times = ""; /* times regular update is allowed */
char *update_times = ""; /* times regular update is allowed */
int update_policy = 0; /* update policy for regular updates */
int update_demandpolicy = 2; /* update policy for demand updates */
int update_missed = 999; /* demand updates missed before veto */
int update_wantmin = 0; /* number of votes required for demand update */
int blitz_time = 10; /* number of minutes between blitz updates */
s_char *update_demandtimes = ""; /* times demand update is allowed */
s_char *game_days = ""; /* days game is running */
s_char *game_hours = ""; /* hours game is running */
char *update_demandtimes = ""; /* times demand update is allowed */
char *game_days = ""; /* days game is running */
char *game_hours = ""; /* hours game is running */
int max_idle = 15; /* session dies after max_idle minutes idle */
int sect_mob_max = 127; /* sector mobility limits */