| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
apropos(1) will need it to display its results.
|
|
|
|
| |
Not yet used by apropos(1).
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Not used yet.
|
|
|
|
|
| |
Consistently use "fsec" and "fform" for info derived from the file name.
No functional change.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
Still a 1:1 relation, no functional change yet.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
No functional change except that the order of database entries changes,
which doesn't matter anyway.
|
|
|
|
|
| |
Make this more searchable by calling it "inodev".
No functional change.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
such that we don't trigger an assertion on a duplicate NAME section.
|
|
|
|
|
|
|
|
|
|
| |
can still be used to write architecture-specific manuals, of course.
So just derive the architecture a man(7) manual belongs to from the
directory where it is located and refrain from warning about each and
every architecture-specific man(7) manual found.
While here, delete some trailing whitespace in the neighbourhood.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of the path (/man1/ .. /man9/) or the file name suffix (*.1 .. *.9)
indicated a source manual. That missed source manuals with unusual
names in unusual locations.
Instead, as the existing comment right above already suggests, try
the source parsers unless both the path and the file name suffix
unambiguously indicate a preformatted manual (/cat*/*.0).
This change is not expensive in practice because no real-world
system will have large numbers of preformatted pages outside
/cat*/*.0. The only way to make information loss even less probable
would be to try the source parsers on all files, even /cat*/*.0,
which wouldn't buy us much because no real-world system will call
source manuals /cat*/*.0, but it will be expensive in practice,
because many real-world systems have large numbers of preformatted
pages called /cat*/*.0.
|
|
|
|
| |
no functional change
|
|
|
|
| |
string table. Fortunately, they never need UTF-8 translation either.
|
|
|
|
| |
directory or one of its subdirectories.
|
|
|
|
|
| |
so move the str_info structure into that function.
No functional change.
|
|
|
|
| |
so move the statement into the function dbopen().
|
|
|
|
|
| |
is actually reachable by man(1). This check got lost when
the database backend was changed from Berkeley to sqlite.
|
|
|
|
|
| |
Having a mask is sufficient to trigger putmdockey.
Simplify by dropping the flags; no functional change.
|
|
|
|
|
| |
the section was dropped when switching from db to sqlite.
Use the customary format foo(N).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of the same string within the same manual, so initialize and purge
it for each manual in ofmerge() instead of one single time in main().
There is no point in saving manual names and descriptions in that
table because each of them occurs only once, or very few times.
The is no point in saving section numbers there because they are
so much shorter than the descriptions.
Testing with the complete tree /usr/share/man/ on my notebook shows
that this change slightly reduces memory consumption by about 20%
while there is no measurable difference in execution time.
As a bonus, this allows to delete the functions stradd() and stradds(),
the "next" member from struct str, and the global struct str *words.
While adapting the places in the code using stradd(), i noticed that
parsing of the mdoc(7) .Nd macro was completely broken and that for
formatted manual pages with unusable NAME section, the description
was never set in the struct of. This commit fixes both bugs as well.
|
|
|
|
|
|
|
| |
and ohash_find() twice. As a bonus, this allows to drop hashget().
While here, rename index to slot to match the terminology in the ohash
manual; it also prevents potential clashes with index(3).
Drop the slot variable altogether where it is used only once.
|
|
|
|
|
| |
Also rename straddbuf() to stradds() to be more similar to putkeys().
Just cleanup, no functional change.
|
|
|
|
|
| |
While here, simplify dbopen() and dbclose(): No need for strlcpy()
and strlcat() when dealing with constant strings only.
|
|
|
|
|
|
| |
used as a default page description if no usable NAME section was found
was preserved when moving from db to sqlite, but the code line actually
doing that was removed without replacement. So, put it back.
|
|
|
|
| |
so make the function void; no functional change.
|
|
|
|
|
|
|
|
|
| |
during the switch from db to sqlite; restore these:
* Warn and skip when directory and file name mismatch.
* Warn and skip when finding special files.
* Warning about "mandocdb.db" is useless, it is always present.
* While here, do not hardcode "mandocdb.db", use MANDOC_DB.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
db to sqlite; they are needed to prevent corruption of the database
when paths containing dot, dotdot, or symlinks are given on the
command line. Also make sure the exit-code is really non-zero on
system errors and use mandoc(1) exit codes.
To make all this simpler,
* Drop the "basedir" argument from almost every function and make it
global because it is really state info used all over the place.
* Move "startdir" and "fd" as local vars into set_basedir() because they
are only used for this one purpose, i.e. to move out of basedir again.
While here,
* Clarify the name of path_arg in the main program; in the -C case,
it is not a dir, and anyway there are lots of different dirs around.
* Include missing <stdio.h> needed for perror().
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
1) SQL statements were only prepared when creating a new database.
2) We rely heavily on foreign_keys, but never enabled them.
|
|
|
|
|
|
|
|
|
|
| |
As variadic macros are not supported on all architectures,
replace them by a real function. While here,
* choose a more logical order for "dir" and "file" arguments
* choose a more logical order when printing; as a bonus,
a simple sed 's/:.*//' will get you valid file names
* in ofmerge(), skip diagnostic string comparisons
when we don't want warnings anyway
|
|
|
|
| |
(via mansearch), and merge mandocdb.h into mansearch.h (and remove).
|
|
|
|
| |
I can test properly for this feature.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
See the tech@ mailing list entries in June 2012 for details, as well as the
discuss@ mailing list entries from March 2012.
Among other changes, this utility now:
1. uses a single sqlite3 database instead of several berkeley dbs
2. stores utf-8 encoded strings
3. using ohash to aggressively hash its contents
4. using fts() instead of manually walking directories
|
|
|
|
|
|
|
|
|
|
| |
default value for the mdoc(7) .Os macro.
Needed for man.cgi on the OpenBSD website.
Problem with man.cgi first noticed by deraadt@;
beck@ and deraadt@ agree with the way to solve the issue.
"Please check them in and I'll look into them later!" kristaps@
|
| |
|
|
|
|
| |
it out here than merge it to OpenBSD. No binary change.
|
|
|
|
|
| |
shebang into a buffer and parsing it that way. This improves on many
cruddy -man manuals in the wild.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
the next section. Also, remove the limit of 72 characters and enforce
this, instead in the apropos frontend.
|
| |
|
|
|
|
| |
const-ify several strings.
|
|
|
|
| |
Requested by deraadt@, ok kristaps@.
|
|
|
|
|
|
|
| |
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.
|