Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/machine/spu/vsnprintf.c')
-rw-r--r--newlib/libc/machine/spu/vsnprintf.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/newlib/libc/machine/spu/vsnprintf.c b/newlib/libc/machine/spu/vsnprintf.c
new file mode 100644
index 000000000..a5ed0f2ee
--- /dev/null
+++ b/newlib/libc/machine/spu/vsnprintf.c
@@ -0,0 +1,47 @@
+
+#include <_ansi.h>
+#include <stdio.h>
+
+#include "c99ppe.h"
+
+#ifdef _HAVE_STDC
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
+typedef struct
+{
+ char* str;
+ unsigned int pad0[ 3 ];
+ size_t size;
+ unsigned int pad1[ 3 ];
+ char* fmt;
+ unsigned int pad2[ 3 ];
+ va_list ap;
+} c99_vsnprintf_t;
+
+#ifndef _REENT_ONLY
+
+int
+_DEFUN (vsnprintf, (str, size, fmt, ap),
+ char *str _AND
+ size_t size _AND
+ _CONST char *fmt _AND
+ va_list ap)
+{
+ int* ret;
+ c99_vsnprintf_t args;
+ ret = (int*) &args;
+
+ args.str = str;
+ args.size = size;
+ args.fmt = fmt;
+ va_copy(args.ap,ap);
+
+ send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSNPRINTF, &args);
+
+ return *ret;
+}
+
+#endif /* ! _REENT_ONLY */