Hi Stefan,

Stefan Sperling wrote on Fri, Apr 29, 2011 at 01:16:37PM +0200:

> Does this look alright? Based on FreeBSD's page.

Looks good from the mdoc(7) side, except that we haven't support yet
for measuring the width of formatted strings, so for now, better
provide width strings unformatted.  That should be fixed with the
patch below.

Besides, I'd remove the FreeBSD CVS IDs because apparently, they have not
been updated after printf.3 was copied to wprintf.3, so they seem
misleading.

Finally, there is no need to mark up NUL; in particular, it is not
a preprocessor constant.

Yours,
  Ingo


--- wprintf.3.orig      Fri Apr 29 14:02:49 2011
+++ wprintf.3   Fri Apr 29 16:21:50 2011
@@ -1,4 +1,5 @@
-.\" $OpenBSD$
+.\"    $OpenBSD$
+.\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
@@ -14,7 +15,7 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
+.\" 3. Neither the name of the University nor the names of its contributors
 .\"    may be used to endorse or promote products derived from this software
 .\"    without specific prior written permission.
 .\"
@@ -31,10 +32,8 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)printf.3   8.1 (Berkeley) 6/4/93
-.\" FreeBSD: src/lib/libc/stdio/printf.3,v 1.47 2002/09/06 11:23:55 tjr Exp
-.\" $FreeBSD$
 .\"
-.Dd July 5, 2003
+.Dd $Mdocdate$
 .Dt WPRINTF 3
 .Os
 .Sh NAME
@@ -131,7 +130,7 @@
 are accessed the results will be indeterminate.
 .It
 Zero or more of the following flags:
-.Bl -tag -width ".So \  Sc (space)"
+.Bl -tag -width "'0' (space)"
 .It Sq Cm #
 The value should be converted to an
 .Dq alternate form .
@@ -253,26 +252,16 @@
 or
 .Cm X
 conversion:
-.Bl -column ".Cm ll No (ell ell)" ".Vt signed char" ".Vt unsigned long long" 
".Vt long long *"
-.It Sy Modifier Ta Cm d , i Ta Cm o , u , x , X
-.It Cm hh Ta Vt "signed char" Ta Vt "unsigned char"
-.It Cm h Ta Vt short Ta Vt "unsigned short"
-.It Cm l No (ell) Ta Vt long Ta Vt "unsigned long"
-.It Cm ll No (ell ell) Ta Vt "long long" Ta Vt "unsigned long long"
-.It Cm j Ta Vt intmax_t Ta Vt uintmax_t
-.It Cm t Ta Vt ptrdiff_t Ta (see note)
-.It Cm z Ta (see note) Ta Vt size_t
+.Bl -column "ll (ell ell)" "signed char" "unsigned long long" "long long *"
+.It Sy Modifier Ta Cm d , i Ta Cm o , u , x , X Ta Cm n
+.It Cm hh Ta Vt "signed char" Ta Vt "unsigned char" Ta Vt "signed char *"
+.It Cm h Ta Vt short Ta Vt "unsigned short" Ta Vt "short *"
+.It Cm l No (ell) Ta Vt long Ta Vt "unsigned long" Ta Vt "long *"
+.It Cm ll No (ell ell) Ta Vt "long long" Ta Vt "unsigned long long" Ta Vt 
"long long *"
+.It Cm j Ta Vt intmax_t Ta Vt uintmax_t Ta Vt "intmax_t *"
+.It Cm t Ta Vt ptrdiff_t Ta (see note) Ta Vt "ptrdiff_t *"
+.It Cm z Ta (see note) Ta Vt size_t Ta (see note)
 .El
-.Bl -column ".Cm ll No (ell ell)" ".Vt signed char *"
-.It Sy Modifier Ta Cm n
-.It Cm hh Ta Vt "signed char *"
-.It Cm h Ta Vt "short *"
-.It Cm l No (ell) Ta Vt "long *"
-.It Cm ll No (ell ell) Ta Vt "long long *"
-.It Cm j Ta Vt "intmax_t *"
-.It Cm t Ta Vt "ptrdiff_t *"
-.It Cm z Ta (see note)
-.El
 .Pp
 Note:
 the
@@ -304,7 +293,7 @@
 or
 .Cm G
 conversion:
-.Bl -column ".Sy Modifier" ".Cm a , A , e , E , f , F , g , G"
+.Bl -column "Modifier" "a, A, e, E, f, F, g, G"
 .It Sy Modifier Ta Cm a , A , e , E , f , F , g , G
 .It Cm L Ta Vt "long double"
 .El
@@ -314,7 +303,7 @@
 or
 .Cm s
 conversion:
-.Bl -column ".Sy Modifier" ".Vt wint_t" ".Vt wchar_t *"
+.Bl -column "Modifier" "wint_t" "wchar_t *"
 .It Sy Modifier Ta Cm c Ta Cm s
 .It Cm l No (ell) Ta Vt wint_t Ta Vt "wchar_t *"
 .El
@@ -340,7 +329,7 @@
 and non-positional arguments, the results are undefined.
 .Pp
 The conversion specifiers and their meanings are:
-.Bl -tag -width ".Cm diouxX"
+.Bl -tag -width "diouxX"
 .It Cm diouxX
 The
 .Vt int
@@ -522,16 +511,12 @@
 to a string) containing a multibyte sequence.
 Characters from the array are converted to wide characters and written up to
 (but not including)
-a terminating
-.Dv NUL
-character;
+a terminating NUL character;
 if a precision is specified, no more than the number specified are
 written.
 If a precision is given, no null character
 need be present; if the precision is not specified, or is greater than
-the size of the array, the array must contain a terminating
-.Dv NUL
-character.
+the size of the array, the array must contain a terminating NUL character.
 .Pp
 If the
 .Cm l
@@ -542,17 +527,13 @@
 Each wide character in the string
 is written.
 Wide characters from the array are written up to (but not including)
-a terminating wide
-.Dv NUL
-character;
+a terminating wide NUL character;
 if a precision is specified, no more than the number specified are
 written (including shift sequences).
 If a precision is given, no null character
 need be present; if the precision is not specified, or is greater than
 the number of characters in
-the string, the array must contain a terminating wide
-.Dv NUL
-character.
+the string, the array must contain a terminating wide NUL character.
 .It Cm p
 The
 .Vt "void *"

Reply via email to