Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / stdio / vsscanf.c
blob6150f541bb24f2dc748f5c2befed457b06fe0769
1 /*
2 * Code created by modifying scanf.c which has following copyright.
4 * Copyright (c) 1990 The Regents of the University of California.
5 * All rights reserved.
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 * and/or 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.
20 #include <_ansi.h>
21 #include <reent.h>
22 #include <stdio.h>
23 #include <string.h>
24 #include <stdarg.h>
25 #include "local.h"
28 * vsscanf
31 #ifndef _REENT_ONLY
33 int
34 vsscanf (const char *__restrict str,
35 const char *__restrict fmt,
36 va_list ap)
38 return _vsscanf_r (_REENT, str, fmt, ap);
41 #ifdef _NANO_FORMATTED_IO
42 int
43 vsiscanf (const char *, const char *, __VALIST)
44 _ATTRIBUTE ((__alias__("vsscanf")));
45 #endif
47 #endif /* !_REENT_ONLY */
49 int
50 _vsscanf_r (struct _reent *ptr,
51 const char *__restrict str,
52 const char *__restrict fmt,
53 va_list ap)
55 FILE f;
57 f._flags = __SRD | __SSTR;
58 f._flags2 = 0;
59 f._bf._base = f._p = (unsigned char *) str;
60 f._bf._size = f._r = strlen (str);
61 f._read = __seofread;
62 f._ub._base = NULL;
63 f._lb._base = NULL;
64 f._file = -1; /* No file. */
65 return __ssvfscanf_r (ptr, &f, fmt, ap);
68 #ifdef _NANO_FORMATTED_IO
69 int
70 _vsiscanf_r (struct _reent *, const char *, const char *, __VALIST)
71 _ATTRIBUTE ((__alias__("_vsscanf_r")));
72 #endif