OpenBSD CVS

CVS log for src/usr.bin/mandoc/tbl.c


[BACK] Up to [local] / src / usr.bin / mandoc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.27 / (download) - annotate - [select for diffs], Fri Dec 14 06:33:03 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, HEAD
Changes since 1.26: +2 -3 lines
Diff to previous 1.26 (colored)

Cleanup, no functional change:
Now that message handling is properly encapsulated,
remove struct mparse pointers from four structs (roff, roff_man,
tbl_node, eqn_node) and from the argument lists of five functions
(roff_alloc, roff_man_alloc, mandoc_getarg, tbl_alloc, eqn_alloc).
Except for being passed to the main program as an opaque object,
it now only occurs in read.c, as it should, and not across 15 files
like in the past.

Revision 1.26 / (download) - annotate - [select for diffs], Fri Dec 14 05:17:45 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.25: +5 -9 lines
Diff to previous 1.25 (colored)

Almost mechanical diff to remove the "struct mparse *" argument
from mandoc_msg(), where it is no longer used.
While here, rename mandoc_vmsg() to mandoc_msg() and retire the
old version:  There is really no point in having another function
merely to save "%s" in a few places.
Minus 140 lines of code.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Dec 13 02:05:57 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.24: +36 -28 lines
Diff to previous 1.24 (colored)

Cleanup, no functional change:
Move tbl(7)-specific parser internals out of libroff.h.
Move some tbl(7)-internal processing from roff.c to tbl.c.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Dec 12 21:54:30 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +3 -2 lines
Diff to previous 1.23 (colored)

Cleanup, no functional change:
No need to expose the tbl(7) syntax tree data structures everywhere.
Move them to their own include file, "tbl.h", and improve comments.

Revision 1.23 / (download) - annotate - [select for diffs], Sat Jul 8 17:52:42 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.22: +8 -13 lines
Diff to previous 1.22 (colored)

Simplify by creating struct roff_node syntax tree nodes for tbl(7)
right from roff_parseln() rather than delegating to read.c,
similar to what i just did for eqn(7).

The interface function roff_span() becomes obsolete and is deleted,
the former interface function roff_addtbl() becomes static,
the interface functions tbl_read() and tbl_cdata() become void,
and minus twelve linus of code.

No functional change.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Jun 8 18:11:15 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.21: +2 -1 lines
Diff to previous 1.21 (colored)

Implement w layout specifier (minimum column width).
Improve width calculation of text blocks.
Reduces the groff/mandoc diff in Base+Xenocara by about 800 lines.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Oct 6 18:30:44 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.20: +9 -9 lines
Diff to previous 1.20 (colored)

modernize style: "return" is not a function; ok cmp(1)

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jan 30 17:31:20 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.19: +1 -5 lines
Diff to previous 1.19 (colored)

Delete the redundant tbl span flags, just inspect the actual data
where needed, which is less fragile.
This fixes a subtle NULL pointer access to tp->tbl.cols:
Due to a bug in the man(7) parser, the first span of a table can
end up in a .TP head, in which case tblcalc() was never called.
Found by jsg@ with afl.

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jan 30 04:08:37 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.18: +1 -7 lines
Diff to previous 1.18 (colored)

Abolish struct tbl_head and replace it by an "int col" member in
struct tbl_cell.  No functional change, minus 40 lines of code.

Revision 1.18 / (download) - annotate - [select for diffs], Fri Jan 30 02:08:37 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.17: +8 -9 lines
Diff to previous 1.17 (colored)

Auditing the tbl(7) code for more NULL pointer accesses, i came out
empty-handed; so this is just KNF and some code simplifications,
no functional change.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Jan 28 17:30:37 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.16: +15 -15 lines
Diff to previous 1.16 (colored)

* Polish tbl(7) error reporting.
* Do not print out macro names in tbl(7) data blocks.
* Like with GNU tbl, let empty tables cause a blank line.
* Avoid producing empty tables in -Tman.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jan 28 15:02:25 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.15: +8 -8 lines
Diff to previous 1.15 (colored)

For now, it can't be helped that mandoc tbl(7) ignores high-level macros,
but stop throwing away their arguments.  This fixes information loss in a
handful of Xenocara manuals, at the price of a small amount of formatting
noise creeping through.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jan 27 05:20:30 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.14: +6 -2 lines
Diff to previous 1.14 (colored)

Multiple parser and formatter fixes for line drawing in tbl(7).
* Allow mixing vertical line bars with the layout options
of the preceding layout cell.
* Correctly combine box options with layout lines.
* Correctly print vertical lines in data rows, with the right spacing.
* Correctly print cross markers and left and right ends of
horizontal lines even if vertical lines differ above and below.
* Avoid the bogus error message "no table data cells"
when a table data section starts with a horizontal line.
No increase in code size.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jan 26 00:54:09 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.13: +33 -18 lines
Diff to previous 1.13 (colored)

Improve (or rather, rewrite) tbl(7) option parsing.
* Allow the layout to start after the semicolon on the options line.
* Ignore leading commas.
* Option arguments cannot contain closing parentheses.
* Avoid needless UNSUPP messages.
* Better ERROR reporting.
* Delete unused "linesize" field in struct tbl_opts.
* No need for static buffers.
* Garbage collect one almost empty wrapper function.
Improved functionality, but minus 40 lines of code.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Jan 21 00:45:16 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.12: +3 -6 lines
Diff to previous 1.12 (colored)

blank lines in tables do not need special handling; simplifies code
and reduces groff/mandoc differences in base by about 1%

Revision 1.12 / (download) - annotate - [select for diffs], Wed Jan 14 22:44:51 2015 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.11: +5 -3 lines
Diff to previous 1.11 (colored)

simplify by getting rid of ROFF_ERR in tbl(7) parsing; no functional change

Revision 1.11 / (download) - annotate - [select for diffs], Fri Nov 28 19:25:03 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.10: +3 -1 lines
Diff to previous 1.10 (colored)

Add some missing OpenBSD RCS markers
and a few missing <sys/types.h> inclusions; no code change.

Revision 1.10 / (download) - annotate - [select for diffs], Sun Apr 20 16:44:44 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.9: +12 -12 lines
Diff to previous 1.9 (colored)

KNF: case (FOO):  ->  case FOO, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change

Revision 1.9 / (download) - annotate - [select for diffs], Fri Mar 21 22:17:01 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored)

The files mandoc.c and mandoc.h contained both specialised low-level
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions.  Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.

Revision 1.8 / (download) - annotate - [select for diffs], Fri May 31 22:08:03 2013 UTC (10 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.7: +19 -19 lines
Diff to previous 1.7 (colored)

More cleanup: Consistently use the name "struct tbl_node *tbl"
that is already used almost everywhere instead of gratuitiously
inventing different names at four places.  No functional change.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Sep 18 10:25:28 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.6: +6 -2 lines
Diff to previous 1.6 (colored)

sync to version 1.11.5:
adding an implementation of the eqn(7) language
by kristaps@

So far, only .EQ/.EN blocks are handled, in-line equations are not, and
rendering is not yet very pretty, but the parser is fairly complete.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Apr 24 16:22:02 2011 UTC (13 years ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.5: +11 -9 lines
Diff to previous 1.5 (colored)

Merge version 1.11.1:
Again lots of cleanup and maintenance work by kristaps@.
- simplify error reporting: less function pointers, more mandoc_[v]msg
- main: split document parsing out of main.c into read.c
- roff, mdoc, man: improved recognition of control characters
- roff: better handling of if/else stack overflows
- roff: add some predefined strings for backward compatibility
- mdoc, man: empty sections are not errors
- mdoc: move delimiter handling to libmdoc
- some header restructuring and some minor features and fixes
This merge causes two minor regressions
that i will fix in separate commits right afterwards.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Jan 25 12:24:26 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.4: +9 -3 lines
Diff to previous 1.4 (colored)

Since tbl_data() can now produce multiple spans, let parsebuf()
generate man(7) or mdoc(7) nodes for all these spans,
not only for the last one.
Restores the horizontal lines in the cpu(4/hppa) tables.
ok kristaps@

Revision 1.4 / (download) - annotate - [select for diffs], Tue Jan 4 22:28:17 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.3: +92 -479 lines
Diff to previous 1.3 (colored)

Merge kristaps@' cleaner tbl integration, removing mine;
there are still a few bugs, but fixing these will be easier in tree.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Oct 15 22:07:12 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)

Move tbl width calculation from plain strlen to mandoc terminal width
calculation routines.  This gives us mostly sane table column widths.
"move forward" deraadt@

Revision 1.2 / (download) - annotate - [select for diffs], Fri Oct 15 21:33:47 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.1: +4 -2 lines
Diff to previous 1.1 (colored)

Move tbl output from plain stdio to mandoc terminal output routines.
This fixes (1) all escape sequences and (2) some aspects of indentation.
Table column widths are still way off, though.
"move forward" deraadt@

Revision 1.1 / (download) - annotate - [select for diffs], Fri Oct 15 19:20:03 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN

Import tbl parser and renderer written by kristaps@.
Unchanged code from bsd.lv release 0.1.5, but without the main program.
Not yet linked to the build; next commit will integrate it into mandoc.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.