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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [stdio/] [vswscanf.c] - Blame information for rev 207

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/*
2
 * Code created by modifying scanf.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 <wchar.h>
24
#include <string.h>
25
#ifdef _HAVE_STDC
26
#include <stdarg.h>
27
#else
28
#include <varargs.h>
29
#endif
30
#include "local.h"
31
 
32
/*
33
 * vsscanf
34
 */
35
 
36
#ifndef _REENT_ONLY
37
 
38
int
39
vswscanf (_CONST wchar_t *str, _CONST wchar_t *fmt, va_list ap)
40
{
41
  return _vswscanf_r (_REENT, str, fmt, ap);
42
}
43
 
44
#endif /* !_REENT_ONLY */
45
 
46
int
47
_vswscanf_r (struct _reent *ptr, _CONST wchar_t *str, _CONST wchar_t *fmt,
48
             va_list ap)
49
{
50
  FILE f;
51
 
52
  f._flags = __SRD | __SSTR;
53
  f._bf._base = f._p = (unsigned char *) str;
54
  f._bf._size = f._r = wcslen (str) * sizeof (wchar_t);
55
  f._read = __seofread;
56
  f._ub._base = NULL;
57
  f._lb._base = NULL;
58
  f._file = -1;  /* No file. */
59
  return __ssvfwscanf_r (ptr, &f, fmt, ap);
60
}

powered by: WebSVN 2.1.0

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