This makes it possible to include this file in C++ compiled programs.
struct tab_table *
tab_cast (const struct table *table)
{
- assert (table->class == &tab_table_class);
+ assert (table->klass == &tab_table_class);
return UP_CAST (table, struct tab_table, table);
}
static struct table_casereader *
table_casereader_cast (const struct table *table)
{
- assert (table->class == &table_casereader_class);
+ assert (table->klass == &table_casereader_class);
return UP_CAST (table, struct table_casereader, table);
}
static struct table_paste *
table_paste_cast (const struct table *table)
{
- assert (table->class == &table_paste_class);
+ assert (table->klass == &table_paste_class);
return UP_CAST (table, struct table_paste, table);
}
static bool
is_table_paste (const struct table *table, int orientation)
{
- return (table->class == &table_paste_class
+ return (table->klass == &table_paste_class
&& table_paste_cast (table)->orientation == orientation);
}
/* Handle tables that know how to paste themselves. */
if (!table_is_shared (a) && !table_is_shared (b) && a != b)
{
- if (a->class->paste != NULL)
+ if (a->klass->paste != NULL)
{
- struct table *new = a->class->paste (a, b, orientation);
+ struct table *new = a->klass->paste (a, b, orientation);
if (new != NULL)
return new;
}
- if (b->class->paste != NULL && a->class != b->class)
+ if (b->klass->paste != NULL && a->klass != b->klass)
{
- struct table *new = b->class->paste (a, b, orientation);
+ struct table *new = b->klass->paste (a, b, orientation);
if (new != NULL)
return new;
}
static struct table_select *
table_select_cast (const struct table *table)
{
- assert (table->class == &table_select_class);
+ assert (table->klass == &table_select_class);
return UP_CAST (table, struct table_select, table);
}
&& rect[TABLE_VERT][1] == subtable->n[TABLE_VERT])
return subtable;
- if (!table_is_shared (subtable) && subtable->class->select != NULL)
+ if (!table_is_shared (subtable) && subtable->klass->select != NULL)
{
- struct table *selected = subtable->class->select (subtable, rect);
+ struct table *selected = subtable->klass->select (subtable, rect);
if (selected != NULL)
return selected;
}
static struct table_transpose *
table_transpose_cast (const struct table *table)
{
- assert (table->class == &table_transpose_class);
+ assert (table->klass == &table_transpose_class);
return UP_CAST (table, struct table_transpose, table);
}
if (subtable->n[TABLE_HORZ] == subtable->n[TABLE_VERT]
&& subtable->n[TABLE_HORZ] <= 1)
return subtable;
- else if (subtable->class == &table_transpose_class)
+ else if (subtable->klass == &table_transpose_class)
{
struct table_transpose *tt = table_transpose_cast (subtable);
struct table *table = table_ref (tt->subtable);
{
assert (table->ref_cnt > 0);
if (--table->ref_cnt == 0)
- table->class->destroy (table);
+ table->klass->destroy (table);
}
}
void
table_init (struct table *table, const struct table_class *class)
{
- table->class = class;
+ table->klass = class;
table->n[TABLE_HORZ] = table->n[TABLE_VERT] = 0;
table->h[TABLE_HORZ][0] = table->h[TABLE_HORZ][1] = 0;
table->h[TABLE_VERT][0] = table->h[TABLE_VERT][1] = 0;
{
assert (x >= 0 && x < table->n[TABLE_HORZ]);
assert (y >= 0 && y < table->n[TABLE_VERT]);
- table->class->get_cell (table, x, y, cell);
+ table->klass->get_cell (table, x, y, cell);
}
/* Frees CELL, which should have been initialized by calling
{
assert (x >= 0 && x < table->n[TABLE_HORZ] + (axis == TABLE_HORZ));
assert (y >= 0 && y < table->n[TABLE_VERT] + (axis == TABLE_VERT));
- return table->class->get_rule (table, axis, x, y);
+ return table->klass->get_rule (table, axis, x, y);
}
\f
struct table_unshared
static struct table_unshared *
table_unshared_cast (const struct table *table)
{
- assert (table->class == &table_unshared_class);
+ assert (table->klass == &table_unshared_class);
return UP_CAST (table, struct table_unshared, table);
}
static struct table_string *
table_string_cast (const struct table *table)
{
- assert (table->class == &table_string_class);
+ assert (table->klass == &table_string_class);
return UP_CAST (table, struct table_string, table);
}
/* A table. */
struct table
{
- const struct table_class *class;
+ const struct table_class *klass;
/* Table size.