111 "<html><head><link rel=\"stylesheet\" type=\"text/css\" "
112 "href=\"manual.css\"/><meta http-equiv=\"Content-Type\" "
113 "content=\"text/html; charset=UTF-8\"/></head><body>\n\n",
122 "<h3 class='section'>",
134 "<div class='item' id='%s%d'>\n",
178 "----\n<!-- %s %d -->\n",
321 || !(doc =
fc_fopen(filename,
"w"))) {
322 log_error(
_(
"Could not write manual file %s."), filename);
326 fprintf(doc,
"%s", tag_info->
header);
327 fprintf(doc,
"<!-- Generated by freeciv-manual version %s -->\n\n",
333 fprintf(doc,
_(
"%sFreeciv %s server settings%s\n\n"), tag_info->
title_begin,
344 if (strlen(sethelp) > 0) {
346 size_t help_len = strlen(help) + 1;
350 fprintf(doc,
"<pre>%s</pre>\n\n", help);
353 fprintf(doc,
"<p class=\"misc\">");
354 fprintf(doc,
_(
"Level: %s.<br>"),
356 fprintf(doc,
_(
"Category: %s.<br>"),
362 fprintf(doc,
_(
"Is locked by the ruleset."));
364 fprintf(doc,
_(
"Can only be used in server console."));
367 fprintf(doc,
"</p>\n");
371 fprintf(doc,
"\n<p class=\"bounds\">%s %d, %s %s, %s %d</p>\n",
380 fprintf(doc,
"\n<p class=\"bounds\">%s</p><ul>",
381 _(
"Possible values:"));
383 fprintf(doc,
"\n<li><p class=\"bounds\"> %s: \"%s\"</p>",
386 fprintf(doc,
"</ul>\n");
393 fprintf(doc,
"\n<p class=\"bounds\">%s</p><ul>",
394 _(
"Possible values (option can take any number of these):"));
396 fprintf(doc,
"\n<li><p class=\"bounds\"> %s: \"%s\"</p>",
399 fprintf(doc,
"</ul>\n");
410 fprintf(doc,
"\n<p class=\"bounds\">%s %s</p>\n",
414 fprintf(doc,
_(
"\n<p class=\"changed\">Value set to %s</p>\n"),
418 fprintf(doc,
"%s", tag_info->
item_end);
424 fprintf(doc,
_(
"%sFreeciv %s server commands%s\n\n"), tag_info->
title_begin,
426 for (i = 0; i <
CMD_NUM; i++) {
435 size_t cmdstr_len = strlen(cmdstr) + 1;
438 fprintf(doc,
_(
"<table>\n<tr>\n<td valign=\"top\">"
439 "<pre>Synopsis:</pre></td>\n<td>"));
440 fprintf(doc,
"<pre>%s</pre></td></tr></table>", cmdstr);
443 fprintf(doc,
_(
"<p class=\"level\">Level: %s</p>\n"),
448 size_t help_len = strlen(help) + 1;
453 fprintf(doc,
_(
"<p>Description:</p>\n\n"));
454 fprintf(doc,
"<pre>%s</pre>\n", help);
459 fprintf(doc,
"%s", tag_info->
item_end);
465 fprintf(doc,
_(
"%sFreeciv %s terrain help (%s)%s\n\n"), tag_info->
title_begin,
467 fprintf(doc,
"<table><tr bgcolor=#9bc3d1><th>%s</th>",
_(
"Terrain"));
468 fprintf(doc,
"<th>F/P/T</th><th>%s</th>",
_(
"Resources"));
469 fprintf(doc,
"<th>%s<br/>%s</th>",
_(
"Move cost"),
_(
"Defense bonus"));
470 fprintf(doc,
"<th>%s<br/>%s<br/>%s<br/>%s<br/>%s<br/>%s<br/>(%s)</th>",
471 _(
"Irrigation"),
_(
"Cultivate"),
_(
"Mining"),
_(
"Plant"),
_(
"Transform"),
473 _(
"% of Road bonus"),
_(
"turns"));
474 fprintf(doc,
"<th>%s<br/>%s</th>",
475 _(
"Clean pollution"),
_(
"Clean fallout"));
478 fprintf(doc,
"<th>");
488 fprintf(doc,
"</tr>\n\n");
492 = { .
kind = VUT_TERRAIN, .value = { .terrain = pterrain }};
499 fprintf(doc,
"<tr><td>%s%s%s%s</td>",
503 fprintf(doc,
"<td>%d/%d/%d</td>\n",
507 fprintf(doc,
"<td><table width=\"100%%\">\n");
508 for (r = pterrain->resources; *r; r++) {
509 fprintf(doc,
"<tr><td>%s%s%s</td><td>%s</td>"
510 "<td align=\"right\">%d/%d/%d</td></tr>\n",
513 (*r)->data.resource->output[
O_FOOD],
514 (*r)->data.resource->output[
O_SHIELD],
515 (*r)->data.resource->output[
O_TRADE]);
517 fprintf(doc,
"</table></td>\n");
519 fprintf(doc,
"<td align=\"center\">%d<br/>+%d%%</td>\n",
520 pterrain->movement_cost, pterrain->defense_bonus);
522 fprintf(doc,
"<td><table width=\"100%%\">\n");
525 fprintf(doc,
"<tr><td>+%d F</td><td align=\"right\">(%d)</td></tr>\n",
526 pterrain->irrigation_food_incr, pterrain->irrigation_time);
528 fprintf(doc,
"<tr><td>%s</td></tr>\n",
_(
"impossible"));
530 if (pterrain->cultivate_result != NULL
533 fprintf(doc,
"<tr><td>%s</td><td align=\"right\">(%d)</td></tr>\n",
535 pterrain->cultivate_time);
537 fprintf(doc,
"<tr><td>%s</td></tr>\n",
_(
"impossible"));
540 fprintf(doc,
"<tr><td>+%d P</td><td align=\"right\">(%d)</td></tr>\n",
541 pterrain->mining_shield_incr, pterrain->mining_time);
543 fprintf(doc,
"<tr><td>%s</td></tr>\n",
_(
"impossible"));
545 if (pterrain->plant_result != NULL
548 fprintf(doc,
"<tr><td>%s</td><td align=\"right\">(%d)</td></tr>\n",
550 pterrain->plant_time);
552 fprintf(doc,
"<tr><td>%s</td></tr>\n",
_(
"impossible"));
555 if (pterrain->transform_result
558 fprintf(doc,
"<tr><td>%s</td><td align=\"right\">(%d)</td></tr>\n",
560 pterrain->transform_time);
562 fprintf(doc,
"<tr><td>-</td><td align=\"right\">(-)</td></tr>\n");
564 fprintf(doc,
"<tr><td>%d / %d / %d</td></tr>\n</table></td>\n",
565 pterrain->road_output_incr_pct[
O_FOOD],
566 pterrain->road_output_incr_pct[
O_SHIELD],
567 pterrain->road_output_incr_pct[
O_TRADE]);
569 fprintf(doc,
"<td align=\"center\">%d / %d</td>",
570 pterrain->clean_pollution_time, pterrain->clean_fallout_time);
574 fprintf(doc,
"<td>");
585 fprintf(doc,
"</tr><tr><td colspan=\"7\">\n%s\n</td></tr>\n\n", tag_info->
hline);
588 fprintf(doc,
"</table>\n");
596 fprintf(doc,
_(
"%sFreeciv %s buildings help (%s)%s\n\n"), tag_info->
title_begin,
600 fprintf(doc,
_(
"%sFreeciv %s wonders help (%s)%s\n\n"), tag_info->
title_begin,
604 fprintf(doc,
"<table>\n<tr bgcolor=#9bc3d1><th colspan=2>%s</th>"
605 "<th>%s<br/>%s</th><th>%s<br/>%s</th><th>%s</th></tr>\n\n",
606 _(
"Name"),
_(
"Cost"),
_(
"Upkeep"),
607 _(
"Requirement"),
_(
"Obsolete by"),
_(
"More info"));
619 fprintf(doc,
"<tr><td>%s%s%s</td><td>%s</td>\n"
620 "<td align=\"center\"><b>%d</b><br/>%d</td>\n<td>",
623 pimprove->build_cost,
626 if (requirement_vector_size(&pimprove->reqs) == 0) {
629 strncpy(text,
Q_(
"?req:None"),
sizeof(text) - 1);
630 fprintf(doc,
"%s<br/>", text);
633 char text[512], text2[512];
637 req->present ?
"%s" :
_(
"no %s"),
639 text,
sizeof(text)));
640 fprintf(doc,
"%s<br/>", text2);
644 fprintf(doc,
"\n%s\n", tag_info->
hline);
646 if (requirement_vector_size(&pimprove->obsolete_by) == 0) {
649 strncpy(text,
Q_(
"?req:None"),
sizeof(text) - 1);
650 fprintf(doc,
"<em>%s</em><br/>", text);
653 char text[512], text2[512];
657 pobs->present ?
"%s" :
_(
"no %s"),
659 text,
sizeof(text)));
660 fprintf(doc,
"<em>%s</em><br/>", text2);
665 "</td>\n<td>%s</td>\n</tr><tr><td colspan=\"5\">\n%s\n</td></tr>\n\n",
666 buf, tag_info->
hline);
669 fprintf(doc,
"</table>");
677 fprintf(doc,
_(
"%sFreeciv %s governments help (%s)%s\n\n"), tag_info->
title_begin,
681 fprintf(doc, tag_info->
item_begin,
"gov", pgov->item_number);
686 fprintf(doc,
"%s\n\n", buf);
688 fprintf(doc,
"%s", tag_info->
item_end);
697 fprintf(doc,
_(
"%sFreeciv %s unit types help (%s)%s\n\n"),
703 fprintf(doc, tag_info->
item_begin,
"utype", putype->item_number);
708 PL_(
"Cost: %d shield",
714 fprintf(doc,
_(
"Upkeep: %s"),
718 fprintf(doc,
_(
"Moves: %s"),
722 fprintf(doc,
_(
"Vision: %d"),
723 (
int)sqrt((
double)putype->vision_radius_sq));
726 fprintf(doc,
_(
"Attack: %d"),
727 putype->attack_strength);
730 fprintf(doc,
_(
"Defense: %d"),
731 putype->defense_strength);
734 fprintf(doc,
_(
"Firepower: %d"),
738 fprintf(doc,
_(
"Hitpoints: %d"),
742 fprintf(doc,
_(
"Obsolete by: %s"),
749 fprintf(doc,
"%s", buf);
751 fprintf(doc,
"%s", tag_info->
item_end);
758 fprintf(doc,
_(
"%sFreeciv %s tech help (%s)%s\n\n"),
765 fprintf(doc, tag_info->
item_begin,
"tech", ptech->item_number);
771 fprintf(doc,
"%s", buf);
774 fprintf(doc,
"%s", tag_info->
item_end);
784 fprintf(doc,
"%s", tag_info->
tail);
786 log_normal(
_(
"Manual file %s successfully written."), filename);
798 bool showhelp =
FALSE;
799 bool showvers =
FALSE;
801 int retval = EXIT_SUCCESS;
822 fc_fprintf(stderr,
_(
"Multiple rulesets requested. Only one "
823 "ruleset at a time is supported.\n"));
827 }
else if (
is_option(
"--help", argv[inx])) {
830 }
else if (
is_option(
"--version", argv[inx])) {
834 }
else if (
is_option(
"--wiki", argv[inx])) {
836#ifndef FREECIV_NDEBUG
837 }
else if (
is_option(
"--Fatal", argv[inx])) {
838 if (inx + 1 >= argc ||
'-' == argv[inx + 1][0]) {
843 fc_fprintf(stderr,
_(
"Invalid signal number \"%s\".\n"),
856 fc_fprintf(stderr,
_(
"Unrecognized option: \"%s\"\n"), argv[inx]);
883 if (showvers && !showhelp) {
886 }
else if (showhelp) {
893 _(
"Set debug log level (one of f,e,w,n,v,d, or "
894 "d:file1,min,max:...)"));
899 _(
"Set debug log level (one of f,e,w,n,v)"));
901#ifndef FREECIV_NDEBUG
905 _(
"Raise a signal on failed assertion"));
908 _(
"Print a summary of the options"));
912 _(
"Use FILE as logfile"));
915 _(
"ruleset RULESET"),
916 _(
"Make manual for RULESET"));
918 _(
"Print the version number"));
920 _(
"Write manual in wiki format"));
931 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)