
extern "C" {

	// ----------------------------------------------------------------
	// IFileArchive
	// ----------------------------------------------------------------
	
	IReadFile* IrrIO_IFileArchive_createAndOpenFile(IFileArchive* fa, const c8* filename)
	{
		if (fa)
			return fa->createAndOpenFile(path(filename));
		else return 0;
	}
	
	IReadFile* IrrIO_IFileArchive_createAndOpenFileByIndex(IFileArchive* fa, u32 index)
	{
		if (fa)
			return fa->createAndOpenFile(index);
		else return 0;
	}
	
	const IFileList* IrrIO_IFileArchive_getFileList(IFileArchive* fa)
	{
		if (fa)
			return fa->getFileList();
		else return 0;
	}
	
	// returns E_FILE_ARCHIVE_TYPE
	s32 IrrIO_IFileArchive_getType(IFileArchive* fa) 
	{
		if (fa)
			return fa->getType();
		else return -1;
	} 

	bool IrrIO_IFileArchive_drop(IFileArchive* unk)
	{
		if (unk)
			return unk->drop();
		else return 0;
	}
	
	const c8* IrrIO_IFileArchive_getDebugName(IFileArchive* unk)
	{
		if (unk)
			return unk->getDebugName();
		else return "";
	}
	
	void IrrIO_IFileArchive_grab(IFileArchive* unk)
	{
		if (unk)
			unk->grab();
	}

	void IrrIO_IFileArchive_setPassword(IFileArchive* fa, const c8* password) 
	{
		if (fa)
			fa->Password = password;
	} 

	const c8* IrrIO_IFileArchive_getPassword(IFileArchive* fa) 
	{
		if (fa)
			return fa->Password.c_str();
	} 

	// ----------------------------------------------------------------
	// IArchiveLoader
	// ----------------------------------------------------------------
	bool IrrIO_IArchiveLoader_isALoadableFileFormat(IArchiveLoader* al, const c8* filename)
	{
		if (al)
			return al->isALoadableFileFormat(path(filename));
		else return false;
	}
	
	bool IrrIO_IArchiveLoader_isALoadableFileFormatFromIO(IArchiveLoader* al, io::IReadFile* file)
	{
		if (al)
			return al->isALoadableFileFormat(file);
		else return false;
	}
	
	bool IrrIO_IArchiveLoader_isALoadableFileFormatFromType(IArchiveLoader* al, E_FILE_ARCHIVE_TYPE fileType) 
	{
		if (al)
			return al->isALoadableFileFormat(fileType);
		else return false;
	}
	
	IFileArchive* IrrIO_IArchiveLoader_createArchive(IArchiveLoader* al, const c8* filename, bool ignoreCase, bool ignorePaths) 
	{
		if (al)
			return al->createArchive(path(filename), ignoreCase, ignorePaths);
		else return 0;
	}
	
	IFileArchive* IrrIO_IArchiveLoader_createArchiveFromIO(IArchiveLoader* al, io::IReadFile* file, bool ignoreCase, bool ignorePaths)
	{
		if (al)
			return al->createArchive(file, ignoreCase, ignorePaths);
		else return 0;
	}

	bool IrrIO_IArchiveLoader_drop(IArchiveLoader* unk)
	{
		if (unk)
			return unk->drop();
		else return 0;
	}
	
	const c8* IrrIO_IArchiveLoader_getDebugName(IArchiveLoader* unk)
	{
		if (unk)
			return unk->getDebugName();
		else return "";
	}
	
	void IrrIO_IArchiveLoader_grab(IArchiveLoader* unk)
	{
		if (unk)
			unk->grab();
	}

}