[82] | 1 | #ifndef _NONSTD_STDIO_H_ |
---|
| 2 | #define _NONSTD_STDIO_H_ |
---|
| 3 | |
---|
| 4 | bool fileExists(const char* path); |
---|
| 5 | bool removeFile(const char* path); |
---|
| 6 | |
---|
| 7 | #ifdef _WIN32 |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | #ifndef _MSC_VER |
---|
| 11 | #include <dir.h> |
---|
| 12 | #else |
---|
| 13 | #ifndef MOBILE2D |
---|
| 14 | #include <direct.h> |
---|
| 15 | #endif |
---|
| 16 | #define mkdir _mkdir |
---|
| 17 | #endif |
---|
| 18 | |
---|
| 19 | #ifndef MOBILE2D |
---|
| 20 | #include <io.h> //borland compiler: include <io.h> before <dir.h> causes the SimWorld class in "simul.h" be unrecognized, for unknown reason :O moreover, this problem is only pertinent to the CLI project, not GUI. Maybe this is caused by global defines like NOVCL, NO_STRICT etc.? |
---|
| 21 | #define makeDirectory(name) mkdir(name) |
---|
| 22 | #endif |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | #else |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | #include <unistd.h> |
---|
| 29 | #include <sys/stat.h> |
---|
| 30 | #define makeDirectory(name) mkdir(name,0777) |
---|
| 31 | |
---|
| 32 | #endif |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | #include <stdio.h> |
---|
| 36 | |
---|
| 37 | #if defined SHP && defined BADA_API_1 |
---|
| 38 | |
---|
| 39 | //sprintf* and others that work correctly are taken from <stdio.h>... |
---|
| 40 | |
---|
| 41 | #include <FIo.h> |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | typedef Osp::Io::File MFILE; |
---|
| 45 | MFILE *mfopen(const char*path,const char*mode); |
---|
| 46 | void mfclose(MFILE *f); |
---|
| 47 | int mfread(void *ptr, int size, int n, MFILE *f); |
---|
| 48 | int mfwrite(const void *ptr, int size, int n, MFILE *f); |
---|
| 49 | int mfputs(const char *, MFILE *); |
---|
| 50 | int mfseek(MFILE *, long, int); |
---|
| 51 | long mftell(MFILE *); |
---|
| 52 | char *mfgets(char *str, int num, MFILE *f); |
---|
| 53 | int mfeof(MFILE *f); |
---|
| 54 | |
---|
| 55 | //#define SEEK_SET 0 /* set file offset to offset */ |
---|
| 56 | //#define SEEK_CUR 1 /* set file offset to current plus offset */ |
---|
| 57 | //#define SEEK_END 2 /* set file offset to EOF plus offset */ |
---|
| 58 | //int sprintf(char *, const char *, ...); |
---|
| 59 | //int vsnprintf(char *,int, const char *, ...); |
---|
| 60 | |
---|
| 61 | #else |
---|
| 62 | typedef FILE MFILE; |
---|
| 63 | #define mfopen fopen |
---|
| 64 | #define mfclose fclose |
---|
| 65 | #define mfread fread |
---|
| 66 | #define mfwrite fwrite |
---|
| 67 | #define mfputs fputs |
---|
| 68 | #define mfgets fgets |
---|
| 69 | #define mfeof feof |
---|
| 70 | #define mfseek fseek |
---|
| 71 | #define mftell ftell |
---|
| 72 | #endif |
---|
| 73 | |
---|
| 74 | #endif |
---|
| 75 | |
---|