-#include "message.h"
-#include "alloc.h"
-#include "format.h"
-#include "magic.h"
-#include "misc.h"
-#include "output.h"
-#include "pool.h"
-#include "manager.h"
-#include "variable.h"
-
-#include "gettext.h"
-#define _(msgid) gettext (msgid)
-
-#include "debug-print.h"
-\f
-struct som_table_class tab_table_class;
-static char *command_name;
-
-/* Creates a table with NC columns and NR rows. If REALLOCABLE is
- nonzero then the table's size can be increased later; otherwise,
- its size can only be reduced. */
-struct tab_table *
-tab_create (int nc, int nr, int reallocable)
-{
- void *(*alloc_func) (struct pool *, size_t n);
- void *(*nalloc_func) (struct pool *, size_t n, size_t s);
-
- struct tab_table *t;
-
- {
- struct pool *container = pool_create ();
- t = pool_alloc (container, sizeof *t);
- t->container = container;
- }
-
- t->col_style = TAB_COL_NONE;
- t->col_group = 0;
- ls_null (&t->title);
- t->flags = SOMF_NONE;
- t->nr = nr;
- t->nc = t->cf = nc;
- t->l = t->r = t->t = t->b = 0;
-
- nalloc_func = reallocable ? pool_nmalloc : pool_nalloc;
- alloc_func = reallocable ? pool_malloc : pool_alloc;
-#if GLOBAL_DEBUGGING
- t->reallocable = reallocable;
-#endif
-
- t->cc = nalloc_func (t->container, nr * nc, sizeof *t->cc);
- t->ct = alloc_func (t->container, nr * nc);
- memset (t->ct, TAB_EMPTY, nc * nr);
-
- t->rh = nalloc_func (t->container, nc, nr + 1);
- memset (t->rh, 0, nc * (nr + 1));
-
- t->hrh = nalloc_func (t->container, nr + 1, sizeof *t->hrh);
- memset (t->hrh, 0, sizeof *t->hrh * (nr + 1));
-
- t->trh = alloc_func (t->container, nr + 1);
- memset (t->trh, 0, nr + 1);
-
- t->rv = nalloc_func (t->container, nr, nc + 1);
- memset (t->rv, 0, (nc + 1) * nr);
-
- t->wrv = nalloc_func (t->container, nc + 1, sizeof *t->wrv);
- memset (t->wrv, 0, sizeof *t->wrv * (nc + 1));
-
- t->trv = alloc_func (t->container, nc + 1);
- memset (t->trv, 0, nc + 1);
-
- t->dim = NULL;
- t->w = t->h = NULL;
- t->col_ofs = t->row_ofs = 0;
-
- return t;
-}