/*
*	Created:			21.01.10
*	Author:				009
*	Last Modifed:		-
*	Description:		Функции упрощения работы с файлами
*/

#if defined _mode_files_included
	#endinput
#endif

#define _mode_files_included
#pragma library mode_files

// --------------------------------------------------
// defines
// --------------------------------------------------
#define WriteFileData(%1,%2,%3) format(%2,sizeof(%2),%3); \
		fwrite(%1,%2); \
		fwrite(%1,"\r\n")
#define ReadFileDataStr(%1,%2,%3,%4) if(!strcmp(%1,%2,true,%3)) strmid(%4,%1,(%3 + 1),strlen(%1))
#define ReadFileDataInt(%1,%2,%3,%4) if(!strcmp(%1,%2,true,%3)) %4 = strval(%1[%3 + 1])
#define ReadFileDataFloat(%1,%2,%3,%4) if(!strcmp(%1,%2,true,%3)) %4 = floatstr(%1[%3 + 1])

// --------------------------------------------------
// natives list (for pawno functions list)
// --------------------------------------------------
/*
native WriteFileData(File:file,temp[],const format[],{Float,_}:...);
native ReadFileDataStr(const source[],const key[],seperator_pos,dest[]);
native ReadFileDataInt(const source[],const key[],seperator_pos,&dest);
native ReadFileDataFloat(const source[],const key[],seperator_pos,&Float:dest);
*/