add variable arguemnt support to stream

pull/1433/head
sg- 2015-11-17 08:35:45 -06:00
parent 8c540341dd
commit f13226663c
2 changed files with 14 additions and 0 deletions

View File

@ -37,6 +37,8 @@ public:
char *gets(char *s, int size);
int printf(const char* format, ...);
int scanf(const char* format, ...);
int vprintf(const char* format, va_list args);
int vscanf(const char* format, va_list args);
operator std::FILE*() {return _file;}

View File

@ -108,4 +108,16 @@ int Stream::scanf(const char* format, ...) {
return r;
}
int Stream::vprintf(const char* format, va_list args) {
fflush(_file);
int r = vfprintf(_file, format, args);
return r;
}
int Stream::vscanf(const char* format, va_list args) {
fflush(_file);
int r = vfscanf(_file, format, args);
return r;
}
} // namespace mbed