xref: /freebsd/contrib/mandoc/tag.h (revision 6d38604fc532a3fc060788e3ce40464b46047eaf)
1*6d38604fSBaptiste Daroussin /* $Id: tag.h,v 1.14 2020/04/18 20:40:10 schwarze Exp $ */
261d06d6bSBaptiste Daroussin /*
3*6d38604fSBaptiste Daroussin  * Copyright (c) 2015, 2018, 2019, 2020 Ingo Schwarze <schwarze@openbsd.org>
461d06d6bSBaptiste Daroussin  *
561d06d6bSBaptiste Daroussin  * Permission to use, copy, modify, and distribute this software for any
661d06d6bSBaptiste Daroussin  * purpose with or without fee is hereby granted, provided that the above
761d06d6bSBaptiste Daroussin  * copyright notice and this permission notice appear in all copies.
861d06d6bSBaptiste Daroussin  *
961d06d6bSBaptiste Daroussin  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1061d06d6bSBaptiste Daroussin  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1161d06d6bSBaptiste Daroussin  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1261d06d6bSBaptiste Daroussin  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1361d06d6bSBaptiste Daroussin  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1461d06d6bSBaptiste Daroussin  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1561d06d6bSBaptiste Daroussin  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*6d38604fSBaptiste Daroussin  *
17*6d38604fSBaptiste Daroussin  * Internal interfaces to tag syntax tree nodes.
18*6d38604fSBaptiste Daroussin  * For use by mandoc(1) validation modules only.
1961d06d6bSBaptiste Daroussin  */
2061d06d6bSBaptiste Daroussin 
21*6d38604fSBaptiste Daroussin /*
22*6d38604fSBaptiste Daroussin  * Tagging priorities.
23*6d38604fSBaptiste Daroussin  * Lower numbers indicate higher importance.
24*6d38604fSBaptiste Daroussin  */
25*6d38604fSBaptiste Daroussin #define	TAG_MANUAL	1		/* Set with a .Tg macro. */
26*6d38604fSBaptiste Daroussin #define	TAG_STRONG	2		/* Good automatic tagging. */
27*6d38604fSBaptiste Daroussin #define	TAG_WEAK	(INT_MAX - 2)	/* Dubious automatic tagging. */
28*6d38604fSBaptiste Daroussin #define	TAG_FALLBACK	(INT_MAX - 1)	/* Tag only used if unique. */
29*6d38604fSBaptiste Daroussin #define	TAG_DELETE	(INT_MAX)	/* Tag not used at all. */
3061d06d6bSBaptiste Daroussin 
31*6d38604fSBaptiste Daroussin void		 tag_alloc(void);
32*6d38604fSBaptiste Daroussin int		 tag_exists(const char *);
33*6d38604fSBaptiste Daroussin void		 tag_put(const char *, int, struct roff_node *);
34*6d38604fSBaptiste Daroussin void		 tag_postprocess(struct roff_man *, struct roff_node *);
35*6d38604fSBaptiste Daroussin void		 tag_free(void);
36