+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 */
+#define PS_BACKSP (1 << 3) /* last character was backspace */
+ size_t pscol; /* visible column (AFM units) */
+ size_t pscolnext; /* used for overstrike */
+ size_t psrow; /* visible row (AFM units) */
+ size_t lastrow; /* psrow of the previous word */
+ char *psmarg; /* margin buf */
+ size_t psmargsz; /* margin buf size */
+ size_t psmargcur; /* cur index in margin buf */
+ char last; /* last non-backspace seen */
+ enum termfont lastf; /* last set font */
+ enum termfont nextf; /* building next font here */
+ 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) */
+ const char *medianame; /* for DocumentMedia and PageSize */
+ size_t height; /* page height (AFM units */
+ size_t width; /* page width (AFM units) */
+ size_t lastwidth; /* page width before last ll */
+ 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 */
+};
+
+static int ps_hspan(const struct termp *,
+ const struct roffsu *);
+static size_t ps_width(const struct termp *, int);
+static void ps_advance(struct termp *, size_t);
+static void ps_begin(struct termp *);
+static void ps_closepage(struct termp *);
+static void ps_end(struct termp *);
+static void ps_endline(struct termp *);
+static void ps_growbuf(struct termp *, size_t);
+static void ps_letter(struct termp *, int);
+static void ps_pclose(struct termp *);
+static void ps_plast(struct termp *);
+static void ps_pletter(struct termp *, int);
+static void ps_printf(struct termp *, const char *, ...)
+ __attribute__((__format__ (__printf__, 2, 3)));
+static void ps_putchar(struct termp *, char);
+static void ps_setfont(struct termp *, enum termfont);
+static void ps_setwidth(struct termp *, int, int);
+static struct termp *pspdf_alloc(const struct manoutput *, enum termtype);
+static void pdf_obj(struct termp *, size_t);
+