4 #include "../common/common.h"
15 if (debug) Bprint(Bstderr, "conv(Biobufhdr *Bp=0x%x)\n", Bp);
16 while ((r = Bgetrune(Bp)) >= 0) {
17 /* Bprint(Bstderr, "r=<%c>,0x%x\n", r, r); */
18 /* Bflush(Bstderr); */
20 case 's': /* set point size */
21 Bgetfield(Bp, 'd', &fontsize, 0);
23 case 'f': /* set font to postion */
24 Bgetfield(Bp, 'd', &fontpos, 0);
27 inputlineno = save; /* ugh */
29 case 'c': /* print rune */
33 case 'C': /* print special character */
34 Bgetfield(Bp, 's', special, 10);
37 case 'N': /* print character with numeric value from current font */
38 Bgetfield(Bp, 'd', &n, 0);
40 case 'H': /* go to absolute horizontal position */
41 Bgetfield(Bp, 'd', &n, 0);
44 case 'V': /* go to absolute vertical position */
45 Bgetfield(Bp, 'd', &n, 0);
48 case 'h': /* go to relative horizontal position */
49 Bgetfield(Bp, 'd', &n, 0);
52 case 'v': /* go to relative vertical position */
53 Bgetfield(Bp, 'd', &n, 0);
56 case '0': case '1': case '2': case '3': case '4':
57 case '5': case '6': case '7': case '8': case '9':
58 /* move right nn units, then print character c */
62 error(FATAL, "EOF or error reading input\n");
63 else if (r < '0' || r > '9')
64 error(FATAL, "integer expected\n");
70 case 'p': /* begin page */
71 Bgetfield(Bp, 'd', &n, 0);
75 case 'n': /* end of line (information only 'b a' follows) */
76 Brdline(Bp, '\n'); /* toss rest of line */
79 case 'w': /* paddable word space (information only) */
81 case 'D': /* graphics function */
84 case 'x': /* device control functions */
87 case '#': /* comment */
88 Brdline(Bp, '\n'); /* toss rest of line */
93 error(WARNING, "unknown troff function <%c>\n", r);
98 if (debug) Bprint(Bstderr, "r=0x%x\n", r);
99 if (debug) Bprint(Bstderr, "leaving conv\n");