Blame


1 5f1cf8e6 2004-05-16 devnull enum slugtypes {
2 5f1cf8e6 2004-05-16 devnull NONE, // can't happen
3 5f1cf8e6 2004-05-16 devnull VBOX, // Vertical Box -- printable stuff
4 5f1cf8e6 2004-05-16 devnull SP, // paddable SPace
5 5f1cf8e6 2004-05-16 devnull BS, // start Breakable Stream
6 5f1cf8e6 2004-05-16 devnull US, // start Unbreakable Stream
7 5f1cf8e6 2004-05-16 devnull BF, // start Breakable Float
8 5f1cf8e6 2004-05-16 devnull UF, // start Unbreakable Float
9 5f1cf8e6 2004-05-16 devnull PT, // start Page Top material (header)
10 5f1cf8e6 2004-05-16 devnull BT, // start page BoTtom material (footer)
11 5f1cf8e6 2004-05-16 devnull END, // ENDs of groups
12 5f1cf8e6 2004-05-16 devnull NEUTRAL, // NEUTRALized slugs can do no harm (cf. CIA)
13 5f1cf8e6 2004-05-16 devnull PAGE, // beginning of PAGE in troff input
14 5f1cf8e6 2004-05-16 devnull TM, // Terminal Message to appear during output
15 5f1cf8e6 2004-05-16 devnull COORD, // output page COORDinates
16 5f1cf8e6 2004-05-16 devnull NE, // NEed command
17 5f1cf8e6 2004-05-16 devnull MC, // Multiple-Column command
18 5f1cf8e6 2004-05-16 devnull CMD, // misc CoMmanDs: FC, FL, BP
19 5f1cf8e6 2004-05-16 devnull PARM, // misc PARaMeters: NP, FO
20 5f1cf8e6 2004-05-16 devnull LASTTYPE // can't happen either
21 5f1cf8e6 2004-05-16 devnull };
22 5f1cf8e6 2004-05-16 devnull
23 5f1cf8e6 2004-05-16 devnull enum cmdtypes {
24 5f1cf8e6 2004-05-16 devnull FC, // Freeze 2-Column material
25 5f1cf8e6 2004-05-16 devnull FL, // FLush all floats before reading more stream
26 5f1cf8e6 2004-05-16 devnull BP // Break Page
27 5f1cf8e6 2004-05-16 devnull };
28 5f1cf8e6 2004-05-16 devnull
29 5f1cf8e6 2004-05-16 devnull enum parmtypes {
30 5f1cf8e6 2004-05-16 devnull NP, // distance of top margin from page top (New Page)
31 5f1cf8e6 2004-05-16 devnull FO, // distance of bottom margin from page top (FOoter)
32 5f1cf8e6 2004-05-16 devnull PL, // distance of physical page bottom from page top (Page Length)
33 5f1cf8e6 2004-05-16 devnull MF, // minimum fullness required for padding
34 5f1cf8e6 2004-05-16 devnull CT, // tolerance for division into two columns
35 fa325e9b 2020-01-10 cross WARN, // warnings to stderr?
36 5f1cf8e6 2004-05-16 devnull DBG // debugging flag
37 5f1cf8e6 2004-05-16 devnull };
38 5f1cf8e6 2004-05-16 devnull
39 5f1cf8e6 2004-05-16 devnull class slug {
40 5f1cf8e6 2004-05-16 devnull int serialnum;
41 5f1cf8e6 2004-05-16 devnull int dp; // offset of data for this slug in inbuf
42 5f1cf8e6 2004-05-16 devnull int linenum; // input line number (approx) for this slug
43 5f1cf8e6 2004-05-16 devnull short font; // font in effect at slug beginning
44 5f1cf8e6 2004-05-16 devnull short size; // size in effect at slug beginning
45 5f1cf8e6 2004-05-16 devnull short seen; // 0 until output
46 5f1cf8e6 2004-05-16 devnull short ncol; // number of columns (1 or 2)
47 5f1cf8e6 2004-05-16 devnull short offset; // horizontal offset for 2 columns
48 5f1cf8e6 2004-05-16 devnull public:
49 5f1cf8e6 2004-05-16 devnull short type; // VBOX, PP, etc.
50 5f1cf8e6 2004-05-16 devnull short parm; // parameter
51 5f1cf8e6 2004-05-16 devnull short base; // "depth" of this slug (from n command)
52 5f1cf8e6 2004-05-16 devnull int hpos; // abs horizontal position
53 5f1cf8e6 2004-05-16 devnull int dv; // height of this slug above its input Vpos
54 5f1cf8e6 2004-05-16 devnull union {
55 5f1cf8e6 2004-05-16 devnull int ht; // "height" of this slug (from n command)
56 5f1cf8e6 2004-05-16 devnull int parm2; // second parameter, since only VBOXes have ht
57 5f1cf8e6 2004-05-16 devnull };
58 5f1cf8e6 2004-05-16 devnull friend slug getslug(FILE *);
59 5f1cf8e6 2004-05-16 devnull friend void checkout();
60 5f1cf8e6 2004-05-16 devnull friend slug eofslug();
61 5f1cf8e6 2004-05-16 devnull void coalesce(); // with next slug in array slugs[]
62 5f1cf8e6 2004-05-16 devnull void neutralize(); // render this one a no-op
63 5f1cf8e6 2004-05-16 devnull void dump(); // dump its contents for debugging
64 5f1cf8e6 2004-05-16 devnull char *headstr(); // string value of text
65 5f1cf8e6 2004-05-16 devnull void slugout(int); // add the slug to the output
66 5f1cf8e6 2004-05-16 devnull char *typename(); // printable slug type
67 5f1cf8e6 2004-05-16 devnull int serialno() { return serialnum; }
68 5f1cf8e6 2004-05-16 devnull int numcol() { return ncol; }
69 5f1cf8e6 2004-05-16 devnull int lineno() { return linenum; }
70 5f1cf8e6 2004-05-16 devnull };
71 5f1cf8e6 2004-05-16 devnull
72 5f1cf8e6 2004-05-16 devnull // functions in slug.c
73 5f1cf8e6 2004-05-16 devnull slug eofslug();
74 5f1cf8e6 2004-05-16 devnull slug getslug(FILE *);