27#ifdef FREECIV_MSWINDOWS
115 "<html><head><link rel=\"stylesheet\" type=\"text/css\" "
116 "href=\"manual.css\"/><meta http-equiv=\"Content-Type\" "
117 "content=\"text/html; charset=UTF-8\"/></head><body>\n\n",
126 "<h3 class='section'>",
138 "<div class='item' id='%s%d'>\n",
182 "----\n<!-- %s %d -->\n",
325 || !(doc =
fc_fopen(filename,
"w"))) {
326 log_error(
_(
"Could not write manual file %s."), filename);
330 fprintf(doc,
"%s", tag_info->
header);
331 fprintf(doc,
"<!-- Generated by freeciv-manual version %s -->\n\n",
337 fprintf(doc,
_(
"%sFreeciv %s server settings%s\n\n"), tag_info->
title_begin,
348 if (strlen(sethelp) > 0) {
350 size_t help_len = strlen(help) + 1;
354 fprintf(doc,
"<pre>%s</pre>\n\n", help);
357 fprintf(doc,
"<p class=\"misc\">");
358 fprintf(doc,
_(
"Level: %s.<br>"),
360 fprintf(doc,
_(
"Category: %s.<br>"),
366 fprintf(doc,
_(
"Is locked by the ruleset."));
368 fprintf(doc,
_(
"Can only be used in server console."));
371 fprintf(doc,
"</p>\n");
375 fprintf(doc,
"\n<p class=\"bounds\">%s %d, %s %s, %s %d</p>\n",
384 fprintf(doc,
"\n<p class=\"bounds\">%s</p><ul>",
385 _(
"Possible values:"));
387 fprintf(doc,
"\n<li><p class=\"bounds\"> %s: \"%s\"</p>",
390 fprintf(doc,
"</ul>\n");
397 fprintf(doc,
"\n<p class=\"bounds\">%s</p><ul>",
398 _(
"Possible values (option can take any number of these):"));
400 fprintf(doc,
"\n<li><p class=\"bounds\"> %s: \"%s\"</p>",
403 fprintf(doc,
"</ul>\n");
414 fprintf(doc,
"\n<p class=\"bounds\">%s %s</p>\n",
418 fprintf(doc,
_(
"\n<p class=\"changed\">Value set to %s</p>\n"),
422 fprintf(doc,
"%s", tag_info->
item_end);
428 fprintf(doc,
_(
"%sFreeciv %s server commands%s\n\n"), tag_info->
title_begin,
430 for (i = 0; i <
CMD_NUM; i++) {
439 size_t cmdstr_len = strlen(cmdstr) + 1;
442 fprintf(doc,
_(
"<table>\n<tr>\n<td valign=\"top\">"
443 "<pre>Synopsis:</pre></td>\n<td>"));
444 fprintf(doc,
"<pre>%s</pre></td></tr></table>", cmdstr);
447 fprintf(doc,
_(
"<p class=\"level\">Level: %s</p>\n"),
452 size_t help_len = strlen(help) + 1;
457 fprintf(doc,
_(
"<p>Description:</p>\n\n"));
458 fprintf(doc,
"<pre>%s</pre>\n", help);
463 fprintf(doc,
"%s", tag_info->
item_end);
469 fprintf(doc,
_(
"%sFreeciv %s terrain help (%s)%s\n\n"), tag_info->
title_begin,
471 fprintf(doc,
"<table><tr bgcolor=#9bc3d1><th>%s</th>",
_(
"Terrain"));
472 fprintf(doc,
"<th>F/P/T</th><th>%s</th>",
_(
"Resources"));
473 fprintf(doc,
"<th>%s<br/>%s</th>",
_(
"Move cost"),
_(
"Defense bonus"));
474 fprintf(doc,
"<th>%s<br/>%s<br/>%s<br/>%s<br/>%s<br/>%s<br/>(%s)</th>",
475 _(
"Irrigation"),
_(
"Cultivate"),
_(
"Mining"),
_(
"Plant"),
_(
"Transform"),
477 _(
"% of Road bonus"),
_(
"turns"));
478 fprintf(doc,
"<th>%s<br/>%s</th>",
479 _(
"Clean pollution"),
_(
"Clean fallout"));
482 fprintf(doc,
"<th>");
492 fprintf(doc,
"</tr>\n\n");
496 = { .
kind = VUT_TERRAIN, .value = { .terrain = pterrain }};
503 fprintf(doc,
"<tr><td>%s%s%s<br/>%s</td>",
507 fprintf(doc,
"<td>%d/%d/%d</td>\n",
511 fprintf(doc,
"<td><table width=\"100%%\">\n");
512 for (r = pterrain->resources; *r; r++) {
513 fprintf(doc,
"<tr><td>%s%s%s</td><td>%s</td>"
514 "<td align=\"right\">%d/%d/%d</td></tr>\n",
517 (*r)->data.resource->output[
O_FOOD],
518 (*r)->data.resource->output[
O_SHIELD],
519 (*r)->data.resource->output[
O_TRADE]);
521 fprintf(doc,
"</table></td>\n");
523 fprintf(doc,
"<td align=\"center\">%d<br/>+%d%%</td>\n",
524 pterrain->movement_cost, pterrain->defense_bonus);
526 fprintf(doc,
"<td><table width=\"100%%\">\n");
529 fprintf(doc,
"<tr><td>+%d F</td>", pterrain->irrigation_food_incr);
530 if (pterrain->irrigation_time == 0) {
531 fprintf(doc,
"<td align=\"right\">(-)</td></tr>\n");
533 fprintf(doc,
"<td align=\"right\">(%d)</td></tr>\n",
534 pterrain->irrigation_time);
537 fprintf(doc,
"<tr><td>%s</td></tr>\n",
_(
"impossible"));
539 if (pterrain->cultivate_result != NULL
542 fprintf(doc,
"<tr><td>%s</td>",
544 if (pterrain->cultivate_time == 0) {
545 fprintf(doc,
"<td align=\"right\">(-)</td></tr>\n");
547 fprintf(doc,
"<td align=\"right\">(%d)</td></tr>\n",
548 pterrain->cultivate_time);
551 fprintf(doc,
"<tr><td>%s</td></tr>\n",
_(
"impossible"));
554 fprintf(doc,
"<tr><td>+%d P</td>", pterrain->mining_shield_incr);
555 if (pterrain->mining_time == 0) {
556 fprintf(doc,
"<td align=\"right\">(-)</td></tr>\n");
558 fprintf(doc,
"<td align=\"right\">(%d)</td></tr>\n",
559 pterrain->mining_time);
562 fprintf(doc,
"<tr><td>%s</td></tr>\n",
_(
"impossible"));
564 if (pterrain->plant_result != NULL
567 fprintf(doc,
"<tr><td>%s</td>",
569 if (pterrain->plant_time == 0) {
570 fprintf(doc,
"<td align=\"right\">(-)</td></tr>\n");
572 fprintf(doc,
"<td align=\"right\">(%d)</td></tr>\n",
573 pterrain->plant_time);
576 fprintf(doc,
"<tr><td>%s</td></tr>\n",
_(
"impossible"));
579 if (pterrain->transform_result
582 fprintf(doc,
"<tr><td>%s</td>",
584 if (pterrain->transform_time == 0) {
585 fprintf(doc,
"<td align=\"right\">(-)</td></tr>\n");
587 fprintf(doc,
"<td align=\"right\">(%d)</td></tr>\n",
588 pterrain->transform_time);
591 fprintf(doc,
"<tr><td>-</td><td align=\"right\">(-)</td></tr>\n");
593 fprintf(doc,
"<tr><td>%d / %d / %d</td></tr>\n</table></td>\n",
594 pterrain->road_output_incr_pct[
O_FOOD],
595 pterrain->road_output_incr_pct[
O_SHIELD],
596 pterrain->road_output_incr_pct[
O_TRADE]);
598 fprintf(doc,
"<td align=\"center\">%d / %d</td>",
599 pterrain->clean_pollution_time, pterrain->clean_fallout_time);
603 fprintf(doc,
"<td>");
610 fprintf(doc,
"- / ");
612 fprintf(doc,
"%d / ", btime);
616 fprintf(doc,
"-</td>");
618 fprintf(doc,
"%d</td>", btime);
622 fprintf(doc,
"</tr><tr><td colspan=\"7\">\n%s\n</td></tr>\n\n", tag_info->
hline);
625 fprintf(doc,
"</table>\n");
633 fprintf(doc,
_(
"%sFreeciv %s buildings help (%s)%s\n\n"), tag_info->
title_begin,
637 fprintf(doc,
_(
"%sFreeciv %s wonders help (%s)%s\n\n"), tag_info->
title_begin,
641 fprintf(doc,
"<table>\n<tr bgcolor=#9bc3d1><th colspan=2>%s</th>"
642 "<th>%s<br/>%s</th><th>%s<br/>%s</th><th>%s</th></tr>\n\n",
643 _(
"Name"),
_(
"Cost"),
_(
"Upkeep"),
644 _(
"Requirement"),
_(
"Obsolete by"),
_(
"More info"));
656 fprintf(doc,
"<tr><td>%s%s%s</td><td>%s</td>\n"
657 "<td align=\"center\"><b>%d</b><br/>%d</td>\n<td>",
660 pimprove->build_cost,
663 if (requirement_vector_size(&pimprove->reqs) == 0) {
666 strncpy(text,
Q_(
"?req:None"),
sizeof(text) - 1);
667 fprintf(doc,
"%s<br/>", text);
670 char text[512], text2[512];
674 req->present ?
"%s" :
_(
"no %s"),
676 text,
sizeof(text)));
677 fprintf(doc,
"%s<br/>", text2);
681 fprintf(doc,
"\n%s\n", tag_info->
hline);
683 if (requirement_vector_size(&pimprove->obsolete_by) == 0) {
686 strncpy(text,
Q_(
"?req:None"),
sizeof(text) - 1);
687 fprintf(doc,
"<em>%s</em><br/>", text);
690 char text[512], text2[512];
694 pobs->present ?
"%s" :
_(
"no %s"),
696 text,
sizeof(text)));
697 fprintf(doc,
"<em>%s</em><br/>", text2);
702 "</td>\n<td>%s</td>\n</tr><tr><td colspan=\"5\">\n%s\n</td></tr>\n\n",
703 buf, tag_info->
hline);
706 fprintf(doc,
"</table>");
714 fprintf(doc,
_(
"%sFreeciv %s governments help (%s)%s\n\n"), tag_info->
title_begin,
718 fprintf(doc, tag_info->
item_begin,
"gov", pgov->item_number);
723 fprintf(doc,
"%s\n\n", buf);
725 fprintf(doc,
"%s", tag_info->
item_end);
734 fprintf(doc,
_(
"%sFreeciv %s unit types help (%s)%s\n\n"),
740 fprintf(doc, tag_info->
item_begin,
"utype", putype->item_number);
745 PL_(
"Cost: %d shield",
751 fprintf(doc,
_(
"Upkeep: %s"),
755 fprintf(doc,
_(
"Moves: %s"),
759 fprintf(doc,
_(
"Vision: %d"),
760 (
int)sqrt((
double)putype->vision_radius_sq));
763 fprintf(doc,
_(
"Attack: %d"),
764 putype->attack_strength);
767 fprintf(doc,
_(
"Defense: %d"),
768 putype->defense_strength);
771 fprintf(doc,
_(
"Firepower: %d"),
775 fprintf(doc,
_(
"Hitpoints: %d"),
779 fprintf(doc,
_(
"Obsolete by: %s"),
786 fprintf(doc,
"%s", buf);
788 fprintf(doc,
"%s", tag_info->
item_end);
795 fprintf(doc,
_(
"%sFreeciv %s tech help (%s)%s\n\n"),
802 fprintf(doc, tag_info->
item_begin,
"tech", ptech->item_number);
808 fprintf(doc,
"%s", buf);
811 fprintf(doc,
"%s", tag_info->
item_end);
821 fprintf(doc,
"%s", tag_info->
tail);
823 log_normal(
_(
"Manual file %s successfully written."), filename);
835 bool showhelp =
FALSE;
836 bool showvers =
FALSE;
838 int retval = EXIT_SUCCESS;
842#ifdef FREECIV_MSWINDOWS
843# ifndef FREECIV_NDEBUG
844 if (LoadLibrary(
"exchndl.dll") == NULL) {
846 fprintf(stderr,
"exchndl.dll could not be loaded, no crash debugger\n");
870 fc_fprintf(stderr,
_(
"Multiple rulesets requested. Only one "
871 "ruleset at a time is supported.\n"));
875 }
else if (
is_option(
"--help", argv[inx])) {
878 }
else if (
is_option(
"--version", argv[inx])) {
882 }
else if (
is_option(
"--wiki", argv[inx])) {
884#ifndef FREECIV_NDEBUG
885 }
else if (
is_option(
"--Fatal", argv[inx])) {
886 if (inx + 1 >= argc ||
'-' == argv[inx + 1][0]) {
891 fc_fprintf(stderr,
_(
"Invalid signal number \"%s\".\n"),
904 fc_fprintf(stderr,
_(
"Unrecognized option: \"%s\"\n"), argv[inx]);
931 if (showvers && !showhelp) {
934 }
else if (showhelp) {
941 _(
"Set debug log level (one of f,e,w,n,v,d, or "
942 "d:file1,min,max:...)"));
947 _(
"Set debug log level (one of f,e,w,n,v)"));
949#ifndef FREECIV_NDEBUG
953 _(
"Raise a signal on failed assertion"));
956 _(
"Print a summary of the options"));
960 _(
"Use FILE as logfile"));
963 _(
"ruleset RULESET"),
964 _(
"Make manual for RULESET"));
966 _(
"Print the version number"));
968 _(
"Write manual in wiki format"));
979 retval = EXIT_FAILURE;
#define action_id_univs_not_blocking(act_id, act_uni, tgt_uni)
void init_our_capability(void)
const char * client_string
static char * html_special_chars(char *str, size_t *len)
int main(int argc, char **argv)
const char * tileset_description(struct tileset *t)
bool client_nation_is_in_current_set(const struct nation_type *pnation)
void popdown_help_dialog(void)
const char * tileset_summary(struct tileset *t)
void popup_help_dialog_string(const char *item)
void insert_client_build_info(char *outbuf, size_t outlen)
enum client_states client_state(void)
static bool manual_command(struct tag_types *tag_info)
const char * tileset_name_get(struct tileset *t)
const char * tileset_version(struct tileset *t)
struct tag_types html_tags
struct tag_types wiki_tags
const char * command_name(const struct command *pcommand)
const struct command * command_by_number(int i)
const char * command_short_help(const struct command *pcommand)
char * command_extra_help(const struct command *pcommand)
enum cmdlevel command_level(const struct command *pcommand)
const char * command_synopsis(const struct command *pcommand)
void connection_common_init(struct connection *pconn)
void con_log_init(const char *log_filename, enum log_level level, int fatal_assertions)
void cmdhelp_destroy(struct cmdhelp *pcmdhelp)
void cmdhelp_display(struct cmdhelp *pcmdhelp, bool sort, bool gui_options, bool report_bugs)
struct cmdhelp * cmdhelp_new(const char *cmdname)
void cmdhelp_add(struct cmdhelp *pcmdhelp, const char *shortarg, const char *longarg, const char *helpstr,...)
bool is_option(const char *option_name, char *option)
char * get_option_malloc(const char *option_name, char **argv, int *i, int argc, bool gc)
void cmdline_option_values_free(void)
void libfreeciv_free(void)
static void i_am_tool(void)
static char void init_character_encodings(const char *my_internal_encoding, bool my_use_transliteration)
#define FC_DEFAULT_DATA_ENCODING
void fc_fprintf(FILE *stream, const char *format,...) fc__attribute((__format__(__printf__
#define PL_(String1, String2, n)
void game_init(bool keep_ruleset_value)
const char * government_name_translation(const struct government *pgovern)
#define governments_iterate(NAME_pgov)
#define governments_iterate_end
void helptext_government(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, struct government *gov)
void helptext_advance(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, int i)
char * helptext_unit_upkeep_str(const struct unit_type *utype)
char * helptext_building(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, const struct impr_type *pimprove)
char * helptext_unit(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, const struct unit_type *utype)
const struct impr_type * valid_improvement(const struct impr_type *pimprove)
bool is_great_wonder(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
bool log_parse_level_str(const char *level_str, enum log_level *ret_level)
#define fc_assert(condition)
#define log_normal(message,...)
#define log_error(message,...)
const char * move_points_text(int mp, bool reduce)
void registry_module_init(void)
void registry_module_close(void)
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
bool load_rulesets(const char *restore, const char *alt, bool compat_mode, rs_conversion_logger logger, bool act, bool buffer_script, bool load_luadata)
void init_connections(void)
void settings_init(bool act)
const char * setting_default_name(const struct setting *pset, bool pretty, char *buf, size_t buf_len)
const char * setting_value_name(const struct setting *pset, bool pretty, char *buf, size_t buf_len)
const char * setting_extra_help(const struct setting *pset, bool constant)
int setting_number(const struct setting *pset)
enum sset_category setting_category(const struct setting *pset)
bool setting_locked(const struct setting *pset)
bool setting_non_default(const struct setting *pset)
enum sset_type setting_type(const struct setting *pset)
int setting_int_max(const struct setting *pset)
enum sset_level setting_level(const struct setting *pset)
const char * setting_enum_val(const struct setting *pset, int val, bool pretty)
const char * setting_short_help(const struct setting *pset)
const char * setting_bitwise_bit(const struct setting *pset, int bit, bool pretty)
int setting_int_min(const struct setting *pset)
bool setting_is_changeable(const struct setting *pset, struct connection *caller, char *reject_msg, size_t reject_msg_len)
const char * setting_name(const struct setting *pset)
#define settings_iterate(_level, _pset)
#define settings_iterate_end
bool str_to_int(const char *str, int *pint)
struct server_arguments srvarg
struct civ_game::@30::@34 server
struct packet_ruleset_control control
struct packet_game_info info
char rulesetdir[MAX_LEN_NAME]
enum cmdlevel access_level
const char * subitem_begin
const char * sect_title_end
const char * sect_title_begin
int fc_snprintf(char *str, size_t n, const char *format,...)
FILE * fc_fopen(const char *filename, const char *opentype)
int fc_break_lines(char *str, size_t desired_len)
bool is_reg_file_for_access(const char *name, bool write_access)
char * fc_strrep_resize(char *str, size_t *len, const char *search, const char *replace)
#define sz_strlcpy(dest, src)
struct advance * valid_advance(struct advance *padvance)
const char * advance_name_translation(const struct advance *padvance)
#define advance_iterate(_start, _p)
#define advance_iterate_end
const char * terrain_name_translation(const struct terrain *pterrain)
const char * terrain_rule_name(const struct terrain *pterrain)
int terrain_extra_build_time(const struct terrain *pterrain, enum unit_activity activity, const struct extra_type *tgt)
#define terrain_type_iterate(_p)
#define terrain_type_iterate_end
int utype_build_shield_cost_base(const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
#define unit_type_iterate(_p)
#define unit_type_iterate_end
const char * freeciv_name_version(void)
const char * freeciv_datafile_version(void)