// This file is a part of the Framsticks GDK.
// Copyright (C) 1999-2014 Maciej Komosinski and Szymon Ulatowski. See LICENSE.txt for details.
// Refer to http://www.framsticks.com/ for further information.
#ifndef _NONSTD_STDIO_H_
#define _NONSTD_STDIO_H_
bool fileExists(const char* path);
bool removeFile(const char* path);
bool isAbsolutePath(const char* fname);
#ifdef _WIN32
#ifndef _MSC_VER
#include
#else
#ifndef MOBILE2D
#include
#endif
#define mkdir _mkdir
#endif
#ifndef MOBILE2D
#include //borland compiler: include before 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.?
#define makeDirectory(name) mkdir(name)
#endif
#else
#include
#include
#define makeDirectory(name) mkdir(name,0777)
#define _unlink unlink //_unlink jest ISO-conformant, unlink jest POSIX-deprecated
#endif
#include
#if (defined SHP && defined BADA_API_1) || defined __ANDROID__
#ifdef __ANDROID__
#include
struct rwFILE //jedno z dwoch pol jest zainicjowane w zaleznosci od tego gdzie jest plik
{
NvFile *rfile; //umie tylko czytac
FILE *rwfile;
rwFILE() {rfile=rwfile=NULL;}
};
typedef rwFILE MFILE;
#else //SHP:
//z wzielismy sprintfy i inne ktore działają...
#include
// wklejone z sailora w ramach integracji frams+engine
// ale to nie sprawia ze framsy korzystaja z mfile - potrzebna jest implementacja virtfile dla bady! (patrz: stdiofile.h)
// i wtedy bedzie mozna mfile wywalic tez z sailora
typedef Osp::Io::File MFILE;
#endif
MFILE *mfopen(const char*path,const char*mode);
void mfclose(MFILE *f);
int mfread(void *ptr, int size, int n, MFILE *f);
int mfwrite(const void *ptr, int size, int n, MFILE *f);
int mfputs(const char *, MFILE *);
int mfseek(MFILE *, long, int);
long mftell(MFILE *);
char *mfgets(char *str, int num, MFILE *f);
int mfeof(MFILE *f);
//#define SEEK_SET 0 /* set file offset to offset */
//#define SEEK_CUR 1 /* set file offset to current plus offset */
//#define SEEK_END 2 /* set file offset to EOF plus offset */
//int sprintf(char *, const char *, ...);
//int vsnprintf(char *,int, const char *, ...);
#else
typedef FILE MFILE;
#define mfopen fopen
#define mfclose fclose
#define mfread fread
#define mfwrite fwrite
#define mfputs fputs
#define mfgets fgets
#define mfeof feof
#define mfseek fseek
#define mftell ftell
#endif
#ifndef _WIN32
#define _strdup strdup //_strdup jest ISO-conformant, strdup jest POSIX deprecated
#include //strdup
#endif
#endif