2 * neatpost troff postscript postprocessor
4 * Copyright (C) 2013 Ali Gholami Rudi <ali at rudi dot ir>
6 * This program is released under the Modified BSD license.
19 static void back(int c
)
24 static int utf8len(int c
)
41 static int nextutf8(char *s
)
49 for (i
= 1; i
< l
; i
++)
56 static void nextskip(void)
65 static int nextnum(void)
79 if (c
< 0 || !isdigit(c
))
86 static int iseol(void)
97 /* skip until the end of line */
98 static void nexteol(void)
103 } while (c
>= 0 && c
!= '\n');
106 static void nextword(char *s
)
111 while (c
>= 0 && !isspace(c
)) {
120 static void postspline(int h1
, int v1
)
126 draws(h1
, v1
, h2
, v2
);
133 static void postdraw(void)
157 drawa(h1
, v1
, h2
, v2
);
172 static char devpath
[PATHLEN
] = "devutf";
174 static void postx(void)
184 dev_mnt(pos
, dev
, dev
);
191 sprintf(devpath
, "%s/font/dev%s", TROFFROOT
, dev
);
201 static void postcmd(int c
)
205 outrel((c
- '0') * 10 + next() - '0', 0);
224 outrel(nextnum(), 0);
227 outrel(0, nextnum());
263 fprintf(stderr
, "unknown command: %c\n", c
);
267 static void post(void)
270 while ((c
= next()) >= 0)
281 ps_trailer(o_pg
, o_fonts
);