summaryrefslogtreecommitdiffstats
path: root/src/cmd/mpm/slug.h
diff options
context:
space:
mode:
authorwkj <devnull@localhost>2004-05-16 07:56:41 +0000
committerwkj <devnull@localhost>2004-05-16 07:56:41 +0000
commit5f1cf8e6fb130fd48d6f016d13baf5408b3181f8 (patch)
tree7f77f458df8c8b34db139fb4551df602ab6286be /src/cmd/mpm/slug.h
parentc5561c23cf394806cbf6d70a96f2dc0253f93745 (diff)
downloadplan9port-5f1cf8e6fb130fd48d6f016d13baf5408b3181f8.tar.gz
plan9port-5f1cf8e6fb130fd48d6f016d13baf5408b3181f8.zip
Checkpoint: pull in mpm; merge pic from Taj's version of the world
Diffstat (limited to 'src/cmd/mpm/slug.h')
-rw-r--r--src/cmd/mpm/slug.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/cmd/mpm/slug.h b/src/cmd/mpm/slug.h
new file mode 100644
index 00000000..9dfd3b2a
--- /dev/null
+++ b/src/cmd/mpm/slug.h
@@ -0,0 +1,74 @@
+enum slugtypes {
+ NONE, // can't happen
+ VBOX, // Vertical Box -- printable stuff
+ SP, // paddable SPace
+ BS, // start Breakable Stream
+ US, // start Unbreakable Stream
+ BF, // start Breakable Float
+ UF, // start Unbreakable Float
+ PT, // start Page Top material (header)
+ BT, // start page BoTtom material (footer)
+ END, // ENDs of groups
+ NEUTRAL, // NEUTRALized slugs can do no harm (cf. CIA)
+ PAGE, // beginning of PAGE in troff input
+ TM, // Terminal Message to appear during output
+ COORD, // output page COORDinates
+ NE, // NEed command
+ MC, // Multiple-Column command
+ CMD, // misc CoMmanDs: FC, FL, BP
+ PARM, // misc PARaMeters: NP, FO
+ LASTTYPE // can't happen either
+};
+
+enum cmdtypes {
+ FC, // Freeze 2-Column material
+ FL, // FLush all floats before reading more stream
+ BP // Break Page
+};
+
+enum parmtypes {
+ NP, // distance of top margin from page top (New Page)
+ FO, // distance of bottom margin from page top (FOoter)
+ PL, // distance of physical page bottom from page top (Page Length)
+ MF, // minimum fullness required for padding
+ CT, // tolerance for division into two columns
+ WARN, // warnings to stderr?
+ DBG // debugging flag
+};
+
+class slug {
+ int serialnum;
+ int dp; // offset of data for this slug in inbuf
+ int linenum; // input line number (approx) for this slug
+ short font; // font in effect at slug beginning
+ short size; // size in effect at slug beginning
+ short seen; // 0 until output
+ short ncol; // number of columns (1 or 2)
+ short offset; // horizontal offset for 2 columns
+ public:
+ short type; // VBOX, PP, etc.
+ short parm; // parameter
+ short base; // "depth" of this slug (from n command)
+ int hpos; // abs horizontal position
+ int dv; // height of this slug above its input Vpos
+ union {
+ int ht; // "height" of this slug (from n command)
+ int parm2; // second parameter, since only VBOXes have ht
+ };
+ friend slug getslug(FILE *);
+ friend void checkout();
+ friend slug eofslug();
+ void coalesce(); // with next slug in array slugs[]
+ void neutralize(); // render this one a no-op
+ void dump(); // dump its contents for debugging
+ char *headstr(); // string value of text
+ void slugout(int); // add the slug to the output
+ char *typename(); // printable slug type
+ int serialno() { return serialnum; }
+ int numcol() { return ncol; }
+ int lineno() { return linenum; }
+};
+
+// functions in slug.c
+slug eofslug();
+slug getslug(FILE *);