-/* Cells. */
-struct fmt_spec;
-union value;
-void tab_value (struct tab_table *, int c, int r, unsigned char opt,
- const union value *, const struct fmt_spec *);
-void tab_float (struct tab_table *, int c, int r, unsigned char opt,
- double v, int w, int d);
-void tab_text (struct tab_table *, int c, int r, unsigned opt,
- const char *, ...)
- PRINTF_FORMAT (5, 6);
-void tab_joint_text (struct tab_table *, int x1, int y1, int x2, int y2,
- unsigned opt, const char *, ...)
- PRINTF_FORMAT (7, 8);
-
-/* Cell low-level access. */
-#define tab_alloc(TABLE, AMT) pool_alloc ((TABLE)->container, (AMT))
-void tab_raw (struct tab_table *, int c, int r, unsigned opt,
- struct fixed_string *);
-
-/* Editing. */
-void tab_offset (struct tab_table *, int col, int row);
-void tab_next_row (struct tab_table *);
-
-/* Current row/column offset. */
-#define tab_row(TABLE) ((TABLE)->row_ofs)
-#define tab_col(TABLE) ((TABLE)->col_ofs)
-
-/* Simple output. */
-void tab_output_text (int options, const char *string, ...)
- PRINTF_FORMAT (2, 3);
-
-/* Embedding the command name in the output. */
-void tab_set_command_name (const char *);
-
-#endif /* tab_h */
-
+/* Reference counting. */
+struct table *table_ref (const struct table *);
+void table_unref (struct table *);
+bool table_is_shared (const struct table *);
+struct table *table_unshare (struct table *);
+
+/* Returns the number of columns or rows, respectively, in T. */
+static inline int table_nc (const struct table *t)
+ { return t->n[TABLE_HORZ]; }
+static inline int table_nr (const struct table *t)
+ { return t->n[TABLE_VERT]; }
+
+/* Returns the number of left, right, top, or bottom headers, respectively, in
+ T. */
+static inline int table_hl (const struct table *t)
+ { return t->h[TABLE_HORZ][0]; }
+static inline int table_hr (const struct table *t)
+ { return t->h[TABLE_HORZ][1]; }
+static inline int table_ht (const struct table *t)
+ { return t->h[TABLE_VERT][0]; }
+static inline int table_hb (const struct table *t)
+ { return t->h[TABLE_VERT][1]; }
+
+/* Set headers. */
+void table_set_hl (struct table *, int hl);
+void table_set_hr (struct table *, int hr);
+void table_set_ht (struct table *, int ht);
+void table_set_hb (struct table *, int hb);
+\f
+/* Table classes. */
+
+/* Simple kinds of tables. */
+struct table *table_from_string (unsigned int options, const char *);
+struct table *table_from_variables (unsigned int options,
+ struct variable **, size_t);
+struct table *table_from_casereader (const struct casereader *,
+ size_t column,
+ const char *heading,
+ const struct fmt_spec *);
+
+/* Combining tables. */
+struct table *table_paste (struct table *, struct table *,
+ enum table_axis orientation);
+struct table *table_hpaste (struct table *left, struct table *right);
+struct table *table_vpaste (struct table *top, struct table *bottom);
+
+/* Taking subsets of tables. */
+struct table *table_select (struct table *, int rect[TABLE_N_AXES][2]);
+struct table *table_select_slice (struct table *, enum table_axis,
+ int z0, int z1, bool add_headers);
+struct table *table_select_columns (struct table *,
+ int x0, int x1, bool add_headers);
+struct table *table_select_rows (struct table *,
+ int y0, int y1, bool add_headers);
+
+/* Miscellaneous table operations. */
+struct table *table_transpose (struct table *);
+
+#endif /* output/table.h */