- int x;
-
- assert (t != NULL);
-
- x1 += t->col_ofs;
- x2 += t->col_ofs;
- y += t->row_ofs;
-
- assert (y >= 0);
- assert (y < t->nr);
- assert (x2 >= x1 );
- assert (x1 >= 0 );
- assert (x2 < t->nc);
-
- if (style != -1)
- {
- if ((style & TAL_SPACING) == 0)
- for (x = x1; x <= x2; x++)
- t->rh[x + t->cf * y] = style;
- t->trh[y] |= (1 << (style & ~TAL_SPACING));
- }
-}
-
-/* Draws a box around cells (X1,Y1)-(X2,Y2) inclusive with horizontal
- lines of style F_H and vertical lines of style F_V. Fills the
- interior of the box with horizontal lines of style I_H and vertical
- lines of style I_V. Any of the line styles may be -1 to avoid
- drawing those lines. This is distinct from 0, which draws a null
- line. */
-void
-tab_box (struct tab_table *t, int f_h, int f_v, int i_h, int i_v,
- int x1, int y1, int x2, int y2)
-{
- assert (t != NULL);
-
-#if DEBUGGING
- if (x1 + t->col_ofs < 0 || x1 + t->col_ofs >= t->nc
- || x2 + t->col_ofs < 0 || x2 + t->col_ofs >= t->nc
- || y1 + t->row_ofs < 0 || y1 + t->row_ofs >= t->nr
- || y2 + t->row_ofs < 0 || y2 + t->row_ofs >= t->nr)
- {
- printf (_("bad box: (%d+%d=%d,%d+%d=%d)-(%d+%d=%d,%d+%d=%d) "
- "in table size (%d,%d)\n"),
- x1, t->col_ofs, x1 + t->col_ofs,
- y1, t->row_ofs, y1 + t->row_ofs,
- x2, t->col_ofs, x2 + t->col_ofs,
- y2, t->row_ofs, y2 + t->row_ofs,
- t->nc, t->nr);
- abort ();
- }
-#endif
-
- x1 += t->col_ofs;
- x2 += t->col_ofs;
- y1 += t->row_ofs;
- y2 += t->row_ofs;
-
- assert (x2 >= x1);
- assert (y2 >= y1);
- assert (x1 >= 0);
- assert (y1 >= 0);
- assert (x2 < t->nc);
- assert (y2 < t->nr);
-
- if (f_h != -1)
- {
- int x;
- if ((f_h & TAL_SPACING) == 0)
- for (x = x1; x <= x2; x++)
- {
- t->rh[x + t->cf * y1] = f_h;
- t->rh[x + t->cf * (y2 + 1)] = f_h;
- }
- t->trh[y1] |= (1 << (f_h & ~TAL_SPACING));
- t->trh[y2 + 1] |= (1 << (f_h & ~TAL_SPACING));
- }
- if (f_v != -1)
- {
- int y;
- if ((f_v & TAL_SPACING) == 0)
- for (y = y1; y <= y2; y++)
- {
- t->rv[x1 + (t->cf + 1) * y] = f_v;
- t->rv[(x2 + 1) + (t->cf + 1) * y] = f_v;
- }
- t->trv[x1] |= (1 << (f_v & ~TAL_SPACING));
- t->trv[x2 + 1] |= (1 << (f_v & ~TAL_SPACING));
- }
-
- if (i_h != -1)
- {
- int y;
-
- for (y = y1 + 1; y <= y2; y++)
- {
- int x;
-
- if ((i_h & TAL_SPACING) == 0)
- for (x = x1; x <= x2; x++)
- t->rh[x + t->cf * y] = i_h;
-
- t->trh[y] |= (1 << (i_h & ~TAL_SPACING));
- }
- }
- if (i_v != -1)
- {
- int x;
-
- for (x = x1 + 1; x <= x2; x++)
- {
- int y;
-
- if ((i_v & TAL_SPACING) == 0)
- for (y = y1; y <= y2; y++)
- t->rv[x + (t->cf + 1) * y] = i_v;
-
- t->trv[x] |= (1 << (i_v & ~TAL_SPACING));
- }
- }