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,
16 const char * _PDCLIB_restrict format,
19 /* TODO: This function should interpret format as multibyte characters. */
20 struct _PDCLIB_status_t status;
30 va_copy( status.arg, arg );
32 while ( *format != '\0' )
35 if ( ( *format != '%' ) || ( ( rc = _PDCLIB_print( format, &status ) ) == format ) )
37 /* No conversion specifier, print verbatim */
40 s[ status.i ] = *format;
47 /* Continue parsing after conversion specifier */
62 #define _PDCLIB_FILEID "stdio/vsnprintf.c"
63 #define _PDCLIB_STRINGIO
65 #include <_PDCLIB_test.h>
67 static int testprintf( char * s, const char * format, ... )
71 va_start( arg, format );
72 i = vsnprintf( s, 100, format, arg );
80 #include "printf_testcases.h"