1 .\" $Id: mchars_alloc.3,v 1.1 2014/08/05 05:48:56 schwarze Exp $
3 .\" Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: August 5 2014 $
27 .Nd character table for mandoc
34 .Fn mchars_alloc "void"
37 .Fa "struct mchars *table"
41 .Fa "const char *decimal"
46 .Fa "const char *hexadecimal"
51 .Fa "const struct mchars *table"
52 .Fa "const char *name"
57 .Fa "const struct mchars *table"
58 .Fa "const char *name"
63 These functions translate Unicode character numbers and
65 character names into glyphs.
71 These functions are intended for external use by programs formatting
75 pages for output, for example the
77 output formatter modules and
85 input arguments are usually obtained from the
93 string representation of a character number consisting of
95 digits into a printable ASCII character.
96 If the input string is non-numeric or does not represent a printable
97 ASCII character, the NUL character
106 output modules use this function to render
115 string representation of a Unicode codepoint consisting of
117 digits into an integer representation.
118 If the input string is non-numeric or represents an ASCII character,
127 output modules use this function to render
129 .Ic \e[u Ns Ar XXXX Ns Ic \&]
131 .Ic \eC\(aqu Ns Ar XXXX Ns Ic \(aq
137 .Vt "struct mchars *"
138 table object for subsequent use by the following two lookup functions.
139 When no longer needed, this object can be destroyed with
152 and returns the corresponding Unicode codepoint.
155 is not recognized, \-1 is returned.
161 output modules use this function to render
163 .Ic \e[ Ns Ar name Ns Ic \&]
165 .Ic \eC\(aq Ns Ar name Ns Ic \(aq
178 and returns an ASCII string representation.
179 The length of the representation is returned in
181 In many cases, the meaning of such ASCII representations
182 is not quite obvious, so using
184 special characters in documents intended for ASCII rendering
185 is usually a bad idea.
196 output module use this function to render
198 .Ic \e[ Ns Ar name Ns Ic \&]
200 .Ic \eC\(aq Ns Ar name Ns Ic \(aq
203 These funtions are implemented in the file
207 .Xr mandoc_escape 3 ,
211 These functions and their predecessors have been available since the
212 following mandoc versions:
213 .Bl -column "mchars_num2char()" "1.11.3" "chars_num2char()" "1.10.10"
214 .It Sy function Ta since Ta Sy predecessor Ta since
215 .It Fn mchars_alloc Ta 1.11.3 Ta Fn ascii2htab Ta 1.5.3
216 .It Fn mchars_free Ta 1.11.2 Ta Fn asciifree Ta 1.6.0
217 .It Fn mchars_num2char Ta 1.11.2 Ta Fn chars_num2char Ta 1.10.10
218 .It Fn mchars_num2uc Ta 1.11.3 Ta \(em Ta \(em
219 .It Fn mchars_spec2cp Ta 1.11.2 Ta Fn chars_spec2cp Ta 1.10.5
220 .It Fn mchars_spec2str Ta 1.11.2 Ta Fn a2ascii Ta 1.5.3
223 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv
224 .An Ingo Schwarze Aq Mt schwarze@openbsd.org