mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-15 11:00:04 +08:00
22a339e8f2
Kazunori Asayama <asayama@sm.sony.co.jp> * libc/machine/spu/Makefile.am: Add objects. * libc/machine/spu/Makefile.in: Regenerated. * libc/machine/spu/vsscanf.c: New file. Add a stdio function implementation. * libc/machine/spu/snprintf.c: Ditto. * libc/machine/spu/sprintf.c: Ditto. * libc/machine/spu/sscanf.c: Ditto. * libc/machine/spu/remove.c: Ditto. * libc/machine/spu/rename.c: Ditto. * libc/machine/spu/tmpnam.c: Ditto. * libc/machine/spu/vsnprintf.c: Add initialization routine of stdio stuffs. * libc/machine/spu/vsprintf.c: Ditto.
50 lines
738 B
C
50 lines
738 B
C
#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 ];
|
|
_CONST 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;
|
|
|
|
CHECK_STR_INIT(_REENT);
|
|
|
|
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 */
|