summaryrefslogtreecommitdiffstats
path: root/libman.h
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup naming of local variables to make the code easier on the eye:Ingo Schwarze2012-11-171-5/+5
| | | | | | | | 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-0/+1
| | | | | | | | 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-1/+1
| | | | found while syncing to OpenBSD
* Follow-up: forgot to remove useless regset structs.Kristaps Dzonsons2011-07-181-1/+0
|
* Make `struct roff' be passed into libmdoc and libman upon creation.Kristaps Dzonsons2011-07-181-0/+1
| | | | | 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-7/+0
| | | | | | 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-6/+8
| | | | | 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-0/+1
| | | | used for `RE'.
* libmdoc.h and libman.h were including mdoc.h and man.h, respectively.Kristaps Dzonsons2011-03-221-2/+0
| | | | | 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-6/+3
| | | | | | | | | 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-1/+1
| | | | Also convert man_vmsg to return void.
* If the first character of free-form text is whitespace, then a newlineKristaps Dzonsons2011-01-121-0/+1
| | | | shall precede outputted text (surprise!).
* Kill man_action.c.Kristaps Dzonsons2010-11-301-2/+0
|
* Implement a simple, consistent user interface for error handling.Ingo Schwarze2010-08-201-1/+0
| | | | | | | | | | | | | | | | | 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-1/+1
| | | | ok kristaps@
* Re-constitution of `ds' symbol processing. First, push theKristaps Dzonsons2010-07-071-1/+0
| | | | | | | | | 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-1/+1
| | | | | | | | | 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-7/+7
| | | | | | | | | 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-2/+7
| | | | libman and libmdoc.
* Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept aKristaps Dzonsons2010-06-261-0/+1
| | | | const struct regset pointer. No functionality.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-1/+1
|
* Squash bug noted by Ulrich Spoerlein where "-" were being converted toKristaps Dzonsons2010-06-091-1/+1
| | | | | | | | | 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-38/+8
| | | | | | | | | | | 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-4/+0
| | | | roff preprocessor.
* Removed restriction on integer manual sections in -man.Kristaps Dzonsons2010-05-151-1/+0
|
* Sync'd mdoc.c's function names with man.c.Kristaps Dzonsons2010-04-081-0/+1
| | | | Prompted by Ingo and Claus Assman, added warn/ignore for text lines beginning with `\."'.
* Final (?) fix to issue pointed out by Sascha Wildner: roff instructions ↵Kristaps Dzonsons2010-03-291-0/+1
| | | | clobbering prior scope rules and line modes.
* Initial step in fixing badness reported by Sascha Wildner (wip).Kristaps Dzonsons2010-03-291-3/+5
|
* Fixed re-adjustment of scope in exiting roff instructions (libman).Kristaps Dzonsons2010-03-271-1/+4
| | | | | | Added title-case check for (libman). Fixed premature closure of roff instruction scope (libman). Added documentation of ignored roff macros to man(3).
* Using man_node_delete() instead of man_node_free()/man_node_freelist() and ↵Kristaps Dzonsons2010-03-241-3/+3
| | | | | | | friends (much simpler). Split blk_imp() into blk_exp() (explicit macros), blk_dotted() (roff macros), and the original. Added de, dei, am, ami, and ig roff macros (for now, these are discarded within the parse).
* libman using enum mant instead of #defines for macros.Kristaps Dzonsons2010-03-231-6/+6
| | | | | Clean-ups, better documentation in man_hash.c. Added extra space for "." in man_hash.c (unused for the time being).
* Clarify -man -T[x]html handling of `br' within `B'.Kristaps Dzonsons2010-03-221-0/+2
| | | | | Consolidated node unlinking in -man. Conclude nested next-line scope issues noted by Ingo Schwarze.
* Accomodate (libman) for next-line macros followed by non-text macros `na', ↵Kristaps Dzonsons2010-03-221-3/+5
| | | | | | `sp', and `br'. Based on a patch by Ingo Schwarze.
* libmdoc and libman now using non-recoverable allocations (simpler code).Kristaps Dzonsons2009-10-301-1/+0
|
* -man also prints unknown macro (noted by Joerg Sonnenberger).Kristaps Dzonsons2009-10-261-1/+0
|
* Lookup hashes are now static tables, ordered first-level by second ↵Kristaps Dzonsons2009-09-161-4/+2
| | | | character, then randomly along a chain. Improves performance by a small fraction and considerably cleans up hash sources.
* Fixed next-line scoping of `.HP nnn' (has both next-line and on-line in head).Kristaps Dzonsons2009-08-211-1/+2
|
* Fixed `nf' behaviour (had broken with de-chunking).Kristaps Dzonsons2009-08-211-0/+4
| | | | Added warnings if literal context already open/closed.
* libman checks for open explicit scopes on exit.Kristaps Dzonsons2009-08-191-0/+1
|
* Added RS/RE macro pair (had to adjust closing rules, sec/ssec/rs/par).Kristaps Dzonsons2009-08-191-0/+1
|
* Significant overhaul in libman. Macros are now block- and line-scoped (withKristaps Dzonsons2009-08-131-4/+30
| | | | | | | | next-line scope extensions possible). man.7 reflects block and line scoping, and also includes a REFERENCE section that will be used as a template for the big mdoc reference. Many fixes in next-line behaviour for both inline and block macros. Added some macros for compatibility (from me.7). Corrected quoted-literal handling for libman.
* Added `sp' support to libman.Kristaps Dzonsons2009-07-241-0/+1
| | | | Added `\c' to known escapes (only used in man, but still).
* Tabularised error strings in libman.Kristaps Dzonsons2009-07-071-2/+3
|
* Consolidated all err/warnings into mdoc.c via libmdoc.h.Kristaps Dzonsons2009-07-061-2/+2
|
* Moved escape validation into libmandoc.h/mandoc.c (common between ↵Kristaps Dzonsons2009-07-041-1/+2
| | | | | | | libman/libmdoc1). libman supports MAN_IGN_ESCAPE (like MDOC_IGN_ESCAPE). All popular escapes now handled consistently.
* libman documents require `TH' and at least one node.Kristaps Dzonsons2009-06-221-1/+3
| | | | | libman requirements documented in man.7 STRUCTURE section. Added STRUCTURE section to mdoc.7, too.
* Moved all formatted libman warn/error into man.c/libman.h.Kristaps Dzonsons2009-06-181-0/+20
| | | | Converted all formatted warn/errors into regular syntax.
* Fixed license email address.Kristaps Dzonsons2009-06-101-1/+1
|
* Using proper license template (const).Kristaps Dzonsons2009-04-121-12/+10
|
* Initial front-end formatting for -man pages.Kristaps Dzonsons2009-03-261-0/+1
|