コード例 #1
0
static tu_file*	file_opener(const char* url)
// Callback function.  This opens files for the gameswf library.
{
	if (s_allow_http) 
	{
#if TU_ENABLE_NETWORK == 1
		return new_tu_net_file(url, "rb");
#else
		return NULL;
#endif
	}
	else
	{
		return new tu_file(url, "rb");
	}
}
コード例 #2
0
ファイル: test_client.cpp プロジェクト: daisukewi/DKGEngine
// arg1: source file, like "http://www.my.com/swf/my.swf"
// arg2: dest file, like "c:\my.swf"
int main(int argc, const char** argv)
{
    if (argc < 3)
    {
        printf("2 args is needed\n");
        exit(0);
    }

    tu_file* source = new_tu_net_file(argv[1], "rb");
    if (source)
    {
        tu_file target(argv[2], "wb");
        target.copy_from(source);
        delete source;
    }
    else
    {
        printf("can't open '%s'\n", argv[1]);
    }
}