xref: /illumos-gate/usr/src/cmd/mandoc/tag.h (revision 4d131170)
1*4d131170SRobert Mustacchi /* $Id: tag.h,v 1.14 2020/04/18 20:40:10 schwarze Exp $ */
295c635efSGarrett D'Amore /*
3*4d131170SRobert Mustacchi  * Copyright (c) 2015, 2018, 2019, 2020 Ingo Schwarze <schwarze@openbsd.org>
495c635efSGarrett D'Amore  *
595c635efSGarrett D'Amore  * Permission to use, copy, modify, and distribute this software for any
695c635efSGarrett D'Amore  * purpose with or without fee is hereby granted, provided that the above
795c635efSGarrett D'Amore  * copyright notice and this permission notice appear in all copies.
895c635efSGarrett D'Amore  *
995c635efSGarrett D'Amore  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1095c635efSGarrett D'Amore  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1195c635efSGarrett D'Amore  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1295c635efSGarrett D'Amore  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1395c635efSGarrett D'Amore  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1495c635efSGarrett D'Amore  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1595c635efSGarrett D'Amore  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*4d131170SRobert Mustacchi  *
17*4d131170SRobert Mustacchi  * Internal interfaces to tag syntax tree nodes.
18*4d131170SRobert Mustacchi  * For use by mandoc(1) validation modules only.
1995c635efSGarrett D'Amore  */
2095c635efSGarrett D'Amore 
21*4d131170SRobert Mustacchi /*
22*4d131170SRobert Mustacchi  * Tagging priorities.
23*4d131170SRobert Mustacchi  * Lower numbers indicate higher importance.
24*4d131170SRobert Mustacchi  */
25*4d131170SRobert Mustacchi #define	TAG_MANUAL	1		/* Set with a .Tg macro. */
26*4d131170SRobert Mustacchi #define	TAG_STRONG	2		/* Good automatic tagging. */
27*4d131170SRobert Mustacchi #define	TAG_WEAK	(INT_MAX - 2)	/* Dubious automatic tagging. */
28*4d131170SRobert Mustacchi #define	TAG_FALLBACK	(INT_MAX - 1)	/* Tag only used if unique. */
29*4d131170SRobert Mustacchi #define	TAG_DELETE	(INT_MAX)	/* Tag not used at all. */
3095c635efSGarrett D'Amore 
31*4d131170SRobert Mustacchi void		 tag_alloc(void);
32*4d131170SRobert Mustacchi int		 tag_exists(const char *);
33*4d131170SRobert Mustacchi void		 tag_put(const char *, int, struct roff_node *);
34*4d131170SRobert Mustacchi void		 tag_postprocess(struct roff_man *, struct roff_node *);
35*4d131170SRobert Mustacchi void		 tag_free(void);
36