diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-03-07 21:53:33 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-03-07 21:53:33 +0000 |
commit | 5d6b8bbd54ab3ccaada8a85c3878a7500d088ada (patch) | |
tree | 1db7c744ea008e7e1435da8be8dd114fe5dcc16c /lib/libc/stdio/printf.3 | |
parent | b913a401981440289fb1e8b3ec92c1c987172f53 (diff) |
Use .Ox
Diffstat (limited to 'lib/libc/stdio/printf.3')
-rw-r--r-- | lib/libc/stdio/printf.3 | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/lib/libc/stdio/printf.3 b/lib/libc/stdio/printf.3 index 46afd207f01..148fb1f6147 100644 --- a/lib/libc/stdio/printf.3 +++ b/lib/libc/stdio/printf.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: printf.3,v 1.7 1998/01/12 06:17:26 millert Exp $ +.\" $OpenBSD: printf.3,v 1.8 1998/03/07 21:53:30 millert Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -46,11 +46,13 @@ .Nm sprintf , .Nm snprintf , .Nm asprintf , +.Nm asnprintf , .Nm vprintf , .Nm vfprintf, .Nm vsprintf , .Nm vsnprintf , .Nm vasprintf +.Nm vansprintf .Nd formatted output conversion .Sh SYNOPSIS .Fd #include <stdio.h> @@ -64,6 +66,8 @@ .Fn snprintf "char *str" "size_t size" "const char *format" ... .Ft int .Fn asprintf "char **ret" "const char *format" ... +.Ft int +.Fn asnprintf "char **ret" "size_t size" "const char *format" ... .Fd #include <stdarg.h> .Ft int .Fn vprintf "const char *format" "va_list ap" @@ -75,6 +79,8 @@ .Fn vsnprintf "char *str" "size_t size" "const char *format" "va_list ap" .Ft int .Fn vasprintf "char **ret" "const char *format" "va_list ap" +.Ft int +.Fn vasnprintf "char **ret" "size_t size" "const char *format" "va_list ap" .Sh DESCRIPTION The .Fn printf @@ -99,9 +105,11 @@ and .Fn vsnprintf write to the character string .Fa str ; -.Fn asprintf -and +.Fn asprintf , +.Fn asnprintf , .Fn vasprintf +and +.Fn vasnprintf write to a dynamically allocated string that is stored in .Fa ret . .Pp @@ -118,9 +126,11 @@ the number of characters printed .Ql \e0 used to end output to strings). .Pp -.Fn Asprintf -and +.Fn Asprintf , +.Fn asnprintf , .Fn vasprintf +and +.Fn vasnprintf return a pointer to a buffer sufficiently large to hold the string in the .Fa ret @@ -133,9 +143,21 @@ will return -1 and set .Fa ret to be a NULL pointer. .Pp -.Fn Snprintf +If +.Fn asnprintf +or +.Fn vasprintf +are given a +.Fa size +of 0, they set +.Fa ret +to be a NULL pointer. +.Pp +.Fn Snprintf , +.Fn vsnprintf , +.Fn asnprintf and -.Fn vsnprintf +.Fn vasnprintf will write at most .Fa size Ns \-1 of the characters printed into the output string @@ -621,8 +643,7 @@ The functions and .Fn vasprintf first appeared in the GNU C library. This implementation first appeared in -.Bx Open -2.3. +.Ox 2.3 . .Sh BUGS The conversion formats .Cm \&%D , |