void EMSCRIPTEN_KEEPALIVE main_2(void *arg) { #if 0 SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER); darea = SDL_SetVideoMode(800, 600, 32, SDL_HWSURFACE); printf("Init: %d\n", TTF_Init()); #endif time_t now; struct tm *tm; SDL_Thread*gth = NULL; /* thread id */ gboolean run_flag = TRUE; /* used as exit flag for threads */ gint i; printf("main2\n"); init_trees(); init_fonts(); font = get_font(12, 0); font_bold = get_font(12, 1); now = time(NULL); tm = localtime(&now); current_year = tm->tm_year+1900; srand(now); //srandom(now); my_address = now + getpid()*10000; emscripten_async_wget("/menuicon.png", "menuicon.png", menuicononload, menupiconerror); emscripten_async_wget("/menupicinfo.png", "menupicinfo.png", menupiconload, menupiconerror); emscripten_set_main_loop(main_loop, 10, 0); }
int main() { emscripten_async_wget( "http://localhost:8888/this_is_not_a_file", "/tmp/null", onLoaded, onError); emscripten_async_wget( "http://localhost:8888/test.html", "/tmp/test.html", onLoaded, onError); // Try downloading the same file a second time emscripten_async_wget( "http://localhost:8888/test.html", "/tmp/test.html", onLoaded, onError); // Try downloading a file to a destination directory that does not exist. emscripten_async_wget( "http://localhost:8888/test.html", "/this_directory_does_not_exist_and_should_be_created_by_wget/test.html", onLoaded, onError); mkdir("/path", 0777); chdir("/path"); // Try downloading a file to a destination directory that is a nonexisting path relative to CWD. emscripten_async_wget( "http://localhost:8888/test.html", "this_directory_is_relative_to_cwd/test.html", onLoaded, onError); char name[40]; strcpy(name, "/tmp/screen_shot.png"); // test for issue #2349, name being free'd emscripten_async_wget( "http://localhost:8888/screenshot.png", name, onLoaded, onError); memset(name, 0, 30); emscripten_set_main_loop(wait_wgets, 0, 0); return 0; }
int main() { emscripten_async_wget("module.js", "themodule.js", next, NULL); return 0; }