6 .Nd ordering of mandoc include files
8 To support a cleaner coding style, the mandoc header files do not
9 contain any include directives and do not guard against multiple
11 The application developer has to make sure that the headers are
12 included in a proper order, and that no header is included more
15 The headers and functions form three major groups:
16 .Sx Parser interface ,
17 .Sx Parser internals ,
19 .Sx Formatter interface .
21 Various rules are given below prohibiting the inclusion of certain
22 combinations of headers into the same file.
23 The intention is to keep the following functional components
24 separate from each other:
26 .Bl -dash -offset indent -compact
50 Note that mere usage of an opaque struct type does
52 require inclusion of the header where that type is defined.
54 Each of the following headers can be included without including
55 any other mandoc header.
56 These headers should be included before any other mandoc headers.
58 .It Qq Pa mandoc_aux.h
63 Provides the utility functions documented in
65 .It Qq Pa mandoc_ohash.h
69 .Fn mandoc_ohash_init .
79 .Vt enum mandoclevel ,
94 the function prototype typedef
98 the functions described in
109 for function prototypes.
114 as an opaque type for function prototypes.
117 .Vt enum mdoc_endbody ,
118 .Vt enum roff_macroset ,
122 .Vt struct roff_man ,
123 .Vt struct roff_meta ,
124 .Vt struct roff_node ,
128 Uses pointers to the types
134 as opaque struct members.
137 The following two require
139 but no other mandoc headers.
140 Afterwards, any other mandoc headers can be included as needed.
154 .Vt struct mdoc_argv ,
155 .Vt struct mdoc_arg ,
161 .Vt union mdoc_data ,
171 as an opaque type for function prototypes.
173 When this header is included, the same file should not include
178 Provides the functions
187 for function prototypes.
192 as an opaque type for function prototypes.
194 When this header is included, the same file should not include
200 The following headers require inclusion of a parser interface header
201 before they can be included. All parser interface headers should
202 precede all parser internal headers. When any parser internal headers
203 are included, the same file should not include any formatter headers.
205 .It Qq Pa libmandoc.h
218 utility functions needed by multiple parsers,
219 and the top-level functions to call the parsers.
221 Uses the opaque types
229 for function prototypes.
240 as opaque types for function prototypes.
247 Provides functions named
249 to handle roff nodes and the two special functions
253 because the latter two are needed by
271 as opaque types for function prototypes.
283 .Vt struct mdoc_macro ,
284 and many functions internal to the
298 as opaque types for function prototypes.
300 When this header is included, the same file should not include
308 and some functions internal to the
318 as opaque types for function prototypes.
320 When this header is included, the same file should not include
342 .Vt struct tbl_node ,
344 .Vt struct eqn_node ,
345 and many functions internal to the
356 When this header is included, the same file should not include
363 .Ss Formatter interface
364 These headers should be included after any parser interface headers.
365 No parser internal headers should be included by the same file.
386 as an opaque type for function prototypes.
388 When this header is included, the same file should not include
406 .Vt struct termp_tbl ,
408 and many terminal formatting functions.
424 as opaque types for function prototypes.
426 When this header is included, the same file should not include
451 .Vt struct htmlpair ,
453 and many HTML formatting functions.
455 When this header is included, the same file should not include
465 Provides an interface to generate
469 functionality mentioned in
472 Provides the top level steering functions for all formatters.
478 as an opaque type for function prototypes.
487 .Vt struct manpaths ,
488 .Vt struct manoutput ,
494 .It Qq Pa mansearch.h
507 .Vt struct mansearch ,
509 .Fn mansearch_setup ,
518 as an opaque type for function prototypes.
520 When this header is included, the same file should not include