aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mansearch.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Reimplement apropos -s NUM -S ARCH EXPR by internally converting it toIngo Schwarze2014-01-051-22/+52
| | | | | | | | | | | | | | | 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-051-1/+3
| | | | | | | | | | 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-56/+92
| | | | | | 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.
* Experimental feature to let apropos(1) show different keys than .Nd.Ingo Schwarze2013-12-311-5/+63
| | | | | | | | 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-31/+41
| | | | too long and unwieldy, but will grow more code soon. No functional change.
* Change the mansearch() interface to use the mlinks table in the databaseIngo Schwarze2013-12-271-9/+50
| | | | | | 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.
* Add an additional mlinks table to the database, redundant for now,Ingo Schwarze2013-12-271-3/+3
| | | | | | 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.
* Fix another regression introduced when switching from DB to SQLite:Ingo Schwarze2013-10-201-29/+72
| | | | The ~ operator has to do regular expression search, not globbing.
* Fix a regression introduced when switching from DB to SQLite:Ingo Schwarze2013-10-191-6/+34
| | | | The = operator has to do substring search, not word search.
* Some places used PATH_MAX from <limits.h>, some MAXPATHLEN from <sys/param.h>.Ingo Schwarze2013-06-051-8/+7
| | | | | | Consistently use the PATH_MAX since it is specified by POSIX, while MAXPATHLEN is not. In preparation for using this at a few more places.
* Merge whatis.1 into apropos.1 (and remove), add whatis bits to aproposKristaps Dzonsons2012-06-091-17/+25
| | | | (via mansearch), and merge mandocdb.h into mansearch.h (and remove).
* Add a compatibility interface for ohash.Kristaps Dzonsons2012-06-091-1/+5
| | | | | | | | | | This include's espie@'s wholesale src/lib/libc/ohash directory from OpenBSD into compat_ohash.c (with a single copyright/license notice at the top) and src/include/ohash.h as compat_ohash.h. The ohash_int.h part of compat_ohash.c has been changed only in that ohash.h points to compat_ohash.h. Added HAVE_OHASH test (test-ohash.c) to Makefile. In mandocdb.c and mansearch.c, check HAVE_OHASH test for inclusion.
* Turn off sqlite3 synchronous mode when creating a new database.Kristaps Dzonsons2012-06-081-7/+7
| | | | | | This makes it run about 5x faster. While here, wrap some sqlite3 statements in #defines to extract errors. (Really, the warning/error/etc. macros should be functionified.)
* Allow mansearch to fail if invariancy (cwd) is violated. Also be moreKristaps Dzonsons2012-06-081-21/+35
| | | | verbose if sqlite3 errors occur.
* Add a new mansearch.h interface, which replaces apropos_db.cKristaps Dzonsons2012-06-081-0/+436
This is a much more minimal interface that stuffs all operations into a single function. It uses sqlite3 and ohash.