summaryrefslogtreecommitdiffstats
path: root/dba.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve clarity of some casts;Ingo Schwarze2017-02-171-6/+6
| | | | from Christos Zoulas <christos at NetBSD>.
* When looking up macro values while the macro tables are being builtIngo Schwarze2017-01-151-61/+129
| | | | | | | | | | | | | | | in makewhatis(8), use ohash rather than linear searches. This was identified as the main makewhatis(8) performance bottleneck by Baptiste Daroussin <bapt at FreeBSD>, who also suggested part of the improved algorithm. This reduces the run time of "makewhatis /usr/share/man" from eleven to five seconds on my notebook. Note that the changed code is not used in apropos(1), so don't expect speedups there. While here, sort macro values asciibetically, to improve reproducibility - which still isn't perfect, but getting better.
* When the content of a manual page does not specify a section, theIngo Schwarze2016-08-171-5/+2
| | | | | | | | empty string got added to the list of sections, breaking the database format slightly and causing the page to not be considered part of any section, not even if a section could be deduced from the directory or from the file name. Bug found due to the bogus pcredemo(3) "manual" in the pcre-8.38p0 package.
* When reading back a mandoc.db(5) file in order to apply incrementalIngo Schwarze2016-08-171-1/+2
| | | | | | changes, do not prepend a stray NAME_FILE (0x10) byte to the first names of pages. Bug found while investigating another issue reported by sthen@.
* Make sure manuals in architecture-independent directories are treatedIngo Schwarze2016-08-171-1/+1
| | | | | | | | | as architecture-independent even if they abuse the third (architecture) argument of the .Dt macro for random stuff like "freetds reference manual". While the .Dt syntax is not the same as the .TH syntax in man(7), punishing offenders by treating them as architecture-dependent and hence completely excluding them from searches is too severe. Problem reported by sthen@.
* The concept of endianness seems to be somewhat newfangled, so theIngo Schwarze2016-08-051-0/+8
| | | | | | respective conversion functions are not yet properly standardized. Rumour has it that POSIX is working on it, though. For now, sprinkle some configuration glue.
* missing <endian.h> reported by Bapt@iste Daroussin, found on FreeBSDIngo Schwarze2016-08-051-0/+1
|
* Sort sections and architectures in the pages table.Ingo Schwarze2016-07-291-6/+18
|
* No need to populate the TYPE_arch and TYPE_sec bits, the informationIngo Schwarze2016-07-291-1/+4
| | | | | | | | | | | | is provided directly to dba_page_add() in dbadd_mlink() and to dba_page_new() in dbadd(). No need for a dedicated loop for NAME_FILE. It's done in dbadd_mlink() anyway. In this context, also record section numbers taken from filenames and from .Dt and .TH macros, architectures taken from .Dt macros, and fix the filtering of duplicate filename entries.
* Remove the dependency on SQLite without loss of functionality.Ingo Schwarze2016-07-191-0/+418
Stop supporting systems that don't have mmap(3). Drop the obsolete names_check() now that we deleted MLINKS.