2019-06-15 11:07:10 +00:00
|
|
|
/*
|
|
|
|
* vfscanf.c - read formatted input from stream
|
|
|
|
*/
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
2019-06-15 11:53:20 +00:00
|
|
|
#include "doscan.h"
|
2019-06-15 11:07:10 +00:00
|
|
|
|
|
|
|
#if ACKCONF_WANT_STDIO
|
|
|
|
|
|
|
|
static FILE* vfscanf_stream;
|
|
|
|
|
|
|
|
static int vfscanf_getc(void)
|
|
|
|
{
|
|
|
|
return getc(vfscanf_stream);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void vfscanf_ungetc(int c)
|
|
|
|
{
|
|
|
|
ungetc(c, vfscanf_stream);
|
|
|
|
}
|
|
|
|
|
|
|
|
int vfscanf(FILE* stream, const char* format, va_list ap)
|
|
|
|
{
|
|
|
|
vfscanf_stream = stream;
|
2019-06-15 11:53:20 +00:00
|
|
|
_doscan_get = vfscanf_getc;
|
|
|
|
_doscan_unget = vfscanf_ungetc;
|
|
|
|
return _doscan(format, ap);
|
2019-06-15 11:07:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|