1 /* $Id: output.h,v 2.0.1.13 2000/02/25 02:20:43 greyham Exp greyham $ 2 * format-independant output interface. 3 */ 4 #ifndef OUTPUT_H 5 #define OUTPUT_H 6 7 /* To add a new output format: 8 * 1. Add the new -Tx suboption to the manual page. 9 * 2. Add handling for the new suboption to c2man.c, including the default 10 * output file extension. 11 * 3. Copy nroff.c to xxx.c and change the xxx_... output functions and the 12 * pointers in the xxx_output structure so the new xxx_output object 13 * generates the correct output constructs. Try to do this without modifying 14 * manpage.c if possible; add new output functions only if necessary. 15 * 4. Add the new xxx_output structure to the declaration of output structures 16 * at the end of this file. 17 */ 18 19 /* Output object defines what type of output is being generated. 20 * This contains pointers to functions that generate each type of output 21 * construct. 22 */ 23 struct Output 24 { 25 /* comment until the end of the line */ 26 void (*comment) _((void)); 27 28 /* header and introduction to the file */ 29 void (*header) _((ManualPage *firstpage, int input_files, boolean grouped, 30 const char *name, const char *terse, const char *section)); 31 32 /* a dash */ 33 void (*dash) _((void)); 34 35 /* start of a main section */ 36 void (*section) _((const char *name)); 37 38 /* start of a sub section */ 39 void (*sub_section) _((const char * name)); 40 41 /* break the current line here */ 42 void (*break_line) _((void)); 43 44 /* a blank line */ 45 void (*blank_line) _((void)); 46 47 /* switch into the mode to include declarations like in program code */ 48 void (*code_start) _((void)); 49 50 /* switch back from code mode to normal */ 51 void (*code_end) _((void)); 52 53 /* output a single string in code font */ 54 void (*code) _((const char *text)); 55 56 /* start a list of tagged paragraphs */ 57 void (*tag_list_start) _((void)); 58 59 /* end a list of tagged paragraph */ 60 void (*tag_list_end) _((void)); 61 62 /* start a tagged paragraph: the tag should go straight after this */ 63 void (*tag_entry_start) _((void)); 64 65 /* start a tagged paragraph that has an extra non-code bit at the end 66 * of the tag: the tag should go straight after this 67 */ 68 void (*tag_entry_start_extra) _((void)); 69 70 /* end the tag on a tagged paragraph */ 71 void (*tag_entry_end) _((void)); 72 73 /* end the tag on a tagged paragraph with an extra non-code bit at the end 74 * of the tag. 75 */ 76 void (*tag_entry_end_extra) _((const char *text)); 77 78 /* start a name/value pair table */ 79 void (*table_start) _((const char *longestag)); 80 81 /* an entry in the name/value pair table */ 82 void (*table_entry) _((const char *name, const char * description)); 83 84 /* end the name/value pair table */ 85 void (*table_end) _((void)); 86 87 /* an indented paragraph */ 88 void (*indent) _((void)); 89 90 /* start a list */ 91 void (*list_start) _((void)); 92 93 /* an entry in the list */ 94 void (*list_entry) _((const char *name)); 95 96 /* the seperator between one entry in a list and the next */ 97 void (*list_separator) _((void)); 98 99 /* end the list */ 100 void (*list_end) _((void)); 101 102 /* include another file in the output */ 103 void (*include) _((const char *filename)); 104 105 /* end the file */ 106 void (*file_end) _((void)); 107 108 /* output string, quoted to protect against formatter controls */ 109 void (*text) _((const char *text)); 110 111 /* output char, quoted to protect against formatter controls */ 112 void (*character) _((const int c)); 113 114 /* parse formatter specific option. set to NULL if not available */ 115 int (*parse_option) _((const char *option)); 116 117 /* print formatter specific options to stderr. */ 118 void (*print_options) _((void)); 119 120 /* output NAME section header and section names */ 121 void (*name) _((const char *name)); 122 123 /* output separators between section name and terse description */ 124 void (*terse_sep) _((void)); 125 126 /* output string, making it a hypertext reference */ 127 void (*reference) _((const char *text)); 128 129 /* output string, displaying it emphasized (usually italic) */ 130 void (*emphasized) _((const char *text)); 131 132 /* output description, fixing punctuation but leaving formatter commands */ 133 void (*description) _((const char *text)); 134 135 /* output returns text, fixing punct. but leaving formatter commands */ 136 void (*returns) _((const char *text)); 137 }; 138 139 /* pointer to the relevant output structure */ 140 extern struct Output *output; 141 142 /* output structures for all formats we support */ 143 extern struct Output nroff_output, texinfo_output, latex_output, html_output, 144 autodoc_output, ascii_output; 145 146 /* dummy routine which does nothing */ 147 void dummy _((void)); 148 149 #endif 150