2 * Copyright (c) 1990 The Regents of the University of California.
5 * Redistribution and use in source and binary forms are permitted
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * and/or other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 <<viprintf>>, <<vfiprintf>>, <<vsiprintf>>, <<vsniprintf>>, <<vasiprintf>>, <<vasniprintf>>---format argument list (integer only)
50 int viprintf(const char *<[fmt]>, va_list <[list]>);
51 int vfiprintf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>);
52 int vsiprintf(char *<[str]>, const char *<[fmt]>, va_list <[list]>);
53 int vsniprintf(char *<[str]>, size_t <[size]>, const char *<[fmt]>,
55 int vasiprintf(char **<[strp]>, const char *<[fmt]>, va_list <[list]>);
56 char *vasniprintf(char *<[str]>, size_t *<[size]>, const char *<[fmt]>,
59 int _viprintf_r(struct _reent *<[reent]>, const char *<[fmt]>,
61 int _vfiprintf_r(struct _reent *<[reent]>, FILE *<[fp]>,
62 const char *<[fmt]>, va_list <[list]>);
63 int _vsiprintf_r(struct _reent *<[reent]>, char *<[str]>,
64 const char *<[fmt]>, va_list <[list]>);
65 int _vsniprintf_r(struct _reent *<[reent]>, char *<[str]>,
66 size_t <[size]>, const char *<[fmt]>, va_list <[list]>);
67 int _vasiprintf_r(struct _reent *<[reent]>, char **<[str]>,
68 const char *<[fmt]>, va_list <[list]>);
69 char *_vasniprintf_r(struct _reent *<[reent]>, char *<[str]>,
70 size_t *<[size]>, const char *<[fmt]>, va_list <[list]>);
73 <<viprintf>>, <<vfiprintf>>, <<vasiprintf>>, <<vsiprintf>>,
74 <<vsniprintf>>, and <<vasniprintf>> are (respectively) variants of
75 <<iprintf>>, <<fiprintf>>, <<asiprintf>>, <<siprintf>>, <<sniprintf>>,
76 and <<asniprintf>>. They differ only in allowing their caller to pass
77 the variable argument list as a <<va_list>> object (initialized by
78 <<va_start>>) rather than directly accepting a variable number of
79 arguments. The caller is responsible for calling <<va_end>>.
81 <<_viprintf_r>>, <<_vfiprintf_r>>, <<_vasiprintf_r>>,
82 <<_vsiprintf_r>>, <<_vsniprintf_r>>, and <<_vasniprintf_r>> are
83 reentrant versions of the above.
86 The return values are consistent with the corresponding functions:
89 All of these functions are newlib extensions.
91 Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
92 <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
104 viprintf (const char *fmt
,
107 struct _reent
*reent
= _REENT
;
109 _REENT_SMALL_CHECK_INIT (reent
);
110 return _vfiprintf_r (reent
, _stdout_r (reent
), fmt
, ap
);
113 #endif /* !_REENT_ONLY */
116 _viprintf_r (struct _reent
*ptr
,
120 _REENT_SMALL_CHECK_INIT (ptr
);
121 return _vfiprintf_r (ptr
, _stdout_r (ptr
), fmt
, ap
);