1 /* doc in vfprintf.c */
3 /* This code created by modifying vsprintf.c so copyright inherited. */
6 * Copyright (c) 1990 The Regents of the University of California.
9 * Redistribution and use in source and binary forms are permitted
10 * provided that the above copyright notice and this paragraph are
11 * duplicated in all such forms and that any documentation,
12 * advertising materials, and other materials related to such
13 * distribution and use acknowledge that the software was developed
14 * by the University of California, Berkeley. The name of the
15 * University may not be used to endorse or promote products derived
16 * from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 #if defined(LIBC_SCCS) && !defined(lint)
23 static char sccsid
[] = "%W% (Berkeley) %G%";
24 #endif /* LIBC_SCCS and not lint */
39 _DEFUN (vsnprintf
, (str
, size
, fmt
, ap
),
48 f
._flags
= __SWR
| __SSTR
;
49 f
._bf
._base
= f
._p
= (unsigned char *) str
;
50 f
._bf
._size
= f
._w
= (size
> 0 ? size
- 1 : 0);
51 ret
= _vfprintf_r (_REENT
, &f
, fmt
, ap
);
57 #endif /* !_REENT_ONLY */
60 _DEFUN (_vsnprintf_r
, (ptr
, str
, size
, fmt
, ap
),
61 struct _reent
*ptr _AND
70 f
._flags
= __SWR
| __SSTR
;
71 f
._bf
._base
= f
._p
= (unsigned char *) str
;
72 f
._bf
._size
= f
._w
= (size
> 0 ? size
- 1 : 0);
73 ret
= _vfprintf_r (ptr
, &f
, fmt
, ap
);