From 4cd3d75ad2cf3f4a8a818925515e44fec045f264 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 1 Oct 2023 23:39:25 +0300 Subject: [PATCH 42/48] Turn enum manuals as specenum See osdn #48785 Signed-off-by: Marko Lindqvist --- gen_headers/enums/Makefile.am | 7 ++++-- gen_headers/enums/manual_enums.def | 19 +++++++++++++++++ gen_headers/enums/manual_enums_gen.h | 32 ++++++++++++++++++++++++++++ tools/manual/fc_manual.h | 14 ++---------- 4 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 gen_headers/enums/manual_enums.def create mode 100644 gen_headers/enums/manual_enums_gen.h diff --git a/gen_headers/enums/Makefile.am b/gen_headers/enums/Makefile.am index a12a025083..1c8a9a5e57 100644 --- a/gen_headers/enums/Makefile.am +++ b/gen_headers/enums/Makefile.am @@ -1,9 +1,12 @@ ## Process this file with automake to produce Makefile.in -ENUMS_GEN = terrain_enums_gen.h +ENUMS_GEN = \ + manual_enums_gen.h \ + terrain_enums_gen.h EXTRA_DIST = \ - terrain_enums.def \ + manual_enums.def \ + terrain_enums.def \ $(ENUMS_GEN) BUILT_SOURCES = $(ENUMS_GEN) diff --git a/gen_headers/enums/manual_enums.def b/gen_headers/enums/manual_enums.def new file mode 100644 index 0000000000..f9292829f7 --- /dev/null +++ b/gen_headers/enums/manual_enums.def @@ -0,0 +1,19 @@ +# Specenum definitions for tools/manual/fc_manual.h +# See gen_headers/generate_enums.py for syntax + +# When modifying this, remember to regenerate the header. +# From the gen_headers/enums directory, this can be done with +# $ ../generate_enums.py manual_enums_gen.h manual_enums.def + +enum manuals + count MANUAL_COUNT +values + MANUAL_SETTINGS "Settings" + MANUAL_COMMANDS "Commands" + MANUAL_TERRAIN "Terrain" + MANUAL_BUILDINGS "Buildings" + MANUAL_WONDERS "Wonders" + MANUAL_GOVS "Governments" + MANUAL_UNITS "Units" + MANUAL_TECHS "Techs" +end diff --git a/gen_headers/enums/manual_enums_gen.h b/gen_headers/enums/manual_enums_gen.h new file mode 100644 index 0000000000..763426a558 --- /dev/null +++ b/gen_headers/enums/manual_enums_gen.h @@ -0,0 +1,32 @@ + /************************************************************************** + * THIS FILE WAS GENERATED * + * Script: gen_headers/generate_enums.py * + * Input: gen_headers/enums/manual_enums.def * + * DO NOT CHANGE THIS FILE * + **************************************************************************/ + +#ifndef FC__MANUAL_ENUMS_GEN_H +#define FC__MANUAL_ENUMS_GEN_H + + +#define SPECENUM_NAME manuals +#define SPECENUM_VALUE0 MANUAL_SETTINGS +#define SPECENUM_VALUE0NAME "Settings" +#define SPECENUM_VALUE1 MANUAL_COMMANDS +#define SPECENUM_VALUE1NAME "Commands" +#define SPECENUM_VALUE2 MANUAL_TERRAIN +#define SPECENUM_VALUE2NAME "Terrain" +#define SPECENUM_VALUE3 MANUAL_BUILDINGS +#define SPECENUM_VALUE3NAME "Buildings" +#define SPECENUM_VALUE4 MANUAL_WONDERS +#define SPECENUM_VALUE4NAME "Wonders" +#define SPECENUM_VALUE5 MANUAL_GOVS +#define SPECENUM_VALUE5NAME "Governments" +#define SPECENUM_VALUE6 MANUAL_UNITS +#define SPECENUM_VALUE6NAME "Units" +#define SPECENUM_VALUE7 MANUAL_TECHS +#define SPECENUM_VALUE7NAME "Techs" +#define SPECENUM_COUNT MANUAL_COUNT +#include "specenum_gen.h" + +#endif /* FC__MANUAL_ENUMS_GEN_H */ diff --git a/tools/manual/fc_manual.h b/tools/manual/fc_manual.h index c1d6dc342d..43b4291d2e 100644 --- a/tools/manual/fc_manual.h +++ b/tools/manual/fc_manual.h @@ -22,18 +22,8 @@ extern "C" { /* utility */ #include "support.h" - -enum manuals { - MANUAL_SETTINGS, - MANUAL_COMMANDS, - MANUAL_TERRAIN, - MANUAL_BUILDINGS, - MANUAL_WONDERS, - MANUAL_GOVS, - MANUAL_UNITS, - MANUAL_TECHS, - MANUAL_COUNT -}; +/* gen_headers/enums */ +#include "manual_enums_gen.h" struct tag_types { const char *file_ext; -- 2.40.1