]> git.cameronkatri.com Git - mandoc.git/blob - out.h
Added horizontal scaling units to -Tman -Tascii.
[mandoc.git] / out.h
1 /* $Id: out.h,v 1.4 2009/10/09 06:54:11 kristaps Exp $ */
2 /*
3 * Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
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 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.
16 */
17 #ifndef OUT_H
18 #define OUT_H
19
20 __BEGIN_DECLS
21
22 enum roffscale {
23 SCALE_CM,
24 SCALE_IN,
25 SCALE_PC,
26 SCALE_PT,
27 SCALE_EM,
28 SCALE_MM,
29 SCALE_EN,
30 SCALE_BU,
31 SCALE_VS,
32 SCALE_FS,
33 SCALE_MAX
34 };
35
36 struct roffsu {
37 enum roffscale unit;
38 double scale;
39 int pt;
40 };
41
42 #define SCALE_INVERT(p) \
43 do { (p)->scale = -(p)->scale; } while (/*CONSTCOND*/0)
44 #define SCALE_VS_INIT(p, v) \
45 do { (p)->unit = SCALE_VS; \
46 (p)->scale = (v); \
47 (p)->pt = 0; } while (/*CONSTCOND*/0)
48 #define SCALE_HS_INIT(p, v) \
49 do { (p)->unit = SCALE_BU; \
50 (p)->scale = (v); \
51 (p)->pt = 0; } while (/*CONSTCOND*/0)
52
53 int a2roffsu(const char *, struct roffsu *);
54
55 __END_DECLS
56
57 #endif /*!HTML_H*/