(read_config_table_file): Set it.
(show_custom): Show it.
(vers): Use it.
#define EFF_MEM bit(8)
/* Table is read-only */
#define EFF_RDONLY bit(9)
+/* Table is customized (configuration tables only) */
+#define EFF_CUSTOM bit(10)
/* Transient flags, only occur in argument of ef_open() */
/* Create table file, clobbering any existing file */
-#define EFF_CREATE bit(10)
+#define EFF_CREATE bit(11)
/*
* Empire `file types'
#include "commands.h"
#include "file.h"
+static void show_custom(void);
static void show_opts(int val);
int
pr("\n");
pr("You can have at most %d BTUs.\n", max_btus);
pr("You are disconnected after %d minutes of idle time.\n", max_idle);
+ show_custom();
pr("\nOptions enabled in this game:\n ");
show_opts(1);
pr("\n\nOptions disabled in this game:\n ");
return RET_OK;
}
+static void
+show_custom(void)
+{
+ char *sep = "\nCustom characteristics in this game:\n ";
+ int i;
+
+ /* TODO wrap long lines */
+ for (i = 0; i < EF_MAX; i++) {
+ if (ef_flags(i) & EFF_CUSTOM) {
+ pr("%s%s", sep, ef_nameof(i));
+ sep = ", ";
+ }
+ }
+ if (*sep == ',')
+ pr("\n");
+}
static void
show_opts(int val)
return -1;
}
- for (n = 0; (res = xundump(fp, fname, EF_BAD)) >= 0; n++) ;
+ for (n = 0; (res = xundump(fp, fname, EF_BAD)) >= 0; n++)
+ empfile[res].flags |= EFF_CUSTOM;
if (res != EF_BAD && n == 0)
fprintf(stderr, "Warning: configuration file %s is empty\n", fname);