/*
 **************************************************************************************************
	*	CPA_Ed_1	team *	
	*   File  Management *
 **************************************************************************************************
*/

#ifndef __LDT_FILE_H__
#define __LDT_FILE_H__

#ifdef LDT_USE_SINGLE_FILE_BUFFER

extern char* GBuff;
extern unsigned long GBuffSize;

#endif


/* struct like a FILE , but for file in memory*/
typedef struct LDT_tdst_MemFile_ LDT_tdst_MemFile;

struct LDT_tdst_MemFile_ {
	char		*pName;			/* Name of the file */
	char		*pBuffer;		/* Pointer of the file in memory */
	unsigned long	Pos;		/* Current Pos of the file in memory*/
	size_t     Size;			/* Size of the file in memory*/
	int		sPathLength;		/* Length of additional path */
};

/* methods */

    long	f_OpenMem(LDT_tdst_MemFile **_pInfoMemFile,char* _Name);
	long	f_CloseMem(LDT_tdst_MemFile *_pInfoMemFile);
	
	long    f_TellMem(LDT_tdst_MemFile *_pInfoMemFile );
	long	f_SeekMem(LDT_tdst_MemFile *_pInfoMemFile ,long  _Offset,int _Origin);

	long	f_ReadMem(char * _PointerDest,size_t _Size,LDT_tdst_MemFile *_pInfoMemFile ) ;

#endif /*__LDT_FILE_H__*/


