xref: /openbsd/usr.bin/mandoc/main.h (revision 8529ddd3)
1 /*	$OpenBSD: main.h,v 1.17 2015/04/18 16:04:40 schwarze Exp $ */
2 /*
3  * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
4  * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #define	UNCONST(a)	((void *)(uintptr_t)(const void *)(a))
20 
21 __BEGIN_DECLS
22 
23 struct	mchars;
24 struct	roff_man;
25 struct	manoutput;
26 
27 /*
28  * Definitions for main.c-visible output device functions, e.g., -Thtml
29  * and -Tascii.  Note that ascii_alloc() is named as such in
30  * anticipation of latin1_alloc() and so on, all of which map into the
31  * terminal output routines with different character settings.
32  */
33 
34 void		 *html_alloc(const struct mchars *,
35 			const struct manoutput *);
36 void		  html_mdoc(void *, const struct roff_man *);
37 void		  html_man(void *, const struct roff_man *);
38 void		  html_free(void *);
39 
40 void		  tree_mdoc(void *, const struct roff_man *);
41 void		  tree_man(void *, const struct roff_man *);
42 
43 void		  man_mdoc(void *, const struct roff_man *);
44 void		  man_man(void *, const struct roff_man *);
45 
46 void		 *locale_alloc(const struct mchars *,
47 			const struct manoutput *);
48 void		 *utf8_alloc(const struct mchars *,
49 			const struct manoutput *);
50 void		 *ascii_alloc(const struct mchars *,
51 			const struct manoutput *);
52 void		  ascii_free(void *);
53 void		  ascii_sepline(void *);
54 
55 void		 *pdf_alloc(const struct mchars *,
56 			const struct manoutput *);
57 void		 *ps_alloc(const struct mchars *,
58 			const struct manoutput *);
59 void		  pspdf_free(void *);
60 
61 void		  terminal_mdoc(void *, const struct roff_man *);
62 void		  terminal_man(void *, const struct roff_man *);
63 
64 __END_DECLS
65