]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
12 years agoRemove catman(8): it's superfluous.
Kristaps Dzonsons [Sat, 9 Jun 2012 11:27:38 +0000 (11:27 +0000)]
Remove catman(8): it's superfluous.
Users of man.cgi should be able to just copy in their directories and have
the CGI fine everything on its own or just suck it up or, in the cases
of multiple manroots, have a simple config file.
Besides, now that mandocdb(8) is using relative paths for everything,
needing a fancy "cp -R" is silly.

12 years agoThs SYNCHRONOUS = off optimisation fails on my Mac OSX. Take it out until
Kristaps Dzonsons [Sat, 9 Jun 2012 11:21:12 +0000 (11:21 +0000)]
Ths SYNCHRONOUS = off optimisation fails on my Mac OSX.  Take it out until
I can test properly for this feature.

12 years agoMake test-ohash.c work on OpenBSD (it now works on have/havenots of OpenBSD
Kristaps Dzonsons [Sat, 9 Jun 2012 11:02:55 +0000 (11:02 +0000)]
Make test-ohash.c work on OpenBSD (it now works on have/havenots of OpenBSD
and OSX).

12 years agoAdd a compatibility interface for ohash.
Kristaps Dzonsons [Sat, 9 Jun 2012 11:00:13 +0000 (11:00 +0000)]
Add a compatibility interface for ohash.
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.

12 years agoTurn off sqlite3 synchronous mode when creating a new database.
Kristaps Dzonsons [Fri, 8 Jun 2012 15:06:28 +0000 (15:06 +0000)]
Turn off sqlite3 synchronous mode when creating a new database.
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.)

12 years agoAllow mansearch to fail if invariancy (cwd) is violated. Also be more
Kristaps Dzonsons [Fri, 8 Jun 2012 14:14:30 +0000 (14:14 +0000)]
Allow mansearch to fail if invariancy (cwd) is violated.  Also be more
verbose if sqlite3 errors occur.

12 years agoUse C99 syntax for declaring the string-hash key array.
Kristaps Dzonsons [Fri, 8 Jun 2012 12:05:27 +0000 (12:05 +0000)]
Use C99 syntax for declaring the string-hash key array.

12 years agoRemove lint from Makefile.
Kristaps Dzonsons [Fri, 8 Jun 2012 10:47:17 +0000 (10:47 +0000)]
Remove lint from Makefile.
Disable some parts of the build (man.cgi, etc.) while sqlite3 is being
merged in nice and slow.
Remove the bit swapping stuff in config.h.post.
Remove apropos_db (replaced by mansearch).

12 years agoFlip apropos to use mansearch instead of apropos_db.
Kristaps Dzonsons [Fri, 8 Jun 2012 10:44:52 +0000 (10:44 +0000)]
Flip apropos to use mansearch instead of apropos_db.
This makes the utility much smaller and simpler.
A lot of functionality has been omitted while the sqlite3 search routines
improve (logical operations, etc.).
It still needs work to make the output more conventional.
Also add the manpage utility, which I use extensively as a mind-meld of
apropos and man.

12 years agoRe-tooled mandocdb using sqlite3 and ohash.
Kristaps Dzonsons [Fri, 8 Jun 2012 10:43:01 +0000 (10:43 +0000)]
Re-tooled mandocdb using sqlite3 and ohash.
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

12 years agoAdd a new mansearch.h interface, which replaces apropos_db.c
Kristaps Dzonsons [Fri, 8 Jun 2012 10:36:23 +0000 (10:36 +0000)]
Add a new mansearch.h interface, which replaces apropos_db.c
This is a much more minimal interface that stuffs all operations into
a single function.
It uses sqlite3 and ohash.

12 years agoUse size_t in catman to match manpath.h.
Kristaps Dzonsons [Fri, 8 Jun 2012 10:33:48 +0000 (10:33 +0000)]
Use size_t in catman to match manpath.h.
Note this file will not be connected to the build for a little while as
I get the new sqlite3 stuff in.

12 years agoUse size_t in manpath instead of int.
Kristaps Dzonsons [Fri, 8 Jun 2012 10:32:40 +0000 (10:32 +0000)]
Use size_t in manpath instead of int.

12 years agoforgot to commit one request bu espie@
Ingo Schwarze [Tue, 5 Jun 2012 21:29:26 +0000 (21:29 +0000)]
forgot to commit one request bu espie@

12 years agoClose a preceding implicit block before opening an explicit block.
Ingo Schwarze [Sun, 3 Jun 2012 09:52:07 +0000 (09:52 +0000)]
Close a preceding implicit block before opening an explicit block.

To allow doing so, no longer abuse rew_scope() to unwind explicit blocks;
explicitly call man_unscope() instead.

Fixing the indentation of slapd.conf(5) in the OpenLDAP port;
thanks to guenther@ for the report.

12 years agoMinimal implementation of .EX and .EE for GNU compatibility.
Ingo Schwarze [Sat, 2 Jun 2012 20:16:23 +0000 (20:16 +0000)]
Minimal implementation of .EX and .EE for GNU compatibility.
Do not use this, it is not portable and only defined in esr's man-ext.
For example, sox(1) wants these macros.

12 years agoFix blank line handling in .if.
Ingo Schwarze [Thu, 31 May 2012 22:41:19 +0000 (22:41 +0000)]
Fix blank line handling in .if.

In particular, two cases were wrong:
- single-line .if with trailing whitespace gave no blank line
- multiline .if with \{ but without \{\ gave no blank line

While here, simplify roff_cond() by partially reordering the code.

"good one" kristaps@

12 years agoWhile i already got my fingers dirty on mandoc_escape(),
Ingo Schwarze [Thu, 31 May 2012 22:38:16 +0000 (22:38 +0000)]
While i already got my fingers dirty on mandoc_escape(),
profit of the occasion to pull out some spaghetti, that is,
three confusing variables and fourteen pointless assignments
among them; instead, always operate on the official pointers
**start, **end, and *sz, each of which conveys an obvious meaning.

No functional change intended, and the new tests confirm that
everything still (err...) "works", as far as that word can be
applied to the kind of roff(7) mock-up code i'm polishing here.

"just commit" kristaps@

12 years agoMake recursive parsing of roff(7) escapes actually work in the general case,
Ingo Schwarze [Thu, 31 May 2012 22:34:06 +0000 (22:34 +0000)]
Make recursive parsing of roff(7) escapes actually work in the general case,
in particular when the inner escapes are preceded or followed by other terms.
While doing so, remove lots of bogus code that was trying to make pointless
distinctions between numeric and non-numeric escape sequences, while both
actually share the same syntax and we ignore the semantics anyway.

This prevents some of the strings defined in the pod2man(1) preamble
from producing garbage output, in particular in scandinavian words.
Of course, proper rendering of scandinavian national characters
cannot be expected even with these fixes.

"just commit" kristaps@

12 years agoImplement the roff \z escape sequence, intended to output the next
Ingo Schwarze [Thu, 31 May 2012 22:29:13 +0000 (22:29 +0000)]
Implement the roff \z escape sequence, intended to output the next
character without advancing the cursor position; implement it to
simply skip the next character, as it will usually be overwritten.

With this change, the pod2man(1) preamble user-defined string \*:,
intended to render as a diaeresis or umlaut diacritic above the
preceding character, is rendered in a slightly less ugly way,
though still not correctly.  It was rendered as "z.." and is now
rendered as ".".

Given that the definition of \*: uses elaborate manual \h positioning,
there is little chance for mandoc(1) to ever render it correctly,
but at least we can refrain from printing out a spurious "z", and
we can make the \z do something semi-reasonable for easier cases.

"just commit" kristaps@

12 years agocatch up with the changed interface of mparse_alloc(), see mandoc.h rev 1.100
Ingo Schwarze [Thu, 31 May 2012 22:27:14 +0000 (22:27 +0000)]
catch up with the changed interface of mparse_alloc(), see mandoc.h rev 1.100

12 years ago.if vertical spacing now fixed in OpenBSD
Ingo Schwarze [Thu, 31 May 2012 01:54:45 +0000 (01:54 +0000)]
.if vertical spacing now fixed in OpenBSD

12 years agoclarify two entries related to roff(7) escapes
Ingo Schwarze [Mon, 28 May 2012 23:09:22 +0000 (23:09 +0000)]
clarify two entries related to roff(7) escapes

12 years agoFix the vertical spacing around tbl(7) instances in man(7).
Ingo Schwarze [Sun, 27 May 2012 18:02:49 +0000 (18:02 +0000)]
Fix the vertical spacing around tbl(7) instances in man(7).

Groff forces the document author to manually request sufficient spacing
after .TE - that is, at least .sp 1v after a table with the "box" option
and at least .sp 2v after a table with the "doublebox" option - or else
it clobbers the box.  I consider that insane, so i'm not imitating groff
in that respect.  Instead, i add at least as much vertical space as groff,
or more where required to avoid clobbering the box.

Consequently, output will be identical for input that looks sane with
groff, and mandoc will make output look better for input that looks bad
with groff.

"Please check them in and I'll look into them later!" kristaps@

12 years agoCorrect width of horizontal spans; relevant in case of centered or
Ingo Schwarze [Sun, 27 May 2012 17:59:23 +0000 (17:59 +0000)]
Correct width of horizontal spans; relevant in case of centered or
flush right text, for boxes, and when more columns follow the span.

Issue found by sthen@ in the net/arp-scan(1) port manual.

"Please check them in and I'll look into them later!" kristaps@

12 years agoDo not handle vertical lines as additional tbl(7) columns,
Ingo Schwarze [Sun, 27 May 2012 17:54:54 +0000 (17:54 +0000)]
Do not handle vertical lines as additional tbl(7) columns,
instead save their properties with the following column.
This simplifies layout parsing and saves a lot of code
related to column handling.

At output time, print all white space and vertical lines
separating columns before printing the following column,
and none after printing the preceding column, considerably
simplifying white space handling and width calculations.

No functional change, but it saves 150 lines of code,
and it allows the next patch to tbl_term.c, tbl_literal().

"Please check them in and I'll look into them later!" kristaps@

12 years agoSupport -Ios='OpenBSD 5.1' to override uname(3) as the source of the
Ingo Schwarze [Sun, 27 May 2012 17:48:57 +0000 (17:48 +0000)]
Support -Ios='OpenBSD 5.1' to override uname(3) as the source of the
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@

12 years agoupdate Copyright years according to the CVS logs; no code change
Ingo Schwarze [Sun, 27 May 2012 17:39:28 +0000 (17:39 +0000)]
update Copyright years according to the CVS logs; no code change

12 years agoHorizontal spacing of tables was fixed
Ingo Schwarze [Sun, 27 May 2012 15:20:12 +0000 (15:20 +0000)]
Horizontal spacing of tables was fixed
in tbl_term.c rev. 1.10 and out.c rev. 1.16
on September 20, 2011.
I merely forgot to delete the TODO entry.

12 years agoThe .\} -> .\& -> pset() bug reported by naddy has already been fixed;
Ingo Schwarze [Sun, 27 May 2012 14:42:05 +0000 (14:42 +0000)]
The .\} -> .\& -> pset() bug reported by naddy has already been fixed;
i'm really sure because i both stepped through the code with gdb
and wrote an OpenBSD regression test for it.

While here, note that bentley@ reported .ti .ce .fc missing.

12 years agoDiscourage the use of esr's man-ext macros:
Ingo Schwarze [Sun, 15 Apr 2012 21:24:18 +0000 (21:24 +0000)]
Discourage the use of esr's man-ext macros:
If man(7) has any advantage compared to mdoc(7), it's portability,
and using man-ext would needlessly give that advantage away.
ok kristaps@

12 years agoThe -width and -offset macro arguments consume the next argument
Ingo Schwarze [Sun, 15 Apr 2012 15:26:49 +0000 (15:26 +0000)]
The -width and -offset macro arguments consume the next argument
even if it starts with a dash.
ok kristaps@

12 years agoBeing reluctant to add yet more trailing whitespace, i rather back
Ingo Schwarze [Sun, 15 Apr 2012 13:30:38 +0000 (13:30 +0000)]
Being reluctant to add yet more trailing whitespace, i rather back
it out here than merge it to OpenBSD.  No binary change.

12 years agoSome documentation nits.
Kristaps Dzonsons [Sun, 25 Mar 2012 00:48:47 +0000 (00:48 +0000)]
Some documentation nits.

12 years agoFix lookup not to use full-out regexp search.
Kristaps Dzonsons [Sun, 25 Mar 2012 00:46:39 +0000 (00:46 +0000)]
Fix lookup not to use full-out regexp search.

12 years agoFreeBSD, NetBSD and DragonFly use the same names as Linux.
Joerg Sonnenberger [Sat, 24 Mar 2012 06:23:14 +0000 (06:23 +0000)]
FreeBSD, NetBSD and DragonFly use the same names as Linux.
Add dummy entry for OpenBSD and XXX entry for the rest.

12 years agoForgot chdir(2) into volume path. VERSION_1_12_1
Kristaps Dzonsons [Sat, 24 Mar 2012 02:18:51 +0000 (02:18 +0000)]
Forgot chdir(2) into volume path.

12 years agoSmall tweaks for release.
Kristaps Dzonsons [Sat, 24 Mar 2012 02:07:32 +0000 (02:07 +0000)]
Small tweaks for release.

12 years agoGet ready for a version.
Kristaps Dzonsons [Sat, 24 Mar 2012 01:54:43 +0000 (01:54 +0000)]
Get ready for a version.

12 years agoBe insane. Make apropos(1) subsume man(1).
Kristaps Dzonsons [Sat, 24 Mar 2012 01:46:25 +0000 (01:46 +0000)]
Be insane.  Make apropos(1) subsume man(1).

12 years agoSimplify by not pre-filtering the result vector for satisfied matches:
Kristaps Dzonsons [Sat, 24 Mar 2012 00:31:55 +0000 (00:31 +0000)]
Simplify by not pre-filtering the result vector for satisfied matches:
we can do this in the frontend.

12 years agoWhitespace fix.
Kristaps Dzonsons [Sat, 24 Mar 2012 00:30:30 +0000 (00:30 +0000)]
Whitespace fix.

12 years agoKnock out useless & confusing whatis mode.
Kristaps Dzonsons [Fri, 23 Mar 2012 09:03:07 +0000 (09:03 +0000)]
Knock out useless & confusing whatis mode.

12 years agoImprove mandocdb's ability to handle NAME sections by sucking the entire
Kristaps Dzonsons [Fri, 23 Mar 2012 06:52:17 +0000 (06:52 +0000)]
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.

12 years agoMake the `-width' field to `Bl' not puke if it doesn't have an argument.
Kristaps Dzonsons [Fri, 23 Mar 2012 05:50:24 +0000 (05:50 +0000)]
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.

12 years agoClean up code a bit by pushing warnings into WARNING macro.
Kristaps Dzonsons [Fri, 23 Mar 2012 05:45:45 +0000 (05:45 +0000)]
Clean up code a bit by pushing warnings into WARNING macro.

12 years agoMerge some/most of schwarze@'s OpenBSD changes into mandoc: many more
Kristaps Dzonsons [Fri, 23 Mar 2012 05:07:35 +0000 (05:07 +0000)]
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.

12 years agoRemove some Mac OS crap in the Makefile.
Kristaps Dzonsons [Fri, 23 Mar 2012 05:05:41 +0000 (05:05 +0000)]
Remove some Mac OS crap in the Makefile.

12 years agoDon't run superfluous mkdir when installing.
Kristaps Dzonsons [Fri, 23 Mar 2012 02:53:18 +0000 (02:53 +0000)]
Don't run superfluous mkdir when installing.

12 years agoRevert to mandocdb.{index,db} for database files.
Kristaps Dzonsons [Fri, 23 Mar 2012 02:52:33 +0000 (02:52 +0000)]
Revert to mandocdb.{index,db} for database files.

12 years agotwo reminders
Ingo Schwarze [Sun, 4 Mar 2012 23:53:37 +0000 (23:53 +0000)]
two reminders

12 years agoCorrect the expansion of -xbd5;
Ingo Schwarze [Sun, 26 Feb 2012 21:47:09 +0000 (21:47 +0000)]
Correct the expansion of -xbd5;
from Philip Guenther <guenther at openbsd dot org>.
OK Werner Lemberg <wl at gnu dot org>.

12 years agoAdd mparse_readmem, which allows application to run the parser directly
Joerg Sonnenberger [Thu, 16 Feb 2012 20:51:31 +0000 (20:51 +0000)]
Add mparse_readmem, which allows application to run the parser directly
from memory, e.g. after de-compressing a document.

12 years agoDon't silently skip non-ASCII characters, but replace them with ``?''.
Joerg Sonnenberger [Sun, 5 Feb 2012 16:46:15 +0000 (16:46 +0000)]
Don't silently skip non-ASCII characters, but replace them with ``?''.
This is less likely to break the syntax of macros.

12 years agoAdd libquota
Joerg Sonnenberger [Sat, 28 Jan 2012 23:46:28 +0000 (23:46 +0000)]
Add libquota

12 years agoAdd libisns, libppath and libsaslc from NetBSD. Fix formatting of librt.
Joerg Sonnenberger [Sat, 28 Jan 2012 14:04:39 +0000 (14:04 +0000)]
Add libisns, libppath and libsaslc from NetBSD. Fix formatting of librt.

12 years agoAdd x86 pseudo architecure
Joerg Sonnenberger [Sat, 28 Jan 2012 14:02:17 +0000 (14:02 +0000)]
Add x86 pseudo architecure

12 years agoAdd entry about the .TP / .RS crash before I forget about it again.
Joerg Sonnenberger [Mon, 23 Jan 2012 01:41:54 +0000 (01:41 +0000)]
Add entry about the .TP / .RS crash before I forget about it again.

13 years agoReflect reality, mandoc_escape does not skip the "\" itself, but expects
Joerg Sonnenberger [Fri, 13 Jan 2012 15:27:14 +0000 (15:27 +0000)]
Reflect reality, mandoc_escape does not skip the "\" itself, but expects
the caller to have done that.

13 years agoFix previous such that all .It HEADs are unparsed,
Ingo Schwarze [Thu, 5 Jan 2012 00:43:51 +0000 (00:43 +0000)]
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@

13 years agoLocal variable initialisation.
Kristaps Dzonsons [Tue, 3 Jan 2012 15:17:20 +0000 (15:17 +0000)]
Local variable initialisation.

13 years agoAdd support for `OP', one of the extended man macros. This also requires
Kristaps Dzonsons [Tue, 3 Jan 2012 15:16:24 +0000 (15:16 +0000)]
Add support for `OP', one of the extended man macros.  This also requires
some man(7) changes to accomodate for the an-ext compatibility.

13 years agoAccommodate for ISO C11. groff applied the same `St' argument on
Kristaps Dzonsons [Tue, 3 Jan 2012 10:18:05 +0000 (10:18 +0000)]
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!

13 years ago`-diag' lists aren't parsed, unlike other list types. This fixes a TODO
Kristaps Dzonsons [Mon, 2 Jan 2012 15:48:05 +0000 (15:48 +0000)]
`-diag' lists aren't parsed, unlike other list types.  This fixes a TODO
entry raised by deraadt@.

13 years agoFix ID vs. CLASS for man.cgi CSS selector on results table and vertically
Kristaps Dzonsons [Sat, 31 Dec 2011 18:48:40 +0000 (18:48 +0000)]
Fix ID vs. CLASS for man.cgi CSS selector on results table and vertically
align.

13 years agoWhen parsing catpages, read from the first section (NAME, we hope) until
Kristaps Dzonsons [Sat, 31 Dec 2011 18:47:52 +0000 (18:47 +0000)]
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.

13 years agoDo not skip manuals shared across architectures when building databases.
Ingo Schwarze [Wed, 28 Dec 2011 00:32:13 +0000 (00:32 +0000)]
Do not skip manuals shared across architectures when building databases.

13 years agoUpdate the whatis.db database format.
Ingo Schwarze [Sun, 25 Dec 2011 21:00:23 +0000 (21:00 +0000)]
Update the whatis.db database format.
While here, reference apropos(1) from the description,
inspired by the makewhatis(8) manual.

13 years agoState default usage before listing arguments of a utility. Inspired by a
Kristaps Dzonsons [Sun, 25 Dec 2011 19:35:44 +0000 (19:35 +0000)]
State default usage before listing arguments of a utility.  Inspired by a
patch to mandocdb.8 by schwarze@ some time ago.  Ok jmc@.

13 years agoFirst memory leak in mandocdb.c freeing "struct of". Also properly
Kristaps Dzonsons [Sun, 25 Dec 2011 19:31:25 +0000 (19:31 +0000)]
First memory leak in mandocdb.c freeing "struct of".  Also properly
const-ify several strings.

13 years agoContinue changing mandoc.{index,db} into whatis.{index,db}. Use mandocdb.h
Kristaps Dzonsons [Sun, 25 Dec 2011 17:49:52 +0000 (17:49 +0000)]
Continue changing mandoc.{index,db} into whatis.{index,db}.  Use mandocdb.h
to do so.

13 years agoUse the traditional name "whatis.db" for the mandocdb(8) databases.
Ingo Schwarze [Sun, 25 Dec 2011 16:53:51 +0000 (16:53 +0000)]
Use the traditional name "whatis.db" for the mandocdb(8) databases.
Requested by deraadt@, ok kristaps@.

13 years agoFor binary compatability of the databases across architectures,
Ingo Schwarze [Sun, 25 Dec 2011 14:58:39 +0000 (14:58 +0000)]
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.

13 years agoImplement test mode (makewhatis -t), required for pkg_create(8).
Ingo Schwarze [Sun, 25 Dec 2011 13:08:12 +0000 (13:08 +0000)]
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@.

13 years agoSupport leading, trailing and double colons in MANPATH to prepend,
Kristaps Dzonsons [Sat, 24 Dec 2011 22:37:16 +0000 (22:37 +0000)]
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.

13 years agoDo not cast void pointers to pointers requiring alignment.
Ingo Schwarze [Tue, 20 Dec 2011 21:41:11 +0000 (21:41 +0000)]
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.

13 years agoGive catman(8) the -C flag (like apropos and friends) and merge in some
Kristaps Dzonsons [Sun, 18 Dec 2011 18:51:01 +0000 (18:51 +0000)]
Give catman(8) the -C flag (like apropos and friends) and merge in some
documentation from apropos(1) to be consistent.

13 years agoMake compat files actually use compat.h. Ooops.
Kristaps Dzonsons [Sun, 18 Dec 2011 14:27:01 +0000 (14:27 +0000)]
Make compat files actually use compat.h.  Ooops.

13 years agoTwo lint fixes.
Kristaps Dzonsons [Fri, 16 Dec 2011 20:06:58 +0000 (20:06 +0000)]
Two lint fixes.

13 years agoFix assertion found when plugging legacy man.cgi query string into my
Kristaps Dzonsons [Fri, 16 Dec 2011 20:05:31 +0000 (20:05 +0000)]
Fix assertion found when plugging legacy man.cgi query string into my
man.cgi.

13 years agoEdge in a little style. Why not.
Kristaps Dzonsons [Fri, 16 Dec 2011 19:18:47 +0000 (19:18 +0000)]
Edge in a little style.  Why not.

13 years agoWhen routing to a "result" page in the cgi, remember our input parameters
Kristaps Dzonsons [Fri, 16 Dec 2011 18:37:12 +0000 (18:37 +0000)]
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.

13 years agoHave results table inherit the small font.
Kristaps Dzonsons [Fri, 16 Dec 2011 15:05:27 +0000 (15:05 +0000)]
Have results table inherit the small font.

13 years agoMake sure that "any" is UINT64_MAX, not just INT_MAX, else "any" won't
Kristaps Dzonsons [Fri, 16 Dec 2011 12:07:45 +0000 (12:07 +0000)]
Make sure that "any" is UINT64_MAX, not just INT_MAX, else "any" won't
cover all types.  Found after some database trawling.

13 years agoMake the stored "cat"/"mdoc"/"man" strings just be c/d/a single-character
Kristaps Dzonsons [Fri, 16 Dec 2011 12:06:35 +0000 (12:06 +0000)]
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.

13 years agoMake paths in the mandocdb(8) index relative to the databases' path
Kristaps Dzonsons [Fri, 16 Dec 2011 08:04:34 +0000 (08:04 +0000)]
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.

13 years agoDon't make man.cgi default font-size dictate manual style.
Kristaps Dzonsons [Thu, 15 Dec 2011 12:44:11 +0000 (12:44 +0000)]
Don't make man.cgi default font-size dictate manual style.

13 years agoFurther tweaks for output consistency.
Kristaps Dzonsons [Thu, 15 Dec 2011 12:18:57 +0000 (12:18 +0000)]
Further tweaks for output consistency.

13 years agoUpdate man.cgi.7 with new CSS files.
Kristaps Dzonsons [Thu, 15 Dec 2011 12:07:54 +0000 (12:07 +0000)]
Update man.cgi.7 with new CSS files.

13 years agoSome presentation polish in man.cgi:
Kristaps Dzonsons [Thu, 15 Dec 2011 12:05:19 +0000 (12:05 +0000)]
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.

13 years agoNote that archives are being hosted at gmane.
Kristaps Dzonsons [Wed, 14 Dec 2011 23:17:12 +0000 (23:17 +0000)]
Note that archives are being hosted at gmane.

13 years agoUnbreak man.cgi's css directories when CSS_DIR isn't specified.
Kristaps Dzonsons [Wed, 14 Dec 2011 13:36:59 +0000 (13:36 +0000)]
Unbreak man.cgi's css directories when CSS_DIR isn't specified.

13 years agoRemove stray warnx() left in the manpath.c code.
Kristaps Dzonsons [Tue, 13 Dec 2011 21:09:01 +0000 (21:09 +0000)]
Remove stray warnx() left in the manpath.c code.

13 years agoHave manpath.c properly use manpath(1), that is, using -C and -m and so on.
Kristaps Dzonsons [Tue, 13 Dec 2011 20:56:46 +0000 (20:56 +0000)]
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.

13 years agoCompatibility support fgetln() on Linux. This uses the BSD-licensed
Kristaps Dzonsons [Tue, 13 Dec 2011 11:26:12 +0000 (11:26 +0000)]
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.

13 years agoimplement -C (alternative config file) for apropos(1) and mandocdb(8),
Ingo Schwarze [Mon, 12 Dec 2011 02:00:49 +0000 (02:00 +0000)]
implement -C (alternative config file) for apropos(1) and mandocdb(8),
including various tweaks to the whatis(8) manual;
ok kristaps@

13 years agoExplain where .so paths are rooted, and why, and discourage its use;
Ingo Schwarze [Sun, 11 Dec 2011 00:38:11 +0000 (00:38 +0000)]
Explain where .so paths are rooted, and why, and discourage its use;
feedback and ok jmc@, suggested by and ok kristaps@.

13 years agoUgh, environmental variables are Ev, not Er. Fix typos.
Kristaps Dzonsons [Sun, 11 Dec 2011 00:24:41 +0000 (00:24 +0000)]
Ugh, environmental variables are Ev, not Er.  Fix typos.

13 years agoNote CSS_DIR in man.cgi.7.
Kristaps Dzonsons [Sun, 11 Dec 2011 00:23:55 +0000 (00:23 +0000)]
Note CSS_DIR in man.cgi.7.

13 years agoWhen 303'ing a search directly to a page, remember to specify its manroot.
Kristaps Dzonsons [Sun, 11 Dec 2011 00:22:47 +0000 (00:22 +0000)]
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.