]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
13 years agoMake `-i' only apply to regular expressions. For the equality operator
Kristaps Dzonsons [Tue, 29 Nov 2011 10:53:42 +0000 (10:53 +0000)]
Make `-i' only apply to regular expressions.  For the equality operator
(and thus the default), always use strcasestr().  Discussed on tech@
with schwarze@.  While here, fix the apropos.c usage() message to be
consistent with apropos(1) and clean up the EXAMPLES in apropos(1).

13 years agoAdd tables of matchable keys into apropos.1. Ok and with feedback by
Kristaps Dzonsons [Tue, 29 Nov 2011 00:41:33 +0000 (00:41 +0000)]
Add tables of matchable keys into apropos.1.  Ok and with feedback by
schwarze@.

13 years agochdir(2) to the right man page tree before parsing manuals;
Ingo Schwarze [Tue, 29 Nov 2011 00:34:50 +0000 (00:34 +0000)]
chdir(2) to the right man page tree before parsing manuals;
ok kristaps@

13 years agoBackout -DUSE_MANPATH that sneaked in;
Ingo Schwarze [Mon, 28 Nov 2011 10:10:08 +0000 (10:10 +0000)]
Backout -DUSE_MANPATH that sneaked in;
ok kristaps@.

13 years agoTweak whatis(1):
Ingo Schwarze [Mon, 28 Nov 2011 09:44:05 +0000 (09:44 +0000)]
Tweak whatis(1):
* Bugfix: Use all arguments, not just the last one.
* Use 'Nm~' instead of 'Nm,Nd~' to match OpenBSD behaviour.
* For the progname, accept '^whatis', not '^whatis$' to ease testing.
ok kristaps@

13 years agoDiscuss the default behaviour up front before talking about options
Ingo Schwarze [Mon, 28 Nov 2011 01:37:34 +0000 (01:37 +0000)]
Discuss the default behaviour up front before talking about options
modifying it; based on a remark by kristaps@.
While here, mention parsing of unformatted files
and the changed index format and fix a few minor issues.

13 years agoReimplement the global command line options -a and -v
Ingo Schwarze [Sun, 27 Nov 2011 23:27:31 +0000 (23:27 +0000)]
Reimplement the global command line options -a and -v
as static global variables, reducing the maze of arguments
passed around among various static functions.
Suggested by kristaps@.

13 years agoSave the manual type (mdoc, man, or cat) in the index file
Ingo Schwarze [Sun, 27 Nov 2011 23:11:37 +0000 (23:11 +0000)]
Save the manual type (mdoc, man, or cat) in the index file
of the mandoc databases, as suggested by kristaps@.
Given the well-structured code, this is surprisingly simple.

This changes the mandoc.index database format.
Run "sudo mandocdb" to regenerate your databases.

13 years agoRudimentary handling of formatted manuals ("cat pages").
Ingo Schwarze [Sun, 27 Nov 2011 22:57:53 +0000 (22:57 +0000)]
Rudimentary handling of formatted manuals ("cat pages").
Coded on the train back from p2k11 in Budapest.
Kristaps has seen the patch and agreed with the direction.

13 years agoGet us a whatis(1) mode for apropos(1).
Kristaps Dzonsons [Sun, 27 Nov 2011 18:54:01 +0000 (18:54 +0000)]
Get us a whatis(1) mode for apropos(1).
This is from a patch to tech@ as critiqued by schwarze@, checked in to
get the ball rolling.

13 years agoRemoving INSECURE mode. This is a work in progress! Logic for
Kristaps Dzonsons [Sun, 27 Nov 2011 11:46:44 +0000 (11:46 +0000)]
Removing INSECURE mode.  This is a work in progress!  Logic for
formatting manpages is now linked into man.cgi.

13 years agoSync to OpenBSD, mostly gratuitous and whitespace differences,
Ingo Schwarze [Sat, 26 Nov 2011 22:38:11 +0000 (22:38 +0000)]
Sync to OpenBSD, mostly gratuitous and whitespace differences,
but a few serious things as well:
* -M overrides MANPATH
* -m prepends to the path
* put back database close calls that got lost in mandocdb
* missing sys/types.h in manpath.c, needed for size_t
ok kristaps@

13 years agoRename manup(8) to catman(8), which Linux already uses for a similar tool.
Kristaps Dzonsons [Sat, 26 Nov 2011 19:54:13 +0000 (19:54 +0000)]
Rename manup(8) to catman(8), which Linux already uses for a similar tool.

13 years agoStore page titles in the correct case, and by default, only
Ingo Schwarze [Sat, 26 Nov 2011 11:23:56 +0000 (11:23 +0000)]
Store page titles in the correct case, and by default, only
put stuff into the database that man(1) will be able to retrieve.
However, support an option to use all directories and files.
feedback and ok  kristaps@

13 years agoI say that mandocdb(8) uses "man(1)'s method", but it doesn't. It just uses
Kristaps Dzonsons [Thu, 24 Nov 2011 12:54:19 +0000 (12:54 +0000)]
I say that mandocdb(8) uses "man(1)'s method", but it doesn't.  It just uses
the configuration file and ignores MANPATH.  Everybody else uses MANPATH
(being apropos and man), so why shouldn't we?

13 years agoMake a small manual for how to run man.cgi.
Kristaps Dzonsons [Thu, 24 Nov 2011 12:43:34 +0000 (12:43 +0000)]
Make a small manual for how to run man.cgi.
This exists almost entirely to document that /tmp must exist in a jailed
Apache directory for dbopen() not to fail.  This was a massive headache
to track down.

13 years agoLet man.cgi run in two modes:
Kristaps Dzonsons [Thu, 24 Nov 2011 12:27:18 +0000 (12:27 +0000)]
Let man.cgi run in two modes:

 (1) Insecure.  This means that we're operating over the full file-system
     with access to mandoc(1).  In this mode, mandocdb entries are formatted
     on-the-fly.  The $INSECURE environment variable must be passed to
     man.cgi for this mode to work.

 (2) Secure.  Manuals are assumed to be pre-formatted in a cache directory,
     which may be set with $CACHE_DIR but default to /cache/man.cgi.
     This mode works with manup(8), which updates the cached pages from
     outside of the jail.  man.cgi simply locates the manual file and
     outputs it to stdout.

13 years agoHave manup(8) put relative paths in its output man.conf. This lets us
Kristaps Dzonsons [Thu, 24 Nov 2011 12:22:53 +0000 (12:22 +0000)]
Have manup(8) put relative paths in its output man.conf.  This lets us
have arbitrarily-located cache directories for man.cgi.

13 years agoAllow man.conf file to be assignable.
Kristaps Dzonsons [Thu, 24 Nov 2011 10:44:56 +0000 (10:44 +0000)]
Allow man.conf file to be assignable.

13 years agoExport the manpath_manconf() function, slightly reorderng manpath.c while
Kristaps Dzonsons [Thu, 24 Nov 2011 10:43:55 +0000 (10:43 +0000)]
Export the manpath_manconf() function, slightly reorderng manpath.c while
doing so.  This will be used by a jailed man.cgi, as the cache built by
manup(8) creates a man.conf for it to use.

13 years agoAdd manup(8). This runs through mandocdb(8) databases (in the same way that
Kristaps Dzonsons [Thu, 24 Nov 2011 10:33:38 +0000 (10:33 +0000)]
Add manup(8).  This runs through mandocdb(8) databases (in the same way that
apropos(1) does so) and updates an HTML fragment cache for use by man.cgi.
Right now man.cgi is "online" in that it requires mandoc(1) in its path,
but this doesn't work for, say, OpenBSD's apache chroot(1).  This allows
a cache to be maintained.

13 years agoAdd pkgsrc to downstream. Ok'd Thomas Klausner.
Kristaps Dzonsons [Wed, 23 Nov 2011 10:26:37 +0000 (10:26 +0000)]
Add pkgsrc to downstream.  Ok'd Thomas Klausner.

13 years agoFix whitespace in manuals.
Kristaps Dzonsons [Wed, 23 Nov 2011 10:09:30 +0000 (10:09 +0000)]
Fix whitespace in manuals.

13 years agoman.cgi works for the non-jailed case.
Kristaps Dzonsons [Wed, 23 Nov 2011 10:01:04 +0000 (10:01 +0000)]
man.cgi works for the non-jailed case.
In other words, if you smash this into a cgi-bin directory, it will Just
Work for your system's manuals (it of course needs access to mandoc(1) and
your file-system, hence "non-jailed").
The notion of a jailed case is much more subtle and being worked on now.

13 years agoAdjust Makefile for manpath.{c,h} linking.
Kristaps Dzonsons [Wed, 23 Nov 2011 09:56:17 +0000 (09:56 +0000)]
Adjust Makefile for manpath.{c,h} linking.

13 years agoLet apropos_db.h export the volume of manpages for a parsed record.
Kristaps Dzonsons [Wed, 23 Nov 2011 09:55:28 +0000 (09:55 +0000)]
Let apropos_db.h export the volume of manpages for a parsed record.
This is necessary since an array of records can have duplicate record
numbers in different mandoc.index files.
The volume [right now] is just the index of the parsed mandoc.index in
the manpaths.  This is sensible because the order of the manpath is
significant (it's the order of duplicate-named manuals displayed by
man(1)) and is thus not likely to change.

13 years agoHave mandocdb(8) take advantage of manpath.h.
Kristaps Dzonsons [Wed, 23 Nov 2011 09:52:20 +0000 (09:52 +0000)]
Have mandocdb(8) take advantage of manpath.h.
This brings it in line with makewhatis(8), which, like apropos(1), will use
man.conf (or manpath(1)) if no manpath entries are provided.

13 years agoHave apropos(1) take advantage of manpath.h instead of doing the work
Kristaps Dzonsons [Wed, 23 Nov 2011 09:50:40 +0000 (09:50 +0000)]
Have apropos(1) take advantage of manpath.h instead of doing the work
itself.

13 years agoSupport for Open/NetBSD's /etc/man.conf and others' manpath(1).
Kristaps Dzonsons [Wed, 23 Nov 2011 09:47:38 +0000 (09:47 +0000)]
Support for Open/NetBSD's /etc/man.conf and others' manpath(1).
Most of this code (except the manpath part) written by schwarze@.
This isn't hooked into anything yet.

13 years agotypo reported by Steffen Daode Nurpmeso <sdaoden at googlemail dot com>
Ingo Schwarze [Wed, 23 Nov 2011 02:12:24 +0000 (02:12 +0000)]
typo reported by Steffen Daode Nurpmeso <sdaoden at googlemail dot com>
and remove a trailing blank noticed by jmc@

13 years agoUpdate historical record to be historical and not made-up. Data from
Kristaps Dzonsons [Mon, 21 Nov 2011 22:19:23 +0000 (22:19 +0000)]
Update historical record to be historical and not made-up.  Data from
<manpages.bsd.lv/history.html>.  Ok schwarze@ (with modifications) and
Jason McIntyre.

13 years agoInitial support for man.conf/makepath(1).
Kristaps Dzonsons [Sun, 20 Nov 2011 21:36:00 +0000 (21:36 +0000)]
Initial support for man.conf/makepath(1).

13 years agoClarify some behaviour, bringing schwarze@'s patch and mine closer together
Kristaps Dzonsons [Sun, 20 Nov 2011 16:29:50 +0000 (16:29 +0000)]
Clarify some behaviour, bringing schwarze@'s patch and mine closer together
(although I still don't have -M, which is a big piece).

First, the default search path is the cwd.  This will change to use -M
once I look over that code.

If MANPATH is specified, this replaces the cwd.

Both of these are augmented by -m.

If paths don't exist or don't have databases, they're silently ignored.
This makes perfect sense: you may be given a superset of possible paths.
The corner case of no paths (where, say, MANPATH consists of bogus paths
or the cwd is unreadable) simply means that no paths are searched.

13 years agoOoops... tiny type error slipped in.
Kristaps Dzonsons [Sun, 20 Nov 2011 15:45:37 +0000 (15:45 +0000)]
Ooops... tiny type error slipped in.

13 years agoIntegrate a moderately-patched version of schwarze@'s support for multiple
Kristaps Dzonsons [Sun, 20 Nov 2011 15:43:14 +0000 (15:43 +0000)]
Integrate a moderately-patched version of schwarze@'s support for multiple
directories containing mandocdb(8) databases.  Some changes follow:

 (1) don't support -M yet;
 (2) fall back to cwd if no prior manpath has been specified;
 (3) resolve manpages using realpath() to prevent consecutive chdir()'s
     over relative paths;
 (4) note where further error-reporting is required;
 (5) fix leaking memory on exit in several cases.

13 years agoFix white-space in apropos_db.c to make merging cleaner.
Kristaps Dzonsons [Sun, 20 Nov 2011 12:46:53 +0000 (12:46 +0000)]
Fix white-space in apropos_db.c to make merging cleaner.

13 years agoMerge schwarze@'s work for 64-bit types. This is based on a tweaked patch
Kristaps Dzonsons [Sun, 20 Nov 2011 12:39:08 +0000 (12:39 +0000)]
Merge schwarze@'s work for 64-bit types.  This is based on a tweaked patch
submitted to tech@ on 16/11/2011, 01:39.  It has been updated to account
for the logical-operator functions and to avoid keeping a live pointer into
the DBT value, which is not guaranteed to be consistent across calls into
the bdb library.

13 years agoImprove misleading comment:
Ingo Schwarze [Sat, 19 Nov 2011 13:29:47 +0000 (13:29 +0000)]
Improve misleading comment:
* Not sure there were any text nodes, might have been other stuff instead.
* Not sure it was just one node, maybe several were deleted.
* No problem if some nodes were deleted, as long as some valid ones are left.
* We do not leave early, but after cleaning out all the crap.
* We are not "bailing", but we consider the block valid after cleanup.

13 years agoFix condition. Not enough tea.
Joerg Sonnenberger [Fri, 18 Nov 2011 17:06:19 +0000 (17:06 +0000)]
Fix condition. Not enough tea.

13 years agoDon't depend on snprintf to handle NULL strings. Deal with missing date.
Joerg Sonnenberger [Fri, 18 Nov 2011 17:05:50 +0000 (17:05 +0000)]
Don't depend on snprintf to handle NULL strings. Deal with missing date.

13 years agoDon't crash if the date can't be extracted. Don't depend on snprintf
Joerg Sonnenberger [Fri, 18 Nov 2011 17:04:06 +0000 (17:04 +0000)]
Don't crash if the date can't be extracted. Don't depend on snprintf
handling NULL strings.

13 years agoSlightly adjust last: return successful as some times the correct error
Joerg Sonnenberger [Fri, 18 Nov 2011 16:43:29 +0000 (16:43 +0000)]
Slightly adjust last: return successful as some times the correct error
is raised later.

13 years agoConvert an assert into an explicit check. man_unscope can be triggered
Joerg Sonnenberger [Fri, 18 Nov 2011 16:39:08 +0000 (16:39 +0000)]
Convert an assert into an explicit check. man_unscope can be triggered
on unknown macros.

13 years agoBail out explicitly on invalid .Rs content like:
Joerg Sonnenberger [Fri, 18 Nov 2011 14:58:24 +0000 (14:58 +0000)]
Bail out explicitly on invalid .Rs content like:
.Rs
plain text
.Re

This avoids a crash on invalid.

13 years agoEvaluation with logical subexpressions. This allows support for arbitrary,
Kristaps Dzonsons [Fri, 18 Nov 2011 07:02:19 +0000 (07:02 +0000)]
Evaluation with logical subexpressions.  This allows support for arbitrary,
nested logical subexpressions with AND (-a) and OR (-o) support.

13 years agousing undefined macros or strings should define them to be empty
Ingo Schwarze [Thu, 17 Nov 2011 17:41:07 +0000 (17:41 +0000)]
using undefined macros or strings should define them to be empty

13 years agoGuard mandocdb.h inclusion.
Kristaps Dzonsons [Thu, 17 Nov 2011 14:57:13 +0000 (14:57 +0000)]
Guard mandocdb.h inclusion.

13 years agoCorrectly handle constructs like
Joerg Sonnenberger [Wed, 16 Nov 2011 22:39:05 +0000 (22:39 +0000)]
Correctly handle constructs like
.TP 8
.SH foo

13 years agoAdd lots of information about special characters that's actually needed
Ingo Schwarze [Mon, 14 Nov 2011 15:10:27 +0000 (15:10 +0000)]
Add lots of information about special characters that's actually needed
in practice, and discourage using fancy characters in manuals.
Text about "Dashes and Hyphens" by jmc@.
Feedback and ok jmc@, grudgingly ok kristaps@.

13 years agoHave exprcomp() accept a string instead of an array-pointer. Also, collapse
Kristaps Dzonsons [Mon, 14 Nov 2011 10:07:06 +0000 (10:07 +0000)]
Have exprcomp() accept a string instead of an array-pointer.  Also, collapse
the arguments in apropos(1) into a single string passed to exprcomp().  Ok
schwarze@.

13 years agoMake the man(7) page footer the same as in groff.
Ingo Schwarze [Sun, 13 Nov 2011 15:33:41 +0000 (15:33 +0000)]
Make the man(7) page footer the same as in groff.

13 years agotypo: overful -> overfull; thanks to jmc@
Ingo Schwarze [Sun, 13 Nov 2011 14:50:54 +0000 (14:50 +0000)]
typo: overful -> overfull; thanks to jmc@

13 years agoMake the default left text margin configurable from the command line,
Ingo Schwarze [Sun, 13 Nov 2011 13:15:14 +0000 (13:15 +0000)]
Make the default left text margin configurable from the command line,
just like the default right margin already is.  This may be useful for
people with expensive screen real estate.  Besides, it helps automated
man(7) to mdoc(7) output comparisons to validate -Tman output.
ok kristaps@ on an earlier version

13 years agoRewrite the expression parser for a more concise syntax:
Ingo Schwarze [Sun, 13 Nov 2011 11:10:27 +0000 (11:10 +0000)]
Rewrite the expression parser for a more concise syntax:

 apropos [search_type[,...]=]substring
 apropos search_type[,...][,i]~regex

... and expression evaluation must take the search type into account.

This allows to:
* drop the global -I option and
* drop the enum match, just using a boolean int.

"go ahead" kristaps@

13 years agoInventing new keywords for mostly the same thing when a well-established
Ingo Schwarze [Sun, 13 Nov 2011 10:49:57 +0000 (10:49 +0000)]
Inventing new keywords for mostly the same thing when a well-established
set of keywords already exists is a bad idea, so reuse the mdoc(7)
macro names as apropos(1) search types.  This is a gain in brevity
as well.  Some time ago, kristaps@ agreed in principle.

The search type bit field constants are used by both mandocdb(8) and
apropos(1) and should better stay in sync, so give them their own
header file.

13 years agoLess misleading file names; ok kristaps@.
Ingo Schwarze [Sun, 13 Nov 2011 10:12:05 +0000 (10:12 +0000)]
Less misleading file names; ok kristaps@.

13 years agoanother detail to implement;
Ingo Schwarze [Sun, 13 Nov 2011 10:02:54 +0000 (10:02 +0000)]
another detail to implement;
long live the tricky exceptions!

13 years agoFix two crashes that occur when walking very large (i.e. real-world) trees:
Ingo Schwarze [Sun, 13 Nov 2011 00:53:13 +0000 (00:53 +0000)]
Fix two crashes that occur when walking very large (i.e. real-world) trees:
1) Avoid excessive, needless recursion, lest you overflow the stack;
2) Close all dir file descriptors, lest you run out of descriptors.
ok kristaps@

13 years agoUse proper infix expressions and provide a default. (Exact match.)
Kristaps Dzonsons [Wed, 9 Nov 2011 23:31:36 +0000 (23:31 +0000)]
Use proper infix expressions and provide a default.  (Exact match.)

13 years agoMake apropos's lookup use a find(1)-like expression. I'll write more on
Kristaps Dzonsons [Wed, 9 Nov 2011 22:05:56 +0000 (22:05 +0000)]
Make apropos's lookup use a find(1)-like expression.  I'll write more on
this when it completes; this is to keep it in-tree.

Right now this uses prefix notation.  Ignore it.  I'll make this into
infix notation real soon.

The goal of this (exprcomp and exprexec) is to have arbitrary logical
expressions.

13 years agoChange getopt() to be more like schwarze@'s suggestions.
Kristaps Dzonsons [Wed, 9 Nov 2011 10:53:48 +0000 (10:53 +0000)]
Change getopt() to be more like schwarze@'s suggestions.

13 years agoSplit apropos.c into db.c and apropos.h with simpler code (re-written, but
Kristaps Dzonsons [Wed, 9 Nov 2011 01:24:23 +0000 (01:24 +0000)]
Split apropos.c into db.c and apropos.h with simpler code (re-written, but
inspired by apropos.c and mandoc-tools' mandoc-cgi.c).  This uses UTF-8
right now for its re-writing, but will soon accomodate for the regular
suspects (this is a rather simple matter).

I also introduce man.cgi (cgi.c), which is a standalone CGI that replaces
mandoc-tools' mandoc.cgi.  Right now it's just a framework.

13 years agoConst-ify some mchars arguments. I think these are non-const for historical
Kristaps Dzonsons [Tue, 8 Nov 2011 00:15:23 +0000 (00:15 +0000)]
Const-ify some mchars arguments.  I think these are non-const for historical
dumbness on my part.

13 years agoWhen the HEAD scope of .TP is broken by another block macro,
Ingo Schwarze [Mon, 7 Nov 2011 01:24:40 +0000 (01:24 +0000)]
When the HEAD scope of .TP is broken by another block macro,
do not abort with a FATAL error, but report a report a WARNING,
remove the broken .TP from the syntax tree, and prod on.
Reported repeatedly by ports people, at least by brad@ and jeremy@.
Also fixes rendition(4) in Xenocara.
ok kristaps@

13 years agoAccomodate for \f(Cx formatting. Noted by Andreas Vogele, thanks!
Kristaps Dzonsons [Sun, 6 Nov 2011 14:43:14 +0000 (14:43 +0000)]
Accomodate for \f(Cx formatting.  Noted by Andreas Vogele, thanks!

13 years agoWhen .TH sets no data, leave the date field in the page footer blank,
Ingo Schwarze [Thu, 3 Nov 2011 20:48:52 +0000 (20:48 +0000)]
When .TH sets no data, leave the date field in the page footer blank,
do not use the current date.  This removes a gratuitous output difference
with respect to groff.
ok kristaps@

13 years agoCorrect .Eo spacing:
Ingo Schwarze [Thu, 3 Nov 2011 20:36:59 +0000 (20:36 +0000)]
Correct .Eo spacing:
no space between the delimiters and the enclosed text.
The mdoc_html.c part was added by kristaps; ok kristaps@.

13 years agoClean up the description of .Dt:
Ingo Schwarze [Tue, 1 Nov 2011 14:59:27 +0000 (14:59 +0000)]
Clean up the description of .Dt:
- Volume and arch are both optional and not alternatives.
- Zap verbiage about what's obvious from the synopsis.
- For fixed argument strings, use .Cm, not .Ar.
Using lots of input from jmc@.

Also, state that the list of valid architectures varies by OS.
If a downstream distribution wants to provide a specific list,
maintaining a local patch is the way to go.

13 years agoImplement missing enclosures (Ao Do Qo Qq So Bro Brq)
Ingo Schwarze [Mon, 24 Oct 2011 21:47:59 +0000 (21:47 +0000)]
Implement missing enclosures (Ao Do Qo Qq So Bro Brq)
and enclosure-like in-line macros (Ad Cd Dv Er Ev Li Ms Tn).
The .No macro works without explicit implementation.

ok kristaps@

13 years agoHandle infinite recursion the same way as groff:
Ingo Schwarze [Mon, 24 Oct 2011 21:41:45 +0000 (21:41 +0000)]
Handle infinite recursion the same way as groff:
When string expansion exceeds the recursion limit, drop the whole
input line, instead of leaving just the string unexpanded.

ok kristaps@

13 years agoHandle \N numbered character escapes the same way as groff:
Ingo Schwarze [Mon, 24 Oct 2011 20:30:57 +0000 (20:30 +0000)]
Handle \N numbered character escapes the same way as groff:
If \N is followed by a digit, ignore \N and the digit.
If \N is followed by a non-digit, the next non-digit
ends the character number; the two delimiters need not match.
Kristaps calls that "gross, but not our fault".

For now, i'm fixing \N only.  Other escapes taking numeric arguments
may or may not need similar handling, but \N is by far the most
important for practical purposes.

ok kristaps@

13 years agoImplement the missing text production macros (Bsx Bx Dx Fx Nx Ox Ux Bt Ud).
Ingo Schwarze [Thu, 20 Oct 2011 20:27:21 +0000 (20:27 +0000)]
Implement the missing text production macros (Bsx Bx Dx Fx Nx Ox Ux Bt Ud).
Some macros work without explicit implementation (At Db Os St).
ok kristaps@

13 years agoFix mandoc_escape() function argument names. From a fix by Abhinav
Kristaps Dzonsons [Tue, 18 Oct 2011 13:25:38 +0000 (13:25 +0000)]
Fix mandoc_escape() function argument names.  From a fix by Abhinav
Upadhyay, thanks!

13 years agoSync to groff, and add tier I and II NetBSD architectures.
Ingo Schwarze [Sun, 16 Oct 2011 16:25:19 +0000 (16:25 +0000)]
Sync to groff, and add tier I and II NetBSD architectures.
ok kristaps@

13 years agoRemove a bunch of useless assignments,
Ingo Schwarze [Sun, 16 Oct 2011 12:20:34 +0000 (12:20 +0000)]
Remove a bunch of useless assignments,
and assert that print_bvspace cannot be called on NULL pointers.
No change in behaviour, none of these were bugs,
but the code becomes easier to understand.
Based on a clang report posted by joerg@; ok kristaps@.

13 years agoAlways print <table> column widths in -T[x]html;
Ingo Schwarze [Sun, 9 Oct 2011 22:10:53 +0000 (22:10 +0000)]
Always print <table> column widths in -T[x]html;
if desired, they can be overridden in the CSS file.
Suggested by kristaps@, and i always like to simplify code.

13 years agoA bit more precision and nicer wording in the descriptions
Ingo Schwarze [Sun, 9 Oct 2011 21:37:06 +0000 (21:37 +0000)]
A bit more precision and nicer wording in the descriptions
of -Ofragment and -Tman; using input from jmc@ and kristaps@.

13 years agoMake apropos results-gathering able to error out and clean up before
Kristaps Dzonsons [Sun, 9 Oct 2011 10:46:38 +0000 (10:46 +0000)]
Make apropos results-gathering able to error out and clean up before
making the utility exit non-zero.

13 years agoRemove some unnecessary variables and note that mchars_alloc never returns
Kristaps Dzonsons [Sun, 9 Oct 2011 10:37:52 +0000 (10:37 +0000)]
Remove some unnecessary variables and note that mchars_alloc never returns
NULL.

13 years agoUse a binary tree (for now, unbalanced) for deduping the records in the
Kristaps Dzonsons [Sun, 9 Oct 2011 10:35:12 +0000 (10:35 +0000)]
Use a binary tree (for now, unbalanced) for deduping the records in the
results array.  This is much faster than the previous method, a linear
search, at a small cost.  Note that array offsets are used instead of
storing the res pointer because we may realloc the results vector.

13 years agoThe documented flags in mandocdb (-u, -d) were switched. Fix this.
Kristaps Dzonsons [Sun, 9 Oct 2011 08:56:27 +0000 (08:56 +0000)]
The documented flags in mandocdb (-u, -d) were switched.  Fix this.

13 years agoCritical fix in the new -Tman lookaside buffer code. Gah.. VERSION_1_12_0
Kristaps Dzonsons [Sat, 8 Oct 2011 15:42:29 +0000 (15:42 +0000)]
Critical fix in the new -Tman lookaside buffer code. Gah..

13 years agoNote volatility of apropos and cut out old news update.
Kristaps Dzonsons [Sat, 8 Oct 2011 13:01:44 +0000 (13:01 +0000)]
Note volatility of apropos and cut out old news update.

13 years agoTweak Makefile and add config.h to -Tman to allow cross-compiling on
Kristaps Dzonsons [Sat, 8 Oct 2011 12:47:40 +0000 (12:47 +0000)]
Tweak Makefile and add config.h to -Tman to allow cross-compiling on
Windows (via MingW).

13 years agoUse `Mt' instead of `Aq' for email address.
Kristaps Dzonsons [Sat, 8 Oct 2011 12:24:40 +0000 (12:24 +0000)]
Use `Mt' instead of `Aq' for email address.

13 years agoGet ready for version. I'm bumping the minor release to 1.12 because
Kristaps Dzonsons [Sat, 8 Oct 2011 12:21:57 +0000 (12:21 +0000)]
Get ready for version.  I'm bumping the minor release to 1.12 because
this involves both a major functionality addition (-Tman), a new utility
(apropos), and both apropos and mandocdb being built by default.

13 years agoUse mandoc_realloc() in apropos, as we're linking to libmandoc.a.
Kristaps Dzonsons [Sat, 8 Oct 2011 12:20:09 +0000 (12:20 +0000)]
Use mandoc_realloc() in apropos, as we're linking to libmandoc.a.

13 years agoImplement a basic -Tman `Rv', like `Ex'.
Kristaps Dzonsons [Sat, 8 Oct 2011 11:37:27 +0000 (11:37 +0000)]
Implement a basic -Tman `Rv', like `Ex'.

13 years agoTidy up -Tman output. This has NO functional change: (1) introduced a
Kristaps Dzonsons [Sat, 8 Oct 2011 09:58:29 +0000 (09:58 +0000)]
Tidy up -Tman output.  This has NO functional change: (1) introduced a
state struct instead of using global statics; (2) documented throughout
the file; (3) fixed a situation of reaching past the end of our buffer
for zero-length strings; (4) alpha-ordered the functions.  (1) and (3)
ok schwarze@.  (2) and (4) are purely style and documentation.

13 years agoLift hard-coded limit of results.
Kristaps Dzonsons [Fri, 7 Oct 2011 13:29:03 +0000 (13:29 +0000)]
Lift hard-coded limit of results.

13 years agoClean up file a bit: remove errx and err function pointers from the
Kristaps Dzonsons [Fri, 7 Oct 2011 13:22:33 +0000 (13:22 +0000)]
Clean up file a bit: remove errx and err function pointers from the
state struct (directly using fprintf and perror to do this); add some
in-line documentation; remove state init and destroy directly to the
main function.

13 years agoMake apropos and mandocdb build by default.
Kristaps Dzonsons [Thu, 6 Oct 2011 23:15:56 +0000 (23:15 +0000)]
Make apropos and mandocdb build by default.

13 years agoAdd more version notes to www.
Kristaps Dzonsons [Thu, 6 Oct 2011 23:06:31 +0000 (23:06 +0000)]
Add more version notes to www.

13 years agoNix end-of-line whitespace.
Kristaps Dzonsons [Thu, 6 Oct 2011 23:05:55 +0000 (23:05 +0000)]
Nix end-of-line whitespace.

13 years agoImport apropos from mandoc-tools after inlining all source files
Kristaps Dzonsons [Thu, 6 Oct 2011 23:00:54 +0000 (23:00 +0000)]
Import apropos from mandoc-tools after inlining all source files
(originally including extern.h, state.c, and sort.c).  The apropos
utility interfaces with the databases of mandocdb to provide semantic
searching capabilities.  It Works For Me, but will need lots of cleanup
in the coming months.

13 years agoIf -Tman is specified and input is -man, echo the preprocessed (`so'
Kristaps Dzonsons [Thu, 6 Oct 2011 22:29:12 +0000 (22:29 +0000)]
If -Tman is specified and input is -man, echo the preprocessed (`so'
replaced by file) input.  This replaces earlier behaviour of doing
nothing, which I found unexpected (mandoc should always output).

This requires a buffer in read.c that saves the input lines before being
parsed, with a special hook if `so' is invoked.  This buffer is just
flushed to output if -mman is the input.

While mucking around doing this, I also alpha-ordered the mandoc.h
functions.

Ok schwarze@, with no screaming when the polished patch was published.

13 years agoAdd -Ofragment mode to release notes.
Kristaps Dzonsons [Wed, 5 Oct 2011 21:43:11 +0000 (21:43 +0000)]
Add -Ofragment mode to release notes.

13 years agoAdd the -Ofragment option to -T[]x]html. This accomodates for embedding
Kristaps Dzonsons [Wed, 5 Oct 2011 21:35:17 +0000 (21:35 +0000)]
Add the -Ofragment option to -T[]x]html.  This accomodates for embedding
manual output in existing HTML or XHTML documents, e.g., when invoking
mandoc from an SSI or CGI.

13 years agoBreak schwarze@'s release notes into sections. Ok schwarze@.
Kristaps Dzonsons [Sun, 2 Oct 2011 18:37:25 +0000 (18:37 +0000)]
Break schwarze@'s release notes into sections.  Ok schwarze@.

13 years agoMake -T[x]html suppress output with \& (and similar zwsp points). This
Kristaps Dzonsons [Sun, 2 Oct 2011 10:02:26 +0000 (10:02 +0000)]
Make -T[x]html suppress output with \& (and similar zwsp points).  This
fixes lynx's rendering of manuals with the \&, which were rendering as
&#8203; in the text.  Reported by Paul de Weerd, thanks!