OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [stdio/] [diprintf.c] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/* Copyright (C) 2005, 2007 Shaun Jackman
/* Copyright (C) 2005, 2007 Shaun Jackman
 * Permission to use, copy, modify, and distribute this software
 * Permission to use, copy, modify, and distribute this software
 * is freely granted, provided that this notice is preserved.
 * is freely granted, provided that this notice is preserved.
 */
 */
 
 
/*
/*
FUNCTION
FUNCTION
<<diprintf>>, <<vdiprintf>>---print to a file descriptor (integer only)
<<diprintf>>, <<vdiprintf>>---print to a file descriptor (integer only)
 
 
INDEX
INDEX
        diprintf
        diprintf
INDEX
INDEX
        _diprintf_r
        _diprintf_r
INDEX
INDEX
        vdiprintf
        vdiprintf
INDEX
INDEX
        _vdiprintf_r
        _vdiprintf_r
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <stdio.h>
        #include <stdio.h>
        #include <stdarg.h>
        #include <stdarg.h>
        int diprintf(int <[fd]>, const char *<[format]>, ...);
        int diprintf(int <[fd]>, const char *<[format]>, ...);
        int vdiprintf(int <[fd]>, const char *<[format]>, va_list <[ap]>);
        int vdiprintf(int <[fd]>, const char *<[format]>, va_list <[ap]>);
        int _diprintf_r(struct _reent *<[ptr]>, int <[fd]>,
        int _diprintf_r(struct _reent *<[ptr]>, int <[fd]>,
                        const char *<[format]>, ...);
                        const char *<[format]>, ...);
        int _vdiprintf_r(struct _reent *<[ptr]>, int <[fd]>,
        int _vdiprintf_r(struct _reent *<[ptr]>, int <[fd]>,
                        const char *<[format]>, va_list <[ap]>);
                        const char *<[format]>, va_list <[ap]>);
 
 
DESCRIPTION
DESCRIPTION
<<diprintf>> and <<vdiprintf>> are similar to <<dprintf>> and <<vdprintf>>,
<<diprintf>> and <<vdiprintf>> are similar to <<dprintf>> and <<vdprintf>>,
except that only integer format specifiers are processed.
except that only integer format specifiers are processed.
 
 
The functions <<_diprintf_r>> and <<_vdiprintf_r>> are simply
The functions <<_diprintf_r>> and <<_vdiprintf_r>> are simply
reentrant versions of the functions above.
reentrant versions of the functions above.
 
 
RETURNS
RETURNS
Similar to <<dprintf>> and <<vdprintf>>.
Similar to <<dprintf>> and <<vdprintf>>.
 
 
PORTABILITY
PORTABILITY
This set of functions is an integer-only extension, and is not portable.
This set of functions is an integer-only extension, and is not portable.
 
 
Supporting OS subroutines required: <<sbrk>>, <<write>>.
Supporting OS subroutines required: <<sbrk>>, <<write>>.
*/
*/
 
 
#include <_ansi.h>
#include <_ansi.h>
#include <reent.h>
#include <reent.h>
#include <stdio.h>
#include <stdio.h>
#include <unistd.h>
#include <unistd.h>
#include <stdarg.h>
#include <stdarg.h>
 
 
int
int
_DEFUN(_diprintf_r, (ptr, fd, format),
_DEFUN(_diprintf_r, (ptr, fd, format),
       struct _reent *ptr _AND
       struct _reent *ptr _AND
       int fd _AND
       int fd _AND
       const char *format _DOTS)
       const char *format _DOTS)
{
{
  va_list ap;
  va_list ap;
  int n;
  int n;
 
 
  va_start (ap, format);
  va_start (ap, format);
  n = _vdiprintf_r (ptr, fd, format, ap);
  n = _vdiprintf_r (ptr, fd, format, ap);
  va_end (ap);
  va_end (ap);
  return n;
  return n;
}
}
 
 
#ifndef _REENT_ONLY
#ifndef _REENT_ONLY
 
 
int
int
_DEFUN(diprintf, (fd, format),
_DEFUN(diprintf, (fd, format),
       int fd _AND
       int fd _AND
       const char *format _DOTS)
       const char *format _DOTS)
{
{
  va_list ap;
  va_list ap;
  int n;
  int n;
 
 
  va_start (ap, format);
  va_start (ap, format);
  n = _vdiprintf_r (_REENT, fd, format, ap);
  n = _vdiprintf_r (_REENT, fd, format, ap);
  va_end (ap);
  va_end (ap);
  return n;
  return n;
}
}
 
 
#endif /* ! _REENT_ONLY */
#endif /* ! _REENT_ONLY */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.