summaryrefslogtreecommitdiffstats
path: root/mandoc_parse.h
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup, no functional change:Ingo Schwarze2018-12-301-3/+3
| | | | | | | | | | | | | | The struct roff_man used to be a bad mixture of internal parser state and public parsing results. Move the public results to the parsing result struct roff_meta, which is already public. Move the rest of struct roff_man to the parser-internal header roff_int.h. Since the validators need access to the parser state, call them from the top level parser during mparse_result() rather than from the main programs, also reducing code duplication. This keeps parser internal state out of thee main programs (five in mandoc portable) and out of eight formatters.
* Delete the function mparse_readmem() that has been unused for almost aIngo Schwarze2018-12-141-2/+0
| | | | | | decade but regularly makes maintenance harder. Mandoc is not a general-purpose library, and being as pluggable as possible is not among the goals of the project.
* Major cleanup; may imply minor changes in edge cases of error reporting.Ingo Schwarze2018-12-141-6/+2
| | | | | | | | | | | Finally, drop support for the run-time configurable mandocmsg() callback. It was over-engineered from the start, never used for anything in a decade, and repeatedly caused maintenance headaches. Consolidate reporting infrastructure into two files, mandoc.h and mandoc_msg.c, mopping up the bits and pieces that were scattered around main.c, read.c, mandoc_parse.h, libmandoc.h, the prototypes of four parsing-related functions, and both parser structs.
* Cleanup, no functional change:Ingo Schwarze2018-12-131-0/+49
Split the top level parser interface out of the utility header mandoc.h, into a new header mandoc_parse.h, for use in the main program and in the main parser only. Move enum mandoc_os into roff.h because struct roff_man is the place where it is stored. This allows removal of mandoc.h from seven files in low-level parsers and in formatters.