/*
- * Copyright (C) 2012, 2013
+ * Copyright (C) 2012, 2013, 2014, 2015
* Dale Weiler
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
+#define GMQCC_PLATFORM_HEADER
#include "gmqcc.h"
#include "platform.h"
}
int fs_file_getc(fs_file_t *fp) {
- return platform_fgetc((FILE*)fp);
+ int get = platform_fgetc((FILE*)fp);
+ return (get == EOF) ? FS_FILE_EOF : get;
}
int fs_file_puts(fs_file_t *fp, const char *str) {
}
int fs_file_seek(fs_file_t *fp, long int off, int whence) {
+ switch(whence) {
+ case FS_FILE_SEEK_CUR: whence = SEEK_CUR; break;
+ case FS_FILE_SEEK_SET: whence = SEEK_SET; break;
+ case FS_FILE_SEEK_END: whence = SEEK_END; break;
+ }
return platform_fseek((FILE*)fp, off, whence);
}