xref: /openbsd-src/usr.bin/mandoc/tag.h (revision 6e2a0df93b26b20049df54aff0406fb853fa3e0b)
1*6e2a0df9Sschwarze /* $OpenBSD: tag.h,v 1.14 2020/04/18 20:28:46 schwarze Exp $ */
2c0a657b3Sschwarze /*
37d109111Sschwarze  * Copyright (c) 2015, 2018, 2019, 2020 Ingo Schwarze <schwarze@openbsd.org>
4c0a657b3Sschwarze  *
5c0a657b3Sschwarze  * Permission to use, copy, modify, and distribute this software for any
6c0a657b3Sschwarze  * purpose with or without fee is hereby granted, provided that the above
7c0a657b3Sschwarze  * copyright notice and this permission notice appear in all copies.
8c0a657b3Sschwarze  *
9c0a657b3Sschwarze  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10c0a657b3Sschwarze  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11c0a657b3Sschwarze  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12c0a657b3Sschwarze  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13c0a657b3Sschwarze  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14c0a657b3Sschwarze  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15c0a657b3Sschwarze  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
160ac7e6ecSschwarze  *
170ac7e6ecSschwarze  * Internal interfaces to tag syntax tree nodes.
180ac7e6ecSschwarze  * For use by mandoc(1) validation modules only.
19c0a657b3Sschwarze  */
20c0a657b3Sschwarze 
217d109111Sschwarze /*
227d109111Sschwarze  * Tagging priorities.
237d109111Sschwarze  * Lower numbers indicate higher importance.
247d109111Sschwarze  */
257d109111Sschwarze #define	TAG_MANUAL	1		/* Set with a .Tg macro. */
267d109111Sschwarze #define	TAG_STRONG	2		/* Good automatic tagging. */
277d109111Sschwarze #define	TAG_WEAK	(INT_MAX - 2)	/* Dubious automatic tagging. */
287d109111Sschwarze #define	TAG_FALLBACK	(INT_MAX - 1)	/* Tag only used if unique. */
297d109111Sschwarze #define	TAG_DELETE	(INT_MAX)	/* Tag not used at all. */
307d109111Sschwarze 
310ac7e6ecSschwarze void		 tag_alloc(void);
32beabc24cSschwarze int		 tag_exists(const char *);
330ac7e6ecSschwarze void		 tag_put(const char *, int, struct roff_node *);
34*6e2a0df9Sschwarze void		 tag_postprocess(struct roff_man *, struct roff_node *);
350ac7e6ecSschwarze void		 tag_free(void);
36