
#include <oslib/oslib.h>


PSP_MODULE_INFO("Devslib Sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);




int main(int argc, char* argv[])
{


	//Initialisation
	oslInit(0);							//la lib
	oslInitGfx(OSL_PF_8888, 1);			//Gfx
	oslInitAudio();						//Sound



	///////////////partie fichier INI
	char buffer[4096];
	dictionary * ini;
	const char *defaultfile = "Test.ini";
	char *nom;
	int age;
	buffer[0] = '\0';
	nom = buffer;
	ini = iniparser_load( defaultfile );


   nom = iniparser_getstring( ini, "TOTO:nom", NULL );
   age = iniparser_getint( ini, "TOTO:age", 0 );
   /////////////fin de la partie fichier INI



	while (!osl_quit)
	{
		oslStartDrawing();
		oslCls();

		nom = iniparser_getstring( ini, "CLIENT1:nom", NULL );
		age = iniparser_getint( ini, "CLIENT1:age", 0 );
		oslPrintf_xy(200, 70, "Nom: %s", nom);
		oslPrintf_xy(200, 90, "age: %i", age);
		nom = buffer;


		nom = iniparser_getstring( ini, "CLIENT2:nom", NULL );
		age = iniparser_getint( ini, "CLIENT2:age", 0 );
		oslPrintf_xy(200, 110, "Nom: %s", nom);
		oslPrintf_xy(200, 130, "age: %i", age);
		nom = buffer;

		

		oslSynchronization();

	}

	oslEndGfx();
	oslQuit();
	return 0;
}



