From 464a7a97da808da1d8a608e9254dfaad30c9de72 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 25 Dec 2019 23:21:05 +0000 Subject: [PATCH] table: Move tab.h into table.h and rename tab_*() to table_*(). --- src/language/data-io/print.c | 4 +- src/output/automake.mk | 1 - src/output/pivot-output.c | 39 ++++++++++--------- src/output/render.c | 21 +++++------ src/output/tab.h | 71 ----------------------------------- src/output/table.c | 72 ++++++++++++++++++------------------ src/output/table.h | 49 ++++++++++++++++++++---- src/output/text-item.c | 6 +-- tests/output/render-test.c | 24 ++++++------ 9 files changed, 123 insertions(+), 164 deletions(-) delete mode 100644 src/output/tab.h diff --git a/src/language/data-io/print.c b/src/language/data-io/print.c index 4545a222df..5ee7fdd369 100644 --- a/src/language/data-io/print.c +++ b/src/language/data-io/print.c @@ -41,7 +41,7 @@ #include "libpspp/pool.h" #include "libpspp/u8-line.h" #include "output/pivot-table.h" -#include "output/tab.h" +#include "output/table.h" #include "output/text-item.h" #include "gl/xalloc.h" @@ -562,7 +562,7 @@ print_text_flush_records (struct print_trns *trns, struct u8_line *line, *u8_line_reserve (line, 0, 1, 1) = leader; if (trns->writer == NULL) - tab_output_text (TAB_FIX, ds_cstr (&line->s) + 1); + table_output_text (TAB_FIX, ds_cstr (&line->s) + 1); else { size_t len = ds_length (&line->s); diff --git a/src/output/automake.mk b/src/output/automake.mk index cbdaa4fc7b..960f43bfc2 100644 --- a/src/output/automake.mk +++ b/src/output/automake.mk @@ -72,7 +72,6 @@ src_output_liboutput_la_SOURCES = \ src/output/pivot-table.h \ src/output/render.c \ src/output/render.h \ - src/output/tab.h \ src/output/table-item.c \ src/output/table-item.h \ src/output/table-provider.h \ diff --git a/src/output/pivot-output.c b/src/output/pivot-output.c index 1325234f35..f90a953e5d 100644 --- a/src/output/pivot-output.c +++ b/src/output/pivot-output.c @@ -23,7 +23,6 @@ #include "data/settings.h" #include "libpspp/assertion.h" #include "libpspp/pool.h" -#include "output/tab.h" #include "output/table.h" #include "output/table-item.h" #include "output/text-item.h" @@ -112,19 +111,19 @@ fill_cell (struct table *t, int x1, int y1, int x2, int y2, if (rotate_label) opts |= TAB_ROTATE; } - tab_joint_text (t, x1, y1, x2, y2, opts, ds_cstr (&s)); + table_joint_text (t, x1, y1, x2, y2, opts, ds_cstr (&s)); ds_destroy (&s); if (value) { if (value->cell_style || value->font_style) - tab_add_style (t, x1, y1, - area_style_override (t->container, style, - value->cell_style, - value->font_style)); - + table_add_style (t, x1, y1, + area_style_override (t->container, style, + value->cell_style, + value->font_style)); + for (size_t i = 0; i < value->n_footnotes; i++) - tab_add_footnote (t, x1, y1, footnotes[value->footnotes[i]->idx]); + table_add_footnote (t, x1, y1, footnotes[value->footnotes[i]->idx]); } } @@ -170,9 +169,9 @@ draw_line (struct table *t, const struct table_border_style *styles, { int rule = get_table_rule (styles, style_idx); if (axis == H) - tab_hline (t, rule, b0, b1, a); + table_hline (t, rule, b0, b1, a); else - tab_vline (t, rule, a, b0, b1); + table_vline (t, rule, a, b0, b1); } static void @@ -309,9 +308,9 @@ pivot_table_submit_layer (const struct pivot_table *pt, [H] = pt->axes[PIVOT_AXIS_ROW].label_depth, [V] = pt->axes[PIVOT_AXIS_COLUMN].label_depth, }; - struct table *table = tab_create (body[H] + stub[H], - body[V] + stub[V], - stub[H], 0, stub[V], 0); + struct table *table = table_create (body[H] + stub[H], + body[V] + stub[V], + stub[H], 0, stub[V], 0); for (size_t i = 0; i < PIVOT_N_AREAS; i++) table->styles[i] = area_style_override (table->container, &pt->areas[i], @@ -336,7 +335,7 @@ pivot_table_submit_layer (const struct pivot_table *pt, pt->footnotes[i]->content, pt->show_values, pt->show_variables); char *marker = pivot_value_to_string ( pt->footnotes[i]->marker, pt->show_values, pt->show_variables); - footnotes[i] = tab_create_footnote ( + footnotes[i] = table_create_footnote ( table, i, content, marker, area_style_override (table->container, &pt->areas[PIVOT_AREA_FOOTER], pt->footnotes[i]->content->cell_style, @@ -407,25 +406,25 @@ pivot_table_submit_layer (const struct pivot_table *pt, if (table_nc (table) && table_nr (table)) { - tab_hline ( + table_hline ( table, get_table_rule (pt->borders, PIVOT_BORDER_INNER_TOP), 0, table_nc (table) - 1, 0); - tab_hline ( + table_hline ( table, get_table_rule (pt->borders, PIVOT_BORDER_INNER_BOTTOM), 0, table_nc (table) - 1, table_nr (table)); - tab_vline ( + table_vline ( table, get_table_rule (pt->borders, PIVOT_BORDER_INNER_LEFT), 0, 0, table_nr (table) - 1); - tab_vline ( + table_vline ( table, get_table_rule (pt->borders, PIVOT_BORDER_INNER_RIGHT), table_nc (table), 0, table_nr (table) - 1); if (stub[V]) - tab_hline ( + table_hline ( table, get_table_rule (pt->borders, PIVOT_BORDER_DATA_TOP), 0, table_nc (table) - 1, stub[V]); if (stub[H]) - tab_vline ( + table_vline ( table, get_table_rule (pt->borders, PIVOT_BORDER_DATA_LEFT), stub[H], 0, table_nr (table) - 1); diff --git a/src/output/render.c b/src/output/render.c index 9c09023a57..e18d8451db 100644 --- a/src/output/render.c +++ b/src/output/render.c @@ -27,7 +27,6 @@ #include "libpspp/hmap.h" #include "libpspp/pool.h" #include "output/render.h" -#include "output/tab.h" #include "output/table-item.h" #include "output/table.h" @@ -1508,13 +1507,13 @@ add_footnote_page (struct render_pager *p, const struct table_item *item) if (!n_footnotes) return; - struct table *t = tab_create (1, n_footnotes, 0, 0, 0, 0); + struct table *t = table_create (1, n_footnotes, 0, 0, 0, 0); for (size_t i = 0; i < n_footnotes; i++) { - tab_text_format (t, 0, i, TAB_LEFT, "%s. %s", - f[i]->marker, f[i]->content); + table_text_format (t, 0, i, TAB_LEFT, "%s. %s", + f[i]->marker, f[i]->content); if (f[i]->style) - tab_add_style (t, 0, i, f[i]->style); + table_add_style (t, 0, i, f[i]->style); } render_pager_add_table (p, t, 0); @@ -1528,10 +1527,10 @@ add_text_page (struct render_pager *p, const struct table_item_text *t, if (!t) return; - struct table *tab = tab_create (1, 1, 0, 0, 0, 0); - tab_text (tab, 0, 0, 0, t->content); + struct table *tab = table_create (1, 1, 0, 0, 0, 0); + table_text (tab, 0, 0, 0, t->content); for (size_t i = 0; i < t->n_footnotes; i++) - tab_add_footnote (tab, 0, 0, t->footnotes[i]); + table_add_footnote (tab, 0, 0, t->footnotes[i]); if (t->style) tab->styles[0] = area_style_clone (tab->container, t->style); render_pager_add_table (p, tab, min_width); @@ -1544,13 +1543,13 @@ add_layers_page (struct render_pager *p, if (!layers) return; - struct table *tab = tab_create (1, layers->n_layers, 0, 0, 0, 0); + struct table *tab = table_create (1, layers->n_layers, 0, 0, 0, 0); for (size_t i = 0; i < layers->n_layers; i++) { const struct table_item_layer *layer = &layers->layers[i]; - tab_text (tab, 0, i, 0, layer->content); + table_text (tab, 0, i, 0, layer->content); for (size_t j = 0; j < layer->n_footnotes; j++) - tab_add_footnote (tab, 0, i, layer->footnotes[j]); + table_add_footnote (tab, 0, i, layer->footnotes[j]); } if (layers->style) tab->styles[0] = area_style_clone (tab->container, layers->style); diff --git a/src/output/tab.h b/src/output/tab.h deleted file mode 100644 index fd8ccf4b97..0000000000 --- a/src/output/tab.h +++ /dev/null @@ -1,71 +0,0 @@ -/* PSPP - a program for statistical analysis. - Copyright (C) 1997, 1998, 1999, 2000, 2009, 2011, 2014 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 published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#ifndef OUTPUT_TAB_H -#define OUTPUT_TAB_H - -/* Simple table class. - - This is a type of table (see output/table.h) whose content is composed - manually by the code that generates it, by filling in cells one by one. -*/ - -#include "libpspp/compiler.h" -#include "output/table.h" -#include "data/format.h" - -/* Rule masks. */ -#define TAB_RULE_TYPE_MASK 7 -#define TAB_RULE_TYPE_SHIFT 0 -#define TAB_RULE_STYLE_MASK (31 << TAB_RULE_STYLE_SHIFT) -#define TAB_RULE_STYLE_SHIFT 3 - -/* Tables. */ -struct table *tab_create (int nc, int nr, int hl, int hr, int ht, int hb); - -/* Rules. */ -void tab_hline (struct table *, int style, int x1, int x2, int y); -void tab_vline (struct table *, int style, int x, int y1, int y2); -void tab_box (struct table *, int f_h, int f_v, int i_h, int i_v, - int x1, int y1, int x2, int y2); - -/* Cells. */ -void tab_text (struct table *, int c, int r, unsigned opt, const char *); -void tab_text_format (struct table *, int c, int r, unsigned opt, - const char *, ...) - PRINTF_FORMAT (5, 6); - -void tab_joint_text (struct table *, int x1, int y1, int x2, int y2, - unsigned opt, const char *); - -struct footnote *tab_create_footnote (struct table *, size_t idx, - const char *content, const char *marker, - struct area_style *); -void tab_add_footnote (struct table *, int x, int y, - const struct footnote *); - -void tab_add_style (struct table *, int x, int y, - const struct area_style *); - -bool tab_cell_is_empty (const struct table *, int c, int r); - -/* Simple output. */ -void tab_output_text (int options, const char *string); -void tab_output_text_format (int options, const char *, ...) - PRINTF_FORMAT (2, 3); - -#endif /* output/tab.h */ - diff --git a/src/output/table.c b/src/output/table.c index 1e3c53d256..10b9f55663 100644 --- a/src/output/table.c +++ b/src/output/table.c @@ -30,7 +30,7 @@ #include "libpspp/pool.h" #include "libpspp/str.h" #include "output/table-item.h" -#include "output/tab.h" +#include "output/table.h" #include "output/text-item.h" #include "gl/xalloc.h" @@ -175,8 +175,8 @@ table_collect_footnotes (const struct table_item *item, struct table * table_from_string (const char *text) { - struct table *t = tab_create (1, 1, 0, 0, 0, 0); - tab_text (t, 0, 0, TAB_LEFT, text); + struct table *t = table_create (1, 1, 0, 0, 0, 0); + table_text (t, 0, 0, TAB_LEFT, text); return t; } @@ -320,7 +320,7 @@ cell_style_dump (const struct cell_style *c) static const bool debugging = true; /* Joined cell. */ -struct tab_joined_cell +struct table_joined_cell { int d[TABLE_N_AXES][2]; /* Table region, same as struct table_cell. */ char *text; @@ -341,7 +341,7 @@ struct tab_joined_cell The table's cells are initially empty. */ struct table * -tab_create (int nc, int nr, int hl, int hr, int ht, int hb) +table_create (int nc, int nr, int hl, int hr, int ht, int hb) { struct table *t; @@ -374,7 +374,7 @@ tab_create (int nc, int nr, int hl, int hr, int ht, int hb) /* Draws a vertical line to the left of cells at horizontal position X from Y1 to Y2 inclusive in style STYLE, if style is not -1. */ void -tab_vline (struct table *t, int style, int x, int y1, int y2) +table_vline (struct table *t, int style, int x, int y1, int y2) { if (debugging) { @@ -405,7 +405,7 @@ tab_vline (struct table *t, int style, int x, int y1, int y2) /* Draws a horizontal line above cells at vertical position Y from X1 to X2 inclusive in style STYLE, if style is not -1. */ void -tab_hline (struct table *t, int style, int x1, int x2, int y) +table_hline (struct table *t, int style, int x1, int x2, int y) { if (debugging) { @@ -440,8 +440,8 @@ tab_hline (struct table *t, int style, int x1, int x2, int y) drawing those lines. This is distinct from 0, which draws a null line. */ void -tab_box (struct table *t, int f_h, int f_v, int i_h, int i_v, - int x1, int y1, int x2, int y2) +table_box (struct table *t, int f_h, int f_v, int i_h, int i_v, + int x1, int y1, int x2, int y2) { if (debugging) { @@ -511,7 +511,7 @@ tab_box (struct table *t, int f_h, int f_v, int i_h, int i_v, /* Cells. */ static void -do_tab_text (struct table *table, int c, int r, unsigned opt, char *text) +do_table_text (struct table *table, int c, int r, unsigned opt, char *text) { assert (c >= 0); assert (r >= 0); @@ -522,7 +522,7 @@ do_tab_text (struct table *table, int c, int r, unsigned opt, char *text) { if (c < 0 || r < 0 || c >= table_nc (table) || r >= table_nr (table)) { - printf ("tab_text(): bad cell (%d,%d) in table size (%d,%d)\n", + printf ("table_text(): bad cell (%d,%d) in table size (%d,%d)\n", c, r, table_nc (table), table_nr (table)); return; } @@ -535,31 +535,31 @@ do_tab_text (struct table *table, int c, int r, unsigned opt, char *text) /* Sets cell (C,R) in TABLE, with options OPT, to have text value TEXT. */ void -tab_text (struct table *table, int c, int r, unsigned opt, +table_text (struct table *table, int c, int r, unsigned opt, const char *text) { - do_tab_text (table, c, r, opt, pool_strdup (table->container, text)); + do_table_text (table, c, r, opt, pool_strdup (table->container, text)); } /* Sets cell (C,R) in TABLE, with options OPT, to have text value FORMAT, which is formatted as if passed to printf. */ void -tab_text_format (struct table *table, int c, int r, unsigned opt, - const char *format, ...) +table_text_format (struct table *table, int c, int r, unsigned opt, + const char *format, ...) { va_list args; va_start (args, format); - do_tab_text (table, c, r, opt, - pool_vasprintf (table->container, format, args)); + do_table_text (table, c, r, opt, + pool_vasprintf (table->container, format, args)); va_end (args); } -static struct tab_joined_cell * +static struct table_joined_cell * add_joined_cell (struct table *table, int x1, int y1, int x2, int y2, unsigned opt) { - struct tab_joined_cell *j; + struct table_joined_cell *j; assert (x1 >= 0); assert (y1 >= 0); @@ -575,14 +575,14 @@ add_joined_cell (struct table *table, int x1, int y1, int x2, int y2, || x2 < x1 || x2 >= table_nc (table) || y2 < y1 || y2 >= table_nr (table)) { - printf ("tab_joint_text(): bad cell " + printf ("table_joint_text(): bad cell " "(%d,%d)-(%d,%d) in table size (%d,%d)\n", x1, y1, x2, y2, table_nc (table), table_nr (table)); return NULL; } } - tab_box (table, -1, -1, TAL_0, TAL_0, x1, y1, x2, y2); + table_box (table, -1, -1, TAL_0, TAL_0, x1, y1, x2, y2); j = pool_alloc (table->container, sizeof *j); j->d[TABLE_HORZ][0] = x1; @@ -621,18 +621,18 @@ add_joined_cell (struct table *table, int x1, int y1, int x2, int y2, /* Joins cells (X1,X2)-(Y1,Y2) inclusive in TABLE, and sets them with options OPT to have text value TEXT. */ void -tab_joint_text (struct table *table, int x1, int y1, int x2, int y2, - unsigned opt, const char *text) +table_joint_text (struct table *table, int x1, int y1, int x2, int y2, + unsigned opt, const char *text) { char *s = pool_strdup (table->container, text); if (x1 == x2 && y1 == y2) - do_tab_text (table, x1, y1, opt, s); + do_table_text (table, x1, y1, opt, s); else add_joined_cell (table, x1, y1, x2, y2, opt)->text = s; } struct footnote * -tab_create_footnote (struct table *table, size_t idx, const char *content, +table_create_footnote (struct table *table, size_t idx, const char *content, const char *marker, struct area_style *style) { struct footnote *f = pool_alloc (table->container, sizeof *f); @@ -644,12 +644,12 @@ tab_create_footnote (struct table *table, size_t idx, const char *content, } void -tab_add_footnote (struct table *table, int x, int y, +table_add_footnote (struct table *table, int x, int y, const struct footnote *f) { int index = x + y * table_nc (table); unsigned short opt = table->ct[index]; - struct tab_joined_cell *j; + struct table_joined_cell *j; if (opt & TAB_JOIN) j = table->cc[index]; @@ -668,12 +668,12 @@ tab_add_footnote (struct table *table, int x, int y, } void -tab_add_style (struct table *table, int x, int y, - const struct area_style *style) +table_add_style (struct table *table, int x, int y, + const struct area_style *style) { int index = x + y * table_nc (table); unsigned short opt = table->ct[index]; - struct tab_joined_cell *j; + struct table_joined_cell *j; if (opt & TAB_JOIN) j = table->cc[index]; @@ -689,7 +689,7 @@ tab_add_style (struct table *table, int x, int y, } bool -tab_cell_is_empty (const struct table *table, int c, int r) +table_cell_is_empty (const struct table *table, int c, int r) { return table->cc[c + r * table_nc (table)] == NULL; } @@ -702,15 +702,15 @@ tab_cell_is_empty (const struct table *table, int c, int r) This function is obsolete. Please do not add new uses of it. Instead, use a text_item (see output/text-item.h). */ void -tab_output_text (int options UNUSED, const char *string) +table_output_text (int options UNUSED, const char *string) { text_item_submit (text_item_create (TEXT_ITEM_LOG, string)); } -/* Same as tab_output_text(), but FORMAT is passed through printf-like +/* Same as table_output_text(), but FORMAT is passed through printf-like formatting before output. */ void -tab_output_text_format (int options, const char *format, ...) +table_output_text_format (int options, const char *format, ...) { va_list args; char *text; @@ -719,7 +719,7 @@ tab_output_text_format (int options, const char *format, ...) text = xvasprintf (format, args); va_end (args); - tab_output_text (options, text); + table_output_text (options, text); free (text); } @@ -777,7 +777,7 @@ table_get_cell (const struct table *t, int x, int y, struct table_cell *cell) if (opt & TAB_JOIN) { - const struct tab_joined_cell *jc = cc; + const struct table_joined_cell *jc = cc; cell->text = jc->text; cell->footnotes = jc->footnotes; diff --git a/src/output/table.h b/src/output/table.h index ea3594b33d..5075fa9e40 100644 --- a/src/output/table.h +++ b/src/output/table.h @@ -26,11 +26,6 @@ broken across more than one page, those rows or columns are repeated on each page. - Every table is an instance of a particular table class that is responsible - for keeping track of cell data. By far the most common table class is - struct table (see output/tab.h). This header also declares some other - kinds of table classes, near the end of the file. - A table is not itself an output_item, and thus a table cannot by itself be used for output, but they can be embedded inside struct table_item (see table-item.h) for that purpose. */ @@ -38,6 +33,7 @@ #include #include #include +#include "libpspp/compiler.h" struct casereader; struct fmt_spec; @@ -284,10 +280,47 @@ 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]; } - -/* Table classes. */ -/* Simple kinds of tables. */ +/* Simple kinds of output. */ struct table *table_from_string (const char *); +void table_output_text (int options, const char *string); +void table_output_text_format (int options, const char *, ...) + PRINTF_FORMAT (2, 3); + +/* Rule masks. */ +#define TAB_RULE_TYPE_MASK 7 +#define TAB_RULE_TYPE_SHIFT 0 +#define TAB_RULE_STYLE_MASK (31 << TAB_RULE_STYLE_SHIFT) +#define TAB_RULE_STYLE_SHIFT 3 + +/* Tables. */ +struct table *table_create (int nc, int nr, int hl, int hr, int ht, int hb); + +/* Rules. */ +void table_hline (struct table *, int style, int x1, int x2, int y); +void table_vline (struct table *, int style, int x, int y1, int y2); +void table_box (struct table *, int f_h, int f_v, int i_h, int i_v, + int x1, int y1, int x2, int y2); + +/* Cells. */ +void table_text (struct table *, int c, int r, unsigned opt, const char *); +void table_text_format (struct table *, int c, int r, unsigned opt, + const char *, ...) + PRINTF_FORMAT (5, 6); + +void table_joint_text (struct table *, int x1, int y1, int x2, int y2, + unsigned opt, const char *); + +struct footnote *table_create_footnote (struct table *, size_t idx, + const char *content, + const char *marker, + struct area_style *); +void table_add_footnote (struct table *, int x, int y, + const struct footnote *); + +void table_add_style (struct table *, int x, int y, + const struct area_style *); + +bool table_cell_is_empty (const struct table *, int c, int r); #endif /* output/table.h */ diff --git a/src/output/text-item.c b/src/output/text-item.c index cfd6cc8a90..ba0f3873ad 100644 --- a/src/output/text-item.c +++ b/src/output/text-item.c @@ -25,7 +25,7 @@ #include "libpspp/pool.h" #include "output/driver.h" #include "output/output-item-provider.h" -#include "output/tab.h" +#include "output/table.h" #include "output/table-item.h" #include "output/table-provider.h" @@ -119,7 +119,7 @@ text_item_submit (struct text_item *item) struct table_item * text_item_to_table_item (struct text_item *text_item) { - struct table *tab = tab_create (1, 1, 0, 0, 0, 0); + struct table *tab = table_create (1, 1, 0, 0, 0, 0); struct area_style *style = pool_alloc (tab->container, sizeof *style); *style = (struct area_style) { AREA_STYLE_INITIALIZER__, @@ -139,7 +139,7 @@ text_item_to_table_item (struct text_item *text_item) opts |= TAB_MARKUP; if (text_item->type == TEXT_ITEM_SYNTAX || text_item->type == TEXT_ITEM_LOG) opts |= TAB_FIX; - tab_text (tab, 0, 0, opts, text_item_get_text (text_item)); + table_text (tab, 0, 0, opts, text_item_get_text (text_item)); struct table_item *table_item = table_item_create (tab, NULL, NULL); text_item_unref (text_item); return table_item; diff --git a/tests/output/render-test.c b/tests/output/render-test.c index 506afbf091..b5b505c940 100644 --- a/tests/output/render-test.c +++ b/tests/output/render-test.c @@ -28,7 +28,7 @@ #include "libpspp/string-map.h" #include "output/ascii.h" #include "output/driver.h" -#include "output/tab.h" +#include "output/table.h" #include "output/table-item.h" #include "gl/error.h" @@ -381,10 +381,10 @@ read_table (FILE *stream) ht = n_input >= 5 ? input[4] : 0; hb = n_input >= 6 ? input[5] : 0; - tab = tab_create (nc, nr, hl, hr, ht, hb); + tab = table_create (nc, nr, hl, hr, ht, hb); for (r = 0; r < nr; r++) for (c = 0; c < nc; c++) - if (tab_cell_is_empty (tab, c, r)) + if (table_cell_is_empty (tab, c, r)) { unsigned int opt; char *new_line; @@ -417,23 +417,23 @@ read_table (FILE *stream) switch (*text++) { case '<': - tab_vline (tab, TAL_1, c, r, r + rs - 1); + table_vline (tab, TAL_1, c, r, r + rs - 1); break; case '>': - tab_vline (tab, TAL_1, c + cs, r, r + rs - 1); + table_vline (tab, TAL_1, c + cs, r, r + rs - 1); break; case '^': - tab_hline (tab, TAL_1, c, c + cs - 1, r); + table_hline (tab, TAL_1, c, c + cs - 1, r); break; case ',': - tab_hline (tab, TAL_1, c, c + cs - 1, r + rs); + table_hline (tab, TAL_1, c, c + cs - 1, r + rs); break; case '@': - tab_box (tab, TAL_1, TAL_1, -1, -1, c, r, + table_box (tab, TAL_1, TAL_1, -1, -1, c, r, c + cs - 1, r + rs - 1); break; @@ -464,14 +464,14 @@ read_table (FILE *stream) for (i = 0; (content = strsep (&pos, "#")) != NULL; i++) if (!i) - tab_joint_text (tab, c, r, c + cs - 1, r + rs - 1, opt, - content); + table_joint_text (tab, c, r, c + cs - 1, r + rs - 1, opt, + content); else { char marker[2] = { 'a' + n_footnotes, '\0' }; - struct footnote *f = tab_create_footnote ( + struct footnote *f = table_create_footnote ( tab, n_footnotes, content, marker, NULL); - tab_add_footnote (tab, c, r, f); + table_add_footnote (tab, c, r, f); n_footnotes++; } } -- 2.30.2