1 /*
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  * 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.
18  */
19 /* Doc in vfwscanf.c */
20 
21 #define _DEFAULT_SOURCE
22 #include <stdio.h>
23 #include <wchar.h>
24 #include <string.h>
25 #include <stdarg.h>
26 #include "local.h"
27 
28 /*
29  * vsscanf
30  */
31 
32 int
vswscanf(const wchar_t * str,const wchar_t * fmt,va_list ap)33 vswscanf ( const wchar_t *str, const wchar_t *fmt,
34 	     va_list ap)
35 {
36   FILE f;
37 
38   f._flags = __SRD | __SSTR;
39   f._bf._base = f._p = (unsigned char *) str;
40   f._bf._size = f._r = wcslen (str) * sizeof (wchar_t);
41   f._read = __seofread;
42   f._ub._base = NULL;
43   f._lb._base = NULL;
44   f._flags2 = 0;
45   f._ur = 0;
46   f._file = -1;  /* No file. */
47   return _ssvfwscanf ( &f, fmt, ap);
48 }
49