2007-02-01 Joel Schopp <jschopp@austin.ibm.com>

Kazunori Asayama <asayama@sm.sony.co.jp>

        * configure.host: Enable SPU specific stdio directory.
        * libc/machine/spu/Makefile.am: Add objects.
        * libc/machine/spu/Makefile.in: Regenerated.
        * libc/machine/spu/c99ppe.h: Add macros and function
        declarations to initialize SPU specific stdio stuffs.
        * libc/machine/spu/stdio.c: Add functions to manage Cell SPU
        specific FILE structures.
        * libc/machine/spu/perror.c: Add initialization routine of
        stdio stuffs.
        * libc/machine/spu/printf.c: Ditto.
        * libc/machine/spu/putchar.c: Ditto.
        * libc/machine/spu/puts.c: Ditto.
        * libc/machine/spu/vprintf.c: Ditto.
        * libc/machine/spu/clearerr.c: New file. Add a stdio function
        implementation.
        * libc/machine/spu/feof.c: Ditto.
        * libc/machine/spu/ferror.c: Ditto.
        * libc/machine/spu/fileno.c: Ditto.
        * libc/machine/spu/fopen.c: Ditto.
        * libc/machine/spu/fclose.c: Ditto.
        * libc/machine/spu/freopen.c: Ditto.
        * libc/machine/spu/fflush.c: Ditto.
        * libc/machine/spu/fseek.c: Ditto.
        * libc/machine/spu/ftell.c: Ditto.
        * libc/machine/spu/rewind.c: Ditto.
        * libc/machine/spu/fgetpos.c: Ditto.
        * libc/machine/spu/fsetpos.c: Ditto.
        * libc/machine/spu/fread.c: Ditto.
        * libc/machine/spu/fwrite.c: Ditto.
        * libc/machine/spu/getc.c: Ditto.
        * libc/machine/spu/getchar.c: Ditto.
        * libc/machine/spu/gets.c: Ditto.
        * libc/machine/spu/fgetc.c: Ditto.
        * libc/machine/spu/fgets.c: Ditto.
        * libc/machine/spu/ungetc.c: Ditto.
        * libc/machine/spu/putc.c: Ditto.
        * libc/machine/spu/fputc.c: Ditto.
        * libc/machine/spu/fputs.c: Ditto.
        * libc/machine/spu/vfprintf.c: Ditto.
        * libc/machine/spu/vfscanf.c: Ditto.
        * libc/machine/spu/fprintf.c: Ditto.
        * libc/machine/spu/fscanf.c: Ditto.
        * libc/machine/spu/scanf.c: Ditto.
        * libc/machine/spu/vscanf.c: Ditto.
        * libc/machine/spu/setbuf.c: Ditto.
        * libc/machine/spu/setvbuf.c: Ditto.
        * libc/machine/spu/tmpfile.c: Ditto.

2007-02-01  Jeff Johnston  <jjohnstn@redhat.com>

        * libc/include/sys/config.h[__SPU__]: Define __CUSTOM_FILE_IO__.
        * libc/include/stdio.h[!__CUSTOM_FILE_IO__]: Add flag check
        around stdio macros that manipulate fields in the normal file
        structure.
        * libc/include/sys/reent.h[__CUSTOM_FILE_IO__]: Include
        <sys/custom_file.h> to define custom FILE structure.
        * libc/include/sys/custom_file.h: New default header file
        that generates error if not overridden when __CUSTOM_FILE_IO__ set.
        * libc/machine/spu/sys/custom_file.h: New file.
This commit is contained in:
Jeff Johnston 2007-02-01 16:33:05 +00:00
parent 4815dd49bb
commit 7d592bb178
49 changed files with 2625 additions and 26 deletions

View File

@ -1,3 +1,66 @@
2007-02-01 Joel Schopp <jschopp@austin.ibm.com>
Kazunori Asayama <asayama@sm.sony.co.jp>
* configure.host: Enable SPU specific stdio directory.
* libc/machine/spu/Makefile.am: Add objects.
* libc/machine/spu/Makefile.in: Regenerated.
* libc/machine/spu/c99ppe.h: Add macros and function
declarations to initialize SPU specific stdio stuffs.
* libc/machine/spu/stdio.c: Add functions to manage Cell SPU
specific FILE structures.
* libc/machine/spu/perror.c: Add initialization routine of
stdio stuffs.
* libc/machine/spu/printf.c: Ditto.
* libc/machine/spu/putchar.c: Ditto.
* libc/machine/spu/puts.c: Ditto.
* libc/machine/spu/vprintf.c: Ditto.
* libc/machine/spu/clearerr.c: New file. Add a stdio function
implementation.
* libc/machine/spu/feof.c: Ditto.
* libc/machine/spu/ferror.c: Ditto.
* libc/machine/spu/fileno.c: Ditto.
* libc/machine/spu/fopen.c: Ditto.
* libc/machine/spu/fclose.c: Ditto.
* libc/machine/spu/freopen.c: Ditto.
* libc/machine/spu/fflush.c: Ditto.
* libc/machine/spu/fseek.c: Ditto.
* libc/machine/spu/ftell.c: Ditto.
* libc/machine/spu/rewind.c: Ditto.
* libc/machine/spu/fgetpos.c: Ditto.
* libc/machine/spu/fsetpos.c: Ditto.
* libc/machine/spu/fread.c: Ditto.
* libc/machine/spu/fwrite.c: Ditto.
* libc/machine/spu/getc.c: Ditto.
* libc/machine/spu/getchar.c: Ditto.
* libc/machine/spu/gets.c: Ditto.
* libc/machine/spu/fgetc.c: Ditto.
* libc/machine/spu/fgets.c: Ditto.
* libc/machine/spu/ungetc.c: Ditto.
* libc/machine/spu/putc.c: Ditto.
* libc/machine/spu/fputc.c: Ditto.
* libc/machine/spu/fputs.c: Ditto.
* libc/machine/spu/vfprintf.c: Ditto.
* libc/machine/spu/vfscanf.c: Ditto.
* libc/machine/spu/fprintf.c: Ditto.
* libc/machine/spu/fscanf.c: Ditto.
* libc/machine/spu/scanf.c: Ditto.
* libc/machine/spu/vscanf.c: Ditto.
* libc/machine/spu/setbuf.c: Ditto.
* libc/machine/spu/setvbuf.c: Ditto.
* libc/machine/spu/tmpfile.c: Ditto.
2007-02-01 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/config.h[__SPU__]: Define __CUSTOM_FILE_IO__.
* libc/include/stdio.h[!__CUSTOM_FILE_IO__]: Add flag check
around stdio macros that manipulate fields in the normal file
structure.
* libc/include/sys/reent.h[__CUSTOM_FILE_IO__]: Include
<sys/custom_file.h> to define custom FILE structure.
* libc/include/sys/custom_file.h: New default header file
that generates error if not overridden when __CUSTOM_FILE_IO__ set.
* libc/machine/spu/sys/custom_file.h: New file.
2007-01-31 Kazunori Asayama <asayama@sm.sony.co.jp> 2007-01-31 Kazunori Asayama <asayama@sm.sony.co.jp>
* configure.host: Define stdio directory as a variable. * configure.host: Define stdio directory as a variable.

View File

@ -257,6 +257,7 @@ case "${host_cpu}" in
machine_dir=z8k machine_dir=z8k
;; ;;
spu) spu)
stdio_dir=
machine_dir=spu machine_dir=spu
newlib_cflags="${newlib_cflags} -ffunction-sections -fdata-sections " newlib_cflags="${newlib_cflags} -ffunction-sections -fdata-sections "
;; ;;

View File

@ -395,6 +395,7 @@ FILE *_EXFUN(funopen,(const _PTR _cookie,
#define fwopen(cookie, fn) funopen(cookie, (int (*)())0, fn, (fpos_t (*)())0, (int (*)())0) #define fwopen(cookie, fn) funopen(cookie, (int (*)())0, fn, (fpos_t (*)())0, (int (*)())0)
#endif #endif
#ifndef __CUSTOM_FILE_IO__
/* /*
* The __sfoo macros are here so that we can * The __sfoo macros are here so that we can
* define function versions in the C library. * define function versions in the C library.
@ -472,9 +473,6 @@ static __inline int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) {
#endif /* lint */ #endif /* lint */
#endif /* __CYGWIN__ */ #endif /* __CYGWIN__ */
#define getchar() getc(stdin)
#define putchar(x) putc(x, stdout)
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* fast always-buffered version, true iff error */ /* fast always-buffered version, true iff error */
#define fast_putc(x,p) (--(p)->_w < 0 ? \ #define fast_putc(x,p) (--(p)->_w < 0 ? \
@ -486,6 +484,11 @@ static __inline int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) {
#endif #endif
#endif #endif
#endif /* !__CUSTOM_FILE_IO__ */
#define getchar() getc(stdin)
#define putchar(x) putc(x, stdout)
_END_STD_C _END_STD_C
#endif /* _STDIO_H_ */ #endif /* _STDIO_H_ */

View File

@ -132,6 +132,7 @@
#ifdef __SPU__ #ifdef __SPU__
#define MALLOC_ALIGNMENT 16 #define MALLOC_ALIGNMENT 16
#define __CUSTOM_FILE_IO__
#endif #endif
/* This block should be kept in sync with GCC's limits.h. The point /* This block should be kept in sync with GCC's limits.h. The point

View File

@ -0,0 +1,2 @@
#error System-specific custom_file.h is missing.

View File

@ -212,6 +212,12 @@ struct __sFILE {
#endif #endif
}; };
#ifdef __CUSTOM_FILE_IO__
/* Get custom _FILE definition. */
#include <sys/custom_file.h>
#else /* !__CUSTOM_FILE_IO__ */
#ifdef __LARGE64_FILES #ifdef __LARGE64_FILES
struct __sFILE64 { struct __sFILE64 {
unsigned char *_p; /* current position in (some) buffer */ unsigned char *_p; /* current position in (some) buffer */
@ -260,6 +266,7 @@ typedef struct __sFILE64 __FILE;
#else #else
typedef struct __sFILE __FILE; typedef struct __sFILE __FILE;
#endif /* __LARGE64_FILES */ #endif /* __LARGE64_FILES */
#endif /* !__CUSTOM_FILE_IO__ */
struct _glue struct _glue
{ {
@ -459,6 +466,10 @@ extern const struct __sFILE_fake __sf_fake_stderr;
#define __reent_assert(x) ((void)0) #define __reent_assert(x) ((void)0)
#endif #endif
#ifdef __CUSTOM_FILE_IO__
#error Custom FILE I/O and _REENT_SMALL not currently supported.
#endif
/* Generic _REENT check macro. */ /* Generic _REENT check macro. */
#define _REENT_CHECK(var, what, type, size, init) do { \ #define _REENT_CHECK(var, what, type, size, init) do { \
struct _reent *_r = (var); \ struct _reent *_r = (var); \

View File

@ -8,12 +8,19 @@ noinst_LIBRARIES = lib.a
AM_CCASFLAGS = $(INCLUDES) AM_CCASFLAGS = $(INCLUDES)
lib_a_SOURCES = setjmp.S memcpy.c memmove.c memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strspn.c strxfrm.c printf.c perror.c putchar.c puts.c vsnprintf.c vprintf.c vsprintf.c lib_a_SOURCES = setjmp.S memcpy.c memmove.c memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strspn.c strxfrm.c \
stdio.c clearerr.c feof.c ferror.c fileno.c fopen.c fclose.c freopen.c \
fflush.c fseek.c ftell.c rewind.c fgetpos.c fsetpos.c fread.c fwrite.c \
getc.c putc.c fgetc.c fgets.c fputc.c fputs.c ungetc.c \
fprintf.c fscanf.c vfprintf.c vfscanf.c \
perror.c gets.c getchar.c putchar.c puts.c \
printf.c scanf.c vprintf.c vscanf.c \
setbuf.c setvbuf.c tmpfile.c \
vsnprintf.c vsprintf.c
lib_a_CCASFLAGS = $(AM_CCASFLAGS) lib_a_CCASFLAGS = $(AM_CCASFLAGS)
lib_a_CFLAGS = $(AM_CFLAGS) lib_a_CFLAGS = $(AM_CFLAGS)
ACLOCAL_AMFLAGS = -I ../../.. ACLOCAL_AMFLAGS = -I ../../..
AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host

View File

@ -51,6 +51,23 @@ DIST_COMMON = $(srcdir)/../../../../config.guess \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \ $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \ $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \ $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile
subdir = . subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@ -74,10 +91,27 @@ am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-memcpy.$(OBJEXT) \
lib_a-strncat.$(OBJEXT) lib_a-strncmp.$(OBJEXT) \ lib_a-strncat.$(OBJEXT) lib_a-strncmp.$(OBJEXT) \
lib_a-strncpy.$(OBJEXT) lib_a-strpbrk.$(OBJEXT) \ lib_a-strncpy.$(OBJEXT) lib_a-strpbrk.$(OBJEXT) \
lib_a-strrchr.$(OBJEXT) lib_a-strspn.$(OBJEXT) \ lib_a-strrchr.$(OBJEXT) lib_a-strspn.$(OBJEXT) \
lib_a-strxfrm.$(OBJEXT) lib_a-printf.$(OBJEXT) \ lib_a-strxfrm.$(OBJEXT) lib_a-stdio.$(OBJEXT) \
lib_a-perror.$(OBJEXT) lib_a-putchar.$(OBJEXT) \ lib_a-clearerr.$(OBJEXT) lib_a-feof.$(OBJEXT) \
lib_a-puts.$(OBJEXT) lib_a-vsnprintf.$(OBJEXT) \ lib_a-ferror.$(OBJEXT) lib_a-fileno.$(OBJEXT) \
lib_a-vprintf.$(OBJEXT) lib_a-vsprintf.$(OBJEXT) lib_a-fopen.$(OBJEXT) lib_a-fclose.$(OBJEXT) \
lib_a-freopen.$(OBJEXT) lib_a-fflush.$(OBJEXT) \
lib_a-fseek.$(OBJEXT) lib_a-ftell.$(OBJEXT) \
lib_a-rewind.$(OBJEXT) lib_a-fgetpos.$(OBJEXT) \
lib_a-fsetpos.$(OBJEXT) lib_a-fread.$(OBJEXT) \
lib_a-fwrite.$(OBJEXT) lib_a-getc.$(OBJEXT) \
lib_a-putc.$(OBJEXT) lib_a-fgetc.$(OBJEXT) \
lib_a-fgets.$(OBJEXT) lib_a-fputc.$(OBJEXT) \
lib_a-fputs.$(OBJEXT) lib_a-ungetc.$(OBJEXT) \
lib_a-fprintf.$(OBJEXT) lib_a-fscanf.$(OBJEXT) \
lib_a-vfprintf.$(OBJEXT) lib_a-vfscanf.$(OBJEXT) \
lib_a-perror.$(OBJEXT) lib_a-gets.$(OBJEXT) \
lib_a-getchar.$(OBJEXT) lib_a-putchar.$(OBJEXT) \
lib_a-puts.$(OBJEXT) lib_a-printf.$(OBJEXT) \
lib_a-scanf.$(OBJEXT) lib_a-vprintf.$(OBJEXT) \
lib_a-vscanf.$(OBJEXT) lib_a-setbuf.$(OBJEXT) \
lib_a-setvbuf.$(OBJEXT) lib_a-tmpfile.$(OBJEXT) \
lib_a-vsnprintf.$(OBJEXT) lib_a-vsprintf.$(OBJEXT)
lib_a_OBJECTS = $(am_lib_a_OBJECTS) lib_a_OBJECTS = $(am_lib_a_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) DEFAULT_INCLUDES = -I. -I$(srcdir)
depcomp = depcomp =
@ -202,11 +236,19 @@ AUTOMAKE_OPTIONS = cygnus
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
noinst_LIBRARIES = lib.a noinst_LIBRARIES = lib.a
AM_CCASFLAGS = $(INCLUDES) AM_CCASFLAGS = $(INCLUDES)
lib_a_SOURCES = setjmp.S memcpy.c memmove.c memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strspn.c strxfrm.c printf.c perror.c putchar.c puts.c vsnprintf.c vprintf.c vsprintf.c lib_a_SOURCES = setjmp.S memcpy.c memmove.c memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strspn.c strxfrm.c \
stdio.c clearerr.c feof.c ferror.c fileno.c fopen.c fclose.c freopen.c \
fflush.c fseek.c ftell.c rewind.c fgetpos.c fsetpos.c fread.c fwrite.c \
getc.c putc.c fgetc.c fgets.c fputc.c fputs.c ungetc.c \
fprintf.c fscanf.c vfprintf.c vfscanf.c \
perror.c gets.c getchar.c putchar.c puts.c \
printf.c scanf.c vprintf.c vscanf.c \
setbuf.c setvbuf.c tmpfile.c \
vsnprintf.c vsprintf.c
lib_a_CCASFLAGS = $(AM_CCASFLAGS) lib_a_CCASFLAGS = $(AM_CCASFLAGS)
lib_a_CFLAGS = $(AM_CFLAGS) lib_a_CFLAGS = $(AM_CFLAGS)
ACLOCAL_AMFLAGS = -I ../../.. ACLOCAL_AMFLAGS = -I ../../..
AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
all: all-am all: all-am
@ -373,11 +415,167 @@ lib_a-strxfrm.o: strxfrm.c
lib_a-strxfrm.obj: strxfrm.c lib_a-strxfrm.obj: strxfrm.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strxfrm.obj `if test -f 'strxfrm.c'; then $(CYGPATH_W) 'strxfrm.c'; else $(CYGPATH_W) '$(srcdir)/strxfrm.c'; fi` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strxfrm.obj `if test -f 'strxfrm.c'; then $(CYGPATH_W) 'strxfrm.c'; else $(CYGPATH_W) '$(srcdir)/strxfrm.c'; fi`
lib_a-printf.o: printf.c lib_a-stdio.o: stdio.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-printf.o `test -f 'printf.c' || echo '$(srcdir)/'`printf.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stdio.o `test -f 'stdio.c' || echo '$(srcdir)/'`stdio.c
lib_a-printf.obj: printf.c lib_a-stdio.obj: stdio.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-printf.obj `if test -f 'printf.c'; then $(CYGPATH_W) 'printf.c'; else $(CYGPATH_W) '$(srcdir)/printf.c'; fi` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stdio.obj `if test -f 'stdio.c'; then $(CYGPATH_W) 'stdio.c'; else $(CYGPATH_W) '$(srcdir)/stdio.c'; fi`
lib_a-clearerr.o: clearerr.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-clearerr.o `test -f 'clearerr.c' || echo '$(srcdir)/'`clearerr.c
lib_a-clearerr.obj: clearerr.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-clearerr.obj `if test -f 'clearerr.c'; then $(CYGPATH_W) 'clearerr.c'; else $(CYGPATH_W) '$(srcdir)/clearerr.c'; fi`
lib_a-feof.o: feof.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feof.o `test -f 'feof.c' || echo '$(srcdir)/'`feof.c
lib_a-feof.obj: feof.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feof.obj `if test -f 'feof.c'; then $(CYGPATH_W) 'feof.c'; else $(CYGPATH_W) '$(srcdir)/feof.c'; fi`
lib_a-ferror.o: ferror.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ferror.o `test -f 'ferror.c' || echo '$(srcdir)/'`ferror.c
lib_a-ferror.obj: ferror.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ferror.obj `if test -f 'ferror.c'; then $(CYGPATH_W) 'ferror.c'; else $(CYGPATH_W) '$(srcdir)/ferror.c'; fi`
lib_a-fileno.o: fileno.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fileno.o `test -f 'fileno.c' || echo '$(srcdir)/'`fileno.c
lib_a-fileno.obj: fileno.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fileno.obj `if test -f 'fileno.c'; then $(CYGPATH_W) 'fileno.c'; else $(CYGPATH_W) '$(srcdir)/fileno.c'; fi`
lib_a-fopen.o: fopen.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fopen.o `test -f 'fopen.c' || echo '$(srcdir)/'`fopen.c
lib_a-fopen.obj: fopen.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fopen.obj `if test -f 'fopen.c'; then $(CYGPATH_W) 'fopen.c'; else $(CYGPATH_W) '$(srcdir)/fopen.c'; fi`
lib_a-fclose.o: fclose.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fclose.o `test -f 'fclose.c' || echo '$(srcdir)/'`fclose.c
lib_a-fclose.obj: fclose.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fclose.obj `if test -f 'fclose.c'; then $(CYGPATH_W) 'fclose.c'; else $(CYGPATH_W) '$(srcdir)/fclose.c'; fi`
lib_a-freopen.o: freopen.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-freopen.o `test -f 'freopen.c' || echo '$(srcdir)/'`freopen.c
lib_a-freopen.obj: freopen.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-freopen.obj `if test -f 'freopen.c'; then $(CYGPATH_W) 'freopen.c'; else $(CYGPATH_W) '$(srcdir)/freopen.c'; fi`
lib_a-fflush.o: fflush.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fflush.o `test -f 'fflush.c' || echo '$(srcdir)/'`fflush.c
lib_a-fflush.obj: fflush.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fflush.obj `if test -f 'fflush.c'; then $(CYGPATH_W) 'fflush.c'; else $(CYGPATH_W) '$(srcdir)/fflush.c'; fi`
lib_a-fseek.o: fseek.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fseek.o `test -f 'fseek.c' || echo '$(srcdir)/'`fseek.c
lib_a-fseek.obj: fseek.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fseek.obj `if test -f 'fseek.c'; then $(CYGPATH_W) 'fseek.c'; else $(CYGPATH_W) '$(srcdir)/fseek.c'; fi`
lib_a-ftell.o: ftell.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ftell.o `test -f 'ftell.c' || echo '$(srcdir)/'`ftell.c
lib_a-ftell.obj: ftell.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ftell.obj `if test -f 'ftell.c'; then $(CYGPATH_W) 'ftell.c'; else $(CYGPATH_W) '$(srcdir)/ftell.c'; fi`
lib_a-rewind.o: rewind.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-rewind.o `test -f 'rewind.c' || echo '$(srcdir)/'`rewind.c
lib_a-rewind.obj: rewind.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-rewind.obj `if test -f 'rewind.c'; then $(CYGPATH_W) 'rewind.c'; else $(CYGPATH_W) '$(srcdir)/rewind.c'; fi`
lib_a-fgetpos.o: fgetpos.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetpos.o `test -f 'fgetpos.c' || echo '$(srcdir)/'`fgetpos.c
lib_a-fgetpos.obj: fgetpos.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetpos.obj `if test -f 'fgetpos.c'; then $(CYGPATH_W) 'fgetpos.c'; else $(CYGPATH_W) '$(srcdir)/fgetpos.c'; fi`
lib_a-fsetpos.o: fsetpos.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fsetpos.o `test -f 'fsetpos.c' || echo '$(srcdir)/'`fsetpos.c
lib_a-fsetpos.obj: fsetpos.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fsetpos.obj `if test -f 'fsetpos.c'; then $(CYGPATH_W) 'fsetpos.c'; else $(CYGPATH_W) '$(srcdir)/fsetpos.c'; fi`
lib_a-fread.o: fread.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fread.o `test -f 'fread.c' || echo '$(srcdir)/'`fread.c
lib_a-fread.obj: fread.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fread.obj `if test -f 'fread.c'; then $(CYGPATH_W) 'fread.c'; else $(CYGPATH_W) '$(srcdir)/fread.c'; fi`
lib_a-fwrite.o: fwrite.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwrite.o `test -f 'fwrite.c' || echo '$(srcdir)/'`fwrite.c
lib_a-fwrite.obj: fwrite.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwrite.obj `if test -f 'fwrite.c'; then $(CYGPATH_W) 'fwrite.c'; else $(CYGPATH_W) '$(srcdir)/fwrite.c'; fi`
lib_a-getc.o: getc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getc.o `test -f 'getc.c' || echo '$(srcdir)/'`getc.c
lib_a-getc.obj: getc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getc.obj `if test -f 'getc.c'; then $(CYGPATH_W) 'getc.c'; else $(CYGPATH_W) '$(srcdir)/getc.c'; fi`
lib_a-putc.o: putc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putc.o `test -f 'putc.c' || echo '$(srcdir)/'`putc.c
lib_a-putc.obj: putc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putc.obj `if test -f 'putc.c'; then $(CYGPATH_W) 'putc.c'; else $(CYGPATH_W) '$(srcdir)/putc.c'; fi`
lib_a-fgetc.o: fgetc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetc.o `test -f 'fgetc.c' || echo '$(srcdir)/'`fgetc.c
lib_a-fgetc.obj: fgetc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetc.obj `if test -f 'fgetc.c'; then $(CYGPATH_W) 'fgetc.c'; else $(CYGPATH_W) '$(srcdir)/fgetc.c'; fi`
lib_a-fgets.o: fgets.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgets.o `test -f 'fgets.c' || echo '$(srcdir)/'`fgets.c
lib_a-fgets.obj: fgets.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgets.obj `if test -f 'fgets.c'; then $(CYGPATH_W) 'fgets.c'; else $(CYGPATH_W) '$(srcdir)/fgets.c'; fi`
lib_a-fputc.o: fputc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputc.o `test -f 'fputc.c' || echo '$(srcdir)/'`fputc.c
lib_a-fputc.obj: fputc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputc.obj `if test -f 'fputc.c'; then $(CYGPATH_W) 'fputc.c'; else $(CYGPATH_W) '$(srcdir)/fputc.c'; fi`
lib_a-fputs.o: fputs.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputs.o `test -f 'fputs.c' || echo '$(srcdir)/'`fputs.c
lib_a-fputs.obj: fputs.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputs.obj `if test -f 'fputs.c'; then $(CYGPATH_W) 'fputs.c'; else $(CYGPATH_W) '$(srcdir)/fputs.c'; fi`
lib_a-ungetc.o: ungetc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ungetc.o `test -f 'ungetc.c' || echo '$(srcdir)/'`ungetc.c
lib_a-ungetc.obj: ungetc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ungetc.obj `if test -f 'ungetc.c'; then $(CYGPATH_W) 'ungetc.c'; else $(CYGPATH_W) '$(srcdir)/ungetc.c'; fi`
lib_a-fprintf.o: fprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fprintf.o `test -f 'fprintf.c' || echo '$(srcdir)/'`fprintf.c
lib_a-fprintf.obj: fprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fprintf.obj `if test -f 'fprintf.c'; then $(CYGPATH_W) 'fprintf.c'; else $(CYGPATH_W) '$(srcdir)/fprintf.c'; fi`
lib_a-fscanf.o: fscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fscanf.o `test -f 'fscanf.c' || echo '$(srcdir)/'`fscanf.c
lib_a-fscanf.obj: fscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fscanf.obj `if test -f 'fscanf.c'; then $(CYGPATH_W) 'fscanf.c'; else $(CYGPATH_W) '$(srcdir)/fscanf.c'; fi`
lib_a-vfprintf.o: vfprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vfprintf.o `test -f 'vfprintf.c' || echo '$(srcdir)/'`vfprintf.c
lib_a-vfprintf.obj: vfprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vfprintf.obj `if test -f 'vfprintf.c'; then $(CYGPATH_W) 'vfprintf.c'; else $(CYGPATH_W) '$(srcdir)/vfprintf.c'; fi`
lib_a-vfscanf.o: vfscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vfscanf.o `test -f 'vfscanf.c' || echo '$(srcdir)/'`vfscanf.c
lib_a-vfscanf.obj: vfscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vfscanf.obj `if test -f 'vfscanf.c'; then $(CYGPATH_W) 'vfscanf.c'; else $(CYGPATH_W) '$(srcdir)/vfscanf.c'; fi`
lib_a-perror.o: perror.c lib_a-perror.o: perror.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-perror.o `test -f 'perror.c' || echo '$(srcdir)/'`perror.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-perror.o `test -f 'perror.c' || echo '$(srcdir)/'`perror.c
@ -385,6 +583,18 @@ lib_a-perror.o: perror.c
lib_a-perror.obj: perror.c lib_a-perror.obj: perror.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-perror.obj `if test -f 'perror.c'; then $(CYGPATH_W) 'perror.c'; else $(CYGPATH_W) '$(srcdir)/perror.c'; fi` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-perror.obj `if test -f 'perror.c'; then $(CYGPATH_W) 'perror.c'; else $(CYGPATH_W) '$(srcdir)/perror.c'; fi`
lib_a-gets.o: gets.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gets.o `test -f 'gets.c' || echo '$(srcdir)/'`gets.c
lib_a-gets.obj: gets.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gets.obj `if test -f 'gets.c'; then $(CYGPATH_W) 'gets.c'; else $(CYGPATH_W) '$(srcdir)/gets.c'; fi`
lib_a-getchar.o: getchar.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getchar.o `test -f 'getchar.c' || echo '$(srcdir)/'`getchar.c
lib_a-getchar.obj: getchar.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getchar.obj `if test -f 'getchar.c'; then $(CYGPATH_W) 'getchar.c'; else $(CYGPATH_W) '$(srcdir)/getchar.c'; fi`
lib_a-putchar.o: putchar.c lib_a-putchar.o: putchar.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putchar.o `test -f 'putchar.c' || echo '$(srcdir)/'`putchar.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putchar.o `test -f 'putchar.c' || echo '$(srcdir)/'`putchar.c
@ -397,11 +607,17 @@ lib_a-puts.o: puts.c
lib_a-puts.obj: puts.c lib_a-puts.obj: puts.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-puts.obj `if test -f 'puts.c'; then $(CYGPATH_W) 'puts.c'; else $(CYGPATH_W) '$(srcdir)/puts.c'; fi` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-puts.obj `if test -f 'puts.c'; then $(CYGPATH_W) 'puts.c'; else $(CYGPATH_W) '$(srcdir)/puts.c'; fi`
lib_a-vsnprintf.o: vsnprintf.c lib_a-printf.o: printf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsnprintf.o `test -f 'vsnprintf.c' || echo '$(srcdir)/'`vsnprintf.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-printf.o `test -f 'printf.c' || echo '$(srcdir)/'`printf.c
lib_a-vsnprintf.obj: vsnprintf.c lib_a-printf.obj: printf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsnprintf.obj `if test -f 'vsnprintf.c'; then $(CYGPATH_W) 'vsnprintf.c'; else $(CYGPATH_W) '$(srcdir)/vsnprintf.c'; fi` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-printf.obj `if test -f 'printf.c'; then $(CYGPATH_W) 'printf.c'; else $(CYGPATH_W) '$(srcdir)/printf.c'; fi`
lib_a-scanf.o: scanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-scanf.o `test -f 'scanf.c' || echo '$(srcdir)/'`scanf.c
lib_a-scanf.obj: scanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-scanf.obj `if test -f 'scanf.c'; then $(CYGPATH_W) 'scanf.c'; else $(CYGPATH_W) '$(srcdir)/scanf.c'; fi`
lib_a-vprintf.o: vprintf.c lib_a-vprintf.o: vprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vprintf.o `test -f 'vprintf.c' || echo '$(srcdir)/'`vprintf.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vprintf.o `test -f 'vprintf.c' || echo '$(srcdir)/'`vprintf.c
@ -409,6 +625,36 @@ lib_a-vprintf.o: vprintf.c
lib_a-vprintf.obj: vprintf.c lib_a-vprintf.obj: vprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vprintf.obj `if test -f 'vprintf.c'; then $(CYGPATH_W) 'vprintf.c'; else $(CYGPATH_W) '$(srcdir)/vprintf.c'; fi` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vprintf.obj `if test -f 'vprintf.c'; then $(CYGPATH_W) 'vprintf.c'; else $(CYGPATH_W) '$(srcdir)/vprintf.c'; fi`
lib_a-vscanf.o: vscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vscanf.o `test -f 'vscanf.c' || echo '$(srcdir)/'`vscanf.c
lib_a-vscanf.obj: vscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vscanf.obj `if test -f 'vscanf.c'; then $(CYGPATH_W) 'vscanf.c'; else $(CYGPATH_W) '$(srcdir)/vscanf.c'; fi`
lib_a-setbuf.o: setbuf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-setbuf.o `test -f 'setbuf.c' || echo '$(srcdir)/'`setbuf.c
lib_a-setbuf.obj: setbuf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-setbuf.obj `if test -f 'setbuf.c'; then $(CYGPATH_W) 'setbuf.c'; else $(CYGPATH_W) '$(srcdir)/setbuf.c'; fi`
lib_a-setvbuf.o: setvbuf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-setvbuf.o `test -f 'setvbuf.c' || echo '$(srcdir)/'`setvbuf.c
lib_a-setvbuf.obj: setvbuf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-setvbuf.obj `if test -f 'setvbuf.c'; then $(CYGPATH_W) 'setvbuf.c'; else $(CYGPATH_W) '$(srcdir)/setvbuf.c'; fi`
lib_a-tmpfile.o: tmpfile.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-tmpfile.o `test -f 'tmpfile.c' || echo '$(srcdir)/'`tmpfile.c
lib_a-tmpfile.obj: tmpfile.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-tmpfile.obj `if test -f 'tmpfile.c'; then $(CYGPATH_W) 'tmpfile.c'; else $(CYGPATH_W) '$(srcdir)/tmpfile.c'; fi`
lib_a-vsnprintf.o: vsnprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsnprintf.o `test -f 'vsnprintf.c' || echo '$(srcdir)/'`vsnprintf.c
lib_a-vsnprintf.obj: vsnprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsnprintf.obj `if test -f 'vsnprintf.c'; then $(CYGPATH_W) 'vsnprintf.c'; else $(CYGPATH_W) '$(srcdir)/vsnprintf.c'; fi`
lib_a-vsprintf.o: vsprintf.c lib_a-vsprintf.o: vsprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsprintf.o `test -f 'vsprintf.c' || echo '$(srcdir)/'`vsprintf.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsprintf.o `test -f 'vsprintf.c' || echo '$(srcdir)/'`vsprintf.c

View File

@ -87,8 +87,7 @@ enum {
#define SPE_STDIN 1 #define SPE_STDIN 1
#define SPE_STDOUT 2 #define SPE_STDOUT 2
#define SPE_STDERR 3 #define SPE_STDERR 3
#define SPE_FOPEN_MAX (FOPEN_MAX+1) #define SPE_FOPEN_MAX FOPEN_MAX
#define SPE_FOPEN_MIN 4
struct spe_reg128{ struct spe_reg128{
unsigned int slot[4]; unsigned int slot[4];
@ -114,3 +113,12 @@ send_to_ppe(int signalcode, int opcode, void *data)
errno = ret->slot[3]; errno = ret->slot[3];
return; return;
} }
void _EXFUN(__sinit,(struct _reent *));
FILE *_EXFUN(__sfp,(struct _reent *));
#define __sfp_free(fp) ( (fp)->_fp = 0 )
#define CHECK_INIT(ptr) \
do { if ((ptr) && !(ptr)->__sdidinit) __sinit (ptr); } while (0)
#define CHECK_STD_INIT(ptr) /* currently, do nothing */
#define CHECK_STR_INIT(ptr) /* currently, do nothing */

View File

@ -0,0 +1,54 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
_VOID
_DEFUN (clearerr, (fp),
FILE * fp)
{
int ret;
CHECK_INIT(_REENT);
ret = fp->_fp;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_CLEARERR, &ret);
return;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,55 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
int
_DEFUN (fclose, (fp),
FILE * fp)
{
int ret;
CHECK_INIT(_REENT);
ret = fp->_fp;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FCLOSE, &ret);
__sfp_free(fp);
return ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,54 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
int
_DEFUN (feof, (fp),
FILE * fp)
{
int result;
CHECK_INIT(_REENT);
result = fp->_fp;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FEOF, &result);
return result;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,54 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
int
_DEFUN (ferror, (fp),
FILE * fp)
{
int result;
CHECK_INIT(_REENT);
result = fp->_fp;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FERROR, &result);
return result;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,53 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
int
_DEFUN (fflush, (fp),
FILE * fp)
{
int result;
CHECK_INIT(_REENT);
result = fp->_fp;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FFLUSH, &result);
return result;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,53 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
int
_DEFUN (fgetc, (fp),
FILE * fp)
{
int result;
CHECK_INIT(_REENT);
result = fp->_fp;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FGETC, &result);
return result;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,66 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
int fp;
unsigned int pad0[ 3 ];
_fpos_t * pos;
} c99_fgetpos_t;
#ifndef _REENT_ONLY
int
_DEFUN (fgetpos, (fp, pos),
FILE * fp _AND
_fpos_t * pos)
{
c99_fgetpos_t arg;
int* result;
CHECK_INIT(_REENT);
result = (int*)&arg;
arg.fp = fp->_fp;
arg.pos = pos;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FGETPOS, &arg);
return *result;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,68 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
char *buf;
unsigned int pad0[3];
int n;
unsigned int pad1[3];
int fp;
} c99_fgets_t;
#ifndef _REENT_ONLY
char *
_DEFUN (fgets, (buf, n, fp),
char *buf _AND
int n _AND
FILE * fp)
{
char** ret;
c99_fgets_t args;
CHECK_INIT(_REENT);
args.buf = buf;
args.n = n;
args.fp = fp->_fp;
ret = (char**) &args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FGETS, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,54 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
int
_DEFUN (fileno, (fp),
FILE *fp)
{
int ret;
CHECK_INIT(_REENT);
ret = fp->_fp;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FILENO, &ret);
return ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,79 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
_CONST char* file;
unsigned int pad0[ 3 ];
_CONST char* mode;
unsigned int pad1[ 3 ];
} c99_fopen_t;
#ifndef _REENT_ONLY
FILE *
_DEFUN (fopen, (file, mode),
_CONST char *file _AND
_CONST char *mode)
{
int *ret;
c99_fopen_t args;
FILE *fp;
struct _reent *ptr = _REENT;
CHECK_INIT(ptr);
fp = __sfp(ptr);
if (!fp) {
return NULL;
}
args.file = file;
args.mode = mode;
ret = (int *) &args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FOPEN, &args);
if (*ret) {
fp->_fp = *ret;
return fp;
}
else {
__sfp_free(fp);
return NULL;
}
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,79 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
#ifdef _HAVE_STDC
#include <stdarg.h>
#else
#include <varargs.h>
#endif
typedef struct
{
int fp;
unsigned int pad0[ 3 ];
_CONST char* fmt;
unsigned int pad1[ 3 ];
va_list ap;
} c99_fprintf_t;
#ifndef _REENT_ONLY
int
fprintf(FILE * fp, _CONST char *fmt,...)
{
int* ret;
c99_fprintf_t args;
CHECK_INIT(_REENT);
ret = (int*) &args;
args.fp = fp->_fp;
args.fmt = (char*) fmt;
#ifdef _HAVE_STDC
va_start (args.ap, fmt);
#else
va_start (args.ap);
#endif
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFPRINTF, &args);
va_end (args.ap);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,66 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
int ch;
unsigned int pad0[ 3 ];
int fp;
unsigned int pad1[ 3 ];
} c99_fputc_t;
#ifndef _REENT_ONLY
int
fputc (c, fp)
int c;
register FILE *fp;
{
int* ret;
c99_fputc_t args;
CHECK_INIT(_REENT);
args.ch = c;
args.fp = fp->_fp;
ret = (int*)&args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FPUTC, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,66 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
_CONST char* s;
unsigned int pad0[ 3 ];
int fp;
unsigned int pad1[ 3 ];
} c99_fputs_t;
#ifndef _REENT_ONLY
int
_DEFUN (fputs, (s, fp),
char _CONST * s _AND
FILE * fp)
{
int* ret;
c99_fputs_t args;
CHECK_INIT(_REENT);
args.s = s;
args.fp = fp->_fp;
ret = (int*)&args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FPUTS, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,73 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
char* buf;
unsigned int pad0[ 3 ];
size_t size;
unsigned int pad1[ 3 ];
size_t count;
unsigned int pad2[ 3 ];
int fp;
} c99_fread_t;
#ifndef _REENT_ONLY
size_t
_DEFUN (fread, (buf, size, count, fp),
_PTR buf _AND
size_t size _AND
size_t count _AND
FILE * fp)
{
size_t* ret;
c99_fread_t args;
CHECK_INIT(_REENT);
args.buf = buf;
args.size = size;
args.count = count;
args.fp = fp->_fp;
ret = (size_t*) &args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FREAD, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,76 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
_CONST char *file;
unsigned int pad0[ 3 ];
_CONST char *mode;
unsigned int pad1[ 3 ];
int fp;
} c99_freopen_t;
#ifndef _REENT_ONLY
FILE *
_DEFUN (freopen, (file, mode, fp),
const char *file _AND
const char *mode _AND
FILE *fp)
{
int *ret;
c99_freopen_t args;
CHECK_INIT(_REENT);
args.file = file;
args.mode = mode;
args.fp = fp->_fp;
ret = (int *) &args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FREOPEN, &args);
if (*ret) {
fp->_fp = *ret;
return fp;
}
else {
__sfp_free(fp);
return NULL;
}
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,78 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
#ifdef _HAVE_STDC
#include <stdarg.h>
#else
#include <varargs.h>
#endif
typedef struct
{
int fp;
unsigned int pad0[ 3 ];
_CONST char* fmt;
unsigned int pad1[ 3 ];
va_list ap;
} c99_vfscanf_t;
#ifndef _REENT_ONLY
fscanf(FILE *fp, _CONST char *fmt, ...)
{
int* ret;
c99_vfscanf_t args;
CHECK_INIT(_REENT);
ret = (int*) &args;
args.fp = fp->_fp;
args.fmt = (char*) fmt;
#ifdef _HAVE_STDC
va_start (args.ap, fmt);
#else
va_start (args.ap);
#endif
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFSCANF, &args);
va_end (args.ap);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,69 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
int fp;
unsigned int pad0[ 3 ];
long offset;
unsigned int pad1[ 3 ];
int whence;
} c99_fseek_t;
#ifndef _REENT_ONLY
int
_DEFUN (fseek, (fp, offset, whence),
register FILE *fp _AND
long offset _AND
int whence)
{
int* ret;
c99_fseek_t args;
CHECK_INIT(_REENT);
args.fp = fp->_fp;
args.offset = offset;
args.whence = whence;
ret = (int*)&args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FSEEK, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,65 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
int fp;
unsigned int pad0[ 3 ];
_CONST _fpos_t *pos;
} c99_fsetpos_t;
#ifndef _REENT_ONLY
int
_DEFUN (fsetpos, (iop, pos),
FILE * iop _AND
_CONST _fpos_t * pos)
{
int* ret;
c99_fsetpos_t args;
CHECK_INIT(_REENT);
args.fp = iop->_fp;
args.pos = pos;
ret = (int*)&args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FSETPOS, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,54 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
long
_DEFUN (ftell, (fp),
FILE * fp)
{
long ret;
CHECK_INIT(_REENT);
ret = fp->_fp;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FTELL, &ret);
return ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,73 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
typedef struct
{
_CONST char* buf;
unsigned int pad0[ 3 ];
size_t size;
unsigned int pad1[ 3 ];
size_t count;
unsigned int pad2[ 3 ];
int fp;
} c99_fwrite_t;
size_t
_DEFUN (fwrite, (buf, size, count, fp),
_CONST _PTR buf _AND
size_t size _AND
size_t count _AND
FILE * fp)
{
size_t* ret;
c99_fwrite_t args;
CHECK_INIT(_REENT);
args.buf = buf;
args.size = size;
args.count = count;
args.fp = fp->_fp;
ret = (size_t*) &args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_FWRITE, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,56 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
/*
* A subroutine version of the macro getc.
*/
#ifndef _REENT_ONLY
int
getc (fp)
FILE *fp;
{
int ret;
CHECK_INIT(_REENT);
ret = fp->_fp;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_GETC, &ret);
return ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,52 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
#undef getchar
#ifndef _REENT_ONLY
int
getchar ()
{
int ret;
CHECK_STD_INIT(_REENT);
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_GETCHAR, &ret);
return ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,51 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
char *
gets (buf)
char *buf;
{
CHECK_STD_INIT(_REENT);
/* The return value gets written over buf
*/
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_GETS, &buf);
return buf;
}
#endif /* ! _REENT_ONLY */

View File

@ -2,13 +2,17 @@
#include "c99ppe.h" #include "c99ppe.h"
#ifndef _REENT_ONLY
void void
_DEFUN (perror, (s), _DEFUN (perror, (s),
_CONST char *s) _CONST char *s)
{ {
CHECK_STD_INIT(_REENT);
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PERROR, &s); send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PERROR, &s);
return; return;
} }
#endif /* ! _REENT_ONLY */

View File

@ -11,7 +11,7 @@
typedef struct typedef struct
{ {
char* fmt; _CONST char* fmt;
unsigned int pad0[ 3 ]; unsigned int pad0[ 3 ];
va_list ap; va_list ap;
} c99_printf_t; } c99_printf_t;
@ -33,6 +33,9 @@ printf (fmt, va_alist)
{ {
int* ret; int* ret;
c99_printf_t args; c99_printf_t args;
CHECK_STD_INIT(_REENT);
ret = (int*) &args; ret = (int*) &args;
args.fmt = fmt; args.fmt = fmt;

View File

@ -0,0 +1,67 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
int ch;
unsigned int pad0[ 3 ];
int fp;
unsigned int pad1[ 3 ];
} c99_putc_t;
#ifndef _REENT_ONLY
int
putc (c, fp)
int c;
register FILE *fp;
{
int* ret;
c99_putc_t args;
CHECK_INIT(_REENT);
args.ch = c;
args.fp = fp->_fp;
ret = (int*)&args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTC, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -4,10 +4,14 @@
#undef putchar #undef putchar
#ifndef _REENT_ONLY
int int
putchar (c) putchar (c)
int c; int c;
{ {
CHECK_STD_INIT(_REENT);
/* c gets overwritten before return */ /* c gets overwritten before return */
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTCHAR, &c); send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTCHAR, &c);
@ -15,3 +19,4 @@ putchar (c)
return c; return c;
} }
#endif /* ! _REENT_ONLY */

View File

@ -2,10 +2,13 @@
#include "c99ppe.h" #include "c99ppe.h"
#ifndef _REENT_ONLY
int int
_DEFUN (puts, (s), _DEFUN (puts, (s),
char _CONST * s) char _CONST * s)
{ {
CHECK_STD_INIT(_REENT);
/* The return value gets written over s /* The return value gets written over s
*/ */
@ -14,3 +17,4 @@ _DEFUN (puts, (s),
return (int)s; return (int)s;
} }
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,54 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
void
_DEFUN (rewind, (fp),
FILE * fp)
{
int ret;
CHECK_INIT(_REENT);
ret = fp->_fp;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_REWIND, &ret);
return;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,76 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
#ifdef _HAVE_STDC
#include <stdarg.h>
#else
#include <varargs.h>
#endif
typedef struct
{
_CONST char* fmt;
unsigned int pad0[ 3 ];
va_list ap;
} c99_vscanf_t;
#ifndef _REENT_ONLY
scanf(_CONST char *fmt, ...)
{
int* ret;
c99_vscanf_t args;
CHECK_STD_INIT(_REENT);
ret = (int*) &args;
args.fmt = (char*) fmt;
#ifdef _HAVE_STDC
va_start (args.ap, fmt);
#else
va_start (args.ap);
#endif
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSCANF, &args);
va_end (args.ap);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,65 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
int fp;
unsigned int pad0[ 3 ];
char *buf;
unsigned int pad1[ 3 ];
} c99_setbuf_t;
#ifndef _REENT_ONLY
void
_DEFUN (setbuf, (fp, buf),
FILE * fp _AND
char *buf)
{
c99_setbuf_t args;
CHECK_INIT(_REENT);
args.fp = fp->_fp;
args.buf = buf;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_SETBUF, &args);
return;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,75 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
int fp;
unsigned int pad0[ 3 ];
char *buf;
unsigned int pad1[ 3 ];
int mode;
unsigned int pad2[ 3 ];
size_t size;
unsigned int pad3[ 3 ];
} c99_setvbuf_t;
#ifndef _REENT_ONLY
int
_DEFUN (setvbuf, (fp, buf, mode, size),
FILE * fp _AND
char *buf _AND
int mode _AND
size_t size)
{
int* ret;
c99_setvbuf_t args;
CHECK_INIT(_REENT);
args.fp = fp->_fp;
args.buf = buf;
args.mode = mode;
args.size = size;
ret = (int*)&args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_SETVBUF, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,82 @@
/*
Copyright (C) 2007 Sony Computer Entertainment Inc.
Copyright 2007 Sony Corp.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the names of the copyright holders nor the names of their
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Kazunori Asayama <asayama@sm.sony.co.jp>
*/
#include <stdio.h>
#include "c99ppe.h"
static FILE __fp[SPE_FOPEN_MAX];
FILE *
_DEFUN (__sfp, (d),
struct _reent *d)
{
int i;
for (i = 0; i < SPE_FOPEN_MAX; i++) {
if (!__fp[i]._fp) {
return &__fp[i];
}
}
d->_errno = EMFILE;
return NULL;
}
static _VOID
_DEFUN (__cleanup, (s),
struct _reent *s)
{
int i;
for (i = 0; i < SPE_FOPEN_MAX; i++) {
if (__fp[i]._fp) {
fclose(&__fp[i]);
}
}
}
_VOID
_DEFUN (__sinit, (s),
struct _reent *s)
{
s->__cleanup = __cleanup;
s->__sdidinit = 1;
s->_stdin = &s->__sf[0];
s->_stdin->_fp = SPE_STDIN;
s->_stdout = &s->__sf[1];
s->_stdout->_fp = SPE_STDOUT;
s->_stderr = &s->__sf[2];
s->_stderr->_fp = SPE_STDERR;
}

View File

@ -0,0 +1,13 @@
#ifndef __CUSTOM_FILE_H__
#define __CUSTOM_FILE_H__ 1
/*
* Cell SPE support
*/
struct __sFILE_spu {
int _fp; /* pseudo FILE pointer on PPE */
};
typedef struct __sFILE_spu __FILE;
#endif /* __CUSTOM_FILE_H__ */

View File

@ -0,0 +1,65 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <stdio.h>
#include "c99ppe.h"
#ifndef _REENT_ONLY
FILE *
_DEFUN_VOID (tmpfile)
{
int ret;
FILE* fp;
struct _reent *ptr = _REENT;
CHECK_INIT(ptr);
fp = __sfp(ptr);
if (!fp) {
return NULL;
}
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_TMPFILE, &ret);
if (ret) {
fp->_fp = ret;
return fp;
}
else {
__sfp_free(fp);
return NULL;
}
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,67 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
typedef struct
{
int c;
unsigned int pad0[ 3 ];
int fp;
unsigned int pad1[ 3 ];
} c99_ungetc_t;
#ifndef _REENT_ONLY
int
ungetc (c, fp)
int c;
register FILE *fp;
{
int* ret;
c99_ungetc_t args;
CHECK_INIT(_REENT);
args.c = c;
args.fp = fp->_fp;
ret = (int*)&args;
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_UNGETC, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,77 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
#ifdef _HAVE_STDC
#include <stdarg.h>
#else
#include <varargs.h>
#endif
typedef struct
{
int fp;
unsigned int pad0[ 3 ];
char* fmt;
unsigned int pad1[ 3 ];
va_list ap;
} c99_vfprintf_t;
#ifndef _REENT_ONLY
int
_DEFUN (vfprintf, (fp, fmt0, ap),
FILE * fp _AND
_CONST char *fmt0 _AND
va_list ap)
{
int* ret;
c99_vfprintf_t args;
CHECK_INIT(_REENT);
ret = (int*) &args;
args.fp = fp->_fp;
args.fmt = (char*) fmt0;
va_copy(args.ap,ap);
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFPRINTF, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -0,0 +1,77 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
#ifdef _HAVE_STDC
#include <stdarg.h>
#else
#include <varargs.h>
#endif
typedef struct
{
int fp;
unsigned int pad0[ 3 ];
char* fmt;
unsigned int pad1[ 3 ];
va_list ap;
} c99_vfscanf_t;
#ifndef _REENT_ONLY
int
_DEFUN (vfscanf, (fp, fmt, ap),
FILE *fp _AND
_CONST char *fmt _AND
va_list ap)
{
int* ret;
c99_vfscanf_t args;
CHECK_INIT(_REENT);
ret = (int*) &args;
args.fp = fp->_fp;
args.fmt = (char*) fmt;
va_copy(args.ap,ap);
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFSCANF, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */

View File

@ -1,4 +1,3 @@
#include <_ansi.h> #include <_ansi.h>
#include <stdio.h> #include <stdio.h>
@ -12,7 +11,7 @@
typedef struct typedef struct
{ {
char* fmt; _CONST char* fmt;
unsigned int pad0[ 3 ]; unsigned int pad0[ 3 ];
va_list ap; va_list ap;
} c99_vprintf_t; } c99_vprintf_t;
@ -26,9 +25,12 @@ _DEFUN (vprintf, (fmt, ap),
{ {
int* ret; int* ret;
c99_vprintf_t args; c99_vprintf_t args;
CHECK_STD_INIT(_REENT);
ret = (int*) &args; ret = (int*) &args;
args.fmt = (char*) fmt; args.fmt = fmt;
va_copy(args.ap,ap); va_copy(args.ap,ap);
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VPRINTF, &args); send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VPRINTF, &args);

View File

@ -0,0 +1,73 @@
/*
(C) Copyright IBM Corp. 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
#ifdef _HAVE_STDC
#include <stdarg.h>
#else
#include <varargs.h>
#endif
typedef struct
{
char* fmt;
unsigned int pad0[ 3 ];
va_list ap;
} c99_vscanf_t;
#ifndef _REENT_ONLY
int
_DEFUN (vscanf, (fmt, ap),
_CONST char *fmt _AND
va_list ap)
{
int* ret;
c99_vscanf_t args;
CHECK_STD_INIT(_REENT);
ret = (int*) &args;
args.fmt = (char*) fmt;
va_copy(args.ap,ap);
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSCANF, &args);
return *ret;
}
#endif /* ! _REENT_ONLY */