#include <limits.h>
#include <stdlib.h>
#include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
#include <libpspp/compiler.h>
#include <data/format.h>
#include <libpspp/magic.h>
t->rh = pool_nmalloc (t->container, nc, nr + 1);
memset (t->rh, 0, nc * (nr + 1));
- t->hrh = pool_nmalloc (t->container, nr + 1, sizeof *t->hrh);
- memset (t->hrh, 0, sizeof *t->hrh * (nr + 1));
-
t->rv = pool_nmalloc (t->container, nr, nc + 1);
memset (t->rv, UCHAR_MAX, nr * (nc + 1));
- t->wrv = pool_nmalloc (t->container, nc + 1, sizeof *t->wrv);
- memset (t->wrv, 0, sizeof *t->wrv * (nc + 1));
-
t->dim = NULL;
t->w = t->h = NULL;
t->col_ofs = t->row_ofs = 0;
tab_destroy (struct tab_table *t)
{
assert (t != NULL);
+ free (t->title);
pool_destroy (t->container);
}
x2, t->col_ofs, x2 + t->col_ofs,
y2, t->row_ofs, y2 + t->row_ofs,
t->nc, t->nr);
- abort ();
+ NOT_REACHED ();
}
#endif
if (width == 0)
{
- width = d->prop_em_width * 8;
-#if DEBUGGING
- printf ("warning: table column %d contains no data.\n", c);
-#endif
+ /* FIXME: This is an ugly kluge to compensate for the fact
+ that we don't let joined cells contribute to column
+ widths. */
+ width = d->prop_em_width * 8;
}
{
assert (t != NULL);
#if DEBUGGING
- if (row < -1 || row >= t->nr)
+ if (row < -1 || row > t->nr)
{
printf ("tab_offset(): row=%d in %d-row table\n", row, t->nr);
- abort ();
+ NOT_REACHED ();
}
- if (col < -1 || col >= t->nc)
+ if (col < -1 || col > t->nc)
{
printf ("tab_offset(): col=%d in %d-column table\n", col, t->nc);
- abort ();
+ NOT_REACHED ();
}
#endif
assert (t->w == NULL && t->h == NULL);
t->w = pool_nalloc (t->container, t->nc, sizeof *t->w);
t->h = pool_nalloc (t->container, t->nr, sizeof *t->h);
+ t->hrh = pool_nmalloc (t->container, t->nr + 1, sizeof *t->hrh);
+ t->wrv = pool_nmalloc (t->container, t->nc + 1, sizeof *t->wrv);
}
/* Returns the line style to use for spacing purposes for a rule
case TAL_2:
return OUTP_L_DOUBLE;
default:
- abort ();
+ NOT_REACHED ();
}
}
case TAB_CENTER:
return OUTP_CENTER;
default:
- abort ();
+ NOT_REACHED ();
}
}
case TAL_2:
return OUTP_L_DOUBLE;
default:
- abort ();
+ NOT_REACHED ();
}
}