aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libman.h
Commit message (Collapse)AuthorAgeFilesLines
* Parser unification: use nice ohashes for all three request and macro tables;Ingo Schwarze2017-04-291-2/+1
| | | | no functional change, minus two source files, minus 200 lines of code.
* Continue parser unification:Ingo Schwarze2017-04-241-3/+3
| | | | | | | | * Make enum rofft an internal interface as enum roff_tok in "roff.h". * Represent mdoc and man macros in enum roff_tok. * Make TOKEN_NONE a proper enum value and use it throughout. * Put the prologue macros first in the macro tables. * Unify mdoc_macroname[] and man_macroname[] into roff_name[].
* In private header files, __BEGIN_DECLS and __END_DECLS are pointless.Ingo Schwarze2015-11-071-4/+1
| | | | | | | | | | | | Because these work slightly differently on different systems, they are becoming a maintenance burden in the portable version, so delete them. Besides, one of the chief design goals of the mandoc toolbox is to make sure that nothing related to documentation requires C++. Consequently, linking mandoc against any kind of C++ program would defeat the purpose and is not supported. I don't understand why kristaps@ added them in the first place.
* move man(7) validation into the dedicated validation phase, tooIngo Schwarze2015-10-221-2/+3
|
* Get rid of two empty wrapper functions. No functional change.Ingo Schwarze2015-04-231-2/+1
|
* Unify trickier node handling functions.Ingo Schwarze2015-04-191-3/+1
| | | | | | | * man_elem_alloc() -> roff_elem_alloc() * man_block_alloc() -> roff_block_alloc() The functions mdoc_elem_alloc() and mdoc_block_alloc() remain for now because they need to do mdoc(7)-specific argument processing.
* Unify some node handling functions that use TOKEN_NONE.Ingo Schwarze2015-04-191-3/+1
| | | | | | | | * mdoc_word_alloc(), man_word_alloc() -> roff_word_alloc() * mdoc_word_append(), man_word_append() -> roff_word_append() * mdoc_addspan(), man_addspan() -> roff_addtbl() * mdoc_addeqn(), man_addeqn() -> roff_addeqn() Minus 50 lines of code, no functional change.
* Unify node handling functions:Ingo Schwarze2015-04-191-3/+1
| | | | | | | | | | | * node_alloc() for mdoc and man_node_alloc() -> roff_node_alloc() * node_append() for mdoc and man_node_append() -> roff_node_append() * mdoc_head_alloc() and man_head_alloc() -> roff_head_alloc() * mdoc_body_alloc() and man_body_alloc() -> roff_body_alloc() * mdoc_node_unlink() and man_node_unlink() -> roff_node_unlink() * mdoc_node_free() and man_node_free() -> roff_node_free() * mdoc_node_delete() and man_node_delete() -> roff_node_delete() Minus 130 lines of code, no functional change.
* Unify {mdoc,man}_{alloc,reset,free}() into roff_man_{alloc,reset,free}().Ingo Schwarze2015-04-181-2/+1
| | | | | Minus 80 lines of code, no functional change. Written on the train from Koeln to Wolfsburg returning from p2k15.
* Move mdoc_hash_init() and man_hash_init() to libmandoc.hIngo Schwarze2015-04-181-2/+1
| | | | | and call them from mparse_alloc() and choose_parser(), preparing unified allocation of struct roff_man.
* Replace the structs mdoc and man by a unified struct roff_man.Ingo Schwarze2015-04-181-33/+12
| | | | | Almost completely mechanical, no functional change. Written on the train from Exeter to London returning from p2k15.
* Third step towards parser unification:Ingo Schwarze2015-04-021-2/+2
| | | | | Replace struct mdoc_meta and struct man_meta by a unified struct roff_meta. Written of the train from London to Exeter on the way to p2k15.
* Second step towards parser unification:Ingo Schwarze2015-04-021-13/+13
| | | | | | | | | Replace struct mdoc_node and struct man_node by a unified struct roff_node. To be able to use the tok member for both mdoc(7) and man(7) without defining all the macros in roff.h, sacrifice a tiny bit of type safety and make tok an int rather than an enum. Almost mechanical, no functional change. Written on the Eurostar from Bruxelles to London on the way to p2k15.
* Simplify by almost halving the number of macro flags:Ingo Schwarze2015-03-201-9/+6
| | | | | | | 1. MAN_EXPLICIT was used iff fp == blk_exp, so just test fp. 2. MAN_FSCOPED was used only for TP, so just test for TP. 3. MAN_NOCLOSE was completely unused. No functional change.
* mdoc(7) already uses the mandoc(1) -Ios argument in the footer lineIngo Schwarze2014-12-281-1/+2
| | | | | | when .Os has no argument, so do the same for man(7) when .TH has less than four arguments; there is no reason to treat both differently. Issue found following a question from Thomas Klausner <wiz at NetBSD>.
* remove unneccessary inclusion protection; patch from deraadt@Ingo Schwarze2014-12-011-5/+1
|
* Simplify by making many functions in the man(7) parser void,Ingo Schwarze2014-11-281-11/+10
| | | | and some cleanup; no functional change, minus 70 lines.
* Allow the five man(7) font macros to concatenate their line arguments,Ingo Schwarze2014-11-031-1/+4
| | | | | | | the same way the mdoc(7) macros marked MDOC_JOIN do it. In -Thtml, this removes bogus <br/> when the font macros are used in no-fill mode; issue found by jsg@ in the Xcursor(3) SYNOPSIS. As a bonus, this slightly reduces the size of the syntax tree.
* Simplify man(7) validation:Ingo Schwarze2014-08-011-2/+1
| | | | | | | | | Drop pre-handlers, they were almost unused. Drop the needless complexity of allowing more than one post-handler. This saves one internal interface function, one static function, one private struct definition, sixteen static arrays, and 45 lines of code. No functional change.
* demacrify: get rid of man_nmsg(), man_pmsg(), mdoc_nmsg(), mdoc_pmsg()Ingo Schwarze2014-08-011-5/+1
|
* garbage collect three unused global flags; no functional changeIngo Schwarze2014-07-301-3/+1
|
* Simplify: replace one global flag by one local variable.Ingo Schwarze2014-07-301-2/+1
| | | | No functional change.
* Simplify man_unscope(), removing 18 lines of code, that is,Ingo Schwarze2014-07-071-3/+2
| | | | | | removing one function argument, one function definition, three function invocations and two pointless assert()s. No functional change.
* KNF: case (FOO): -> case FOO:, remove /* LINTED */ and /* ARGSUSED */,Ingo Schwarze2014-04-201-3/+3
| | | | | remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
* Add an option -Q (quick) to mandocdb(8)Ingo Schwarze2014-01-051-1/+2
| | | | | | | | | | | | | | | for accelerated generation of reduced-size databases. Implement this by allowing the parsers to optionally abort the parse sequence after the NAME section. While here, garbage collect the unused void *arg attribute of struct mparse and mparse_alloc() and fix some errors in mandoc(3). This reduces the processing time of mandocdb(8) on /usr/share/man by a factor of 2 and the database size by a factor of 4. However, it still takes 5 times the time and 6 times the space of makewhatis(8), so more work is clearly needed.
* Cleanup naming of local variables to make the code easier on the eye:Ingo Schwarze2012-11-171-6/+6
| | | | | | | | Settle for "struct man *man", "struct mdoc *mdoc", "struct meta *meta" and avoid the confusing "*m" which was sometimes this, sometimes that. No functional change. ok kristaps@ some time ago
* When the HEAD scope of .TP is broken by another block macro,Ingo Schwarze2011-11-071-1/+2
| | | | | | | | do not abort with a FATAL error, but report a report a WARNING, remove the broken .TP from the syntax tree, and prod on. Reported repeatedly by ports people, at least by brad@ and jeremy@. Also fixes rendition(4) in Xenocara. ok kristaps@
* forgotten Copyright bumps; no code changeIngo Schwarze2011-09-181-2/+2
| | | | found while syncing to OpenBSD
* Follow-up: forgot to remove useless regset structs.Kristaps Dzonsons2011-07-181-2/+1
|
* Make `struct roff' be passed into libmdoc and libman upon creation.Kristaps Dzonsons2011-07-181-1/+2
| | | | | This is required for supporting in-line equations. While here, push registers properly into roff and add an set/get/mod interface.
* Merge man_args() into man_macro.c, the only place where it's called, andKristaps Dzonsons2011-03-231-8/+1
| | | | | | make its return value boolean (we don't care about QWORD). We can move it into mdoc_macro.c because it's basically just a wrapper around mandoc_getarg(). Then blow away man_argv.c, which is left empty.
* First, make -man ARGS_EOLN et al. be an enum. Second, removeKristaps Dzonsons2011-03-231-7/+9
| | | | | ARGS_ERROR, as it is never returned by man_args(). Then clean up invocations of man_args() to only check for ARGS_EOLN.
* Add MAN_TAIL, which will be used by `UE' (forthcoming) and needs to beKristaps Dzonsons2011-03-231-1/+2
| | | | used for `RE'.
* libmdoc.h and libman.h were including mdoc.h and man.h, respectively.Kristaps Dzonsons2011-03-221-3/+1
| | | | | Don't have them do that (includes in header files = faugh), and have individual files directly include these files.
* Consolidate messages. Have all parse-time messages (in libmdoc,Kristaps Dzonsons2011-03-201-7/+4
| | | | | | | | | 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.
* Clean-up in libman: make all calls to man_*msg not check return value.Kristaps Dzonsons2011-03-171-2/+2
| | | | Also convert man_vmsg to return void.
* If the first character of free-form text is whitespace, then a newlineKristaps Dzonsons2011-01-121-1/+2
| | | | shall precede outputted text (surprise!).
* Kill man_action.c.Kristaps Dzonsons2010-11-301-3/+1
|
* Implement a simple, consistent user interface for error handling.Ingo Schwarze2010-08-201-2/+1
| | | | | | | | | | | | | | | | | We now have sufficient practical experience to know what we want, so this is intended to be final: - provide -Wlevel (warning, error or fatal) to select what you care about - provide -Wstop to stop after parsing a file with warnings you care about - provide consistent exit status codes for those warnings you care about - fully document what warnings, errors and fatal errors mean - remove all other cruft from the user interface, less is more: - remove all -f knobs along with the whole -f option - remove the old -Werror because calling warnings "fatal" is silly - always finish parsing each file, unless fatal errors prevent that This commit also includes a couple of related simplifications behind the scenes regarding error handling. Feedback and OK kristaps@; Joerg Sonnenberger (NetBSD) and Sascha Wildner (DragonFly BSD) agree with the general direction.
* correct lots of copyright notices;Ingo Schwarze2010-07-131-2/+2
| | | | ok kristaps@
* Re-constitution of `ds' symbol processing. First, push theKristaps Dzonsons2010-07-071-2/+1
| | | | | | | | | roff_getstr() family of functions into roff.c with the "first_string" directly in struct roff. Second, pre-process each line for reserved words in libroff, splicing and re-running a line if it has one (this allows defined symbols to be macros). Remove term.c's invocation of the roff_getstrn() function. Removed function documentation in roff.3 and added roff.7 `ds' documentation.
* Following clue-stick applied by schwarze@, back out const-ness of regsetKristaps Dzonsons2010-06-271-2/+2
| | | | | | | | | passed in to libmdoc and libman. Fix mdoc.3 and man.3 EXAMPLE sections to include regset. Add MDOC_SYNPRETTY flag cueing front-end to nicely format certain values as if SEC_SYNOPSIS were the current section.
* Downstream maintainers: this removes UGLY! I don't want divergingKristaps Dzonsons2010-06-271-8/+8
| | | | | | | | | functionality and UGLY works quite well thanks to schwarze@'s careful attention. This also backs out function-prototype changes for struct regset, instead stuffing a pointer to the regset directly into struct mdoc/man/roff.
* Mechanical diff allowing the const struct regset to propogate throughKristaps Dzonsons2010-06-261-3/+8
| | | | libman and libmdoc.
* Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept aKristaps Dzonsons2010-06-261-1/+2
| | | | const struct regset pointer. No functionality.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-2/+2
|
* Squash bug noted by Ulrich Spoerlein where "-" were being converted toKristaps Dzonsons2010-06-091-2/+2
| | | | | | | | | ASCII_HYPH, as per normal, but were screwing up mandoc_special(). Fixed by making mandoc_special() first check isspace() instead of ! isgraph(), then normalise its string as it passes out. This require de-constifying some validation routines not already de-constified (those in libman), but that's ok, because I'd like to be pushing actions into validation routines to save on space and redundant calculations.
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-39/+9
| | | | | | | | | | | stringified in main.c. Allow `An' to handle an argument and child (with a warning). Allow `Rv' and `Ex' to work without a prior `Nm' as groff does (with a warning). Allow inconsistent column syntax to only raise a warning.
* Remove `am', `ami', `de', `dei', and `.' from -man, as they're now in the ↵Kristaps Dzonsons2010-05-151-5/+1
| | | | roff preprocessor.
* Removed restriction on integer manual sections in -man.Kristaps Dzonsons2010-05-151-2/+1
|