aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/chars.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve handling of the roff(7) "\t" escape sequence:Ingo Schwarze2013-06-201-2/+2
| | | | | | | | | | | * Parsing macro arguments has to be done in copy mode, which implies replacing "\t" by a literal tab character. * Otherwise, render "\t" as the empty string, not as a 't' character. This fixes formatting of the distfile example in the oldrdist(1) manual. This also shows up in the unzip(1) manual as one of several issues preventing the removal of USE_GROFF from the archivers/unzip port. Thanks to espie@ for attracting my attention to the unzip(1) manual.
* Even though the size of a pointer should not depend on the type of theIngo Schwarze2013-05-181-2/+2
| | | | | | | data pointed to, pass the size of the right pointer type to calloc; cosmetic issue reported by Ulrich Spoerlein <uqs@spoerlein.net> found in Coverity Scan CID 978734. No binary change - ok cmp(1).
* Const-ify some mchars arguments. I think these are non-const for historicalKristaps Dzonsons2011-11-081-7/+10
| | | | dumbness on my part.
* forgotten Copyright bumps; no code changeIngo Schwarze2011-09-181-2/+2
| | | | found while syncing to OpenBSD
* Regression fixes after merging 1.11.3 to OpenBSD (rev. 1.20):Ingo Schwarze2011-07-311-3/+5
| | | | | | | * Do not pass integers outside the ASCII range to isprint(). * Make sure escaped characters are really printed verbatim when the escape sequence has no special meaning. ok kristaps@
* Add support for 1/2, 1/4, and 3/4 (needed by eqn).Kristaps Dzonsons2011-07-221-2/+2
|
* Support `size' constructs in eqn.7. Generalise mandoc_strontou to thisKristaps Dzonsons2011-07-211-3/+3
| | | | effect.
* Simplify chars.c---there's really no need for extra code to reorder theKristaps Dzonsons2011-07-071-61/+8
| | | | hash chain or an extra function for checking matches.
* Remove all references to ESCAPE_PREDEF, which is now not exposed passedKristaps Dzonsons2011-05-241-32/+1
| | | | the libroff point. This clears up a nice chunk of code.
* Remove predefined strings from the chars.in file, as they're now localKristaps Dzonsons2011-05-241-23/+12
| | | | | to predefs.in. This also makes "BOTH" entries directly into CHAR. The res2str and spec2str are now effectively the same function.
* Flip on unicode output (via \[uNNNN]) in -T[x]html. Here we go!Kristaps Dzonsons2011-05-171-3/+17
|
* Remove function calls to res() and so forth in term_word(). These wereKristaps Dzonsons2011-05-151-4/+3
| | | | | | 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.
* Fix missing support for \N'n' when calculating string widths in -TasciiKristaps Dzonsons2011-05-151-1/+2
| | | | (oops). Do the same for -Thtml (oops^2).
* Make character engine (-Tascii, -Tpdf, -Tps) ready for Unicode: make bufferKristaps Dzonsons2011-05-141-2/+3
| | | | | | 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.
* Filter all \N'' values with isprint(). Ok schwarze@.Kristaps Dzonsons2011-05-011-10/+6
|
* Make mchars_num2char() return a char like it says.Kristaps Dzonsons2011-04-301-11/+11
|
* Rename mchars_init() -> mchars_alloc() for consistency.Kristaps Dzonsons2011-04-301-2/+2
|
* Remove enum mcharst, which hasn't been used in quite some time.Kristaps Dzonsons2011-04-301-4/+2
|
* Move "chars" interface out of out.h and into mandoc.h. This doesn'tKristaps Dzonsons2011-04-291-29/+21
| | | | | | | | | | 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.
* Add \*(Ai (ANSI) and \*(Px (POSIX) predefined strings, which are part ofKristaps Dzonsons2011-04-201-2/+2
| | | | | | groff's tmac.doc package. Originally noted by Matthew Dempsky. Feedback by Jason McIntyre, joerg@, and schwarze@. Also add some documentation about predefined strings, tweaked by schwarze@.
* Step 4: merge chars.h into out.h. The functions in this file areKristaps Dzonsons2011-03-221-2/+2
| | | | | necessary to all [real] front-ends, so stop pretending it's special. While here, add some documentation to the variable types.
* Move mandoc_{realloc,malloc,calloc} out of libmandoc.h and into mandoc.hKristaps Dzonsons2011-03-171-12/+3
| | | | | | | | 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.
* Implement the \N'number' (numbered character) roff escape sequence.Ingo Schwarze2011-01-301-1/+23
| | | | | | | 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)
* Churn to get parts of 'struct tbl' visible from mandoc.h: rename theKristaps Dzonsons2011-01-021-12/+12
| | | | | | | existing 'struct tbl' as 'struct tbl_node', then move all option stuff into a 'struct tbl' in mandoc.h. This conflicted with a structure in chars.c, which was renamed.
* Remove last pod2man escapes. These render ok, although \*(-- renders asKristaps Dzonsons2010-09-151-2/+2
| | | | | | O- because the underlying macro depends on \(*W, which a prior pod2man preamble `tr' macro rewrites as "-". This is an error in groff as this tramples on the real \(*W, or Greek omega.
* Churny commit to quiet lint. No functional changes.Kristaps Dzonsons2010-09-041-3/+3
|
* Remove the pod2man table entries. They can now be properly read andKristaps Dzonsons2010-08-291-2/+2
| | | | assigned within the pod2man preamble.
* Implement a simple, consistent user interface for error handling.Ingo Schwarze2010-08-201-3/+3
| | | | | | | | | | | | | | | | | 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.
* Remove \*(C+ from the pre-predefined strings. It is always `ds'-definedKristaps Dzonsons2010-08-161-2/+2
| | | | | | when being used in manuals. Since we now support `ds', it's no longer necessary to account for it. From a bug report originally by Thomas Jeunet.
* Sync to OpenBSD: add missing Copyright years.Ingo Schwarze2010-07-311-2/+2
| | | | | I checked that substantial changes were committed to these files during these years.
* Remove asciisz from chars.in. It frees up a nice chunk of memory and atKristaps Dzonsons2010-07-261-10/+9
| | | | | | the overhead of running strlen() for ASCII strings (yes, I benchmarked this running mandoc_char(7) as input again and again with hundredth-second penalties... on my slow-ass alpha).
* Clean up mandoc_special() (in order later to catch \m). It also flagsKristaps Dzonsons2010-07-181-2/+3
| | | | | | several syntactic errors that weren't caught before. Also un-puke chars.c on zero-length \[].
* By letting strncmp() do its job and not helping it with a prior lengthKristaps Dzonsons2010-07-171-10/+9
| | | | | check, we can remove the hard-coded length of all escape patterns. This frees up a nice chunk of memory.
* Change chars.in HTML encoding to be a Unicode codepoint (int), which isKristaps Dzonsons2010-07-161-24/+65
| | | | later formatted in html.c.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-2/+2
|
* Fixed condition of `\}' closing a conditional at the start of the line.Kristaps Dzonsons2010-06-011-2/+2
| | | | | | | | Fixed flushed-out condition of \} causing subsequent arguments to be truncated, when in fact the whole line should be passed through (if the conditional succeeds) to the front-end and the \} ignored there. Added regression test of this behaviour.
* Modified version of Ingo Schwarze's patch for hyphen-breaking.Kristaps Dzonsons2010-05-251-1/+2
| | | | | | | Breakable hyphens are cued in the back-ends (with ASCII_HYPH) and acted upon in term.c or ignored in html.c. Also cleaned up XML decl printing (no need for extra vars).
* Added stupid pod2man reserved strings.Kristaps Dzonsons2010-03-231-2/+2
|
* Removed superfluous lookahead block in chars.c.Kristaps Dzonsons2010-01-281-13/+1
|
* Removed references to `\\' escape (noted by Jason McIntyre, Ingo Schwarze).Kristaps Dzonsons2010-01-051-2/+2
|
* Big check-in of compatibility layer. This should work on most major ↵Kristaps Dzonsons2010-01-011-1/+5
| | | | architectures. Thanks to Joerg Sonnenberger.
* Added functionality of -Tascii non-breaking `\~' space.Kristaps Dzonsons2009-11-051-3/+4
|
* Replaced putchar() loop with fwrite() (noted by Joerg Sonnenberger).Kristaps Dzonsons2009-11-011-2/+2
|
* Using perror() instead of fprintf for failure from library functions.Kristaps Dzonsons2009-10-311-3/+3
|
* Continued safe handling of allocations.Kristaps Dzonsons2009-10-301-7/+12
|
* All special characters sync'd with groff, both -Thtml and -Tascii.Kristaps Dzonsons2009-09-231-2/+2
| | | | Re-added text links to index.sgml (just for show).
* Sync'd special letters and ligatures with newest groff.Kristaps Dzonsons2009-09-231-2/+2
|
* Arrows & brackets sync'd with newest groff.Kristaps Dzonsons2009-09-231-2/+2
|
* Quotes sync'd with newest groff.Kristaps Dzonsons2009-09-231-2/+2
|
* Accent marks sync'd with current groff.Kristaps Dzonsons2009-09-221-2/+2
|