]>
Commit | Line | Data |
---|---|---|
dbfcb4be BK |
1 | /* Copyright (C) 1993, 1997 Free Software Foundation, Inc. |
2 | This file is part of the GNU IO Library. | |
6599da04 | 3 | |
dbfcb4be BK |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU General Public License as | |
6 | published by the Free Software Foundation; either version 2, or (at | |
7 | your option) any later version. | |
6599da04 | 8 | |
dbfcb4be BK |
9 | This library is distributed in the hope that it will be useful, but |
10 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | General Public License for more details. | |
6599da04 | 13 | |
dbfcb4be BK |
14 | You should have received a copy of the GNU General Public License |
15 | along with this library; see the file COPYING. If not, write to | |
16 | the Free Software Foundation, 59 Temple Place - Suite 330, Boston, | |
17 | MA 02111-1307, USA. | |
6599da04 | 18 | |
dbfcb4be BK |
19 | As a special exception, if you link this library with files |
20 | compiled with a GNU compiler to produce an executable, this does | |
21 | not cause the resulting executable to be covered by the GNU General | |
22 | Public License. This exception does not however invalidate any | |
23 | other reasons why the executable file might be covered by the GNU | |
24 | General Public License. */ | |
6599da04 JM |
25 | |
26 | #include "libioP.h" | |
27 | #include "strfile.h" | |
28 | ||
29 | int | |
dbfcb4be BK |
30 | _IO_vsscanf (string, format, args) |
31 | const char *string; | |
32 | const char *format; | |
33 | _IO_va_list args; | |
6599da04 | 34 | { |
dbfcb4be | 35 | int ret; |
6599da04 | 36 | _IO_strfile sf; |
dbfcb4be BK |
37 | #ifdef _IO_MTSAFE_IO |
38 | _IO_lock_t lock; | |
39 | sf._sbf._f._lock = &lock; | |
40 | #endif | |
41 | _IO_init (&sf._sbf._f, 0); | |
42 | _IO_JUMPS (&sf._sbf._f) = &_IO_str_jumps; | |
43 | _IO_str_init_static (&sf._sbf._f, (char*)string, 0, NULL); | |
44 | _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, &sf); | |
45 | _IO_flockfile (&sf._sbf._f); | |
46 | ret = _IO_vfscanf (&sf._sbf._f, format, args, NULL); | |
47 | _IO_cleanup_region_end (1); | |
48 | return ret; | |
6599da04 | 49 | } |
dbfcb4be BK |
50 | |
51 | #ifdef weak_alias | |
52 | weak_alias (_IO_vsscanf, __vsscanf) | |
53 | weak_alias (_IO_vsscanf, vsscanf) | |
1510f52e JL |
54 | #else |
55 | #ifdef __ELF__ | |
56 | #pragma weak vsscanf = _IO_vsscanf | |
57 | #endif | |
dbfcb4be | 58 | #endif |