_SP_printf.c

00001 #ifdef INTEGER_ONLY
00002         #define         _vfprintf_r     _vfiprintf_r 
00003         #define         _vfprintf               _vfiprintf
00004         #define         vfprintf                vfiprintf
00005 #endif
00006 
00007 #include <_ansi.h>
00008 #include <stdio.h>
00009 
00010 #ifndef _SMALL_PRINTF
00011         #include "local.h"
00012 #endif
00013 
00014 #ifdef _HAVE_STDC
00015 #include <stdarg.h>
00016 #else
00017 #include <varargs.h>
00018 #endif
00019 
00020 #ifndef _SMALL_PRINTF
00021 
00022         #ifdef _HAVE_STDC
00023         int
00024         _printf_r (struct _reent *ptr, const char *fmt, ...)
00025         #else
00026         int
00027         _printf_r (ptr, fmt, va_alist)
00028              struct _reent *ptr;
00029              char *fmt;
00030              va_dcl
00031         #endif
00032         {
00033           int ret;
00034           va_list ap;
00035         
00036           //_REENT_SMALL_CHECK_INIT(_stdout_r (ptr));
00037         #ifdef _HAVE_STDC
00038           va_start (ap, fmt);
00039         #else
00040           va_start (ap);
00041         #endif
00042           ret = _vfprintf_r (ptr, _stdout_r (ptr), fmt, ap);
00043           va_end (ap);
00044           return ret;
00045         }
00046 #endif
00047 
00048 #ifndef _REENT_ONLY
00049 
00050 #ifdef _HAVE_STDC
00051 int
00052 printf (const char *fmt, ...)
00053 #else
00054 int
00055 printf (fmt, va_alist)
00056      char *fmt;
00057      va_dcl
00058 #endif
00059 {
00060   int ret;
00061   va_list ap;
00062 
00063   //_REENT_SMALL_CHECK_INIT(_stdout_r (_REENT));
00064 #ifdef _HAVE_STDC
00065   va_start (ap, fmt);
00066 #else
00067   va_start (ap);
00068 #endif
00069 #ifndef _SMALL_PRINTF
00070   ret = vfprintf (_stdout_r (_REENT), fmt, ap);
00071 #else
00072   ret = vfprintf (0, fmt, ap);
00073 #endif
00074   va_end (ap);
00075   return ret;
00076 }
00077 
00078 #endif /* ! _REENT_ONLY */

Generated on Mon Apr 11 14:23:39 2011 for Contiki 2.5 by  doxygen 1.6.1