2001-03-13 07:59:17 +00:00
|
|
|
/*
|
|
|
|
* _scanf.h
|
|
|
|
*
|
|
|
|
* (C) Copyright 2001 Ullrich von Bassewitz (uz@cc65.org)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __SCANF_H
|
|
|
|
#define __SCANF_H
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-04-19 06:46:30 +00:00
|
|
|
/* Type of the function that is called to input data. The function will
|
|
|
|
* return EOF if no more data is available.
|
|
|
|
*/
|
2004-11-26 22:16:54 +00:00
|
|
|
typedef int __fastcall__ (*getfunc) (void* data);
|
|
|
|
typedef int __fastcall__ (*ungetfunc) (int c, void* data);
|
2001-03-13 07:59:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Control structure passed to the low level worker function.
|
|
|
|
* Beware: The low level functions will access the structure on the assembly
|
|
|
|
* level, so check this when altering the structure.
|
|
|
|
*/
|
2004-11-26 22:16:54 +00:00
|
|
|
struct scanfdata {
|
|
|
|
getfunc get; /* Pointer to input routine */
|
|
|
|
ungetfunc unget; /* Pointer to pushback routine */
|
|
|
|
unsigned ccount; /* Number of chars read */
|
2001-04-19 06:46:30 +00:00
|
|
|
|
2004-06-04 14:47:21 +00:00
|
|
|
/* Fields used outside of _scanf */
|
2004-11-26 22:16:54 +00:00
|
|
|
void* data; /* Caller data */
|
2001-03-13 07:59:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Internal scanning routine */
|
2004-11-26 22:16:54 +00:00
|
|
|
int _scanf (struct scanfdata* d, const char* format, va_list ap);
|
2001-03-13 07:59:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* End of _scanf.h */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-06-04 14:47:21 +00:00
|
|
|
|