From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-2.sys.kth.se (smtp-2.sys.kth.se [130.237.32.160]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id q2O2R5BN000391 for ; Fri, 23 Mar 2012 22:27:06 -0400 (EDT) Received: from mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 2833014E864 for ; Sat, 24 Mar 2012 03:27:00 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([130.237.32.160]) by mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) (amavisd-new, port 10024) with LMTP id xoVIMOHDUngy for ; Sat, 24 Mar 2012 03:26:57 +0100 (CET) X-KTH-Auth: kristaps [202.32.214.197] X-KTH-mail-from: kristaps@bsd.lv X-KTH-rcpt-to: discuss@mdocml.bsd.lv Received: from macky.local (197.214.32.202.bf.2iij.net [202.32.214.197]) by smtp-2.sys.kth.se (Postfix) with ESMTP id A2D5514D7E1 for ; Sat, 24 Mar 2012 03:26:53 +0100 (CET) Message-ID: <4F6D30E8.1080003@bsd.lv> Date: Sat, 24 Mar 2012 11:26:48 +0900 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 To: discuss@mdocml.bsd.lv Subject: mdocml version 1.12.1 available Content-Type: multipart/mixed; boundary="------------010504030707060106080002" This is a multi-part message in MIME format. --------------010504030707060106080002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, I'm pleased to announce mdocml 1.12.1, now at http://mdocml.bsd.lv/. Among many, many improvements, this release has an improved mandocdb(8) and the constellation of UNIX manpage tools (apropos(1), whatis(1), man.cgi(7)). I snuck a controversial bit into apropos(1) and whatis(1): if the terminal is a TTY, one can choose output from a list and see the manpage for it. These tools will need a lot of work -- the legacy tools have seen many years of polish and development -- but it's a start. For a full list of changes, see the attached ChangeLog. An abbreviated list of changes is on the NEWS section of the web-site. As usual, sources are at http://mdocml.bsd.lv/snapshots/mdocml.tar.gz. Thanks, Kristaps --------------010504030707060106080002 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="ChangeLog" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ChangeLog" 2012-03-23 22:18 kristaps * apropos.c: Forgot chdir(2) into volume path. 2012-03-23 22:07 kristaps * apropos.c, index.sgml: Small tweaks for release. 2012-03-23 21:54 kristaps * Makefile, index.sgml, whatis.1: Get ready for a version. 2012-03-23 21:46 kristaps * apropos.1, apropos.c, apropos_db.c, apropos_db.h, cgi.c: Be insane. Make apropos(1) subsume man(1). 2012-03-23 20:31 kristaps * apropos.c, apropos_db.c, apropos_db.h, cgi.c: Simplify by not pre-filtering the result vector for satisfied matches: we can do this in the frontend. 2012-03-23 20:30 kristaps * man.cgi.7: Whitespace fix. 2012-03-23 05:03 kristaps * cgi.c: Knock out useless & confusing whatis mode. 2012-03-23 02:52 kristaps * mandocdb.c: Improve mandocdb's ability to handle NAME sections by sucking the entire shebang into a buffer and parsing it that way. This improves on many cruddy -man manuals in the wild. 2012-03-23 01:50 kristaps * mdoc_argv.c, mdoc_validate.c: Make the `-width' field to `Bl' not puke if it doesn't have an argument. This makes mandoc work much, much nicer with Mac OSX manpages. 2012-03-23 01:45 kristaps * mandocdb.c: Clean up code a bit by pushing warnings into WARNING macro. 2012-03-23 01:07 kristaps * apropos_db.c, mandocdb.c: Merge some/most of schwarze@'s OpenBSD changes into mandoc: many more warnings about grokking manpages in their respective directories. DO NOT, however, import his temporary-file routines (I don't plan on staying with a recno/btree split) nor the realpath() routines, which destroy relative path-ness. Also pull in the lorder bits. There are some changes I started to make then stopped relating to reporting errors in the correct directories. I'll clean this up in subsequent commits. This puts us more or less on parity with OpenBSD. 2012-03-23 01:05 kristaps * Makefile: Remove some Mac OS crap in the Makefile. 2012-03-22 22:53 kristaps * Makefile: Don't run superfluous mkdir when installing. 2012-03-22 22:52 kristaps * apropos.c, mandocdb.h: Revert to mandocdb.{index,db} for database files. 2012-03-04 18:53 schwarze * TODO: two reminders 2012-02-26 16:47 schwarze * st.in: Correct the expansion of -xbd5; from Philip Guenther . OK Werner Lemberg . 2012-02-16 15:51 joerg * mandoc.h, read.c: Add mparse_readmem, which allows application to run the parser directly from memory, e.g. after de-compressing a document. 2012-02-05 11:46 joerg * read.c: Don't silently skip non-ASCII characters, but replace them with ``?''. This is less likely to break the syntax of macros. 2012-01-28 18:46 joerg * lib.in: Add libquota 2012-01-28 09:04 joerg * lib.in: Add libisns, libppath and libsaslc from NetBSD. Fix formatting of librt. 2012-01-28 09:02 joerg * arch.in: Add x86 pseudo architecure 2012-01-22 20:41 joerg * TODO: Add entry about the .TP / .RS crash before I forget about it again. 2012-01-13 10:27 joerg * mandoc.3: Reflect reality, mandoc_escape does not skip the "\" itself, but expects the caller to have done that. 2012-01-04 19:43 schwarze * mdoc_macro.c: Fix previous such that all .It HEADs are unparsed, not just the first one in each -diag list. While here, drop the needless if-statement and choose a more precise wording for the comment. ok kristaps@ 2012-01-03 10:17 kristaps * catman.c: Local variable initialisation. 2012-01-03 10:16 kristaps * man.7, man.c, man.h, man_html.c, man_macro.c, man_term.c, man_validate.c: Add support for `OP', one of the extended man macros. This also requires some man(7) changes to accomodate for the an-ext compatibility. 2012-01-03 05:18 kristaps * mdoc.7, st.in: Accommodate for ISO C11. groff applied the same `St' argument on 03/01/2012. From a tweaked patch (isoC-11 -> isoC-2011) by Ulrich Sporlein: thanks! 2012-01-02 10:48 kristaps * TODO, mdoc_macro.c: `-diag' lists aren't parsed, unlike other list types. This fixes a TODO entry raised by deraadt@. 2011-12-31 13:48 kristaps * man-cgi.css: Fix ID vs. CLASS for man.cgi CSS selector on results table and vertically align. 2011-12-31 13:47 kristaps * apropos.c, mandocdb.c: When parsing catpages, read from the first section (NAME, we hope) until the next section. Also, remove the limit of 72 characters and enforce this, instead in the apropos frontend. 2011-12-27 19:32 schwarze * mandocdb.c: Do not skip manuals shared across architectures when building databases. 2011-12-25 16:00 schwarze * mandocdb.8: Update the whatis.db database format. While here, reference apropos(1) from the description, inspired by the makewhatis(8) manual. 2011-12-25 14:35 kristaps * apropos.1, catman.8, demandoc.1, mandoc.1, preconv.1, whatis.1: State default usage before listing arguments of a utility. Inspired by a patch to mandocdb.8 by schwarze@ some time ago. Ok jmc@. 2011-12-25 14:31 kristaps * mandocdb.c: First memory leak in mandocdb.c freeing "struct of". Also properly const-ify several strings. 2011-12-25 12:49 kristaps * Makefile, catman.c, cgi.c: Continue changing mandoc.{index,db} into whatis.{index,db}. Use mandocdb.h to do so. 2011-12-25 11:53 schwarze * apropos.1, mandocdb.8, mandocdb.c, mandocdb.h, whatis.1: Use the traditional name "whatis.db" for the mandocdb(8) databases. Requested by deraadt@, ok kristaps@. 2011-12-25 09:58 schwarze * apropos_db.c, mandocdb.c, mandocdb.h: For binary compatability of the databases across architectures, use pointers to arrays, not pointers to structs. It is now possible to create databases on sparc64 and use them on i386 and vice versa. Kristaps@ can't think of anything else that might be required, either. Put this in now such that we can move on. 2011-12-25 08:08 schwarze * mandocdb.8, mandocdb.c: Implement test mode (makewhatis -t), required for pkg_create(8). Always do all consistency checks; when any one fails, decide whether to print a message, or skip the file, or both, or none. While here, do some cleanup as well: * Bail out on conflicting options. * Do not crash with -a if there are plain files in the root dir. * Collect some related variables into structs. Feedback and OK kristaps@. 2011-12-24 17:37 kristaps * apropos.1, catman.8, manpath.c, whatis.1: Support leading, trailing and double colons in MANPATH to prepend, append or insert the man.conf(5) default path; compatible with GNU manpath(1), implementation by kristaps@, heavily tweaked by schwarze@. Updates to MANPATH documentation applied to whatis.1, apropos.1, and catman.8 also. 2011-12-20 16:41 schwarze * apropos_db.c, mandocdb.c: Do not cast void pointers to pointers requiring alignment. This makes mandocdb(8)/apropos(1) work on strict alignment architectures. Basic way to fix this confirmed by deraadt@ and kettenis@, thanks. ok kristaps@ This now works on both sparc64 and i386, but note that the binary database format is still machine-dependent. 2011-12-18 13:51 kristaps * catman.8, catman.c: Give catman(8) the -C flag (like apropos and friends) and merge in some documentation from apropos(1) to be consistent. 2011-12-18 09:27 kristaps * compat_fgetln.c, compat_getsubopt.c, compat_strlcat.c, compat_strlcpy.c: Make compat files actually use compat.h. Ooops. 2011-12-16 15:06 kristaps * apropos_db.c, cgi.c: Two lint fixes. 2011-12-16 15:05 kristaps * cgi.c: Fix assertion found when plugging legacy man.cgi query string into my man.cgi. 2011-12-16 14:18 kristaps * man-cgi.css: Edge in a little style. Why not. 2011-12-16 13:37 kristaps * cgi.c: When routing to a "result" page in the cgi, remember our input parameters and repeat them in the search bar. This is handy. While here, make the QUERY_STRING parser a bit simpler. 2011-12-16 10:05 kristaps * man-cgi.css: Have results table inherit the small font. 2011-12-16 07:07 kristaps * apropos_db.c: Make sure that "any" is UINT64_MAX, not just INT_MAX, else "any" won't cover all types. Found after some database trawling. 2011-12-16 07:06 kristaps * apropos_db.c, apropos_db.h, catman.c, cgi.c, mandocdb.8, mandocdb.c: Make the stored "cat"/"mdoc"/"man" strings just be c/d/a single-character bytes. This cuts down a little in index size and allows for cleaner extraction of information. 2011-12-16 03:04 kristaps * catman.c, cgi.c, mandocdb.8, mandocdb.c: Make paths in the mandocdb(8) index relative to the databases' path prefix. This means that an index in, say, /usr/share/man will point to man1/foo.1 instead of /usr/share/man/man1/foo.1. Not only does this save a lot of space, it also allows manual trees to be moved around without any side effects to the mandocdb(8) databases. 2011-12-15 07:44 kristaps * man-cgi.css: Don't make man.cgi default font-size dictate manual style. 2011-12-15 07:18 kristaps * cgi.c, example.style.css, man-cgi.css: Further tweaks for output consistency. 2011-12-15 07:07 kristaps * man.cgi.7: Update man.cgi.7 with new CSS files. 2011-12-15 07:05 kristaps * Makefile, cgi.c, example.style.css, man-cgi.css, man.cgi.css: Some presentation polish in man.cgi: - include search bar above result page (I relent: it's annoying to follow three links then press back three times to get a search page); - make man.cgi.css into man-cgi.css so Apache isn't confused by two handlers (css, cgi); - finally consolidate example.style.css to be under the div.mandoc css selector; - put catman pages under div.catman; - put search bar under div#mancgi; - reflect this properly in the bundled CSS files. 2011-12-14 18:17 kristaps * index.sgml: Note that archives are being hosted at gmane. 2011-12-14 08:36 kristaps * cgi.c, man.cgi.7: Unbreak man.cgi's css directories when CSS_DIR isn't specified. 2011-12-13 16:09 kristaps * manpath.c: Remove stray warnx() left in the manpath.c code. 2011-12-13 15:56 kristaps * manpath.c, manpath.h: Have manpath.c properly use manpath(1), that is, using -C and -m and so on. This also cleans up the code a little bit. While here, make some functions static that are only used within manpath.c. 2011-12-13 06:26 kristaps * Makefile, compat_fgetln.c, config.h.post, config.h.pre, test-fgetln.c: Compatibility support fgetln() on Linux. This uses the BSD-licensed implementation from NetBSD tnftpd, Christos Zoulas (copyright message retained in the compat_fgetln.c file). Patch verified by schwarze@. He notes that you'll need -pthread for -static binaries (due to libdb), so I've noted that -static should really only be used for BSD UNIX. While here, add some forgotten goop to the Makefile, building and cleaning extra manpages. 2011-12-11 21:00 schwarze * apropos.1, apropos.c, catman.c, cgi.c, mandocdb.8, mandocdb.c, manpath.c, manpath.h, whatis.1: implement -C (alternative config file) for apropos(1) and mandocdb(8), including various tweaks to the whatis(8) manual; ok kristaps@ 2011-12-10 19:38 schwarze * roff.7: Explain where .so paths are rooted, and why, and discourage its use; feedback and ok jmc@, suggested by and ok kristaps@. 2011-12-10 19:24 kristaps * man.cgi.7: Ugh, environmental variables are Ev, not Er. Fix typos. 2011-12-10 19:23 kristaps * man.cgi.7: Note CSS_DIR in man.cgi.7. 2011-12-10 19:22 kristaps * cgi.c: When 303'ing a search directly to a page, remember to specify its manroot. Also allow for a CSS_DIR to specify alternate CSS locations. Finally, some clutter as I assume that "css" and "progname" are already HTML-safe. 2011-12-10 18:44 kristaps * index.sgml, man.cgi.7: Begin working on release notes. Also whitespace-fix man.cgi.7. 2011-12-10 18:31 kristaps * man.cgi.7: Update man.cgi.7 to note compatibility and running with multiple roots. 2011-12-10 18:09 kristaps * cgi.c: Slip in a fix to allow for empty cache directories. 2011-12-10 18:04 kristaps * cgi.c: Finishing touches on multi-manroot man.cgi. If more than one root is specified, write them out using a SELECT box. Else write nothing (the manroot will still be checked if it's specified). 2011-12-10 17:45 kristaps * cgi.c: Switch on "manpath=" handling, which I call the "manroot" (as "manpath" is reserved for paths within a manroot). This functionality is bare-bones: right now, the default manroot is the first one scanned from the cache directory. At some point this will be sexy and smooth, but it's easy to upgrade functionality by modifying pathgen() and so forth. If a manroot isn't parsed from the "manpath=", results are always empty. 2011-12-10 17:20 kristaps * cgi.c: Encode "manroot" into file URL and parse it properly. Right now this just uses the first manroot by default. 2011-12-10 17:01 schwarze * mandocdb.c: Avoid leaking index records: Before allocating a record for a file, first make sure we actually want to use the file. 2011-12-10 16:51 kristaps * cgi.c: Big upgrade and polish for cgi.c. - Deprecate kvals (key/value pairs for QUERY_STRING values). Since there's only one place that uses this, kval_parse (now http_parse()) dumps directly into struct query, which is more high-level. - Put query values directly into struct req. - The biggest difference is dynamic support for multiple "manroots". A "manroot" is a path with an "etc/catman.conf" file. When the cgi starts, it (prefix) recurses through its CACHE_DIR searching for "etc" directories. When one's found, it sees if a catman.conf file exists. This is marked as a manroot and appended to a list. The name of a manroot is the path without slashes (e.g., OpenBSD/4.9 -> "OpenBSD 4.9"). Right now "manroot" isn't enabled. The first manroot is chosen as the real one. I'll add the interface to it in the next checkins, but it'll be quite simple. 2011-12-10 16:46 kristaps * apropos_db.c: Plug a memory leak in single_search(). 2011-12-10 11:53 schwarze * mandocdb.c: Fix selection of arch-specific manuals: (1) Correctly compare cat vs. man paths. (2) Compare arch (and section) names case-insensitively. Problem noticed by kristaps@. 2011-12-10 06:00 kristaps * Makefile: Adding some missing "install" bits to Makefile. 2011-12-10 05:59 kristaps * cgi.c: FreeBSD's man.cgi uses a "default" value for no arch. 2011-12-09 19:06 kristaps * cgi.c: Add some periods (just to see if mlmmj is working again...). 2011-12-09 18:18 kristaps * cgi.c: Forgot to make whatis the default during abstraction. Do it again. 2011-12-09 06:29 kristaps * cgi.c: Abstract query extraction code. Perform some readability fixes while here. 2011-12-09 06:18 kristaps * apropos_db.c: When specifying an architecture to whatis(1)/apropos(1)/man.cgi(7), do a comparison only if the manual specifies an architecture, otherwise let it through. Looked over by schwarze@. This brings us much more in line with OpenBSD's behaviour. 2011-12-09 06:16 schwarze * mandocdb.c: Tweak pformatted(): * If the first section is empty, use the file name as .Nd. * No need to check (len > 0) after successful fgetln(3). * Improve some comments and strip trailing whitespace. ok kristaps@ 2011-12-08 20:21 kristaps * mandocdb.c: Considerably tidy mandocdb(8) catman descriptions by skipping to the first hyphen-space combo, not the last hyphen as done previously. 2011-12-08 19:49 kristaps * mandocdb.c: Strip backspace encoding from preformatted manuals. This cleans up a lot of catpage entries in the mandoc databases. 2011-12-08 17:47 kristaps * cgi.c: If no man.cgi `whatis' results are found, offer a quick link to the apropos query mode. 2011-12-08 13:39 kristaps * cgi.c: Fix stupid typo: strlcpy() instead of strlcat(). 2011-12-08 04:19 kristaps * mandocdb.c: Clean up grok of preformatted manual description. (1) put fclose() at the end, as line isn't valid afterward (see fgetln()) (2) clean up loops to be more readable to my old eyes (3) mandate trailing newline, nul-terminate, and use strrchr 2011-12-07 21:24 schwarze * mandocdb.c: bugfix: make reclaiming of index slots actually work; index_prune always counted the free slots, but didn't tell anybody about them, so they weren't reused 2011-12-07 20:00 kristaps * mandocdb.c: If arguments are passed to mandocdb(8) in "default" mode, then use realpath() to convert them into absolute paths before putting the traversed subdirectory filenames into the index. 2011-12-07 19:48 kristaps * cgi.c: Look for man.cgi files in the cache, not under the volume path. 2011-12-07 19:20 kristaps * catman.c: First, remove the catman(8) jobstart() stuff. It only copies files. Second, when creating the destination filename, append the index's file (which is an absolute path) to the cache directory, not to the index's directory name. 2011-12-07 11:18 kristaps * cgi.c: Tweak to make man.cgi's search results validate properly. 2011-12-07 11:08 kristaps * apropos.c, cgi.c: Apropos and man.cgi should strcasecmp their output sorting. man.cgi should sort in the first place -- it wasn't before. Revert uppercasing of man.cgi title. 2011-12-07 10:55 kristaps * cgi.c, man.cgi.css: Add skeleton man.cgi.css file. I don't think this should become more complicated than this. Also make the title be printed out in caps as it is in apropos(1) and whatis(1). 2011-12-07 10:12 kristaps * cgi.c: Accept old-school man.cgi parameters like "sektion" and "query". This still needs work because specifying an arch with "arch=i386" will return results that don't have an arch specified. I think this is weird, but it will need to be supported if we want backwards compatibility. 2011-12-07 08:00 kristaps * Makefile, cgi.c, man.cgi.7: Have a whatis/apropos mode, with the default (hitting enter within the expression text) be whatis. This is a much nicer default than apropos, which can be scary. While here, fix the cat.css location (erroneously put in the response page instead of the catman page) and add bits for a default style-sheet. 2011-12-07 06:59 kristaps * Makefile: Make installing CGI a bit easier. 2011-12-07 06:52 kristaps * Makefile, cgi.c: By default, man.cgi should compile with -static (this was unset by mistake). Also, set a custom CSS for man.cgi catman files. 2011-12-06 20:57 schwarze * mandocdb.c: Implement search support for 24 additional macros, extract more information from Fn, and lift section restrictions from An Cd Er Ev Fn Fo In Pa St Va Vt by removing 4 handler functions and 50 lines of code. ok kristaps@ 2011-12-06 19:23 kristaps * cgi.c: Add cat2html functionality. This keeps track of italic/bold mode per line and properly handles some funny troff-isms we've exposed. I originally wanted to use man2html.c (found on W3's website with no known author) but the code is dodgy. This will need some more work (links, etc.) but does a decent job thusfar. Note: I think it's better style NOT to use
, and instead
	  have each line employ 
afterward. This allows browsers to break the lines if necessary. This can be changed trivially (replacing the newline and pre tags with the
and new tag). 2011-12-04 19:41 schwarze * TODO: must ignore \h with quoted argument 2011-12-04 18:10 schwarze * man_term.c, term.h, term_ascii.c: Implement mdoc(7)-like output style variant for man(7) documents: * one instead of three blank lines after the page header; * one instead of three blank lines before the page footer; * source instead of title(section) in the lower right corner. Select this style variant with the undocumented command line option -Omdoc. In the long run, we hope to unify the ouput of both languages and to pull this out again, but that requires coordination with groff. Grudgingly ok and, (as usual,-) more comments requested by kristaps@ 2011-12-04 17:52 kristaps * catman.8, catman.c, cgi.c, man.cgi.7: Make catman and man.cgi understand the index type-field. Also make catman's man.conf be generated as catman.conf to avoid clobbering a real man.conf file. Finally, add a placeholder catman() function to man.cgi for preformatted manuals in the cache. 2011-12-04 09:23 schwarze * mandocdb.c: Fix parsing of file names given on the command line; i broke it when adding support for formatted manual pages. 2011-12-03 19:44 schwarze * man_html.c, man_macro.c, man_term.c: Jumping out of man_unscope() for the root node is a bad idea because that will skip root node validation, potentially entering rendering modules will NULL pointers lurking in the meta data. Instead, always validate the root node and (as suggested by joerg@) assert validity of the meta data before using it in the renderers. ok joerg@ 2011-12-03 18:59 schwarze * mdoc_macro.c: Remove an OpenBSD-specific tweak regarding .Xr spacing and make it compatible with groff-1.21. This tweak was originally added for compatibility with groff-1.15, which is no longer needed. ok jmc@ kristaps@ 2011-12-03 13:47 kristaps * apropos_db.c, mandocdb.c: Back out lorder, which doesn't seem necessary (?). I think this means all fields are endian-neutral, although the recno(3) key is unknown. 2011-12-03 11:58 schwarze * mdoc_validate.c: When processing .Sh HEAD, as soon as we know which section this is, fix up the section attributes of the HEAD, it's parent BLOCK, and all its (text) children. This is required because the section attributes get set when each node is allocated, i.e. before processing the content of the node itself. Thus, the listed nodes got the section attribute of the preceding section. No need to fix up the BODY, all is fine there already. Found while implementing TYPE_Sh for mandocdb(8). OK and comment requested by kristaps@. 2011-12-03 11:08 schwarze * mandoc.c: ISO style "%Y-%m-%d" dates are common in man(7) .TH. They have been considered valid in the past, but were reformatted to the mdoc(7) "Month day, year" style. To make page footers more similar to groff, no longer reformat them, just print them as they are. This doesn't change anything with respect to what's considered valid or what is warned about. ok kristaps@ 2011-12-03 07:09 kristaps * apropos_db.c, mandocdb.c: Make sure the btree(3) goop is also BE. This covers both the DB metadata and prior commits handle the contained binary fields. 2011-12-01 20:37 schwarze * Makefile, libmandoc.h, libmdoc.h, man.7, man_validate.c, mdoc_validate.c, msec.c: In man(7), when no explicit volume name is given, use the default 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 2011-12-01 19:21 kristaps * apropos_db.c, config.h.post, mandocdb.8, mandocdb.c: This is a little gross: Linux and Apple need lots some cajoling to work with byte-swapping. Tested on Mac. Any Linux machines somebody can test on? Anybody? While here, note the correct byte-size in mandocdb(8) and also note field widths and endianness. The btree is now endian-neutral. 2011-12-01 18:55 kristaps * apropos_db.c, mandocdb.c: Use OpenBSD's endian functions. Make btree type also be endian-neutral. 2011-12-01 18:46 kristaps * apropos_db.c, mandocdb.c: In apropos_db.c, move all btree reading (and safety checks) into the btree_read() function. Also, add a forgotten free() for the type of grokked record. Then in both mandocdb.c and apropos_db.c, make the "rec" field of the btree by in network-order. 2011-12-01 16:05 kristaps * mandocdb.8, mandocdb.c: Fix mandocdb(8) to pass over the type when pruning the database. This fixed `-d' perpetually adding the same files. While here, clean up the code and document it. Remove -vv (complain if you want it back in). Document the error messages in a DIAGNOSTICS section of mandocdb(8). 2011-11-29 06:21 kristaps * index.sgml: Add whatis(1) to www and start version information. While here, change "mdoc macro compiler" to "UNIX manpage compiler", which is more correct. I'm not sold on this language; I may end up just going with mandoc(1)'s notation. Note also that our archives are now hosted at gmane. 2011-11-29 06:17 kristaps * mandocdb.8: Note that mandocdb(8) record type is 64-bit and show all possible values. Also slightly clarify the role of mdoc/man/cat. Finally, remove mandoc(1) reference (it's not mentioned in the manual). 2011-11-29 05:59 kristaps * apropos.1, whatis.1: Snip some whitespace from apropos(1) and remove mandoc(1) ref from whatis(1) (both apropos/whatis aren't related to mandoc from an operator's perspective). 2011-11-29 05:53 kristaps * apropos.1, apropos.c, apropos_db.c: Make `-i' only apply to regular expressions. For the equality operator (and thus the default), always use strcasestr(). Discussed on tech@ with schwarze@. While here, fix the apropos.c usage() message to be consistent with apropos(1) and clean up the EXAMPLES in apropos(1). 2011-11-28 19:41 kristaps * apropos.1: Add tables of matchable keys into apropos.1. Ok and with feedback by schwarze@. 2011-11-28 19:34 schwarze * mandocdb.c: chdir(2) to the right man page tree before parsing manuals; ok kristaps@ 2011-11-28 05:10 schwarze * Makefile: Backout -DUSE_MANPATH that sneaked in; ok kristaps@. 2011-11-28 04:44 schwarze * apropos.c, apropos_db.c, whatis.1: Tweak whatis(1): * Bugfix: Use all arguments, not just the last one. * Use 'Nm~' instead of 'Nm,Nd~' to match OpenBSD behaviour. * For the progname, accept '^whatis', not '^whatis$' to ease testing. ok kristaps@ 2011-11-27 20:37 schwarze * mandocdb.8: Discuss the default behaviour up front before talking about options modifying it; based on a remark by kristaps@. While here, mention parsing of unformatted files and the changed index format and fix a few minor issues. 2011-11-27 18:27 schwarze * mandocdb.c: Reimplement the global command line options -a and -v as static global variables, reducing the maze of arguments passed around among various static functions. Suggested by kristaps@. 2011-11-27 18:11 schwarze * apropos_db.c, apropos_db.h, mandocdb.c: Save the manual type (mdoc, man, or cat) in the index file of the mandoc databases, as suggested by kristaps@. Given the well-structured code, this is surprisingly simple. This changes the mandoc.index database format. Run "sudo mandocdb" to regenerate your databases. 2011-11-27 17:57 schwarze * mandocdb.c: Rudimentary handling of formatted manuals ("cat pages"). Coded on the train back from p2k11 in Budapest. Kristaps has seen the patch and agreed with the direction. 2011-11-27 13:54 kristaps * apropos.c, apropos_db.c, apropos_db.h, whatis.1: Get us a whatis(1) mode for apropos(1). This is from a patch to tech@ as critiqued by schwarze@, checked in to get the ball rolling. 2011-11-27 06:46 kristaps * Makefile, catman.c, cgi.c, man.cgi.7: Removing INSECURE mode. This is a work in progress! Logic for formatting manpages is now linked into man.cgi. 2011-11-26 17:38 schwarze * apropos.1, apropos.c, apropos_db.c, apropos_db.h, mandocdb.c, manpath.c: Sync to OpenBSD, mostly gratuitous and whitespace differences, but a few serious things as well: * -M overrides MANPATH * -m prepends to the path * put back database close calls that got lost in mandocdb * missing sys/types.h in manpath.c, needed for size_t ok kristaps@ 2011-11-26 14:54 kristaps * catman.8, catman.c, manup.8, manup.c: Rename manup(8) to catman(8), which Linux already uses for a similar tool. 2011-11-26 06:23 schwarze * mandocdb.8, mandocdb.c: Store page titles in the correct case, and by default, only put stuff into the database that man(1) will be able to retrieve. However, support an option to use all directories and files. feedback and ok kristaps@ 2011-11-24 07:54 kristaps * mandocdb.c: I say that mandocdb(8) uses "man(1)'s method", but it doesn't. It just uses the configuration file and ignores MANPATH. Everybody else uses MANPATH (being apropos and man), so why shouldn't we? 2011-11-24 07:43 kristaps * Makefile, man.cgi.7: Make a small manual for how to run man.cgi. This exists almost entirely to document that /tmp must exist in a jailed Apache directory for dbopen() not to fail. This was a massive headache to track down. 2011-11-24 07:27 kristaps * cgi.c: Let man.cgi run in two modes: (1) Insecure. This means that we're operating over the full file-system with access to mandoc(1). In this mode, mandocdb entries are formatted on-the-fly. The $INSECURE environment variable must be passed to man.cgi for this mode to work. (2) Secure. Manuals are assumed to be pre-formatted in a cache directory, which may be set with $CACHE_DIR but default to /cache/man.cgi. This mode works with manup(8), which updates the cached pages from outside of the jail. man.cgi simply locates the manual file and outputs it to stdout. 2011-11-24 07:22 kristaps * manup.c: Have manup(8) put relative paths in its output man.conf. This lets us have arbitrarily-located cache directories for man.cgi. 2011-11-24 05:44 kristaps * manpath.c, manpath.h: Allow man.conf file to be assignable. 2011-11-24 05:43 kristaps * manpath.c, manpath.h: Export the manpath_manconf() function, slightly reorderng manpath.c while doing so. This will be used by a jailed man.cgi, as the cache built by manup(8) creates a man.conf for it to use. 2011-11-24 05:33 kristaps * Makefile, manup.8, manup.c: Add manup(8). This runs through mandocdb(8) databases (in the same way that apropos(1) does so) and updates an HTML fragment cache for use by man.cgi. Right now man.cgi is "online" in that it requires mandoc(1) in its path, but this doesn't work for, say, OpenBSD's apache chroot(1). This allows a cache to be maintained. 2011-11-23 05:26 kristaps * index.sgml: Add pkgsrc to downstream. Ok'd Thomas Klausner. 2011-11-23 05:09 kristaps * apropos.1, mandoc_char.7: Fix whitespace in manuals. 2011-11-23 05:01 kristaps * cgi.c: man.cgi works for the non-jailed case. In other words, if you smash this into a cgi-bin directory, it will Just Work for your system's manuals (it of course needs access to mandoc(1) and your file-system, hence "non-jailed"). The notion of a jailed case is much more subtle and being worked on now. 2011-11-23 04:56 kristaps * Makefile: Adjust Makefile for manpath.{c,h} linking. 2011-11-23 04:55 kristaps * apropos_db.c, apropos_db.h: Let apropos_db.h export the volume of manpages for a parsed record. This is necessary since an array of records can have duplicate record numbers in different mandoc.index files. The volume [right now] is just the index of the parsed mandoc.index in the manpaths. This is sensible because the order of the manpath is significant (it's the order of duplicate-named manuals displayed by man(1)) and is thus not likely to change. 2011-11-23 04:52 kristaps * mandocdb.8, mandocdb.c: Have mandocdb(8) take advantage of manpath.h. This brings it in line with makewhatis(8), which, like apropos(1), will use man.conf (or manpath(1)) if no manpath entries are provided. 2011-11-23 04:50 kristaps * apropos.c: Have apropos(1) take advantage of manpath.h instead of doing the work itself. 2011-11-23 04:47 kristaps * manpath.c, manpath.h: Support for Open/NetBSD's /etc/man.conf and others' manpath(1). Most of this code (except the manpath part) written by schwarze@. This isn't hooked into anything yet. 2011-11-22 21:12 schwarze * roff.7: typo reported by Steffen Daode Nurpmeso and remove a trailing blank noticed by jmc@ 2011-11-21 17:19 kristaps * roff.7: Update historical record to be historical and not made-up. Data from . Ok schwarze@ (with modifications) and Jason McIntyre. 2011-11-20 16:36 kristaps * Makefile, apropos.1, apropos.c: Initial support for man.conf/makepath(1). 2011-11-20 11:29 kristaps * apropos.1, apropos.c, apropos_db.c: Clarify some behaviour, bringing schwarze@'s patch and mine closer together (although I still don't have -M, which is a big piece). First, the default search path is the cwd. This will change to use -M once I look over that code. If MANPATH is specified, this replaces the cwd. Both of these are augmented by -m. If paths don't exist or don't have databases, they're silently ignored. This makes perfect sense: you may be given a superset of possible paths. The corner case of no paths (where, say, MANPATH consists of bogus paths or the cwd is unreadable) simply means that no paths are searched. 2011-11-20 10:45 kristaps * apropos_db.c: Ooops... tiny type error slipped in. 2011-11-20 10:43 kristaps * apropos.1, apropos.c, apropos_db.c, apropos_db.h: Integrate a moderately-patched version of schwarze@'s support for multiple directories containing mandocdb(8) databases. Some changes follow: (1) don't support -M yet; (2) fall back to cwd if no prior manpath has been specified; (3) resolve manpages using realpath() to prevent consecutive chdir()'s over relative paths; (4) note where further error-reporting is required; (5) fix leaking memory on exit in several cases. 2011-11-20 07:46 kristaps * apropos_db.c: Fix white-space in apropos_db.c to make merging cleaner. 2011-11-20 07:39 kristaps * apropos_db.c, cgi.c, mandocdb.c, mandocdb.h: Merge schwarze@'s work for 64-bit types. This is based on a tweaked patch submitted to tech@ on 16/11/2011, 01:39. It has been updated to account for the logical-operator functions and to avoid keeping a live pointer into the DBT value, which is not guaranteed to be consistent across calls into the bdb library. 2011-11-19 08:29 schwarze * mdoc_validate.c: Improve misleading comment: * Not sure there were any text nodes, might have been other stuff instead. * Not sure it was just one node, maybe several were deleted. * No problem if some nodes were deleted, as long as some valid ones are left. * We do not leave early, but after cleaning out all the crap. * We are not "bailing", but we consider the block valid after cleanup. 2011-11-18 12:06 joerg * man_macro.c: Fix condition. Not enough tea. 2011-11-18 12:05 joerg * man_html.c: Don't depend on snprintf to handle NULL strings. Deal with missing date. 2011-11-18 12:04 joerg * man_term.c: Don't crash if the date can't be extracted. Don't depend on snprintf handling NULL strings. 2011-11-18 11:43 joerg * man_macro.c: Slightly adjust last: return successful as some times the correct error is raised later. 2011-11-18 11:39 joerg * man_macro.c: Convert an assert into an explicit check. man_unscope can be triggered on unknown macros. 2011-11-18 09:58 joerg * mdoc_validate.c: Bail out explicitly on invalid .Rs content like: .Rs plain text .Re This avoids a crash on invalid. 2011-11-18 02:02 kristaps * apropos.1, apropos.c, apropos_db.c, apropos_db.h: Evaluation with logical subexpressions. This allows support for arbitrary, nested logical subexpressions with AND (-a) and OR (-o) support. 2011-11-17 12:41 schwarze * TODO: using undefined macros or strings should define them to be empty 2011-11-17 09:57 kristaps * mandocdb.h: Guard mandocdb.h inclusion. 2011-11-16 17:39 joerg * man.c: Correctly handle constructs like .TP 8 .SH foo 2011-11-14 10:10 schwarze * mandoc_char.7: Add lots of information about special characters that's actually needed in practice, and discourage using fancy characters in manuals. Text about "Dashes and Hyphens" by jmc@. Feedback and ok jmc@, grudgingly ok kristaps@. 2011-11-14 05:07 kristaps * apropos.c, apropos_db.c, apropos_db.h: Have exprcomp() accept a string instead of an array-pointer. Also, collapse the arguments in apropos(1) into a single string passed to exprcomp(). Ok schwarze@. 2011-11-13 10:33 schwarze * man_term.c: Make the man(7) page footer the same as in groff. 2011-11-13 09:50 schwarze * mandoc.1: typo: overful -> overfull; thanks to jmc@ 2011-11-13 08:15 schwarze * man_term.c, mandoc.1, mdoc_term.c, term.h, term_ascii.c: Make the default left text margin configurable from the command line, just like the default right margin already is. This may be useful for people with expensive screen real estate. Besides, it helps automated man(7) to mdoc(7) output comparisons to validate -Tman output. ok kristaps@ on an earlier version 2011-11-13 06:10 schwarze * apropos.c, apropos_db.c, apropos_db.h: Rewrite the expression parser for a more concise syntax: apropos [search_type[,...]=]substring apropos search_type[,...][,i]~regex ... and expression evaluation must take the search type into account. This allows to: * drop the global -I option and * drop the enum match, just using a boolean int. "go ahead" kristaps@ 2011-11-13 05:49 schwarze * Makefile, apropos_db.c, apropos_db.h, cgi.c, mandocdb.c, mandocdb.h: Inventing new keywords for mostly the same thing when a well-established set of keywords already exists is a bad idea, so reuse the mdoc(7) macro names as apropos(1) search types. This is a gain in brevity as well. Some time ago, kristaps@ agreed in principle. The search type bit field constants are used by both mandocdb(8) and apropos(1) and should better stay in sync, so give them their own header file. 2011-11-13 05:12 schwarze * Makefile, apropos.c, apropos.h, apropos_db.c, apropos_db.h, cgi.c, db.c: Less misleading file names; ok kristaps@. 2011-11-13 05:02 schwarze * TODO: another detail to implement; long live the tricky exceptions! 2011-11-12 19:53 schwarze * mandocdb.c: Fix two crashes that occur when walking very large (i.e. real-world) trees: 1) Avoid excessive, needless recursion, lest you overflow the stack; 2) Close all dir file descriptors, lest you run out of descriptors. ok kristaps@ 2011-11-09 18:31 kristaps * db.c: Use proper infix expressions and provide a default. (Exact match.) 2011-11-09 17:05 kristaps * apropos.c, apropos.h, cgi.c, db.c: Make apropos's lookup use a find(1)-like expression. I'll write more on this when it completes; this is to keep it in-tree. Right now this uses prefix notation. Ignore it. I'll make this into infix notation real soon. The goal of this (exprcomp and exprexec) is to have arbitrary logical expressions. 2011-11-09 05:53 kristaps * apropos.1, apropos.c: Change getopt() to be more like schwarze@'s suggestions. 2011-11-08 20:24 kristaps * Makefile, apropos.c, apropos.h, cgi.c, db.c: Split apropos.c into db.c and apropos.h with simpler code (re-written, but inspired by apropos.c and mandoc-tools' mandoc-cgi.c). This uses UTF-8 right now for its re-writing, but will soon accomodate for the regular suspects (this is a rather simple matter). I also introduce man.cgi (cgi.c), which is a standalone CGI that replaces mandoc-tools' mandoc.cgi. Right now it's just a framework. 2011-11-07 19:15 kristaps * chars.c, mandoc.3, mandoc.h: Const-ify some mchars arguments. I think these are non-const for historical dumbness on my part. 2011-11-06 20:24 schwarze * TODO, libman.h, man.c, man_macro.c, man_validate.c, mandoc.h, read.c: When the HEAD scope of .TP is broken by another block macro, 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@ 2011-11-06 09:43 kristaps * mandoc.c, roff.7: Accomodate for \f(Cx formatting. Noted by Andreas Vogele, thanks! 2011-11-03 16:48 schwarze * man_validate.c: When .TH sets no data, leave the date field in the page footer blank, do not use the current date. This removes a gratuitous output difference with respect to groff. ok kristaps@ 2011-11-03 16:36 schwarze * mdoc_term.c, mdoc_html.c: Correct .Eo spacing: no space between the delimiters and the enclosed text. The mdoc_html.c part was added by kristaps; ok kristaps@. 2011-11-01 10:59 schwarze * mdoc.7: Clean up the description of .Dt: - Volume and arch are both optional and not alternatives. - Zap verbiage about what's obvious from the synopsis. - For fixed argument strings, use .Cm, not .Ar. Using lots of input from jmc@. Also, state that the list of valid architectures varies by OS. If a downstream distribution wants to provide a specific list, maintaining a local patch is the way to go. 2011-10-24 17:47 schwarze * mdoc_man.c: Implement missing enclosures (Ao Do Qo Qq So Bro Brq) and enclosure-like in-line macros (Ad Cd Dv Er Ev Li Ms Tn). The .No macro works without explicit implementation. ok kristaps@ 2011-10-24 17:41 schwarze * roff.c: Handle infinite recursion the same way as groff: When string expansion exceeds the recursion limit, drop the whole input line, instead of leaving just the string unexpanded. ok kristaps@ 2011-10-24 16:30 schwarze * mandoc.c: Handle \N numbered character escapes the same way as groff: If \N is followed by a digit, ignore \N and the digit. If \N is followed by a non-digit, the next non-digit ends the character number; the two delimiters need not match. Kristaps calls that "gross, but not our fault". For now, i'm fixing \N only. Other escapes taking numeric arguments may or may not need similar handling, but \N is by far the most important for practical purposes. ok kristaps@ 2011-10-20 16:27 schwarze * mdoc_man.c: Implement the missing text production macros (Bsx Bx Dx Fx Nx Ox Ux Bt Ud). Some macros work without explicit implementation (At Db Os St). ok kristaps@ 2011-10-18 09:25 kristaps * mandoc.3: Fix mandoc_escape() function argument names. From a fix by Abhinav Upadhyay, thanks! 2011-10-16 12:25 schwarze * arch.in, lib.in: Sync to groff, and add tier I and II NetBSD architectures. ok kristaps@ 2011-10-16 08:20 schwarze * man_validate.c, mdoc_html.c, mdoc_macro.c, mdoc_term.c, mdoc_validate.c, term_ps.c: Remove a bunch of useless assignments, and assert that print_bvspace cannot be called on NULL pointers. No change in behaviour, none of these were bugs, but the code becomes easier to understand. Based on a clang report posted by joerg@; ok kristaps@. 2011-10-09 18:10 schwarze * man_html.c, mdoc_html.c: Always print column widths in -T[x]html; if desired, they can be overridden in the CSS file. Suggested by kristaps@, and i always like to simplify code. 2011-10-09 17:37 schwarze * mandoc.1: A bit more precision and nicer wording in the descriptions of -Ofragment and -Tman; using input from jmc@ and kristaps@. 2011-10-09 06:46 kristaps * apropos.c: Make apropos results-gathering able to error out and clean up before making the utility exit non-zero. 2011-10-09 06:37 kristaps * apropos.c: Remove some unnecessary variables and note that mchars_alloc never returns NULL. 2011-10-09 06:35 kristaps * apropos.c: Use a binary tree (for now, unbalanced) for deduping the records in the results array. This is much faster than the previous method, a linear search, at a small cost. Note that array offsets are used instead of storing the res pointer because we may realloc the results vector. 2011-10-09 04:56 kristaps * mandocdb.8: The documented flags in mandocdb (-u, -d) were switched. Fix this. --------------010504030707060106080002-- -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv