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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [stdio/] [vsiscanf.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
/*
2
 * Code created by modifying iscanf.c which has following copyright.
3
 *
4
 * Copyright (c) 1990 The Regents of the University of California.
5
 * All rights reserved.
6
 *
7
 * Redistribution and use in source and binary forms are permitted
8
 * provided that the above copyright notice and this paragraph are
9
 * duplicated in all such forms and that any documentation,
10
 * advertising materials, and other materials related to such
11
 * distribution and use acknowledge that the software was developed
12
 * by the University of California, Berkeley.  The name of the
13
 * University may not be used to endorse or promote products derived
14
 * from this software without specific prior written permission.
15
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18
 */
19
 
20
#include <_ansi.h>
21
#include <reent.h>
22
#include <stdio.h>
23
#include <string.h>
24
#ifdef _HAVE_STDC
25
#include <stdarg.h>
26
#else
27
#include <varargs.h>
28
#endif
29
#include "local.h"
30
 
31
static _READ_WRITE_RETURN_TYPE
32
_DEFUN(eofread1, (ptr, cookie, buf, len),
33
       struct _reent *ptr _AND
34
       _PTR cookie _AND
35
       char *buf   _AND
36
       int len)
37
{
38
  return 0;
39
}
40
 
41
/*
42
 * vsiscanf
43
 */
44
 
45
#ifndef _REENT_ONLY
46
 
47
int
48
_DEFUN(vsiscanf, (str, fmt, ap),
49
       _CONST char *str _AND
50
       _CONST char *fmt _AND
51
       va_list ap)
52
{
53
  return _vsiscanf_r (_REENT, str, fmt, ap);
54
}
55
 
56
#endif /* !_REENT_ONLY */
57
 
58
int
59
_DEFUN(_vsiscanf_r, (ptr, str, fmt, ap),
60
       struct _reent *ptr _AND
61
       _CONST char *str   _AND
62
       _CONST char *fmt   _AND
63
       va_list ap)
64
{
65
  FILE f;
66
 
67
  f._flags = __SRD | __SSTR;
68
  f._bf._base = f._p = (unsigned char *) str;
69
  f._bf._size = f._r = strlen (str);
70
  f._read = eofread1;
71
  f._ub._base = NULL;
72
  f._lb._base = NULL;
73
  f._file = -1;  /* No file. */
74
  return __ssvfiscanf_r (ptr, &f, fmt, ap);
75
}

powered by: WebSVN 2.1.0

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