Rewrote _scanf. It does need some tests and improvements, but it's a more
standard version than before, and it does support the necessary functionality to support scanf functions for files. Added vfscanf, fscanf and vfscanf. git-svn-id: svn://svn.cc65.org/cc65/trunk@3301 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
36
libsrc/common/scanf.c
Normal file
36
libsrc/common/scanf.c
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* scanf.c
|
||||
*
|
||||
* Ullrich von Bassewitz (uz@cc65.org), 2004-11-26
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Code */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
int scanf (const char* format, ...)
|
||||
/* Standard C function */
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
/* Setup for variable arguments */
|
||||
va_start (ap, format);
|
||||
|
||||
/* Call vfscanf(). Since we know that va_end won't do anything, we will
|
||||
* save the call and return the value directly.
|
||||
*/
|
||||
return vfscanf (stdin, format, ap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user