summaryrefslogtreecommitdiffstats
path: root/mandoc.3
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup, no functional change:Ingo Schwarze2018-12-301-50/+13
| | | | | | | | | | | | | | 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.
* Major cleanup; may imply minor changes in edge cases of error reporting.Ingo Schwarze2018-12-141-79/+3
| | | | | | | | | | | 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.
* The upcoming .while request will have to re-execute roff(7) linesIngo Schwarze2018-08-231-32/+6
| | | | | | | parsed earlier, so they will have to be saved for reuse - but the read.c preparser does not know yet whether a line contains a .while request before passing it to the roff parser. To cope with that, save all parsed lines for now. Even shortens the code by 20 lines.
* various nits found with mandoc -TlintIngo Schwarze2017-07-041-1/+1
|
* Split -Wstyle into -Wstyle and the even lower -Wbase, and addIngo Schwarze2017-06-241-10/+23
| | | | | | | | | | | | | | | -Wopenbsd and -Wnetbsd to check conventions for the base system of a specific operating system. Mark operating system specific messages with "(OpenBSD)" at the end. Please use just "-Tlint" to check base system manuals (defaulting to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the manuals of portable software projects you maintain that are not part of OpenBSD base, to avoid bogus recommendations about base system conventions that do not apply. Issue originally reported by semarie@, solution using an idea from tedu@, discussed with jmc@ and jca@.
* Delete the -T xhtml command line option.Ingo Schwarze2017-05-171-4/+2
| | | | | It has been obsolete for more than two years. Use -T html.
* Warnings and errors that occur during mdoc_validate()Ingo Schwarze2017-01-091-2/+27
| | | | | | or during man_validate() have to affect the mandoc(1) EXIT STATUS. Many thanks to <Yuri dot Pankov at gmail dot com> (illumos developer) for reporting this regression.
* update developer documentationIngo Schwarze2016-07-071-95/+86
|
* Delete the redundant "nchild" member of struct roff_node, replacingIngo Schwarze2016-01-081-2/+2
| | | | | | | | most uses by one, a few by two pointer checks, and only one by a tiny loop - not only making data smaller, but code shorter as well. This gets rid of an implicit invariant that confused both static analysis tools and human auditors. No functional change.
* Simplify the mparse_open() interface.Ingo Schwarze2016-01-081-5/+2
| | | | | | Just return the file descriptor or -1 on error; there is just one kind of error anyway. Suggested by Christos Zoulas (NetBSD).
* It was very surprising that a function called mparse_readfd()Ingo Schwarze2016-01-081-0/+5
| | | | | | | | | | | | | closed the file descriptor passed to it after completing its work, in particular considering the fact that it required its callers to call open(2) or mparse_open() beforehand. Change mparse_readfd() to not call close(2) and change the callers to call close(2) afterwards, more or less bringing open and close to the same level of the code and making review easier. Note that man.cgi(8) already did that, even though it was wrong in the past. Small restructuring suggested by Christos Zoulas (NetBSD).
* Major character table cleanup:Ingo Schwarze2015-10-131-10/+0
| | | | | | | | | | | | | * Use ohash(3) rather than a hand-rolled hash table. * Make the character table static in the chars.c module: There is no need to pass a pointer around, we most certainly never want to use two different character tables concurrently. * No need to keep the characters in a separate file chars.in; that merely encourages downstream porters to mess with them. * Sort the characters to agree with the mandoc_chars(7) manual page. * Specify Unicode codepoints in hex, not decimal (that's the detail that originally triggered this patch). No functional change, minus 100 LOC, and i don't see a performance change.
* Do not fork and exec gunzip(1), just link with libz instead.Ingo Schwarze2015-07-191-43/+7
| | | | | | | As discussed with deraadt@, that's cleaner and will help tame(2). Something like this was also suggested earlier by bapt at FreeBSD. Minus 50 lines of code, deleting one interface function (mparse_wait), no functional change intended.
* Fatal errors no longer exist.Ingo Schwarze2015-01-151-18/+13
| | | | | | If a file can be opened, mandoc will produce some output; at worst, the output may be almost empty. Simplifies error handling and frees a message type for future use.
* downgrade .so failure from FATAL to ERRORIngo Schwarze2015-01-151-11/+8
|
* Let mparse_readfd() use mparse_open() and mparse_wait()Ingo Schwarze2014-11-261-6/+17
| | | | | | | | and let mparse_open() fall back to .gz files such that .so works even when the target is zipped, requested by and in part using ideas from <bapt at FreeBSD>. While here, make sure files are readable before forking, both for efficiency and for better error reporting.
* Simplify the mparse_open()/mparse_wait() interface.Ingo Schwarze2014-11-261-10/+0
| | | | | Don't bother the user with the PID of the child process, store it inside the opaque mparse handle.
* Make the character table available to libroff so it can check theIngo Schwarze2014-10-281-1/+15
| | | | | | | | validity of character escape names and warn about unknown ones. This requires mchars_spec2cp() to report unknown names again. Fortunately, that doesn't require changing the calling code because according to groff, invalid character escapes should not produce output anyway, and now that we warn about them, that's fine.
* Add *.gz support to apropos(1) -a, man(1), and even mandoc(1).Ingo Schwarze2014-09-031-0/+62
| | | | Implemented by moving the zip code from makewhatis(8) to the parser lib.
* Sync library documentation with reality.Ingo Schwarze2014-08-051-179/+91
| | | | | Split mandoc_escape(3), mandoc_malloc(3), and mchars_alloc(3) out of mandoc(3), adding lots of new information.
* The files mandoc.c and mandoc.h contained both specialised low-levelIngo Schwarze2014-03-231-25/+55
| | | | | | | functions used for multiple languages (mdoc, man, roff), for example mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary functions. Split the auxiliaries out into their own file and header. While here, do some #include cleanup.
* Add an option -Q (quick) to mandocdb(8)Ingo Schwarze2014-01-051-7/+44
| | | | | | | | | | | | | | | 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.
* The .Lb arguments wants a "lib" prefix;Ingo Schwarze2013-10-061-1/+1
| | | | | from Sascha Wildner via Franco Fichtner (DragonFly); also fixing the same in the mdoc(7) example while i'm about it.
* Cleanup suggested by gcc-4.8.1, following hints by Christos Zoulas:Ingo Schwarze2013-10-051-2/+2
| | | | | | | | - avoid bad qualifier casting in roff.c, roff_parsetext() by changing the mandoc_escape arguments to "const char const **" - avoid bad qualifier casting in mandocdb.c, index_merge() - do not complain about unused variables in test-*.c - garbage collect a few unused variables elsewhere
* two improvements in the SYNOPSIS;Ingo Schwarze2013-09-161-2/+1
| | | | from Sascha Wildner <swildner at gmail dot com> (DragonFly)
* For citing the names and email addresses of authors,Ingo Schwarze2013-07-131-2/+1
| | | | | | | consistently use the style ".An name Aq Mt email". Triggered by a question from Jan Stary <hans at stare dot cz>, ok jmc@.
* Note where these functions are declared and implemented.Ingo Schwarze2013-06-021-0/+84
| | | | That helps to find one's way when hacking on the code.
* Reflect reality, mandoc_escape does not skip the "\" itself, but expectsJoerg Sonnenberger2012-01-131-1/+3
| | | | the caller to have done that.
* Const-ify some mchars arguments. I think these are non-const for historicalKristaps Dzonsons2011-11-081-2/+2
| | | | dumbness on my part.
* Fix mandoc_escape() function argument names. From a fix by AbhinavKristaps Dzonsons2011-10-181-3/+3
| | | | Upadhyay, thanks!
* If -Tman is specified and input is -man, echo the preprocessed (`so'Kristaps Dzonsons2011-10-061-0/+26
| | | | | | | | | | | | | | 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.
* Replace the old `An'/`Aq' AUTHORS note with `An'/`Mt'.Kristaps Dzonsons2011-08-181-1/+2
|
* Make sure constants in mandoc.3 use the `Dv' macro.Kristaps Dzonsons2011-07-111-5/+13
|
* Add more documentation for libmandoc.Kristaps Dzonsons2011-06-221-6/+51
|
* Document that spec2cp never returns 0.Kristaps Dzonsons2011-05-241-3/+1
|
* Remove all references to ESCAPE_PREDEF, which is now not exposed passedKristaps Dzonsons2011-05-241-24/+0
| | | | the libroff point. This clears up a nice chunk of code.
* Documentation: note COMPATIBILITY of -Tascii `?' printing in mandoc.1Kristaps Dzonsons2011-05-171-0/+2
| | | | | and remove some long-fixed notes in sthe same section. Also, add an `Lb' for the mandoc library to mandoc.3 (noted by Sascha Wildner).
* Flip on unicode output (via \[uNNNN]) in -T[x]html. Here we go!Kristaps Dzonsons2011-05-171-2/+12
|
* Documenting the mchars_XXXX part of mandoc.h.Kristaps Dzonsons2011-05-011-0/+86
|
* No code change: fixing spelling errors. From a patch by uqs@. Thanks!Kristaps Dzonsons2011-04-301-1/+1
|
* Add more documentation bits to mandoc.3.Kristaps Dzonsons2011-04-191-0/+72
|
* Skeleton of documentation functions, types, and variables in mandoc.h.Kristaps Dzonsons2011-04-091-0/+41
|
* Put mandocerrs and mandoclevels arrays into libmandoc with accessorsKristaps Dzonsons2011-03-281-1/+11
| | | | mparse_strerror() and mparse_strlevel().
* Step 3: consolidate manuals. The parse functions in mdoc.h, roff.h, andKristaps Dzonsons2011-03-221-0/+323
man.h are now part of libmandoc.h, so remove these from their respective manuals (they're no longer public-facing and we don't need a libmandoc.3 (yet?)). Before that, move the juicy data (parse tree syntax) into new-born mandoc.3. Peck around in Makefile and index.sgml to reflect reality.