From 30ce888d480da723732ae4e7d259fbb2bb4588d4 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 6 Oct 2023 00:46:51 +0300 Subject: [PATCH 55/55] Manual: Log both page name and number See osdn #48808 Signed-off-by: Marko Lindqvist --- tools/manual/fc_manual.c | 10 ++++------ tools/manual/fc_manual.h | 2 +- tools/manual/manual_buildings.c | 2 +- tools/manual/manual_commands.c | 2 +- tools/manual/manual_settings.c | 2 +- tools/manual/manual_terrain.c | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tools/manual/fc_manual.c b/tools/manual/fc_manual.c index 81d421f9e0..9ae48f5824 100644 --- a/tools/manual/fc_manual.c +++ b/tools/manual/fc_manual.c @@ -330,11 +330,12 @@ FILE *manual_start(struct tag_types *tag_info, int manual_number) @param manual_name Name of the manual **************************************************************************/ void manual_finalize(struct tag_types *tag_info, FILE *doc, - const char *manual_name) + enum manuals manual) { fprintf(doc, "%s", tag_info->tail); fclose(doc); - log_normal(_("%s manual successfully written."), manual_name); + log_normal(_("%s (%d) manual successfully written."), + _(manuals_name(manual)), manual + 1); } /**********************************************************************//** @@ -360,7 +361,6 @@ static bool manual_command(struct tag_types *tag_info) } for (manuals = MANUAL_GOVS; manuals < MANUAL_COUNT; manuals++) { - char mnamebuf[20]; FILE *doc; doc = manual_start(tag_info, manuals); @@ -491,9 +491,7 @@ static bool manual_command(struct tag_types *tag_info) } /* switch */ - fc_snprintf(mnamebuf, sizeof(mnamebuf), "%d", manuals + 1); - - manual_finalize(tag_info, doc, mnamebuf); + manual_finalize(tag_info, doc, manuals); } /* manuals */ return TRUE; diff --git a/tools/manual/fc_manual.h b/tools/manual/fc_manual.h index ea4c8164af..2af7171b7b 100644 --- a/tools/manual/fc_manual.h +++ b/tools/manual/fc_manual.h @@ -45,7 +45,7 @@ struct tag_types { /* Utility functions */ FILE *manual_start(struct tag_types *tag_info, int manual_number); void manual_finalize(struct tag_types *tag_info, FILE *doc, - const char *manual_name); + enum manuals manual); char *html_special_chars(char *str, size_t *len); /* Individual manual pages */ diff --git a/tools/manual/manual_buildings.c b/tools/manual/manual_buildings.c index eb1b225564..4982b862a2 100644 --- a/tools/manual/manual_buildings.c +++ b/tools/manual/manual_buildings.c @@ -122,7 +122,7 @@ static bool manual_improvements(struct tag_types *tag_info, fprintf(doc, ""); - manual_finalize(tag_info, doc, _(manuals_name(manual))); + manual_finalize(tag_info, doc, manual); return TRUE; } diff --git a/tools/manual/manual_commands.c b/tools/manual/manual_commands.c index 0b44fc0017..e529f53e05 100644 --- a/tools/manual/manual_commands.c +++ b/tools/manual/manual_commands.c @@ -81,7 +81,7 @@ bool manual_commands(struct tag_types *tag_info) fprintf(doc, "%s", tag_info->item_end); } - manual_finalize(tag_info, doc, _("Commands")); + manual_finalize(tag_info, doc, MANUAL_COMMANDS); return TRUE; } diff --git a/tools/manual/manual_settings.c b/tools/manual/manual_settings.c index 23f948dcc0..a82455c36c 100644 --- a/tools/manual/manual_settings.c +++ b/tools/manual/manual_settings.c @@ -135,7 +135,7 @@ bool manual_settings(struct tag_types *tag_info) fprintf(doc, "%s", tag_info->item_end); } settings_iterate_end; - manual_finalize(tag_info, doc, _("Settings")); + manual_finalize(tag_info, doc, MANUAL_SETTINGS); return TRUE; } diff --git a/tools/manual/manual_terrain.c b/tools/manual/manual_terrain.c index daeeccf78b..7ffe4bd2fb 100644 --- a/tools/manual/manual_terrain.c +++ b/tools/manual/manual_terrain.c @@ -163,7 +163,7 @@ bool manual_terrain(struct tag_types *tag_info) fprintf(doc, "\n"); - manual_finalize(tag_info, doc, _("Terrain")); + manual_finalize(tag_info, doc, MANUAL_TERRAIN); return TRUE; } -- 2.40.1