summaryrefslogtreecommitdiffstats
path: root/tbl_layout.c
Commit message (Collapse)AuthorAgeFilesLines
* Consolidate messages. Have all parse-time messages (in libmdoc,Kristaps Dzonsons2011-03-201-10/+18
| | | | | | | | | libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the time being in libmandoc.h. This requires struct mparse to be passed into the allocation routines instead of mandocmsg and a void pointer. Then, move some of the functionality of the old mmsg() into read.c's mparse_mmsg() (check against wlevel and setting of file_status) and use main.c's mmsg() as simply a printing tool.
* Add support for "^" vertical spanners. Unlike GNU tbl, raiseKristaps Dzonsons2011-01-111-0/+10
| | | | | | | error-class messages when data is being ignored by specifying it in "^" cells (either as-is or in blocks). Also note again that horizontal spanners aren't really supported...
* Clarify what members may be NULL or not in calculating widths. MakeKristaps Dzonsons2011-01-101-1/+1
| | | | | sure signedness is correct. Verify that layouts MUST exit for data cells.
* First, make extra data cells be thrown away. This makes "dp->layout"Kristaps Dzonsons2011-01-101-4/+19
| | | | | | | | | | | | always hold, which cleans up the table stuff a bit. Second, set a "spans" value per data cell consisting of the number of skipped TBL_CELL_SPAN layout cells. Third, make tbl_term.c understand how to skip over spanned sections when iterating over the header queue. What remains is to calculate the widths of spanned cells.
* Add some unsigned char casts for tolower() usageJoerg Sonnenberger2011-01-091-3/+3
|
* Fixes: T} can be followed by a delimiter then more data. Make thisKristaps Dzonsons2011-01-071-0/+14
| | | | | | | | | work and add documentation for it. Also make tbl_term() not puke if the number of data cells is less than the number of layout cells (which happens from time to time). This still needs work because we should pad out empty cells so that the borders all work out.
* Tiny bits in place for tbl horizontal spans. This will wait for the nextKristaps Dzonsons2011-01-071-1/+18
| | | | release to be implemented in full.
* Merge from OpenBSD (similar to my original fix committed on Oct 15, 2010):Ingo Schwarze2011-01-041-0/+2
| | | | | For now, parse and ignore minimal column width specifications. First step to get terminfo(5) to build.
* Make width calculations occur within tbl_term.c, not tbl.c. This allowsKristaps Dzonsons2011-01-031-0/+2
| | | | | | | | | | | | | | | | for front-ends to make decisions about widths, not the back-end. To pull this off, first make each tbl_head contain a unique index value (0 <= index < total tbl_head elements) and remove the tbl_calc() routine from the back-end. Then, when encountering the first tbl_span in the front-end, dynamically create an array of configurations (termp_tbl) keyed on each tbl_head's unique index value. Construct the decimals and widths at this time, then continue parsing as before. The termp_tbl and indexes are required because we pass a const tbl AST into the front-end.
* Fix table to print nicely (merging error). Also have -Ttree push out someKristaps Dzonsons2011-01-021-1/+1
| | | | header stuff.
* Add some final bits necessary in the upcoming -Tascii tbl stuff.Kristaps Dzonsons2011-01-021-0/+2
|
* Churn to get parts of 'struct tbl' visible from mandoc.h: rename theKristaps Dzonsons2011-01-021-9/+9
| | | | | | | existing 'struct tbl' as 'struct tbl_node', then move all option stuff into a 'struct tbl' in mandoc.h. This conflicted with a structure in chars.c, which was renamed.
* Plug in the "head" concept for tables. A tbl_head specifies the fullKristaps Dzonsons2011-01-011-17/+121
| | | | | | | | | | layout for each row, including vertical spacers. One grabs the tbl_head for a row and iterates through each entry, plugging data from the tbl_span into the header as appropriate. This is pulled in more or less verbatim from tbl.bsd.lv. In fact, this is verbatim except that lists macros are made into hard-coded lists (for compatibility, as long-ago noted by joerg@).
* Add bits for compilation on Mac.Kristaps Dzonsons2011-01-011-0/+1
|
* Move clean-up of parsed tbl nodes into the tbl_clear() function, calledKristaps Dzonsons2010-12-301-5/+5
| | | | once per invocation.
* Update (still-commented) manual bits for tbl.Kristaps Dzonsons2010-12-291-29/+6
| | | | | Also removed lots of superfluous switch cases by using tolower() and handling only the lowercase keys.
* Merge, with considerable changes, tbl.bsd.lv's layout-handling code.Kristaps Dzonsons2010-12-291-0/+289