2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 C99 function vsnprintf().
7 /* Original source from libnix */
18 static int _vsnprintf_uc (int c
, struct data
* data
)
29 /*****************************************************************************
43 Format a list of arguments and put them into the string str.
44 The function makes sure that no more than n characters (including
45 the terminal 0 byte) are written into str.
46 If n is zero, nothing is written, and s may be a null pointer. Otherwise,
47 output characters beyond the n-1st are discarded rather than being written
48 to the array, and a null character is written at the end of the characters
49 actually written into the array. If copying takes place between objects
50 that overlap, the behavior is undefined.
53 str - The formatted result is stored here
55 format - A printf() format string.
56 args - A list of arguments for the format string.
59 Function returns the number of characters that would have been
60 written had n been sufficiently large, not counting the terminating null
61 character, or a negative value if an encoding error occurred. Thus, the
62 null-terminated output has been completely written if and only if the
63 returned value is nonnegative and less than n.
72 printf(), sprintf(), fprintf(), vprintf(), vfprintf(), snprintf(),
77 ******************************************************************************/
82 if (str
== NULL
&& n
!= 0) n
= 0;
87 rc
= __vcformat (&data
, (void *)_vsnprintf_uc
, format
, args
);