#if defined _xml_included
  #endinput
#endif
#define _xml_included

enum
{
	XMLLOAD_BUSY = 0,
	XMLLOAD_OK = 1,
	XMLLOAD_ERROR = -1,
};

enum
{
	XMLLOAD_MODE_NORMAL = 0,
	XMLLOAD_MODE_BG,
	XMLLOAD_MODE_MODAL,
}

stock POST_MAX = 64*1024;

native xmlLoadStart( const _url_[], const _name_[]="", const _argtable_[]="", _mode_=XMLLOAD_MODE_NORMAL );
native xmlLoadSync();
native xmlLoadSetPost( const _post_entity_[], bool:_encode_=true );
native xmlLoadTrapError( const _trap_range_list_[] );
native xmlLoadGetError();
stock xmlLoadWait()
{
	new	ret;

	for(;;){
		ret = xmlLoadSync();
		if( ret != XMLLOAD_BUSY ) return ret;		// 処理完了、または、エラー
		sleep;
	}

	return 0;
}

native xmlGetURI( _buf_[], _bufsize_ = sizeof _buf_ );
native xmlMakeFullPath( _buf_[], _bufsize_ = sizeof _buf_ );

stock xmlLoadStart_BNMenu()
	return xmlLoadStart( "$$BUILDIN_TOPMENU$$" );

stock xmlLoadStart_Download()
	return xmlLoadStart( "$$BUILDIN_DOWNLOAD$$" );
