OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [stdio/] [scanf.c] - Diff between revs 1010 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 1010 Rev 1765
/*
/*
 * Copyright (c) 1990 The Regents of the University of California.
 * Copyright (c) 1990 The Regents of the University of California.
 * All rights reserved.
 * All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms are permitted
 * Redistribution and use in source and binary forms are permitted
 * provided that the above copyright notice and this paragraph are
 * provided that the above copyright notice and this paragraph are
 * duplicated in all such forms and that any documentation,
 * duplicated in all such forms and that any documentation,
 * advertising materials, and other materials related to such
 * advertising materials, and other materials related to such
 * distribution and use acknowledge that the software was developed
 * distribution and use acknowledge that the software was developed
 * by the University of California, Berkeley.  The name of the
 * by the University of California, Berkeley.  The name of the
 * University may not be used to endorse or promote products derived
 * University may not be used to endorse or promote products derived
 * from this software without specific prior written permission.
 * from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */
 */
 
 
#include <_ansi.h>
#include <_ansi.h>
#include <stdio.h>
#include <stdio.h>
#include "local.h"
#include "local.h"
 
 
#ifdef _HAVE_STDC
#ifdef _HAVE_STDC
#include <stdarg.h>
#include <stdarg.h>
#else
#else
#include <varargs.h>
#include <varargs.h>
#endif
#endif
 
 
#include "local.h"
#include "local.h"
 
 
#ifndef _REENT_ONLY
#ifndef _REENT_ONLY
 
 
int
int
#ifdef _HAVE_STDC
#ifdef _HAVE_STDC
scanf (const char *fmt, ...)
scanf (const char *fmt, ...)
#else
#else
scanf (fmt, va_alist)
scanf (fmt, va_alist)
     char *fmt;
     char *fmt;
     va_dcl
     va_dcl
#endif
#endif
{
{
  int ret;
  int ret;
  va_list ap;
  va_list ap;
 
 
#ifdef _HAVE_STDC
#ifdef _HAVE_STDC
  va_start (ap, fmt);
  va_start (ap, fmt);
#else
#else
  va_start (ap);
  va_start (ap);
#endif
#endif
  ret = __svfscanf_r (_REENT, _stdin_r (_REENT), fmt, ap);
  ret = __svfscanf_r (_REENT, _stdin_r (_REENT), fmt, ap);
  va_end (ap);
  va_end (ap);
  return ret;
  return ret;
}
}
 
 
#endif /* !_REENT_ONLY */
#endif /* !_REENT_ONLY */
 
 
int
int
#ifdef _HAVE_STDC
#ifdef _HAVE_STDC
_scanf_r (struct _reent *ptr, const char *fmt, ...)
_scanf_r (struct _reent *ptr, const char *fmt, ...)
#else
#else
_scanf_r (ptr, fmt, va_alist)
_scanf_r (ptr, fmt, va_alist)
     struct _reent *ptr;
     struct _reent *ptr;
     char *fmt;
     char *fmt;
     va_dcl
     va_dcl
#endif
#endif
{
{
  int ret;
  int ret;
  va_list ap;
  va_list ap;
 
 
#ifdef _HAVE_STDC
#ifdef _HAVE_STDC
  va_start (ap, fmt);
  va_start (ap, fmt);
#else
#else
  va_start (ap);
  va_start (ap);
#endif
#endif
  ret = __svfscanf_r (ptr, _stdin_r (ptr), fmt, ap);
  ret = __svfscanf_r (ptr, _stdin_r (ptr), fmt, ap);
  va_end (ap);
  va_end (ap);
  return (ret);
  return (ret);
}
}
 
 
 
 
 
 

powered by: WebSVN 2.1.0

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