00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 enum nodeclass {
00015 miscnode,
00016 utypenode,
00017 mtypenode,
00018 ttypenode,
00019 atypenode
00020 };
00021
00022
00023 #define HELP_OUTPUT_CC_NONE 0
00024 #define HELP_OUTPUT_CC_FILES 1
00025
00026
00027
00028
00029
00030
00031 typedef enum help_output_mode {
00032 HELP_OUTPUT_PLAIN_TEXT = 0,
00033 HELP_OUTPUT_HTML,
00034 HELP_OUTPUT_TEXI,
00035 HELP_OUTPUT_XML,
00036 HELP_OUTPUT_LATEX,
00037 HELP_OUTPUT_MAGIC_TEXT
00038 } HelpOutputMode;
00039
00040
00041 typedef enum help_page {
00042 HELP_PAGE_NONE = 0,
00043 HELP_PAGE_MASTER_INDEX,
00044 HELP_PAGE_TOC,
00045 HELP_PAGE_COPYRIGHT,
00046 HELP_PAGE_WARRANTY,
00047 HELP_PAGE_NEWS,
00048 HELP_PAGE_INSTRUCTIONS,
00049 HELP_PAGE_GAME_OVERVIEW,
00050 HELP_PAGE_SCORING,
00051 HELP_PAGE_MODULES,
00052 HELP_PAGE_GAME_SETUP,
00053 HELP_PAGE_WORLD,
00054 HELP_PAGE_UTYPE,
00055 HELP_PAGE_TTYPE,
00056 HELP_PAGE_MTYPE,
00057 HELP_PAGE_ATYPE,
00058 HELP_PAGE_CONCEPTS
00059 } HelpPage;
00060
00061
00062 typedef struct help_page_defn {
00063 char *filebname;
00064 char *name;
00065 HelpPage tocpage;
00066 HelpPage prevpage;
00067 HelpPage nextpage;
00068 } HelpPageDefn;
00069
00070 #include "obstack.h"
00071
00073 typedef struct a_textbuffer {
00074 char *text;
00075 int bufmax;
00076 struct obstack ostack;
00077 } TextBuffer;
00078
00080 typedef struct a_helpnode {
00081 char *key;
00083 void (*fn)(int arg, char *key, TextBuffer *buf);
00084 enum nodeclass nclass;
00085 int arg;
00086 char *text;
00087 int textend;
00088 struct a_helpnode *prev;
00089 struct a_helpnode *next;
00090 } HelpNode;
00091
00093 extern HelpNode *first_help_node;
00094
00096 extern HelpNode *copying_help_node;
00098 extern HelpNode *warranty_help_node;
00099
00100 extern void tbprintf(TextBuffer *buf, char *str, ...);
00101 extern void tbcat(TextBuffer *buf, char *str);
00102 extern void tbcat_si(TextBuffer *buf, char *str);
00103 extern void tbcatline(TextBuffer *buf, char *str);
00104 extern void tbcatline_si(TextBuffer *buf, char *str);
00105
00106 extern void init_help(void);
00107 extern HelpNode *create_help_node(void);
00108 extern HelpNode *add_help_node(char *key,
00109 void (*fn)(int, char *, TextBuffer *),
00110 int arg, HelpNode *prevnode);
00111 extern HelpNode *find_help_node(HelpNode *node, char *str);
00112 extern void create_game_help_nodes(void);
00113 extern char *get_help_text(HelpNode *node);
00114
00115 extern void describe_topics(int arg, char *key, TextBuffer *buf);
00116 extern void describe_command(int ch, char *name, char *help, int onechar,
00117 TextBuffer *buf);
00118 extern void append_blurb_strings(char *buf, Obj *notes);
00119 extern void notify_instructions(void);
00120
00121 extern void print_any_news(void);
00122 extern void print_game_description_to_file(FILE *fp);
00123
00124 extern void describe_copyright(int arg, char *key, TextBuffer *buf);
00125 extern void describe_warranty(int arg, char *key, TextBuffer *buf);
00126
00127 extern void set_help_output_cc(int cctarget);
00128 extern void set_help_output_mode(HelpOutputMode houtmode);
00129 extern void set_help_output_dir(char *);
00130 extern void set_help_toc_filep(FILE *htocfilep);
00131
00132 extern FILE *prep_help_file(char *hfilename);
00133 extern void finish_help_file(FILE *hfilep);
00134 extern void write_help_file_header(FILE *hfile, char *headerdata);
00135 extern void write_help_file_footer(FILE *hfile, char *footerdata);
00136 extern void write_help_toc_entry(char *hfilebname, char *sectionname,
00137 int indentlvl);
00138 extern char *help_file_brand(void);
00139 extern char *get_help_file_extension(void);