summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Drop Nd from the mpages table, it is still in the keys table.Ingo Schwarze2014-01-065-28/+7
| | | | | This shrinks the database in standard mode by 3%, in -Q mode by 9%, without loss of functionality.
* Joerg Sonnenberger contributed copyrightable amounts of text toIngo Schwarze2014-01-066-0/+6
| | | | | | some files. To make it clear that he also put his contributions under the ISC license, with his explicit permission, add his Copyright notice to the relevant files. No code change.
* Cope with mparse_alloc() interface change.Ingo Schwarze2014-01-052-2/+2
|
* Add an option -Q (quick) to mandocdb(8)Ingo Schwarze2014-01-0510-29/+90
| | | | | | | | | | | | | | | 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.
* Tag functions with format strings as arguments as printf-like.Joerg Sonnenberger2014-01-054-2/+11
| | | | | Fix one case where a non-literal is used as format string. Fix another case where a variable is formatted using the wrong type.
* Merge NetBSD's r1.4: Rename data to getdata to work around bugs in theJoerg Sonnenberger2014-01-051-4/+4
| | | | PPC64 toolchain.
* Rip out the complete "reachable" checks, without replacement.Ingo Schwarze2014-01-051-68/+6
| | | | | | | | | | | | | | It's a pity i spent time during t2k13 writing this; however, when an entire concept is busted, let us not look back, There is no such thing as an unreachable page. Even if you are crazy enough to put a page starting with ".Dt NAMEI 9" into a file man1/cat.1, we now make sure that it can be found by all of the following: Nm=namei Nm=cat sec=1 sec=9 It will always be displayed as: cat(1) - pathname lookup So you know that you have to type `man cat` to get at it. That obsoletes the concept of "unreachable manuals" for good.
* Remove the obsolete file name column from the mpages table.Ingo Schwarze2014-01-052-36/+30
| | | | | This column wasn't helpful because one manpage can have multiple MLINKS. Use the file name column in the mlinks table, instead.
* Remove the obsolete sec and arch columns from the mpages table.Ingo Schwarze2014-01-052-10/+6
| | | | | They were confusing because a manpage can have MLINKS in different sections and architectures.
* Reimplement apropos -s NUM -S ARCH EXPR by internally converting it toIngo Schwarze2014-01-052-23/+55
| | | | | | | | | | | | | | | apropos \( EXPR \) -a 'sec~^NUM$' -a 'arch~^(ARCH|any)$' in preparation for removal of sec and arch from the mpage table. Almost no functional change except for the following bonus: This also makes sure that for cross-section and cross-arch MLINKs, all of the following work: apropos -s 1 encrypt apropos -s 8 encrypt apropos -s 1 makekey apropos -s 8 makekey While here, print error messages about invalid regexps to stderr.
* Put section and architecture info into the keys table,Ingo Schwarze2014-01-053-2/+14
| | | | | | | | | | in preparation for removing them from the mpages table, aiming for cleaner and more uniform interfaces. Database growth is below 4%, part of which will be reclaimed. As a bonus, this allows searches like: ./obj/apropos An=kettenis -a arch=ppc ./obj/apropos An=kettenis -a sec~[^4]
* New implementation of complex search criteria using \(, \), -a becauseIngo Schwarze2014-01-041-55/+91
| | | | | | the old implementation got lost in the Berkeley to SQLite switch. Note that this is not just feature creep, but required for upcoming database format cleanup and simplification.
* Put mansearch.{h,c}, manpage.c, and compat_ohash.{h,c}Ingo Schwarze2014-01-041-2/+7
| | | | into the distribution tarball. Bump VERSION.
* Put ./configure into the distributin tarball.Ingo Schwarze2014-01-041-1/+3
|
* Use C99 uint32_t, not BSD-style u_int32_t.Ingo Schwarze2014-01-042-3/+3
| | | | Needed for Solaris 10 as reported by Matthias Scheler.
* Even though strnlen(3) is required by POSIX 2008,Ingo Schwarze2014-01-046-9/+66
| | | | | | Matthias Scheler reports than Solaris 10 lacks it. While here, sort the declarations in config.h and move the headers to the top.
* Clean up feature tests:Ingo Schwarze2014-01-048-72/+86
| | | | | | * Split the configure steering script out of the Makefile. * Let the configure step depend on the test sources. * Clean up the test programs such that they can be run.
* Avoid "utf8" in the names of a function and a struct memberIngo Schwarze2014-01-021-18/+18
| | | | | that don't necessarily have anything to do with UTF-8. Just renaming, no functional change.
* Do not put UTF-8-encoded strings into the database by default, use ASCII.Ingo Schwarze2014-01-021-16/+34
| | | | Just like for mandoc(1), provide a -Tutf8 option for people who want that.
* Polish the mlink_add() interface:Ingo Schwarze2014-01-021-26/+20
| | | | | Allocate memory inside, not in the callers. No functional change.
* Check all MLINKS for consistency with the content of the manual page,Ingo Schwarze2014-01-021-42/+59
| | | | | not just the first one. This doesn't change how the check is done, but just which MLINKS are checked.
* Since the functions in read.c are part of the mandoc(3) library,Ingo Schwarze2014-01-022-17/+49
| | | | | | do not print to stderr. Instead, properly use the mmsg callback. Issue noticed by Abhinav Upadhyay <er dot abhinav dot upadhyay at gmail dot com> and Thomas Klausner <wiz at NetBSD>.
* Support .St -p1003.1-2013, "IEEE Std 1003.1-2008/Cor 1-2013".Ingo Schwarze2013-12-312-0/+3
| | | | | | | | | | | | | | Note that the POSIX-2008 standard remains in force, so please refrain from wholesale 2008 -> 2013 replacements. Make sure to only use the new -p1003.1-2013 argument for cases where "IEEE Std 1003.1(TM)-2008/ Cor 1-2013, IEEE Standard for Information Technology--Portable Operating System Interface (POSIX(R)), Technical Corrigendum 1" actually changes something in the standard with respect to the specific function documented in the manual you touch. Otherwise, please continue using .St -p1003.1-2008. Triggered by a similar, but slightly incorrect patch from jmc@; ok guenther@.
* Simplify: Remove an unused argument from the mandoc_eos() function.Ingo Schwarze2013-12-316-9/+9
| | | | No functional change.
* Provide strcasestr(3) and strsep(3) for Solaris 10 compat;Ingo Schwarze2013-12-316-1/+192
| | | | reported missing by Matthias Scheler <tron at NetBSD> via wiz@.
* Do not trigger end-of-sentence spacing by trailing punctuationIngo Schwarze2013-12-311-19/+0
| | | | | | | | | | | | | | | | | | | | at the end of partial implicit macros. Prodded by jmc@. Actually, this is a revert of rev. 1.64 Fri May 14 14:09:13 2010 UTC by kristaps@, with this original commit message: "Block-implicit macros now up-propogate end-of-sentence spacing. NOTE: GROFF IS NOT SMART ENOUGH TO DO THIS." Please speak after me: Then why the hell should we? We already weakened this in rev. 1.93 Sun Jul 18 17:00:26 2010 UTC, but that weakening was insufficient. Let's take it out completely. Admittedly, there are two places in OpenBSD base where what Kristaps did make the output nicer, in calloc(3) and in fish(6). But both are atypical. There are 18 other places where this revert makes the output nicer, the typical case being: "Mail status is shown as ``No Mail.'' if there is no mail." You do *not* want the EOS spacing after ``No Mail.'' in that sentence.
* Yet another regression introduced by Kristaps when he switched fromIngo Schwarze2013-12-311-33/+5
| | | | | | | | | | | | | | Berkeley DB to SQLite3: In the .In parser, the logic got inverted. The resulting NULL pointer access was found by clang; scan log provided by Ulrich Spoerlein <uqs at FreeBSD>. The best fix is to simply remove the whole, pointless custom handler function for .In and let the framework do its work. Now searching for included header files actually works. While here, remove the similarly pointless custom .St handler, fix the return value of the .Fd handler and disentangle the spaghetti in the .Nm handler.
* remove assignments that will be overwritten right afterwards,Ingo Schwarze2013-12-313-7/+1
| | | | | and remove pointless local variables; found in a clang output from Ulrich Spoerlein <uqs at FreeBSD>
* update the link to the ISC licenseIngo Schwarze2013-12-311-2/+2
| | | | and note that the pkgsrc port was updated to 1.12.3
* Add missing description of .UR/.UE.Ingo Schwarze2013-12-311-1/+20
| | | | While here, also add .EX/.EE and .PD to the MACRO SYNTAX table.
* release 1.12.3VERSION.1.12.3Ingo Schwarze2013-12-313-29/+83
|
* Experimental feature to let apropos(1) show different keys than .Nd.Ingo Schwarze2013-12-314-8/+81
| | | | | | | | This really takes us beyond what grep -R /usr/*/man/ can do because now you can search for pages by *one* criterion and then display the contents of *another* macro from those pages, like in $ apropos -O Ox Fa~wchar to get an impression how long wide character handling is available.
* Split buildnames() out of mansearch(); the latter function is gettingIngo Schwarze2013-12-311-30/+40
| | | | too long and unwieldy, but will grow more code soon. No functional change.
* Oops, missed one:Ingo Schwarze2013-12-301-2/+1
| | | | | | Remove duplicate const specifier from a call to mandoc_escape(). Found by Thomas Klausner <wiz at NetBSD dot org> using clang. No functional change.
* Remove duplicate const specifiers from the declaration of mandoc_escape().Ingo Schwarze2013-12-302-3/+2
| | | | | Found by Thomas Klausner <wiz at NetBSD dot org> using clang. No functional change.
* Oops, that segfaulted after deleting an mlink from the list.Ingo Schwarze2013-12-271-7/+9
| | | | Fix the loop logic in mlinks_undupe().
* Split mlinks_undupe() out of mpages_merge()Ingo Schwarze2013-12-271-36/+52
| | | | | such that the check for source manuals of the same name can be done for multiple mlinks pointing to the same preformatted mpage.
* Change the mansearch() interface to use the mlinks table in the databaseIngo Schwarze2013-12-274-11/+62
| | | | | | and return a list of names with sections, used by apropos(1) for display. While here, improve uniformity of the interface by allocating the file name dynamically, just like the names list and the description.
* Save the MLINK name into the database, too;Ingo Schwarze2013-12-271-2/+4
| | | | apropos(1) will need it to display its results.
* Write more than one mlink per mpage to the database.Ingo Schwarze2013-12-271-7/+10
| | | | Not yet used by apropos(1).
* Allow saving more than one mlink per mpage in the mlinks ohash.Ingo Schwarze2013-12-271-23/+0
| | | | | | We are still only using one of them for now. Actually, we are now using a different one, but the order the mlinks are found is random anyway.
* Enable the framework code to allow more than one mlink per mpage.Ingo Schwarze2013-12-271-2/+3
| | | | Not used yet.
* Clean up the interface of mlink_add().Ingo Schwarze2013-12-271-69/+66
| | | | | Consistently use "fsec" and "fform" for info derived from the file name. No functional change.
* Another step on the way to clear naming, this time regarding mlinks:Ingo Schwarze2013-12-271-76/+36
| | | | | | | | * rename global ohash filenames to mlinks * rename ofadd() to mlink_add() * fold fileadd() and inoadd() into mlink_add() * fold filecheck() into mpages_merge() Still no functional change.
* Split struct mlink out of struct mpage.Ingo Schwarze2013-12-271-82/+123
| | | | Still a 1:1 relation, no functional change yet.
* Add an additional mlinks table to the database, redundant for now,Ingo Schwarze2013-12-272-23/+54
| | | | | | both because it contains nothing but a subset of the data of the existing mpages table and because the relationship of mpage and mlink entries is still 1:1. But all that will eventually change.
* Drop the mpages_list, use the existing mpages ohash for iteration.Ingo Schwarze2013-12-261-23/+27
| | | | | No functional change except that the order of database entries changes, which doesn't matter anyway.
* The name "id" is terrible for a struct.Ingo Schwarze2013-12-261-14/+14
| | | | | Make this more searchable by calling it "inodev". No functional change.
* To better support MLINKS, we will have to split the "docs" databaseIngo Schwarze2013-12-261-178/+183
| | | | | | | | table into two tables, on for actual files on disk, one for (often multiple) directory entries pointing to them. That implies splitting struct of into two structs, to be called "mpage" and "mlink", respectively. As a preparation, globally rename "of" and "inos" to "mpage". No functional change.
* Stop parsing man(7) input when we found all we were searching for,Ingo Schwarze2013-12-261-1/+4
| | | | such that we don't trigger an assertion on a duplicate NAME section.