source: cpp/gdk/nonstd_stdio.h @ 104

Last change on this file since 104 was 82, checked in by Maciej Komosinski, 11 years ago

compiles under more platforms and OSes

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1#ifndef _NONSTD_STDIO_H_
2#define _NONSTD_STDIO_H_
3
4bool fileExists(const char* path);
5bool 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
44typedef Osp::Io::File MFILE;
45MFILE *mfopen(const char*path,const char*mode);
46void mfclose(MFILE *f);
47int mfread(void *ptr, int size, int n, MFILE *f);
48int mfwrite(const void *ptr, int size, int n, MFILE *f);
49int mfputs(const char *, MFILE *);
50int     mfseek(MFILE *, long, int);
51long mftell(MFILE *);
52char *mfgets(char *str, int num, MFILE *f);
53int 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
Note: See TracBrowser for help on using the repository browser.