Freeciv-3.3: /fast/freeciv/nightly/main/tools/manual/manual_techs.c Source File

Freeciv-3.3

Loading...
Searching...
No Matches
manual_techs.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* utility */
19#include "fcintl.h"
20
21/* common */
22#include "game.h"
23#include "tech.h"
24
25/* client */
26#include "helpdata.h"
27
28/* tools/manual */
29#include "fc_manual.h"
30
31/**********************************************************************/
37 bool manual_techs(struct tag_types *tag_info)
38{
39 FILE *doc;
40
41 doc = manual_start(tag_info, MANUAL_TECHS);
42
43 if (doc == NULL) {
44 return FALSE;
45 }
46
47 /* FIXME: this doesn't resemble the wiki manual at all. */
48 /* TRANS: markup ... Freeciv version ... ruleset name ... markup */
49 fprintf(doc, _("%sFreeciv %s tech help (%s)%s\n\n"),
50 tag_info->title_begin, VERSION_STRING, game.control.name,
51 tag_info->title_end);
52 advance_iterate(ptech) {
53 if (valid_advance(ptech)) {
54 char buf[64000];
55
56 fprintf(doc, tag_info->item_begin, "tech", ptech->item_number);
57 fprintf(doc, "%s%s%s\n\n", tag_info->sect_title_begin,
58 advance_name_translation(ptech), tag_info->sect_title_end);
59
60 fprintf(doc, tag_info->subitem_begin, "helptext");
61 helptext_advance(buf, sizeof(buf), NULL, "", ptech->item_number);
62 fprintf(doc, "%s", buf);
63 fprintf(doc, "%s", tag_info->subitem_end);
64
65 fprintf(doc, "%s", tag_info->item_end);
66 }
67 } advance_iterate_end;
68
69 manual_finalize(tag_info, doc, MANUAL_TECHS);
70
71 return TRUE;
72}
incite_cost
char * incite_cost
Definition comments.c:74
manual_finalize
void manual_finalize(struct tag_types *tag_info, FILE *doc, enum manuals manual)
Definition fc_manual.c:316
manual_start
FILE * manual_start(struct tag_types *tag_info, int manual_number)
Definition fc_manual.c:287
fc_manual.h
fcintl.h
_
#define _(String)
Definition fcintl.h:67
game
struct civ_game game
Definition game.c:62
game.h
helptext_advance
void helptext_advance(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, int i)
Definition helpdata.c:3263
helpdata.h
manual_techs
bool manual_techs(struct tag_types *tag_info)
Definition manual_techs.c:37
civ_game::control
struct packet_ruleset_control control
Definition game.h:83
packet_ruleset_control::name
char name[MAX_LEN_NAME]
Definition packets_gen.h:1484
tag_types
Definition fc_manual.h:28
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
valid_advance
struct advance * valid_advance(struct advance *padvance)
Definition tech.c:152
advance_name_translation
const char * advance_name_translation(const struct advance *padvance)
Definition tech.c:300
tech.h
advance_iterate
#define advance_iterate(_p)
Definition tech.h:276
advance_iterate_end
#define advance_iterate_end
Definition tech.h:277