3 /* vsnprintf( char *, size_t, const char *, va_list ap )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
14 int vsnprintf( char * _PDCLIB_restrict s, size_t n, const char * _PDCLIB_restrict format, _PDCLIB_va_list arg )
16 /* TODO: This function should interpret format as multibyte characters. */
17 struct _PDCLIB_status_t status;
27 va_copy( status.arg, arg );
29 while ( *format != '\0' )
32 if ( ( *format != '%' ) || ( ( rc = _PDCLIB_print( format, &status ) ) == format ) )
34 /* No conversion specifier, print verbatim */
37 s[ status.i ] = *format;
44 /* Continue parsing after conversion specifier */
59 #define _PDCLIB_FILEID "stdio/vsnprintf.c"
60 #define _PDCLIB_STRINGIO
62 #include <_PDCLIB_test.h>
64 static int testprintf( char * s, const char * format, ... )
68 va_start( arg, format );
69 i = vsnprintf( s, 100, format, arg );
77 #include "printf_testcases.h"