// Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker
// This file is part of the "Luxinia Engine".
// For conditions of distribution and use, see copyright notice in luxiniapublicsdk.txt
//
// <Author: Christoph Kubisch>


#ifndef __LUXCORE_FILE_H__
#define __LUXCORE_FILE_H__

#include <luxplatform/luxplatform.h>

#ifdef __cplusplus
extern "C"{
#endif

	typedef struct FSFile_s
	{
		byte	*contents;
		size_t	index;
		size_t	size;

		booln	freecontent;
	}FSFile_t;

	booln	FS_setCurrent(FSFile_t *file, void *data);
	void*	FS_getCurrent(FSFile_t *file);
	void*	FS_getContent(FSFile_t *file);
	size_t	FS_getSize(FSFile_t *file);


	char*	FS_gets(char *buffer, size_t size, FSFile_t *file);
	char	FS_eof(FSFile_t *file);
	char	FS_getc(FSFile_t *file);
	size_t	FS_read(void* target, size_t size, size_t count,FSFile_t *file);
	size_t	FS_seek(FSFile_t* file, size_t offset, size_t origin);

#ifdef __cplusplus
}
#endif

#endif
