
extern "C" 
{

//------------------------------------------------------------------------------------
// irr::io::IWriteFile wrappers
// be sure to call the del function when done
//------------------------------------------------------------------------------------

void IrrIO_IWriteFile_del(IWriteFile* f)
{
	if (f)
		f->drop();
}


const c8* IrrIO_IWriteFile_getFileName(IWriteFile* f)
{
	if (f)
		return f->getFileName().c_str();
	else
		return "";
}

long IrrIO_IWriteFile_getPos(IWriteFile* f)
{
	if (f)
		return f->getPos();
	else
		return -1;
}


bool IrrIO_IWriteFile_seek(IWriteFile* f,long finalPos,bool relativeMovement=false)
{
	if (f)
		return f->seek(finalPos,relativeMovement);
	else
		return false;
}

s32 IrrIO_IWriteFile_write(IWriteFile* f,void* buffer,u32 sizeToWrite)
{
	if (f)
		return f->write(buffer,sizeToWrite);
	else
		return 0;
}

bool IrrIO_IWriteFile_drop(IWriteFile* unk)
{
	if (unk)
		return unk->drop();
	else return 0;
}

const c8* IrrIO_IWriteFile_getDebugName(IWriteFile* unk)
{
	if (unk)
		return unk->getDebugName();
	else return "";
}

void IrrIO_IWriteFile_grab(IWriteFile* unk)
{
	if (unk)
		unk->grab();
}

}


