mld6query(8): Rename mld6.c -> mld6query.c
[dragonfly.git] / contrib / mdocml / out.h
blob514db3fe279c021526d70e5cacf6829ba6356b31
1 /* $Id: out.h,v 1.22 2014/04/20 16:46:05 schwarze Exp $ */
2 /*
3 * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
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.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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.
17 #ifndef OUT_H
18 #define OUT_H
20 enum roffscale {
21 SCALE_CM, /* centimeters (c) */
22 SCALE_IN, /* inches (i) */
23 SCALE_PC, /* pica (P) */
24 SCALE_PT, /* points (p) */
25 SCALE_EM, /* ems (m) */
26 SCALE_MM, /* mini-ems (M) */
27 SCALE_EN, /* ens (n) */
28 SCALE_BU, /* default horizontal (u) */
29 SCALE_VS, /* default vertical (v) */
30 SCALE_FS, /* syn. for u (f) */
31 SCALE_MAX
34 struct roffcol {
35 size_t width; /* width of cell */
36 size_t decimal; /* decimal position in cell */
39 struct roffsu {
40 enum roffscale unit;
41 double scale;
44 typedef size_t (*tbl_strlen)(const char *, void *);
45 typedef size_t (*tbl_len)(size_t, void *);
47 struct rofftbl {
48 tbl_strlen slen; /* calculate string length */
49 tbl_len len; /* produce width of empty space */
50 struct roffcol *cols; /* master column specifiers */
51 void *arg; /* passed to slen and len */
54 __BEGIN_DECLS
56 #define SCALE_VS_INIT(p, v) \
57 do { (p)->unit = SCALE_VS; \
58 (p)->scale = (v); } \
59 while (/* CONSTCOND */ 0)
61 #define SCALE_HS_INIT(p, v) \
62 do { (p)->unit = SCALE_BU; \
63 (p)->scale = (v); } \
64 while (/* CONSTCOND */ 0)
66 int a2roffsu(const char *, struct roffsu *, enum roffscale);
67 void tblcalc(struct rofftbl *tbl, const struct tbl_span *);
69 __END_DECLS
71 #endif /*!OUT_H*/