=================================================================== RCS file: /cvs/mandoc/mandoc.3,v retrieving revision 1.6 retrieving revision 1.10 diff -u -p -r1.6 -r1.10 --- mandoc/mandoc.3 2011/05/01 10:40:52 1.6 +++ mandoc/mandoc.3 2011/05/24 21:41:11 1.10 @@ -1,4 +1,4 @@ -.\" $Id: mandoc.3,v 1.6 2011/05/01 10:40:52 kristaps Exp $ +.\" $Id: mandoc.3,v 1.10 2011/05/24 21:41:11 kristaps Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons .\" Copyright (c) 2010 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 1 2011 $ +.Dd $Mdocdate: May 24 2011 $ .Dt MANDOC 3 .Os .Sh NAME @@ -26,8 +26,7 @@ .Nm mchars_alloc , .Nm mchars_free , .Nm mchars_num2char , -.Nm mchars_res2cp , -.Nm mchars_res2str , +.Nm mchars_num2uc , .Nm mchars_spec2cp , .Nm mchars_spec2str , .Nm mdoc_meta , @@ -40,6 +39,8 @@ .Nm mparse_strerror , .Nm mparse_strlevel .Nd mandoc macro compiler library +.Sh LIBRARY +.Lb mandoc .Sh SYNOPSIS .In man.h .In mdoc.h @@ -64,21 +65,9 @@ .Fn mchars_free "struct mchars *p" .Ft char .Fn mchars_num2char "const char *cp" "size_t sz" -.Ft "const char *" -.Fo mchars_res2str -.Fa "struct mchars *p" -.Fa "const char *cp" -.Fa "size_t sz" -.Fa "size_t *rsz" -.Fc .Ft int -.Fo mchars_res2cp -.Fa "struct mchars *p" -.Fa "const char *cp" -.Fa "size_t sz" +.Fn mchars_num2uc "const char *cp" "size_t sz" .Ft "const char *" -.Fc -.Ft "const char *" .Fo mchars_spec2str .Fa "struct mchars *p" .Fa "const char *cp" @@ -188,6 +177,9 @@ library also contains routines for translating charact .Pq see Fn mchars_alloc and parsing escape sequences from strings .Pq see Fn mandoc_escape . +.Pp +This library is +.Ud .Sh REFERENCE This section documents the functions, types, and variables available via @@ -247,22 +239,16 @@ The object must be freed with Free an object created with .Fn mchars_alloc . .It Fn mchars_num2char -Convert a character index as found in \eN\(aq\(aq into a printable -character. +Convert a character index (e.g., the \eN\(aq\(aq escape) into a +printable ASCII character. Returns \e0 (the nil character) if the input sequence is malformed. -.It Fn mchars_res2cp -Convert a predefined character into a valid Unicode codepoint. -Returns \-1 on failure and 0 if no code-point exists (if this occurs, -the caller should fall back to -.Fn mchars_res2str ) . -.It Fn mchars_res2str -Convert a predefined character into an ASCII string. -Returns NULL on failure. +.It Fn mchars_num2uc +Convert a hexadecimal character index (e.g., the \e[uNNNN] escape) into +a Unicode codepoint. +Returns \e0 (the nil character) if the input sequence is malformed. .It Fn mchars_spec2cp Convert a special character into a valid Unicode codepoint. -Returns \-1 on failure and 0 if no code-point exists (if this occurs, -the caller should fall back to -.Fn mchars_spec2str ) . +Returns \-1 on failure or a non-zero Unicode codepoint on success. .It Fn mchars_spec2str Convert a special character into an ASCII string. Returns NULL on failure.