summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/tbl.c
AgeCommit message (Collapse)Author
2015-01-30Delete the redundant tbl span flags, just inspect the actual dataIngo Schwarze
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.
2015-01-30Abolish struct tbl_head and replace it by an "int col" member inIngo Schwarze
struct tbl_cell. No functional change, minus 40 lines of code.
2015-01-30Auditing the tbl(7) code for more NULL pointer accesses, i came outIngo Schwarze
empty-handed; so this is just KNF and some code simplifications, no functional change.
2015-01-28* Polish tbl(7) error reporting.Ingo Schwarze
* 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.
2015-01-28For now, it can't be helped that mandoc tbl(7) ignores high-level macros,Ingo Schwarze
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.
2015-01-27Multiple parser and formatter fixes for line drawing in tbl(7).Ingo Schwarze
* 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.
2015-01-26Improve (or rather, rewrite) tbl(7) option parsing.Ingo Schwarze
* 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.
2015-01-21blank lines in tables do not need special handling; simplifies codeIngo Schwarze
and reduces groff/mandoc differences in base by about 1%
2015-01-14simplify by getting rid of ROFF_ERR in tbl(7) parsing; no functional changeIngo Schwarze
2014-11-28Add some missing OpenBSD RCS markersIngo Schwarze
and a few missing <sys/types.h> inclusions; no code change.
2014-04-20KNF: case (FOO): -> case FOO, remove /* LINTED */ and /* ARGSUSED */,Ingo Schwarze
remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
2014-03-21The files mandoc.c and mandoc.h contained both specialised low-levelIngo Schwarze
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.
2013-05-31More cleanup: Consistently use the name "struct tbl_node *tbl"Ingo Schwarze
that is already used almost everywhere instead of gratuitiously inventing different names at four places. No functional change.
2011-09-18sync to version 1.11.5:Ingo Schwarze
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.
2011-04-24Merge version 1.11.1:Ingo Schwarze
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.
2011-01-25Since tbl_data() can now produce multiple spans, let parsebuf()Ingo Schwarze
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@
2011-01-04Merge kristaps@' cleaner tbl integration, removing mine;Ingo Schwarze
there are still a few bugs, but fixing these will be easier in tree.
2010-10-15Move tbl width calculation from plain strlen to mandoc terminal widthIngo Schwarze
calculation routines. This gives us mostly sane table column widths. "move forward" deraadt@
2010-10-15Move tbl output from plain stdio to mandoc terminal output routines.Ingo Schwarze
This fixes (1) all escape sequences and (2) some aspects of indentation. Table column widths are still way off, though. "move forward" deraadt@
2010-10-15Import tbl parser and renderer written by kristaps@.Ingo Schwarze
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.