aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-15 00:58:48 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-15 00:58:48 +0000
commit0dd8e0810b147f5b43ed6f6621f157e9dfec02fc (patch)
tree24ddca50ad9ca6061fbe186f5b3dcac0976b287c /term.h
parent236d2c65308cad428096f5cf0d16565498ba155d (diff)
downloadmandoc-0dd8e0810b147f5b43ed6f6621f157e9dfec02fc.tar.gz
mandoc-0dd8e0810b147f5b43ed6f6621f157e9dfec02fc.tar.zst
mandoc-0dd8e0810b147f5b43ed6f6621f157e9dfec02fc.zip
Move struct termp_ps into term_ps.c; remove the engine union in struct termp,
which only held one entry; finally (as per the first), make "ps" member into a pointer managed by term_ps.c. This frees up a nice chunk of memory during run-time and in the binary.
Diffstat (limited to 'term.h')
-rw-r--r--term.h35
1 files changed, 2 insertions, 33 deletions
diff --git a/term.h b/term.h
index 38afbfa6..7b0537df 100644
--- a/term.h
+++ b/term.h
@@ -1,4 +1,4 @@
-/* $Id: term.h,v 1.82 2011/05/14 18:15:20 kristaps Exp $ */
+/* $Id: term.h,v 1.83 2011/05/15 00:58:48 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -42,35 +42,6 @@ enum termfont {
typedef void (*term_margin)(struct termp *, const void *);
-struct termp_ps {
- int flags;
-#define PS_INLINE (1 << 0) /* we're in a word */
-#define PS_MARGINS (1 << 1) /* we're in the margins */
-#define PS_NEWPAGE (1 << 2) /* new page, no words yet */
- size_t pscol; /* visible column (AFM units) */
- size_t psrow; /* visible row (AFM units) */
- char *psmarg; /* margin buf */
- size_t psmargsz; /* margin buf size */
- size_t psmargcur; /* cur index in margin buf */
- char last; /* character buffer */
- enum termfont lastf; /* last set font */
- size_t scale; /* font scaling factor */
- size_t pages; /* number of pages shown */
- size_t lineheight; /* line height (AFM units) */
- size_t top; /* body top (AFM units) */
- size_t bottom; /* body bottom (AFM units) */
- size_t height; /* page height (AFM units */
- size_t width; /* page width (AFM units) */
- size_t left; /* body left (AFM units) */
- size_t header; /* header pos (AFM units) */
- size_t footer; /* footer pos (AFM units) */
- size_t pdfbytes; /* current output byte */
- size_t pdflastpg; /* byte of last page mark */
- size_t pdfbody; /* start of body object */
- size_t *pdfobjs; /* table of object offsets */
- size_t pdfobjsz; /* size of pdfobjs */
-};
-
struct termp_tbl {
int width; /* width in fixed chars */
int decimal; /* decimal point position */
@@ -120,9 +91,7 @@ struct termp {
double (*hspan)(const struct termp *,
const struct roffsu *);
const void *argf; /* arg for headf/footf */
- union {
- struct termp_ps ps;
- } engine;
+ struct termp_ps *ps;
};
struct termp *term_alloc(enum termenc);