371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankov/* $Id: libman.h,v 1.79 2015/11/07 14:01:16 schwarze Exp $ */
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore/*
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankov * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore *
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * Permission to use, copy, modify, and distribute this software for any
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * purpose with or without fee is hereby granted, provided that the above
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * copyright notice and this permission notice appear in all copies.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore *
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankov * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankov * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore */
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankov#define MACRO_PROT_ARGS struct roff_man *man, \
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankov int tok, \
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore int line, \
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore int ppos, \
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore int *pos, \
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore char *buf
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amorestruct man_macro {
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov void (*fp)(MACRO_PROT_ARGS);
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore int flags;
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankov#define MAN_SCOPED (1 << 0) /* Optional next-line scope. */
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankov#define MAN_NSCOPED (1 << 1) /* Allowed in next-line element scope. */
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankov#define MAN_BSCOPE (1 << 2) /* Break next-line block scope. */
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankov#define MAN_JOIN (1 << 3) /* Join arguments together. */
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore};
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amoreextern const struct man_macro *const man_macros;
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankovint man_hash_find(const char *);
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankovvoid man_node_validate(struct roff_man *);
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankovvoid man_state(struct roff_man *, struct roff_node *);
371584c2eae4cf827fd406ba26c14f021adaaa70Yuri Pankovvoid man_unscope(struct roff_man *, const struct roff_node *);