/* PSPP - computes sample statistics.
- Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
+ Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
02110-1301, USA. */
#include <config.h>
+
#include "table.h"
+
#include <ctype.h>
#include <stdarg.h>
#include <limits.h>
#include <stdlib.h>
+
+#include "output.h"
+#include "manager.h"
+
+#include <data/data-out.h>
+#include <data/format.h>
+#include <data/value.h>
#include <libpspp/alloc.h>
#include <libpspp/assertion.h>
#include <libpspp/compiler.h>
-#include <data/format.h>
#include <libpspp/magic.h>
#include <libpspp/misc.h>
-#include "minmax.h"
-#include "output.h"
#include <libpspp/pool.h>
-#include "manager.h"
-#include <data/variable.h>
+
+#include "minmax.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
\f
-struct som_table_class tab_table_class;
+const struct som_table_class tab_table_class;
static char *command_name;
/* Returns the font to use for a cell with the given OPTIONS. */
if (nc > t->cf)
{
- int mr1 = min (nr, t->nr);
- int mc1 = min (nc, t->nc);
+ int mr1 = MIN (nr, t->nr);
+ int mc1 = MIN (nc, t->nc);
struct substring *new_cc;
unsigned char *new_ct;
y += t->row_ofs;
assert (y >= 0);
- assert (y < t->nr);
+ assert (y <= t->nr);
assert (x2 >= x1 );
assert (x1 >= 0 );
assert (x2 < t->nc);
table->cc[c + r * table->cf] = ss_buffer (contents, f->w);
table->ct[c + r * table->cf] = opt;
- data_out (contents, f, v);
+ data_out (v, f, contents);
}
/* Sets cell (C,R) in TABLE, with options OPT, to have value VAL
assert (r >= 0);
assert (r < table->nr);
- f = make_output_format (FMT_F, w, d);
+ f = fmt_for_output (FMT_F, w, d);
#if DEBUGGING
if (c + table->col_ofs < 0 || r + table->row_ofs < 0
#endif
double_value.f = val;
- data_out (buf, &f, &double_value);
+ data_out (&double_value, &f, buf);
cp = buf;
while (isspace ((unsigned char) *cp) && cp < &buf[w])
\f
static struct tab_table *t;
static struct outp_driver *d;
-int tab_hit;
+static int tab_hit;
/* Set the current table to TABLE. */
static void
y = render_rows (y, c0, c1, (t->nr - t->b) * 2, t->nr * 2 + 1);
}
-struct som_table_class tab_table_class =
+const struct som_table_class tab_table_class =
{
tabi_table,
tabi_driver,