1
2/*
3Copyright (C) 1993 Free Software Foundation
4
5This file is part of the GNU IO Library.  This library is free
6software; you can redistribute it and/or modify it under the
7terms of the GNU General Public License as published by the
8Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11This library is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this library; see the file COPYING.  If not, write to the Free
18Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
20As a special exception, if you link this library with files
21compiled with a GNU compiler to produce an executable, this does not cause
22the resulting executable to be covered by the GNU General Public License.
23This exception does not however invalidate any other reasons why
24the executable file might be covered by the GNU General Public License. */
25
26#include "libioP.h"
27#include "streambuf.h"
28#include <stdarg.h>
29
30int streambuf::vscan(char const *fmt0, _IO_va_list ap, ios* stream /* = NULL*/)
31{
32  int errcode = 0;
33  int count = _IO_vfscanf(this, fmt0, ap, &errcode);
34  if (stream)
35    stream->setstate((ios::iostate)errcode);
36  return count;
37}
38int streambuf::scan(char const *format ...)
39{
40  va_list ap;
41  va_start(ap, format);
42  int count = _IO_vfscanf(this, format, ap, NULL);
43  va_end(ap);
44  return count;
45}
46