aboutsummaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
* man.cgi works for the non-jailed case.Kristaps Dzonsons2011-11-231-81/+422
| | | | | | | 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.
* Adjust Makefile for manpath.{c,h} linking.Kristaps Dzonsons2011-11-231-11/+16
|
* Let apropos_db.h export the volume of manpages for a parsed record.Kristaps Dzonsons2011-11-232-8/+14
| | | | | | | | | 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.
* Have mandocdb(8) take advantage of manpath.h.Kristaps Dzonsons2011-11-232-8/+35
| | | | | 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.
* Have apropos(1) take advantage of manpath.h instead of doing the workKristaps Dzonsons2011-11-231-134/+5
| | | | itself.
* Support for Open/NetBSD's /etc/man.conf and others' manpath(1).Kristaps Dzonsons2011-11-232-0/+206
| | | | | Most of this code (except the manpath part) written by schwarze@. This isn't hooked into anything yet.
* typo reported by Steffen Daode Nurpmeso <sdaoden at googlemail dot com>Ingo Schwarze2011-11-231-4/+4
| | | | and remove a trailing blank noticed by jmc@
* Update historical record to be historical and not made-up. Data fromKristaps Dzonsons2011-11-211-9/+17
| | | | | <manpages.bsd.lv/history.html>. Ok schwarze@ (with modifications) and Jason McIntyre.
* Initial support for man.conf/makepath(1).Kristaps Dzonsons2011-11-203-13/+110
|
* Clarify some behaviour, bringing schwarze@'s patch and mine closer togetherKristaps Dzonsons2011-11-203-56/+53
| | | | | | | | | | | | | | | | (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.
* Ooops... tiny type error slipped in.Kristaps Dzonsons2011-11-201-2/+2
|
* Integrate a moderately-patched version of schwarze@'s support for multipleKristaps Dzonsons2011-11-204-86/+191
| | | | | | | | | | | 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.
* Fix white-space in apropos_db.c to make merging cleaner.Kristaps Dzonsons2011-11-201-40/+40
|
* Merge schwarze@'s work for 64-bit types. This is based on a tweaked patchKristaps Dzonsons2011-11-204-60/+118
| | | | | | | 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.
* Improve misleading comment:Ingo Schwarze2011-11-191-2/+6
| | | | | | | | * 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.
* Fix condition. Not enough tea.Joerg Sonnenberger2011-11-181-2/+2
|
* Don't depend on snprintf to handle NULL strings. Deal with missing date.Joerg Sonnenberger2011-11-181-3/+5
|
* Don't crash if the date can't be extracted. Don't depend on snprintfJoerg Sonnenberger2011-11-181-5/+7
| | | | handling NULL strings.
* Slightly adjust last: return successful as some times the correct errorJoerg Sonnenberger2011-11-181-2/+2
| | | | is raised later.
* Convert an assert into an explicit check. man_unscope can be triggeredJoerg Sonnenberger2011-11-181-2/+3
| | | | on unknown macros.
* Bail out explicitly on invalid .Rs content like:Joerg Sonnenberger2011-11-181-1/+5
| | | | | | | | .Rs plain text .Re This avoids a crash on invalid.
* Evaluation with logical subexpressions. This allows support for arbitrary,Kristaps Dzonsons2011-11-184-202/+455
| | | | nested logical subexpressions with AND (-a) and OR (-o) support.
* using undefined macros or strings should define them to be emptyIngo Schwarze2011-11-171-1/+4
|
* Guard mandocdb.h inclusion.Kristaps Dzonsons2011-11-171-1/+5
|
* Correctly handle constructs likeJoerg Sonnenberger2011-11-161-3/+8
| | | | | .TP 8 .SH foo
* Add lots of information about special characters that's actually neededIngo Schwarze2011-11-141-42/+177
| | | | | | in practice, and discourage using fancy characters in manuals. Text about "Dashes and Hyphens" by jmc@. Feedback and ok jmc@, grudgingly ok kristaps@.
* Have exprcomp() accept a string instead of an array-pointer. Also, collapseKristaps Dzonsons2011-11-143-12/+39
| | | | | the arguments in apropos(1) into a single string passed to exprcomp(). Ok schwarze@.
* Make the man(7) page footer the same as in groff.Ingo Schwarze2011-11-131-10/+17
|
* typo: overful -> overfull; thanks to jmc@Ingo Schwarze2011-11-131-2/+2
|
* Make the default left text margin configurable from the command line,Ingo Schwarze2011-11-135-29/+44
| | | | | | | 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
* Rewrite the expression parser for a more concise syntax:Ingo Schwarze2011-11-133-68/+57
| | | | | | | | | | | | | 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@
* Inventing new keywords for mostly the same thing when a well-establishedIngo Schwarze2011-11-136-73/+78
| | | | | | | | | | 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.
* Less misleading file names; ok kristaps@.Ingo Schwarze2011-11-135-13/+13
|
* another detail to implement;Ingo Schwarze2011-11-131-1/+4
| | | | long live the tricky exceptions!
* Fix two crashes that occur when walking very large (i.e. real-world) trees:Ingo Schwarze2011-11-131-5/+5
| | | | | | 1) Avoid excessive, needless recursion, lest you overflow the stack; 2) Close all dir file descriptors, lest you run out of descriptors. ok kristaps@
* Use proper infix expressions and provide a default. (Exact match.)Kristaps Dzonsons2011-11-091-12/+25
|
* Make apropos's lookup use a find(1)-like expression. I'll write more onKristaps Dzonsons2011-11-094-88/+150
| | | | | | | | | | 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.
* Change getopt() to be more like schwarze@'s suggestions.Kristaps Dzonsons2011-11-092-46/+27
|
* Split apropos.c into db.c and apropos.h with simpler code (re-written, butKristaps Dzonsons2011-11-095-552/+861
| | | | | | | | | 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.
* Const-ify some mchars arguments. I think these are non-const for historicalKristaps Dzonsons2011-11-083-14/+17
| | | | dumbness on my part.
* When the HEAD scope of .TP is broken by another block macro,Ingo Schwarze2011-11-077-51/+58
| | | | | | | | 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@
* Accomodate for \f(Cx formatting. Noted by Andreas Vogele, thanks!Kristaps Dzonsons2011-11-062-4/+13
|
* When .TH sets no data, leave the date field in the page footer blank,Ingo Schwarze2011-11-031-4/+6
| | | | | | do not use the current date. This removes a gratuitous output difference with respect to groff. ok kristaps@
* Correct .Eo spacing:Ingo Schwarze2011-11-032-4/+12
| | | | | no space between the delimiters and the enclosed text. The mdoc_html.c part was added by kristaps; ok kristaps@.
* Clean up the description of .Dt:Ingo Schwarze2011-11-011-38/+16
| | | | | | | | | | | - 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.
* Implement missing enclosures (Ao Do Qo Qq So Bro Brq)Ingo Schwarze2011-10-241-24/+24
| | | | | | | and enclosure-like in-line macros (Ad Cd Dv Er Ev Li Ms Tn). The .No macro works without explicit implementation. ok kristaps@
* Handle infinite recursion the same way as groff:Ingo Schwarze2011-10-241-9/+13
| | | | | | | When string expansion exceeds the recursion limit, drop the whole input line, instead of leaving just the string unexpanded. ok kristaps@
* Handle \N numbered character escapes the same way as groff:Ingo Schwarze2011-10-241-7/+23
| | | | | | | | | | | | | 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@
* Implement the missing text production macros (Bsx Bx Dx Fx Nx Ox Ux Bt Ud).Ingo Schwarze2011-10-201-19/+54
| | | | | Some macros work without explicit implementation (At Db Os St). ok kristaps@
* Fix mandoc_escape() function argument names. From a fix by AbhinavKristaps Dzonsons2011-10-181-5/+5
| | | | Upadhyay, thanks!