| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
the libroff point. This clears up a nice chunk of code.
|
|
|
|
|
| |
special characters, if possible. This is broken into a separate switch
statement for clarity.
|
|
|
|
|
| |
This makes sequences of \f[unknown] \fP not completely puke. From a
TODO by schwarze@.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
| |
The reasoning behind printing SOMETHING at a Unicode codepoint is
because the input is not "wrong" (we suppress printing of "wrong"
things). It's just that ASCII can't handle it.
|
|
|
|
|
|
| |
only used once and simply bloated the binary. Also fix mchars_num2char
to correctly render the character instead of using atoi(). This makes
the conversation more strict, but it's more correct.
|
|
|
|
| |
(oops). Do the same for -Thtml (oops^2).
|
| |
|
|
|
|
| |
indexing into arrays, so this removes lots of casts from size_t to int.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
change any code but for renaming functions and types to be consistent
with other mandoc.h stuff. The reason for moving into libmandoc is that
the rendering of special characters is part of mandoc itself---not an
external part. From mandoc(1)'s perspective, this changes nothing, but
for other utilities, it's important to have these part of libmandoc.
Note this isn't documented [yet] in mandoc.3 because there are some
parts I'd like to change around beforehand.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a public (mandoc.h) function mandoc_escape(), which merges the
functionality of both prior functions.
Reason: code duplication. The a2roffdeco() and mandoc_special()
functions were pretty much the same thing and both quite complex. This
allows one function to receive improvements in (e.g.) subexpression
handling and performance, instead of having to replicate functionality.
As such, the mandoc_escape() function already handles a superset of the
escapes handled in previous versions and has improvements in performance
(using strcspn(), for example) and reliable handling of subexpressions.
This code Works For Me, but may need work to catch any regressions.
Since the benefits are great (leaner code, simpler API), I'd rather have
it in-tree than floating as a patch.
|
| |
|
|
|
|
|
|
|
|
|
| |
error where (1) -man pages were punctuating delimiters (e.g., `.B a ;')
and where (2) standalone punctuation in -mdoc or -man (e.g., ";" on its
own line) would also be punctuated. This introduces a small amount of
complexity of mdoc_{html,term}.c must manage their own spacing with
running print_word() or print_text(). The check for delimiting now
happens in mdoc_macro.c's dword().
|
|
|
|
|
| |
necessary to all [real] front-ends, so stop pretending it's special.
While here, add some documentation to the variable types.
|
|
|
|
|
|
| |
removal of manual delimiter checks in html.c and term.c. Finally, add
the escaped period as a closing delimiter, removing a TODO to this
effect.
|
|
|
|
|
|
|
|
| |
so that everybody can use them. This follows the convention of
libXXXX.h being internal to a library and XXXX.h being the external
interface. Not only does this allow the removal of lots of redundant
NULL-checking code, it also sets the tone for adding new mandoc-global
routines.
|
| |
|
|
|
|
|
|
|
| |
Don't use it in new manuals, it is inherently non-portable, but we
need it for backward-compatibility with existing manuals, for example
in Xenocara driver pages.
ok kristaps@ jmc@ and tested by Matthieu Herrb (matthieu at openbsd dot org)
|
|
|
|
| |
recode ASCII_HYPHEN and ASCII_NBRSP before passing back for widths.
|
|
|
|
|
|
|
|
|
|
| |
returning empty strings in roff_getstrn() instead of NULL. This caused
maddeningly irregular segfaults in the pod2man preamble for `de IX'.
But only on DEC alpha.
Also integrate the kinda-probably-safe assertion relaxation in term.c,
field-tested by schwarze@. This allows ALL [unpreprocessed] base and
xenocara manuals for all BSD systems to run without segfault.
|
|
|
|
|
|
|
|
| |
* make the initial maxvis/mmax calculation easier to understand
* where real, non-indexing casts happen, make them explicit
* avoid a few lint warnings that can easily be fixed
* remove one needless LINTED comment
"I like this" kristaps@
|
|
|
|
|
|
|
| |
* slightly simplify .Pf *_IGNDELIM code, and share part of it with .No
* do not let opening delimiters fall out of the front of .Ns (from kristaps@)
This fixes a few spacing issues in csh(1) and ksh(1).
OK kristaps@
|
|
|
|
|
| |
those ruined the alignment of columns.
Tested by jmc@, and kristaps@ agrees with the direction.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
column width in -Tascii, -Tpdf, and -Tps will account for "more real"
string lengths.
Example:
.Bl -tag -width \s[+123424]foo
.It bar
baz
.El
The size escape will be correctly tossed.
.Bl -tag -width \(aqbar
.It \(aqbar
baz
.El
The \(aq will be correctly handled.
|
| |
|
|
|
|
|
| |
making the code simpler and easier to understand.
No functional change.
|
|
|
|
|
| |
to the start of the next column correctly.
Fixing a problem found by jmc@ in sysctl(3), reminded by kettenis@.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now have sufficient practical experience to know what we want,
so this is intended to be final:
- provide -Wlevel (warning, error or fatal) to select what you care about
- provide -Wstop to stop after parsing a file with warnings you care about
- provide consistent exit status codes for those warnings you care about
- fully document what warnings, errors and fatal errors mean
- remove all other cruft from the user interface, less is more:
- remove all -f knobs along with the whole -f option
- remove the old -Werror because calling warnings "fatal" is silly
- always finish parsing each file, unless fatal errors prevent that
This commit also includes a couple of related simplifications behind
the scenes regarding error handling.
Feedback and OK kristaps@; Joerg Sonnenberger (NetBSD) and
Sascha Wildner (DragonFly BSD) agree with the general direction.
|
|
|
|
| |
-T[x]html and -T{pdf,ps,ascii}. Reported by Jason McIntyre.
|
|
|
|
|
| |
pre-allocate the output buffer for words and in-line the buffera()
function, which was only called in one place anyway.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
single-character escape (and ONLY this type of escape) will map back
into itself:
"If a backslash is followed by a character that does not
constitute a defined escape sequence the backslash is silently
ignored and the character maps to itself."
(From groff.7.)
Found by Jason McIntyre.
|
| |
|
|
|
|
| |
later formatted in html.c.
|
|
|
|
|
|
|
|
|
| |
roff_getstr() family of functions into roff.c with the "first_string"
directly in struct roff. Second, pre-process each line for reserved
words in libroff, splicing and re-running a line if it has one (this
allows defined symbols to be macros). Remove term.c's invocation of the
roff_getstrn() function. Removed function documentation in roff.3 and
added roff.7 `ds' documentation.
|
|
|
|
|
| |
on those parts of the code and text that i have written as Kristaps is.
"fine with me" kristaps@
|
|
|
|
|
|
| |
no time for more refinement right now.
In particular, fixes terminfo(3) and mdoc.samples(7).
ok kristaps@, who will add the HTML frontend bits
|
| |
|
| |
|
| |
|
|
|
|
|
| |
restructured to make a bit more readable. Also removed an unused entry
in the PS engine structure.
|
|
|
|
|
|
| |
by a [functionless] clean-up in term_ps.c, but this makes the
appropriate changes to "enable" initial proportional-width functionality
in term.c and fixes some areas of term_ps.c that were causing errors.
|
|
|
|
|
| |
visual screen output and what's an array index (getting closer to
variable-width fonting).
|
|
|
|
| |
OK and one stylistic tweak by kristaps@.
|
|
|
|
| |
const struct regset pointer. No functionality.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|