+static bool
+check_fits_width (struct som_entity *t, const struct outp_driver *d, void *r)
+{
+ int hl, hr, ht, hb;
+ int nc, nr;
+ int i;
+
+ t->class->headers (t, &hl, &hr, &ht, &hb);
+ t->class->count (t, &nc, &nr);
+ for (i = hl; i < nc - hr; i++)
+ {
+ int end, actual;
+ t->class->cumulate (r, SOM_COLUMNS, i, &end, d->width, &actual);
+ if (end == i)
+ return false;
+ }
+
+ return true;
+}
+
+static bool
+check_fits_length (struct som_entity *t, const struct outp_driver *d, void *r)
+{
+ int hl, hr, ht, hb;
+ int nc, nr;
+ int i;
+
+ t->class->headers (t, &hl, &hr, &ht, &hb);
+ t->class->count (t, &nc, &nr);
+ for (i = ht; i < nr - hb; i++)
+ {
+ int end, actual;
+ t->class->cumulate (r, SOM_ROWS, i, &end, d->length, &actual);
+ if (end == i)
+ return false;
+ }
+
+ return true;
+}
+
+/* Output entity T to driver D. */