2006-12-19 04:39:02 +08:00
|
|
|
#include <_ansi.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "c99ppe.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
2007-02-21 04:58:38 +08:00
|
|
|
#ifdef INTEGER_ONLY
|
|
|
|
# define vsnprintf vsniprintf
|
|
|
|
#endif
|
|
|
|
|
2006-12-19 04:39:02 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char* str;
|
|
|
|
unsigned int pad0[ 3 ];
|
|
|
|
size_t size;
|
|
|
|
unsigned int pad1[ 3 ];
|
2017-12-04 10:25:16 +08:00
|
|
|
const char* fmt;
|
2006-12-19 04:39:02 +08:00
|
|
|
unsigned int pad2[ 3 ];
|
|
|
|
va_list ap;
|
|
|
|
} c99_vsnprintf_t;
|
|
|
|
|
|
|
|
#ifndef _REENT_ONLY
|
|
|
|
|
|
|
|
int
|
2017-12-04 11:43:30 +08:00
|
|
|
vsnprintf (char *__restrict str,
|
2017-12-04 09:31:41 +08:00
|
|
|
size_t size,
|
2017-12-04 10:25:16 +08:00
|
|
|
const char *__restrict fmt,
|
2006-12-19 04:39:02 +08:00
|
|
|
va_list ap)
|
|
|
|
{
|
|
|
|
c99_vsnprintf_t args;
|
2007-02-02 00:43:45 +08:00
|
|
|
|
|
|
|
CHECK_STR_INIT(_REENT);
|
|
|
|
|
2006-12-19 04:39:02 +08:00
|
|
|
args.str = str;
|
|
|
|
args.size = size;
|
|
|
|
args.fmt = fmt;
|
|
|
|
va_copy(args.ap,ap);
|
|
|
|
|
2007-05-24 05:41:17 +08:00
|
|
|
return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSNPRINTF, &args);
|
2006-12-19 04:39:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* ! _REENT_ONLY */
|