source: trunk/libs/newlib/src/newlib/libc/machine/spu/vsnprintf.c @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 676 bytes
Line 
1#include <_ansi.h>
2#include <stdio.h>
3
4#include "c99ppe.h"
5
6#include <stdarg.h>
7
8#ifdef INTEGER_ONLY
9#  define vsnprintf vsniprintf
10#endif
11
12typedef struct
13{
14  char* str;
15  unsigned int pad0[ 3 ];
16  size_t size;
17  unsigned int pad1[ 3 ];
18  const char* fmt;
19  unsigned int pad2[ 3 ];
20  va_list ap;
21} c99_vsnprintf_t;
22
23#ifndef _REENT_ONLY
24
25int
26vsnprintf (char *__restrict str,
27     size_t size,
28     const char *__restrict fmt,
29     va_list ap)
30{
31  c99_vsnprintf_t args;
32
33  CHECK_STR_INIT(_REENT);
34
35  args.str = str;
36  args.size = size;
37  args.fmt = fmt;
38  va_copy(args.ap,ap);
39
40  return __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSNPRINTF, &args);
41}
42
43#endif /* ! _REENT_ONLY */
Note: See TracBrowser for help on using the repository browser.