Ticket #8572: common-file-scanf.patch
File common-file-scanf.patch, 1.0 KB (added by , 18 years ago) |
---|
-
common/file.cpp
20 20 * 21 21 */ 22 22 23 #include <stdarg.h> 24 23 25 #include "common/file.h" 24 26 #include "common/fs.h" 25 27 #include "common/hashmap.h" … … 446 448 return len; 447 449 } 448 450 451 int File::scanf(const char *format, ...) { 452 va_list arg; 453 int done; 454 455 if (_handle == NULL) { 456 error("File::scanf: File is not open!"); 457 return 0; 458 } 459 460 va_start(arg, format); 461 done = vfscanf(_handle, format, arg); 462 va_end(arg); 463 464 return done; 465 } 466 449 467 } // End of namespace Common -
common/file.h
140 140 void seek(int32 offs, int whence = SEEK_SET); 141 141 uint32 read(void *dataPtr, uint32 dataSize); 142 142 uint32 write(const void *dataPtr, uint32 dataSize); 143 144 int scanf(const char *format, ...); 143 145 }; 144 146 145 147 } // End of namespace Common