version 1.1, 2013/06/01 05:44:39 |
version 1.2, 2015/01/30 04:11:50 |
|
|
created in |
created in |
.Fn tbl_alloc , |
.Fn tbl_alloc , |
and stored in the members |
and stored in the members |
.Va first_tbl , |
.Fa first_tbl , |
.Va last_tbl , |
.Fa last_tbl , |
and |
and |
.Va tbl |
.Fa tbl |
of |
of |
.Vt struct roff Bq Pa roff.c . |
.Vt struct roff Bq Pa roff.c . |
|
.Pp |
|
The |
|
.Fa first_span , |
|
.Fa current_span , |
|
.Fa last_span , |
|
and |
|
.Fa next |
|
members may be |
|
.Dv NULL . |
|
The |
|
.Fa first_row |
|
and |
|
.Fa last_row |
|
members may be |
|
.Dv NULL , |
|
but if there is a span, the function |
|
.Fn tbl_layout |
|
guarantees that these pointers are not |
|
.Dv NULL . |
|
The function |
|
.Fn tbl_alloc |
|
guarantees that the |
|
.Fa parse |
|
member is not |
|
.Dv NULL . |
.It Vt struct tbl_opts |
.It Vt struct tbl_opts |
This structure describes the options of one table. |
This structure describes the options of one table. |
It is used as a substructure of |
It is used as a substructure of |
Line 92 It is used as a substructure of |
|
Line 117 It is used as a substructure of |
|
and thus created and deleted together with it. |
and thus created and deleted together with it. |
It is filled in |
It is filled in |
.Fn tbl_options . |
.Fn tbl_options . |
.It Vt struct tbl_head |
|
This structure describes one layout column in a table, |
|
in particular the vertical line to its left. |
|
It is allocated and filled in |
|
.Fn cell_alloc Bq Pa tbl_layout.c |
|
and referenced from the |
|
.Va first_head |
|
and |
|
.Va last_head |
|
members of |
|
.Vt struct tbl_node . |
|
.It Vt struct tbl_row |
.It Vt struct tbl_row |
This structure describes one layout line in a table |
This structure describes one layout line in a table |
by maintaining a list of all the cells in that line. |
by maintaining a list of all the cells in that line. |
It is allocated and filled in |
It is allocated and filled in |
.Fn row Bq Pa tbl_layout.c |
.Fn row Bq Pa tbl_layout.c |
and referenced from the |
and referenced from the |
.Va layout |
.Fa layout |
member of |
member of |
.Vt struct tbl_node . |
.Vt struct tbl_node . |
|
.Pp |
|
The |
|
.Fa next |
|
member may be |
|
.Dv NULL . |
|
The function |
|
.Fn tbl_layout |
|
guarantees that the |
|
.Fa first |
|
and |
|
.Fa last |
|
members are not NULL. |
.It Vt struct tbl_cell |
.It Vt struct tbl_cell |
This structure describes one layout cell in a table, |
This structure describes one layout cell in a table, |
in particular its alignment, membership in spans, and |
in particular its alignment, membership in spans, and |
Line 119 usage for lines. |
|
Line 145 usage for lines. |
|
It is allocated and filled in |
It is allocated and filled in |
.Fn cell_alloc Bq Pa tbl_layout.c |
.Fn cell_alloc Bq Pa tbl_layout.c |
and referenced from the |
and referenced from the |
.Va first |
.Fa first |
and |
and |
.Va last |
.Fa last |
members of |
members of |
.Vt struct tbl_row . |
.Vt struct tbl_row . |
|
.Pp |
|
The |
|
.Fa next |
|
member may be |
|
.Dv NULL . |
.It Vt struct tbl_span |
.It Vt struct tbl_span |
This structure describes one data line in a table |
This structure describes one data line in a table |
by maintaining a list of all data cells in that line |
by maintaining a list of all data cells in that line |
Line 133 It is allocated and filled in |
|
Line 164 It is allocated and filled in |
|
which is called from |
which is called from |
.Fn tbl_data |
.Fn tbl_data |
and referenced from the |
and referenced from the |
.Va first_span , |
.Fa first_span , |
.Va current_span , |
.Fa current_span , |
and |
and |
.Va last_span |
.Fa last_span |
members of |
members of |
.Vt struct tbl_node , |
.Vt struct tbl_node , |
and from the |
and from the |
.Va span |
.Fa span |
members of |
members of |
.Vt struct man_node |
.Vt struct man_node |
and |
and |
|
|
.In man.h |
.In man.h |
and |
and |
.In mdoc.h . |
.In mdoc.h . |
|
.Pp |
|
The |
|
.Fa first , |
|
.Fa last , |
|
.Fa prev , |
|
and |
|
.Fa next |
|
members may be |
|
.Dv NULL . |
|
The function |
|
.Fn newspan Bq Pa tbl_data.c |
|
guarantees that the |
|
.Fa opts |
|
and |
|
.Fa layout |
|
members are not |
|
.Dv NULL . |
.It Vt struct tbl_dat |
.It Vt struct tbl_dat |
This structure describes one data cell in a table by specifying |
This structure describes one data cell in a table by specifying |
whether it contains a line or data, whether it spans additional |
whether it contains a line or data, whether it spans additional |
layout cells, and by storing the data. |
layout cells, and by storing the data. |
It is allocated and filled in |
It is allocated and filled in |
.Fn data |
.Fn tbl_data |
and referenced from the |
and referenced from the |
.Va first |
.Fa first |
and |
and |
.Va last |
.Fa last |
members of |
members of |
.Vt struct tbl_span . |
.Vt struct tbl_span . |
|
.Pp |
|
The |
|
.Fa string |
|
and |
|
.Fa next |
|
members may be |
|
.Dv NULL . |
|
The function |
|
.Fn getdata |
|
guarantees that the |
|
.Fa layout |
|
member is not |
|
.Dv NULL . |
.El |
.El |
.Ss Interface functions |
.Ss Interface functions |
The following functions are implemented in |
The following functions are implemented in |
|
|
.Fn roff_parseln . |
.Fn roff_parseln . |
.It Fn tbl_restart |
.It Fn tbl_restart |
Resets the |
Resets the |
.Va part |
.Fa part |
member of |
member of |
.Vt struct tbl_node |
.Vt struct tbl_node |
to |
to |
|
|
.It Fn tbl_free |
.It Fn tbl_free |
Frees the specified |
Frees the specified |
.Vt struct tbl_node |
.Vt struct tbl_node |
and all the tbl_row, tbl_cell, tbl_span, tbl_dat and tbl_head structures |
and all the tbl_row, tbl_cell, tbl_span, and tbl_dat structures |
referenced from it. |
referenced from it. |
Called from |
Called from |
.Fn roff_free |
.Fn roff_free |
|
|
.Fn tbl_read . |
.Fn tbl_read . |
.It Ft int Fn tbl_layout "struct tbl_node *tbl" "int ln" "const char *p" |
.It Ft int Fn tbl_layout "struct tbl_node *tbl" "int ln" "const char *p" |
Allocates and fills one |
Allocates and fills one |
.Vt struct tbl_head |
|
for each layout column, one |
|
.Vt struct tbl_row |
.Vt struct tbl_row |
for each layout line, and one |
for each layout line and one |
.Vt struct tbl_cell |
.Vt struct tbl_cell |
for each layout cell. |
for each layout cell. |
Implemented in |
Implemented in |
|
|
Allocates one |
Allocates one |
.Vt struct tbl_span |
.Vt struct tbl_span |
for each data line and calls |
for each data line and calls |
.Fn data |
.Fn getdata |
on that line. |
for each data cell. |
Implemented in |
Implemented in |
.Pa tbl_data.c , |
.Pa tbl_data.c , |
called from |
called from |
|
|
switches back to |
switches back to |
.Dv TBL_PART_DATA |
.Dv TBL_PART_DATA |
mode and calls |
mode and calls |
.Fn data |
.Fn getdata |
if there are more data cells on the line. |
if there are more data cells on the line. |
Otherwise, appends the data to the current data cell. |
Otherwise, appends the data to the current data cell. |
Implemented in |
Implemented in |
|
|
.Fn tbl_read . |
.Fn tbl_read . |
.It Xo |
.It Xo |
.Ft int |
.Ft int |
.Fo data |
.Fo getdata |
.Fa "struct tbl_node *tbl" |
.Fa "struct tbl_node *tbl" |
.Fa "struct tbl_span *dp" |
.Fa "struct tbl_span *dp" |
.Fa "int ln" |
.Fa "int ln" |