summaryrefslogtreecommitdiffstats
path: root/libmdoc.h
Commit message (Collapse)AuthorAgeFilesLines
* Support -Ios='OpenBSD 5.1' to override uname(3) as the source of theIngo Schwarze2012-05-271-0/+1
| | | | | | | | | | default value for the mdoc(7) .Os macro. Needed for man.cgi on the OpenBSD website. Problem with man.cgi first noticed by deraadt@; beck@ and deraadt@ agree with the way to solve the issue. "Please check them in and I'll look into them later!" kristaps@
* In man(7), when no explicit volume name is given, use the defaultIngo Schwarze2011-12-021-1/+0
| | | | | | | | | | | | volume name for the respective manual section, just like in mdoc(7). This gives us nicer page headers for cvs(1), lynx(1), tic(1), mkhybrid(8), and many curses(3) manuals. ok kristaps@ To not break compatibility, i wrote a corresponding patch for GNU troff which Werner Lemberg accepted upstream at rev. 1.65 of: http://cvs.savannah.gnu.org/viewvc/groff/tmac/an-old.tmac?root=groff
* 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.
* Clean up parsing of delimiters in -mdoc. First, remove the "dowarn"Kristaps Dzonsons2011-04-191-7/+1
| | | | | | | | variable from mandoc_getarg() so that it prints the warning every time. Then, remove the warning from args_checkpunct(). This way, warnings are being posted at the correct time. This makes the flag argument to mdoc_zargs() superfluous, so make it be zero when it's invoked. Finally, move the args() flags into mdoc_argv.c and make them enums.
* Get mdoc_argv.c ready to use [some of] mandoc_getarg() by giving saidKristaps Dzonsons2011-04-171-10/+10
| | | | function a parameter to suppress warnings.
* 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.
* mdoc_argn_free is only used local to mdoc_argv.c, so make it static.Kristaps Dzonsons2011-03-221-1/+0
|
* Move mandoc_isdelim() back into libmdoc.h. This fixes an unreportedKristaps Dzonsons2011-03-221-0/+20
| | | | | | | | | error where (1) -man pages were punctuating delimiters (e.g., `.B a ;') and where (2) standalone punctuation in -mdoc or -man (e.g., ";" on its own line) would also be punctuated. This introduces a small amount of complexity of mdoc_{html,term}.c must manage their own spacing with running print_word() or print_text(). The check for delimiting now happens in mdoc_macro.c's dword().
* 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 libmdoc: fix last checks for mdoc_*msg return value, thenKristaps Dzonsons2011-03-171-1/+1
| | | | | make mdoc_vmsg not return an int. libmdoc is now completely clean of return-value checks from the message subsystem.
* Kill off some unused function prototypes.Kristaps Dzonsons2011-03-171-3/+0
|
* Move mdoc_str2sec() into mdoc_validate.c as a2sec(), as that's the onlyKristaps Dzonsons2011-03-171-1/+0
| | | | place that it's being used.
* Move mdoc_isdelim() into mandoc.h as mandoc_isdelim(). This allows theKristaps Dzonsons2011-03-171-9/+0
| | | | | | removal of manual delimiter checks in html.c and term.c. Finally, add the escaped period as a closing delimiter, removing a TODO to this effect.
* Make args_checkpunct() use mdoc_isdelim() instead of mdoc_iscdelim(),Kristaps Dzonsons2011-03-171-1/+1
| | | | which is wrong. Then remove mdoc_iscdelim() alltogether.
* mdoc_action.c is no more. Attic it and remove it from the Makefile.Kristaps Dzonsons2010-11-301-3/+0
| | | | | Remove references to MDOC_ACTED (it was only assertions) and the pre- and post-action functions.
* 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.
* In the mdoc(7) parser, inspect roff registers early such that all partsIngo Schwarze2010-07-011-0/+1
| | | | | | | | | | | | of the parser can use the resulting cues. In particular, this allows to use .nr nS to force SYNOPSIS-style .Nm indentation outside the SYNOPSIS as needed by ifconfig(8). To actually make this useable, .Pp must rewind .Nm, or the rest of the section would end up indented. Implement a quick hack for now, a generic solution can be designed later. ok kristaps@ and tested by sobrado@
* Support for badly nested blocks, written around the time ofIngo Schwarze2010-06-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | the Rostock mandoc hackathon and tested and polished since, supporting constructs like: .Ao Bo Ac Bc (exp breaking exp) .Aq Bo eol Bc (imp breaking exp) .Ao Bq Ac eol (exp breaking imp) .Ao Bo So Bc Ac Sc (double break, inner before outer) .Ao Bo So Ac Bc Sc (double break, outer before inner) .Ao Bo Ac So Bc Sc (broken breaker) .Ao Bo So Bc Do Ac Sc Dc (broken double breaker) There are still two known issues which are tricky: 1) Breaking two identical explicit blocks (Ao Bo Bo Ac or Aq Bo Bo eol) fails outright, triggering a bogus syntax error. 2) Breaking a block by two identical explicit blocks (Ao Ao Bo Ac Ac Bc or Ao Ao Bq Ac Ac eol) still has a minor rendering error left: "<ao1 <ao2 [bo ac2> ac1> bc]>" should not have the final ">". We can fix these later in the tree, let's not grow this diff too large. "get it in" kristaps@
* 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
|
* Consolidated list processing to a single loop in mdoc_validate.c. ThisKristaps Dzonsons2010-06-031-2/+1
| | | | | | | | | | relieves having to repeat running over the argument list in mdoc_action.c and mdoc_validate.c. Default to LIST_item for type-less lists (groff technically doesn't do this: it just ignores the `It' lines altogether). Make MANDOC_LISTTYPE be a recoverable error.
* Add ability to interpret initial free-form lines as part of a `BlKristaps Dzonsons2010-05-311-0/+1
| | | | | | | | -column' up until the first `It'. This is UGLY and should have all sorts of warnings, and will. On the one hand, it fits with groff's notion of tabs and tab-spaces. On the other hand, it's not really "free-form" text any more. Note that this does not yet accomodate for macros coming on these lines.
* remove unused enum merr;Ingo Schwarze2010-05-241-56/+0
| | | | ok joerg@
* Increase performance by stashing the list type in struct mdoc_node.Kristaps Dzonsons2010-05-171-1/+1
| | | | | | | This will eventually be used so that mdoc_macro can known whether to dump list line arguments into the body (`Bl -column' overflowing). Remove a2list() and arg_listtype() because of this.
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-14/+7
| | | | | | | | | | | 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.
* LIBRARY can also occur in section 9.Kristaps Dzonsons2010-05-151-1/+1
| | | | | | All manual sections (unknown, 3p, 3f, etc.) correctly handled by -mdoc. Useful warning printed if unknown manual section. Checking for manual sections (e.g., LIBRARY) checks only first character, so 3p, 3f, etc. are free.
* Distinguish OPEN, MIDDLE and CLOSE delimiters (using an enum).Ingo Schwarze2010-05-151-2/+9
| | | | | | | Only OPEN are drawn before the beginning of a macro; this is new, before this, MIDDLE ('|') were drawn in front, too. Only CLOSE are pushed after the end of a macro (as before). ok kristaps@
* More `Bl -column' dancing: It children also inherit in-phrase flags (noted ↵Kristaps Dzonsons2010-05-151-2/+2
| | | | by Ingo Schwarze).
* Backed out check for `Ex' manual sec (ok schwarze@, joerg@), in turn backing ↵Kristaps Dzonsons2010-05-141-1/+0
| | | | out check_msec() and deps.
* Proper handling of quoted tab-separated column lists.Kristaps Dzonsons2010-05-141-3/+5
|
* Fixed bug in -Thtml -mdoc where `Lb' would line-break in LIBRARY section.Kristaps Dzonsons2010-05-131-3/+4
| | | | | Fixed assumption that parse-point == 1 equates to beginning of line (false if whitespace separates macro and control character). Fixed line-break for non-first-macro in several SYNOPSIS macros.
* mdoc_atosec -> mdoc_str2sec (consistent with str2 being different from a2).Kristaps Dzonsons2010-05-121-1/+1
| | | | | Changed ordering of sections (EXIT STATUS moved around), argued for by Ulrich Sporlein. Fixed mdoc_str2sec not to use weird structure.
* Introduce ARGS_PEND for `It -column' end-of-line special casing.Kristaps Dzonsons2010-05-091-1/+2
| | | | Initial rules for insane `It -column' tabsep handling.
* Lint fixes (type-safety for enums via -cefuh).Kristaps Dzonsons2010-05-081-2/+1
|
* Initial ARGS_PPHRASE (partial phrase) framework.Kristaps Dzonsons2010-05-071-1/+2
| | | | Running tally of changes in index.sgml.
* enum-ised mdoc_argv() return (better return-value safety).Kristaps Dzonsons2010-05-071-5/+8
|
* margerr -> margserr (getting ready for margverr).Kristaps Dzonsons2010-05-071-3/+3
|
* Wrangle mdoc_args() and mdoc_zargs() to use enum return type.Kristaps Dzonsons2010-05-071-8/+12
| | | | | Fixed lookup() and lookup_raw() to correctly use enum type. Quashed in_line_argn() bug (not reported, but there) where mixing return values.
* 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 `\."'.
* Migrating mdoc_node_free() and mdoc_node_freelist() to use ↵Kristaps Dzonsons2010-04-061-2/+1
| | | | mdoc_node_delete(), which has a more intuitive interface and mirrors libman.
* Merged Ingo Schwarze's patch (plus documentation) for removing extraneous ↵Kristaps Dzonsons2010-04-031-0/+1
| | | | list types, which happens fairly often.
* Macro types enum-ated (enum mdoct) (for easier debugging in gdb of "tok" ↵Kristaps Dzonsons2010-03-311-10/+10
| | | | | | | values). Initial check-in of Ingo Schwarze's patch for Xo/Xc handling (in blocks ifdef'd "UGLY"). Put Oc-close-Op parts into UGLY ifdef blocks.
* libmdoc and libman now using non-recoverable allocations (simpler code).Kristaps Dzonsons2009-10-301-1/+0
|