Annotation of docbook2mdoc/macro.h, Revision 1.2
1.2 ! schwarze 1: /* $Id: macro.h,v 1.1 2019/03/26 19:17:29 schwarze Exp $ */
1.1 schwarze 2: /*
3: * Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org>
4: *
5: * Permission to use, copy, modify, and distribute this software for any
6: * purpose with or without fee is hereby granted, provided that the above
7: * copyright notice and this permission notice appear in all copies.
8: *
9: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
10: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
12: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16: */
17:
18: /*
19: * The interface of the macro line formatter,
20: * a part of the mdoc(7) formatter.
21: */
22:
23: enum linestate {
24: LINE_NEW = 0, /* At the beginning of a new line. */
25: LINE_TEXT, /* In the middle of a text line. */
26: LINE_MACRO /* In the middle of a macro line. */
27: };
28:
29: struct format {
30: int level; /* Header level, starting at 1. */
31: enum linestate linestate;
32: };
33:
34: #define ARG_SPACE 1 /* Insert whitespace before this argument. */
35: #define ARG_SINGLE 2 /* Quote argument if it contains whitespace. */
36: #define ARG_QUOTED 4 /* We are already in a quoted argument. */
37: #define ARG_UPPER 8 /* Covert argument to upper case. */
38:
39:
40: void macro_open(struct format *, const char *);
41: void macro_close(struct format *);
42: void macro_line(struct format *, const char *);
43: void macro_closepunct(struct format *, struct pnode *);
44:
45: void macro_addarg(struct format *, const char *, int);
46: void macro_argline(struct format *, const char *, const char *);
47: void macro_addnode(struct format *, struct pnode *, int);
48: void macro_nodeline(struct format *, const char *, struct pnode *, int);
1.2 ! schwarze 49:
! 50: void print_text(struct format *, const char *, int);
! 51: void print_textnode(struct format *, struct pnode *);
CVSweb