aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man.c
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup naming of local variables to make the code easier on the eye:Ingo Schwarze2012-11-171-126/+126
| | | | | | | | 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
* Translate blank input lines to .sp just like in mdoc(7),Ingo Schwarze2012-07-141-3/+4
| | | | | | and ignore .sp after .PP. This fixes vertical spacing for blank lines after .PP and for .sp after .PP. OpenBSD rev. man.c 1.68 and man_term.c 1.86
* Add `cc' support.Kristaps Dzonsons2012-06-121-2/+2
| | | | | | | | | | | | | | | This was reported by espie@ and in the TODO. Caveat: `cc' has buggy behaviour when invoked in groff(1) and followed by a line-breaking control character macro, e.g., in a -man doc, .cc | .B foo 'B foo |cc 'B foo will cause groff(1) to behave properly for `.B' but inline the macro definition for `B' when invoked with the line-breaking macro.
* Minimal implementation of .EX and .EE for GNU compatibility.Ingo Schwarze2012-06-021-2/+2
| | | | | Do not use this, it is not portable and only defined in esr's man-ext. For example, sox(1) wants these macros.
* Add support for `OP', one of the extended man macros. This also requiresKristaps Dzonsons2012-01-031-2/+2
| | | | some man(7) changes to accomodate for the an-ext compatibility.
* Correctly handle constructs likeJoerg Sonnenberger2011-11-161-3/+8
| | | | | .TP 8 .SH foo
* When the HEAD scope of .TP is broken by another block macro,Ingo Schwarze2011-11-071-2/+29
| | | | | | | | 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@
* If -Tman is specified and input is -man, echo the preprocessed (`so'Kristaps Dzonsons2011-10-061-1/+9
| | | | | | | | | | | | | | replaced by file) input. This replaces earlier behaviour of doing nothing, which I found unexpected (mandoc should always output). This requires a buffer in read.c that saves the input lines before being parsed, with a special hook if `so' is invoked. This buffer is just flushed to output if -mman is the input. While mucking around doing this, I also alpha-ordered the mandoc.h functions. Ok schwarze@, with no screaming when the polished patch was published.
* An implementation of `tr'. This routes allocations of TEXT nodesKristaps Dzonsons2011-07-281-2/+2
| | | | | | | through libroff, which does the appropriate translations of `tr'. This is SLOW: it uses the backend of `ds' and `de', which is a simple linear list. However, unlike `ds' and `de', it iterates over EACH CHARACTER of the entire file looking for replacements.
* Simply word allocation in libmdoc and libman.Kristaps Dzonsons2011-07-271-9/+2
|
* Finish the eqn syntactic parser. This correctly parses terms and doesKristaps Dzonsons2011-07-211-3/+3
| | | | | | | the proper `define' dance, which amounts to pure word-replace (you can, say, define `foo' as `define' then define `define' as something else). eqn.c is now ready for some semantic parsing of `box' and `eqn' productions as defined by the grammar.
* Make `struct roff' be passed into libmdoc and libman upon creation.Kristaps Dzonsons2011-07-181-3/+3
| | | | | This is required for supporting in-line equations. While here, push registers properly into roff and add an set/get/mod interface.
* Make libman use mandoc_getcontrol() for real this time.Kristaps Dzonsons2011-03-291-47/+23
|
* Add MAN_TAIL, which will be used by `UE' (forthcoming) and needs to beKristaps Dzonsons2011-03-231-1/+18
| | | | used for `RE'.
* libmdoc.h and libman.h were including mdoc.h and man.h, respectively.Kristaps Dzonsons2011-03-221-1/+2
| | | | | 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-22/+7
| | | | | | | | | 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-3/+3
| | | | Also convert man_vmsg to return void.
* Clean up date handling,Ingo Schwarze2011-03-071-4/+4
| | | | | | | | | | | | as a first step to get rid of the frequent petty warnings in this area: - always store dates as strings, not as seconds since the Epoch - for input, try the three most common formats everywhere - for unrecognized format, just pass the date though verbatim - when there is no date at all, still use the current date Originally triggered by a one-line patch from Tim van der Molen, <tbvdm at xs4all dot nl>, which is included here. Feedback and OK on manual parts from jmc@. "please check this in" kristaps@
* Allow -man to process EQN as well. Also fix a segfault in missing caseKristaps Dzonsons2011-02-091-1/+17
| | | | statements in the post-handler for EQN in -mdoc and -man.
* Put tbl_alloc function right into the addspan() one, as this is the onlyKristaps Dzonsons2011-02-081-19/+9
| | | | place that it's called.
* Use tbl_span line number for warnings/errors.Kristaps Dzonsons2011-02-061-2/+2
|
* Let the line-number of a tbl_span be remembered.Kristaps Dzonsons2011-02-061-3/+2
|
* If the first character of free-form text is whitespace, then a newlineKristaps Dzonsons2011-01-121-9/+16
| | | | shall precede outputted text (surprise!).
* Same treatment for MAN_HALT as for MDOC_HALT.Kristaps Dzonsons2011-01-031-10/+10
|
* Make -Ttree spit out table columns.Kristaps Dzonsons2011-01-011-1/+2
| | | | Add forgotten assignment of span to -man's TBL nodes.
* Add -man support for tables. Like -mdoc, this consists of anKristaps Dzonsons2011-01-011-23/+57
| | | | | | | external-facing function man_addspan() (this required shuffling around the descope routine) and hooks elsewhere. Also fixed mdoc.c's post-validation of tables.
* Clean up {mdoc,man}_pmsg and vmsg invocations (ignore return values).Kristaps Dzonsons2011-01-011-7/+7
|
* Remove `i' and `r' macro handlers. These macros, originally part of theKristaps Dzonsons2010-12-081-5/+5
| | | | | | | | me package, aren't recognised by "groff -mandoc" so we don't need to do so either. Discussed on tech@ with schwarze@. While at it, remove references to `b' in man.7. As far as I know, this was never supported anyway.
* Add support for `ft' macro found in groff(7). Based on a patch byKristaps Dzonsons2010-12-061-2/+2
| | | | | schwarze@, but without the -T[x]html handling, which structurally does not work. Also add man.7 documentation (not in original patch).
* Allow multiple ELINE macros without raising a fatal error. From a field-Kristaps Dzonsons2010-12-061-26/+10
| | | | tested patch by schwarze@.
* Remove `Sp', `Vb', and `Ve' (as per schwarze@'s changes in OpenBSD),Kristaps Dzonsons2010-12-051-3/+2
| | | | which are now accomodated for the new libroff modifications.
* Kill man_action.c.Kristaps Dzonsons2010-11-301-3/+1
|
* Implement a simple, consistent user interface for error handling.Ingo Schwarze2010-08-201-27/+7
| | | | | | | | | | | | | | | | | 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.
* simplify the code copying the macro name, and sync theIngo Schwarze2010-08-081-8/+8
| | | | | accompagnying comment between man_pmacro() and mdoc_pmacro(); ok'd by kristaps@ together with main.c rev. 1.102
* Clean out the isgraph() checks in mdoc.c and man.c. These code pathsKristaps Dzonsons2010-08-071-12/+2
| | | | | were never taken since main.c begin skipping over unrecognisable characters, so they were noops.
* Added `in' macro support for -man -Tascii. This is not yet supported inKristaps Dzonsons2010-07-221-1/+2
| | | | -Thtml (I'm surprised to note that neither is LITERAL mode).
* Text ending in a full stop, exclamation mark or question markIngo Schwarze2010-07-181-2/+2
| | | | | | | | | | | | | | | | | | should not flag the end of a sentence if: 1) The punctuation is followed by closing delimiters and not preceded by alphanumeric characters, like in "There is no full stop (.) in this sentence" or 2) The punctuation is a child of a macro and not preceded by alphanumeric characters, like in "There is no full stop .Pq \&. in this sentence" "looks fine" to kristaps@; tested by jmc@ and sobrado@
* 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-3/+3
| | | | | | | | | 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-11/+9
| | | | | | | | | 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-5/+8
| | | | libman and libmdoc.
* Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept aKristaps Dzonsons2010-06-261-2/+4
| | | | const struct regset pointer. No functionality.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-2/+2
|
* Allow bad -man dates to flow verbatim into the front-ends. Noted byKristaps Dzonsons2010-05-261-1/+3
| | | | Ulrich Spoerlein.
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-85/+30
| | | | | | | | | | | 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.
* Add support for .AT. Properly implement .UC. Add regress tests.Joerg Sonnenberger2010-05-171-2/+2
|
* Allow roff_parseln() to be re-run.Kristaps Dzonsons2010-05-161-27/+31
| | | | | | | | | Allow roff_parseln() to manipulate the line buffer offset. This is used in situations like `.ie n .TH FOO 1' or `.ie n .ie n', where the line buffer offset is recalculated then the roff parser re-run. Fix mdoc_parseln() and man_parseln() to accept the initial line offset. WARNING: backed-out ALL roff macros whilst accomodating for how roff handles multi-line conditionals (in short, re-running the parser).
* Fix allowing silly '\'' control character.Kristaps Dzonsons2010-05-161-2/+2
|
* Remove `am', `ami', `de', `dei', and `.' from -man, as they're now in the ↵Kristaps Dzonsons2010-05-151-8/+2
| | | | roff preprocessor.