CVS log for mandoc/term_ascii.c

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.69 / (download) - annotate - [select for diffs], Mon Nov 13 19:13:01 2023 UTC (4 months, 2 weeks ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.68: +3 -4 lines
Diff to previous 1.68 (unified) to selected 1.54 (unified)

Reduce the man(7) default global indentation from 7n, which was an oddity
in groff-1.01 to groff-1.22.4, to 5n for compatibility with Version 7 AT&T
UNIX, 4.3BSD-Reno, groff-1.23.0, and all versions of mdoc(7).
OK jmc@ millert@

Revision 1.68 / (download) - annotate - [select for diffs], Tue Aug 16 17:45:55 2022 UTC (19 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (unified) to selected 1.54 (unified)

When starting a new input line, even when continuing the same output
line, use the current output position as the reference position
for tabs on that input line.  This brings mandoc in line with the
behaviour of GNU, Heirloom, and Plan 9 roff.

Revision 1.67 / (download) - annotate - [select for diffs], Mon Aug 15 18:12:30 2022 UTC (19 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.66: +2 -2 lines
Diff to previous 1.66 (unified) to selected 1.54 (unified)

Distinguish between escape sequences that produce no output
whatsoever (for example \fR) and escape sequences that produce
invisible zero-width output (for example \&).  No, i'm not joking,
groff does make that distinction, and it has consequences in some
situations, for example for vertical spacing in no-fill mode.
Heirloom and Plan 9 behaviour is subtly different, but in case of
doubt, we want to follow groff.

While this fixes the behaviour for the majority of escape sequences,
in particular for those most likely to occur in practice, it is not
perfect yet because some of the more exotic ESCAPE_IGNORE sequences
are actually of the "no output whatsoever" type but treated
as "invisible zero-width" for now.  With the new ASCII_NBRZW mechanism
in place, switching them over one by one when the need arises will
no longer be very difficult.

Revision 1.66 / (download) - annotate - [select for diffs], Wed Sep 9 13:45:05 2020 UTC (3 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6
Changes since 1.65: +17 -3 lines
Diff to previous 1.65 (unified) to selected 1.54 (unified)

Do not abuse assert(3) to react to absurd input; the purpose of assert(3)
only is to catch internal inconsistencies in the program itself.
Issue found in an afl run performed by Jan Schreiber <jes at posteo dot de>.

Instead, just cut down unreasonably wide spacing requested by the document
to a narrower width.

Revision 1.65 / (download) - annotate - [select for diffs], Sun Sep 6 14:45:22 2020 UTC (3 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.64: +10 -4 lines
Diff to previous 1.64 (unified) to selected 1.54 (unified)

After .ti, there are many reasons why the offset may change, so setting
it back later requires a guard against underflow, or subsequent assertions
may fail.
Issue found in an afl run performed by Jan Schreiber <jes at posteo dot de>.

Revision 1.64 / (download) - annotate - [select for diffs], Wed Nov 28 14:23:06 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.63: +4 -4 lines
Diff to previous 1.63 (unified) to selected 1.54 (unified)

Bugfix: never set termp->enc to the ambiguous value TERMENC_LOCALE,
but instead set it to TERMENC_UTF8 or TERMENC_ASCII.
Makes tbl(7) box drawing work under -T locale (that is, by default
when LC_CTYPE is defined appropriately).

Revision 1.63 / (download) - annotate - [select for diffs], Tue Aug 21 16:06:48 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.62: +2 -2 lines
Diff to previous 1.62 (unified) to selected 1.54 (unified)

Improve the ASCII rendering of \(Po (Pound Sterling)
and of the playing card suits to match groff, using feedback
from Ralph Corderoy <ralph at inputplus dot co dot uk>.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Aug 18 15:17:03 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.61: +2 -3 lines
Diff to previous 1.61 (unified) to selected 1.54 (unified)

Unsurprisingly, zero-width non-breaking spaces have...  width 0.

Revision 1.61 / (download) - annotate - [select for diffs], Sun May 20 21:37:34 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4
Changes since 1.60: +7 -1 lines
Diff to previous 1.60 (unified) to selected 1.54 (unified)

Protect against malicious manual pages containing .ll requests with
excessive arguments: apply the same cutoff as for the -O width=
command line argument.

While here, also place some assertions at strategical places to
prevent excessive indentations from being printed in case of bugs.
In the past, we had more than one bug that caused mandoc to print
effectively infinite output, filling up people's /tmp/ file system,
which is not funny.  We cannot prevent bugs from crashing the
program, but we can at least make filling up the disk less likely.

Triggered by a remark from sthen@ on source-changes@.

Revision 1.60 / (download) - annotate - [select for diffs], Fri Apr 13 18:31:00 2018 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.59: +15 -3 lines
Diff to previous 1.59 (unified) to selected 1.54 (unified)

Make sure that mandoc only goes into UTF-8 mode if the user really
selected UTF-8, not some other multibyte locale.  This obviously
makes no difference on OpenBSD but improves portability.
Issue reported by <Nakayama at NetBSD> via wiz@.

Revision 1.59 / (download) - annotate - [select for diffs], Wed Aug 23 10:50:15 2017 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.58: +6 -6 lines
Diff to previous 1.58 (unified) to selected 1.54 (unified)

Switch ASCII rendering of the same mathematical symbols and greek
letters as in groff commit babca15f from trying to imitate the
characters' graphical shapes, which resulted in unintelligible
renderings in many cases, to transliterations conveying the characters'
meanings.  One benefit is making these characters usable for portable
manual pages.

Solving a problem pointed out by bentley@.

Revision 1.58 / (download) - annotate - [select for diffs], Wed Jun 14 14:24:20 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_3, VERSION_1_14_2
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (unified) to selected 1.54 (unified)

harmless, but weird typo; found with afterstep_faq(1)

Revision 1.57 / (download) - annotate - [select for diffs], Wed Jun 7 17:38:26 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.56: +10 -8 lines
Diff to previous 1.56 (unified) to selected 1.54 (unified)

Prepare the terminal driver for filling multiple columns in parallel,
first step: split column data out of the terminal state struct into
a new column state struct and use an array of such column state
structs.  No functional change.

Revision 1.56 / (download) - annotate - [select for diffs], Mon May 8 15:34:54 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.55: +6 -2 lines
Diff to previous 1.55 (unified) to selected 1.54 (unified)

Basic implementation of the roff(7) .ti (temporary indent) request.
Needed by about four dozen ports (thanks to naddy@ for the research).

Revision 1.55 / (download) - annotate - [select for diffs], Sun May 7 17:31:45 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.54: +1 -2 lines
Diff to previous 1.54 (unified)

Basic implementation of the roff(7) .ta (define tab stops) request.
This is the first feature made possible by the parser reorganization.
Improves the formatting of the SYNOPSIS in many Xenocara GL manuals.
Also important for ports, as reported by many, including naddy@.

Revision 1.54 / (download) - annotate - [selected], Sun Jul 31 09:29:13 2016 UTC (7 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_1, VERSION_1_13
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (unified)

Autodetect a suitable locale for -Tutf8 mode,
and allow overriding it manually.
Based on a patch from Svyatoslav Mishyn <juef at openmailbox dot org>
tweaked by me.
The idea originally came up in a conversation with Markus Waldeck.

Revision 1.53 / (download) - annotate - [select for diffs], Fri Jul 8 22:29:05 2016 UTC (7 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_4
Changes since 1.52: +6 -7 lines
Diff to previous 1.52 (unified) to selected 1.54 (unified)

ISO C99 7.19.2.5 doesn't like mixing putchar(3) and putwchar(3) on
the same stream, and actually, it fails spectacularly on glibc.
Portability issue pointed out by Svyatoslav Mishyn <juef at openmailbox
dot org> after testing on Void Linux.

Revision 1.52 / (download) - annotate - [select for diffs], Thu Nov 12 21:50:03 2015 UTC (8 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.51: +10 -2 lines
Diff to previous 1.51 (unified) to selected 1.54 (unified)

Never use LC_ALL.  On the one hand, it can cause misformatting.
On the other hand, it is a security risk because it might cause
buffer overflows.  Use LC_CTYPE only, that's all we need.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Oct 13 22:59:54 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.50: +9 -12 lines
Diff to previous 1.50 (unified) to selected 1.54 (unified)

Major character table cleanup:
* Use ohash(3) rather than a hand-rolled hash table.
* Make the character table static in the chars.c module:
There is no need to pass a pointer around, we most certainly
never want to use two different character tables concurrently.
* No need to keep the characters in a separate file chars.in;
that merely encourages downstream porters to mess with them.
* Sort the characters to agree with the mandoc_chars(7) manual page.
* Specify Unicode codepoints in hex, not decimal (that's the detail
that originally triggered this patch).
No functional change, minus 100 LOC, and i don't see a performance change.

Revision 1.50 / (download) - annotate - [select for diffs], Mon Oct 12 00:08:16 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.49: +1 -3 lines
Diff to previous 1.49 (unified) to selected 1.54 (unified)

To make the code more readable, delete 283 /* FALLTHROUGH */ comments
that were right between two adjacent case statement.  Keep only
those 24 where the first case actually executes some code before
falling through to the next case.

Revision 1.49 / (download) - annotate - [select for diffs], Tue Oct 6 18:32:20 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.48: +10 -10 lines
Diff to previous 1.48 (unified) to selected 1.54 (unified)

modernize style: "return" is not a function

Revision 1.48 / (download) - annotate - [select for diffs], Sat Sep 26 00:54:04 2015 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.47: +1 -2 lines
Diff to previous 1.47 (unified) to selected 1.54 (unified)

/* NOTREACHED */ after abort() is silly, delete it

Revision 1.47 / (download) - annotate - [select for diffs], Fri Jul 17 22:38:29 2015 UTC (8 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.46: +5 -1 lines
Diff to previous 1.46 (unified) to selected 1.54 (unified)

Initial, still somewhat experimental implementation to leverage
less(1) -T and :t ctags(1)-like functionality to jump to the
definitions of various terms inside manual pages.
To be polished in the tree, so bear with me and report issues.

Technically, if less(1) is used as a pager, information is collected
by the mdoc(7) terminal formatter, first stored using the ohash
library, then ultimately written to a temporary file which is passed
to less via -T.  No change intended for other output formatters or
when running without a pager.

Based on an idea from Kristaps using feedback from many, in particular
phessler@ nicm@ millert@ halex@ doug@ kspillner@ deraadt@.

Revision 1.46 / (download) - annotate - [select for diffs], Wed Jun 10 19:17:15 2015 UTC (8 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.45: +3 -1 lines
Diff to previous 1.45 (unified) to selected 1.54 (unified)

Avoid warning "unused variable" when compiling without HAVE_WCHAR.
Issue found on Debian by Markus <Waldeck at gmx dot de>.

Revision 1.45 / (download) - annotate - [select for diffs], Sat Apr 4 17:47:18 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.44: +19 -25 lines
Diff to previous 1.44 (unified) to selected 1.54 (unified)

Rounding rules for horizontal scaling widths are more complicated.
There is a first rounding to basic units on the input side.
After that, rounding rules differ between requests and macros.
Requests round to the nearest possible character position.
Macros round to the next character position to the left.

Implement that by changing the return value of term_hspan()
to basic units and leaving the second scaling and rounding stage
to the formatters instead of doing it in the terminal handler.

Improves for example argtable2(3).

Revision 1.44 / (download) - annotate - [select for diffs], Fri Mar 27 21:33:20 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.43: +22 -49 lines
Diff to previous 1.43 (unified) to selected 1.54 (unified)

Actually use the new man.conf(5) "output" directive.
Additional functionality, yet minus 45 lines of code.

Revision 1.43 / (download) - annotate - [select for diffs], Mon Feb 16 14:11:41 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3
Changes since 1.42: +9 -3 lines
Diff to previous 1.42 (unified) to selected 1.54 (unified)

Clamp width and indent settings to sensible values.
Ignore errors for now.
Patch from tedu@.

Revision 1.42 / (download) - annotate - [select for diffs], Wed Dec 31 16:52:40 2014 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.41: +15 -1 lines
Diff to previous 1.41 (unified) to selected 1.54 (unified)

When showing more than one formatted manual page, insert horizontal lines
between pages.  Suggested by Theo Buehler <theo at math dot ethz dot ch>.
Even in UTF-8 output mode, do not use fancy line drawing characters such
that you can easily use /^--- to skip to the next manual in your pager.

Revision 1.41 / (download) - annotate - [select for diffs], Fri Dec 19 17:12:04 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.40: +4 -1 lines
Diff to previous 1.40 (unified) to selected 1.54 (unified)

Enforcing an arbitrary, implementation dependent, undocumented limit
by calling assert() when valid user input exceeds it is a bad idea.
Allocate the terminal font stack dynamically instead of crashing
above 10 entries.  Issue found by jsg@ with afl.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Nov 20 13:56:20 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_2
Changes since 1.39: +6 -4 lines
Diff to previous 1.39 (unified) to selected 1.54 (unified)

Prevent negative arguments to the .ll request from causing integer
underflow.  Found while preparing an audit of termp.rmargin.

Overflow can also happen, but i see no sane way to deal with it,
so just let it happen.  It doesn't happen for any sane input anyway,
groff behaviour is undefined, and the resulting values are legal,
even though they are useless.

Revision 1.39 / (download) - annotate - [select for diffs], Tue Oct 28 18:49:33 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (unified) to selected 1.54 (unified)

In -Tascii mode, print "<?>" only for Unicode escapes of unknown
representation, not for character escapes with unknown names.
According to groff, the latter produce no output, and we now warn
about them.

Revision 1.38 / (download) - annotate - [select for diffs], Tue Oct 28 17:36:19 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.37: +11 -9 lines
Diff to previous 1.37 (unified) to selected 1.54 (unified)

Make the character table available to libroff so it can check the
validity of character escape names and warn about unknown ones.
This requires mchars_spec2cp() to report unknown names again.
Fortunately, that doesn't require changing the calling code because
according to groff, invalid character escapes should not produce
output anyway, and now that we warn about them, that's fine.

Revision 1.37 / (download) - annotate - [select for diffs], Tue Oct 28 02:43:59 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.36: +35 -35 lines
Diff to previous 1.36 (unified) to selected 1.54 (unified)

Refine -Tascii rendering of Unicode characters, mostly to better agree
with groff, in particular in cases where groff uses backspace overstrike.
In two cases, agreement is impossible because groff clobbers the
previous line: \(*G \(*S
In a number of cases, groff rendering is so misleading that i chose
to render differently: \(Sd \(TP \(Tp \(Po \(ps \(sc \(r! \(r? \(de
While here, also correct the \(la and \(ra Unicode code points.

Revision 1.36 / (download) - annotate - [select for diffs], Sun Oct 26 18:12:28 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.35: +78 -78 lines
Diff to previous 1.35 (unified) to selected 1.54 (unified)

Grrr, patch(1) merged the new function to the wrong place in this file.
Resync with OpenBSD.  No code change.

Revision 1.35 / (download) - annotate - [select for diffs], Sun Oct 26 18:07:28 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.34: +5 -3 lines
Diff to previous 1.34 (unified) to selected 1.54 (unified)

In -Tascii mode, provide approximations even for some Unicode escape
sequences above codepoint 512 by doing a reverse lookup in the
existing mandoc_char(7) character table.

Again, groff isn't smart enough to do this and silently discards such
escape sequences without printing anything.

Revision 1.34 / (download) - annotate - [select for diffs], Sun Oct 26 17:12:03 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.33: +76 -1 lines
Diff to previous 1.33 (unified) to selected 1.54 (unified)

Improve -Tascii output for Unicode escape sequences: For the first 512
code points, provide ASCII approximations.  This is already much better
than what groff does, which prints nothing for most code points.

A few minor fixes while here:
* Handle Unicode escape sequences in the ASCII range.
* In case of errors, use the REPLACEMENT CHARACTER U+FFFD for -Tutf8
and the string "<?>" for -Tascii output.
* Handle all one-character escape sequences in mchars_spec2{cp,str}()
and remove the workarounds on the higher level.

Revision 1.33 / (download) - annotate - [select for diffs], Wed Sep 3 05:22:45 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.32: +7 -3 lines
Diff to previous 1.32 (unified) to selected 1.54 (unified)

Implement the traditional -h option for man(1): show the SYNOPSIS only.
As usual, we get mandoc -h and apropos -h for free.
Try stuff like "apropos -h In=dirent" or "apropos -h Fa=timespec".

Only useful for terminal output, so -Tps, -Tpdf, -Thtml ignore -h for now.

Revision 1.32 / (download) - annotate - [select for diffs], Sun Aug 17 22:10:29 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (unified) to selected 1.54 (unified)

While all current callers pass valid data to ascii_hspan() only,
it's safer to assume incoming enum data might be invalid
and catch it instead of happily returning an unitialized int.
No functional change right now.

Revision 1.31 / (download) - annotate - [select for diffs], Sat Aug 16 19:00:01 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.30: +6 -17 lines
Diff to previous 1.30 (unified) to selected 1.54 (unified)

Improve build system and autodetection.
* Make ./configure standalone, that's what people expect.
* Let people write a ./configure.local from scratch, not edit existing files.
* Autodetect wchar, sqlite3, and manpath and act accordingly.
* Autodetect the need for -L/usr/local/lib and -lutil.
* Get rid of config.h.p{re,ost}, let ./configure only write what's needed.
* Let ./configure write a Makefile.local snippet, that's quite flexible.

Revision 1.30 / (download) - annotate - [select for diffs], Thu Aug 14 22:33:10 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Branch point for: VERSION_1_12
Changes since 1.29: +3 -2 lines
Diff to previous 1.29 (unified) to selected 1.54 (unified)

Some compilers apparently worry that abort() might return
and then throw a "may be used uninitialized" warning, so
sprinkle some /* NOTREACHED */.  No functional change.
Noticed by Thomas Klausner <wiz at NetBSD dot org>.

Revision 1.29 / (download) - annotate - [select for diffs], Wed Aug 13 20:34:29 2014 UTC (9 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.28: +21 -11 lines
Diff to previous 1.28 (unified) to selected 1.54 (unified)

Begin cleaning up scaling units.
Start with the horizontal terminal specifiers, making sure that they match
up with troff.
Then move on to PS, PDF, and HTML, noting that we stick to the terminal
default width for "u".
Lastly, fix some completely-wrong documentation and note that we diverge
from troff w/r/t "u".

Revision 1.28 / (download) - annotate - [select for diffs], Sun Aug 10 23:54:41 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.27: +3 -5 lines
Diff to previous 1.27 (unified) to selected 1.54 (unified)

Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.
Include <sys/types.h> where needed, it does not belong in config.h.
Remove <stdio.h> from config.h; if it is missing somewhere, it should
be added, but i cannot find a *.c file where it is missing.

Revision 1.27 / (download) - annotate - [select for diffs], Fri Aug 1 19:25:52 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_1
Changes since 1.26: +7 -7 lines
Diff to previous 1.26 (unified) to selected 1.54 (unified)

Clarity with respect to floating point handling:
Write double constants as double rather than integer literals.
Remove useless explicit (double) cast done at one place and nowhere else.
No functional change.

Revision 1.26 / (download) - annotate - [select for diffs], Sun Jul 27 21:52:16 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.25: +7 -2 lines
Diff to previous 1.25 (unified) to selected 1.54 (unified)

Even for UTF-8 output, a non-breaking space character has the same width
as a normal space character, and not width 0.  Bug reported by bentley@.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Apr 20 16:46:05 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.24: +17 -26 lines
Diff to previous 1.24 (unified) to selected 1.54 (unified)

KNF: case (FOO):  ->  case FOO:, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change

Revision 1.24 / (download) - annotate - [select for diffs], Sun Mar 30 21:28:01 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.23: +12 -8 lines
Diff to previous 1.23 (unified) to selected 1.54 (unified)

Support relative arguments to .ll (increase or decrease line length).

Revision 1.23 / (download) - annotate - [select for diffs], Sun Mar 30 19:47:48 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.22: +16 -2 lines
Diff to previous 1.22 (unified) to selected 1.54 (unified)

Implement the roff(7) .ll (line length) request.
Found by naddy@ in the textproc/enchant(1) port.
Of course, do not use this in new manuals.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Mar 23 11:25:26 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (unified) to selected 1.54 (unified)

The files mandoc.c and mandoc.h contained both specialised low-level
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions.  Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.

Revision 1.21 / (download) - annotate - [select for diffs], Sat Jun 1 14:27:20 2013 UTC (10 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_3, VERSION_1_12_2
Changes since 1.20: +2 -3 lines
Diff to previous 1.20 (unified) to selected 1.54 (unified)

Use a standard locale name, "UTF-8" is an ugly non-standard alias
that doesn't work on OpenBSD.
OK tedu@ naddy@

Revision 1.20 / (download) - annotate - [select for diffs], Sun Dec 4 23:10:52 2011 UTC (12 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_1
Changes since 1.19: +12 -3 lines
Diff to previous 1.19 (unified) to selected 1.54 (unified)

Implement mdoc(7)-like output style variant for man(7) documents:
* one instead of three blank lines after the page header;
* one instead of three blank lines before the page footer;
* source instead of title(section) in the lower right corner.
Select this style variant with the undocumented command line option -Omdoc.
In the long run, we hope to unify the ouput of both languages and
to pull this out again, but that requires coordination with groff.

Grudgingly ok and, (as usual,-) more comments requested by  kristaps@

Revision 1.19 / (download) - annotate - [select for diffs], Sun Nov 13 13:15:14 2011 UTC (12 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.18: +8 -4 lines
Diff to previous 1.18 (unified) to selected 1.54 (unified)

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

Revision 1.18 / (download) - annotate - [select for diffs], Sun Sep 18 14:14:15 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_0
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (unified) to selected 1.54 (unified)

forgotten Copyright bumps; no code change
found while syncing to OpenBSD

Revision 1.17 / (download) - annotate - [select for diffs], Fri May 20 15:48:22 2011 UTC (12 years, 10 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_7, VERSION_1_11_6, VERSION_1_11_5, VERSION_1_11_4, VERSION_1_11_3
Changes since 1.16: +16 -4 lines
Diff to previous 1.16 (unified) to selected 1.54 (unified)

Flip on -Tutf8 backend support.  This forces the UTF-8 LC_CTYPE and does
little else.  Also remove the check for __STDC_ISO_10646__.  It turns
out that very few systems---even those that support it---actually
declare this and it's just causing problems instead of being useful.

Revision 1.16 / (download) - annotate - [select for diffs], Thu May 19 15:48:58 2011 UTC (12 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.15: +8 -1 lines
Diff to previous 1.15 (unified) to selected 1.54 (unified)

It seems that __STDC_ISO_10646__ isn't defined even where it can be
defined, so remove the check for it and leave it up to people compiling
the software (DOWNSTREAM) to take care of this.  This will eventually
need to be fixed up with a proper non-10646 converter and so on, but
this is a simple start.  While here, strengthen then language in the
Makefile to this effect.

Revision 1.15 / (download) - annotate - [select for diffs], Tue May 17 22:32:45 2011 UTC (12 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.14: +70 -13 lines
Diff to previous 1.14 (unified) to selected 1.54 (unified)

Locale support.  I'm checking this in to clean up fall-out in-tree, but
it looks pretty good.  Basically, the -Tlocale option propogates into
term_ascii.c, where we set locale-specific console call-backs IFF (1)
setlocale() works; (2) locale support is compiled in (see Makefile for
-DUSE_WCHAR); (3) the internal structure of wchar_t maps directly to
Unicode codepoints as defined by __STDC_ISO_10646__; and (4) the console
supports multi-byte characters.

To date, this configuration only supports GNU/Linux.  OpenBSD doesn't
export __STDC_ISO_10646__ although I'm told by stsp@openbsd.org that it
should (it has the correct map).  Apparently FreeBSD is the same way.
NetBSD?  Don't know.  Apple also supports this, but doesn't define the
macro.  Special-casing!

Benchmark: -Tlocale incurs less than 0.2 factor overhead when run
through several thousand manuals when UTF8 output is enabled.  Native
mode (whether directly -Tascii or through no locale or whatever) is
UNCHANGED: the function callbacks are the same as before.

Note.  If the underlying system does NOT support STDC_ISO_10646, there
is a "slow" version possible with iconv or other means of flipping from
a Unicode codepoint to a wchar_t.

Revision 1.14 / (download) - annotate - [select for diffs], Tue May 17 14:38:34 2011 UTC (12 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.13: +20 -6 lines
Diff to previous 1.13 (unified) to selected 1.54 (unified)

Add mode for -Tlocale.  This mode, with this commit, behaves exactly
like -Tascii.  While adding this, inline term_alloc() (was a one-liner),
remove some switches around the terminal encoding for the symbol table
(unnecessary), and split out ascii_alloc() into ascii_init(), which is
also called from locale_init().

Revision 1.13 / (download) - annotate - [select for diffs], Sat May 14 17:54:42 2011 UTC (12 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.12: +5 -5 lines
Diff to previous 1.12 (unified) to selected 1.54 (unified)

Make character engine (-Tascii, -Tpdf, -Tps) ready for Unicode: make buffer
consist of type "int".  This will take more work (especially in encode and
friends), but this is a strong start.  This commit also consists of some
harmless lint fixes.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Jan 25 17:32:04 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_2, VERSION_1_11_1, VERSION_1_10_10
Changes since 1.11: +2 -3 lines
Diff to previous 1.11 (unified) to selected 1.54 (unified)

Remove unnecessary conditional...

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jan 2 12:21:07 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_9
Changes since 1.10: +2 -1 lines
Diff to previous 1.10 (unified) to selected 1.54 (unified)

Turn on -Tascii tbl printing.  The output still has some issues---I'm
not sure whether it's in the header calculation or term.c squashing
spaces or whatever, but let's get this in for general testing as soon as
possible.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Sep 4 20:18:53 2010 UTC (13 years, 6 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_8, VERSION_1_10_7, VERSION_1_10_6
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (unified) to selected 1.54 (unified)

Churny commit to quiet lint.  No functional changes.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jul 13 23:53:20 2010 UTC (13 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_10_5_PREPDF, VERSION_1_10_5
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (unified) to selected 1.54 (unified)

correct lots of copyright notices;
ok kristaps@

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jun 30 12:30:36 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_4
Changes since 1.7: +4 -10 lines
Diff to previous 1.7 (unified) to selected 1.54 (unified)

Pushed normalisation of scaling units into term_hspan().

Revision 1.7 / (download) - annotate - [select for diffs], Wed Jun 30 12:27:55 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.6: +57 -8 lines
Diff to previous 1.6 (unified) to selected 1.54 (unified)

Move term_hspan() calculation into the output devices, where it belongs.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jun 25 19:50:23 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_3
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (unified) to selected 1.54 (unified)

Remove "pt" from struct roffsu, as CSS (the only reason it was there) is
unclear about which units accept floats/integers, which leads me to
assume that it handles either and rounds as appropriate.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jun 25 18:53:14 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.4: +14 -1 lines
Diff to previous 1.4 (unified) to selected 1.54 (unified)

Initial chunks for variable-width fonts.  Pushes all width calculations
in mdoc_term.c and man_term.c down into term.c.  This is still not
implemented in term.c, although stubs for width calculations are in
place.  From now on, offset, rmargin, and other layout variables are
abstract screen widths.  They will resolve to the the familiar values
for -Tascii but -Tps will eventually use points instead of chars.

Revision 1.4 / (download) - annotate - [select for diffs], Sat Jun 19 20:46:28 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_2
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (unified) to selected 1.54 (unified)

Churn as I finish email address migration kth.se -> bsd.lv.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 9 08:07:13 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.2: +1 -2 lines
Diff to previous 1.2 (unified) to selected 1.54 (unified)

Have the standard manpage header and footer print on every page of -Tps
output.  This is more tricky than you may think:  we can't just call the
header function out-of-state (i.e., before a flushln has occured)
because we'd clobber our current state.  Thus, we call at the beginning
and dump the output into an auxiliary buffer.

For the record, I don't think there's any other clean way to do this.
The only other Way That Works is to copy-aside *all* termp state, zero
it, and do the necessary headf/footf.  This is just as complex, as
memory needs to be alloc'd and free'd per margin.

Unfortunately, this prohibits page numbering (the margin is only printed
once), so I'll probably end up re-writing this down the line.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jun 8 15:06:01 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (unified) to selected 1.54 (unified)

Lint noops.  Also fixed getsubopt() to be in unistd.h (noted by joerg@).

Revision 1.1 / (download) - annotate - [select for diffs], Tue Jun 8 15:00:17 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Diff to selected 1.54 (unified)

Broke ascii_*() functions into term_ascii.c

Made low-level engine functions into function pointers.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb