testurl.c (930B)
1 /* 2 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> 3 4 This software is provided 'as-is', without any express or implied 5 warranty. In no event will the authors be held liable for any damages 6 arising from the use of this software. 7 8 Permission is granted to anyone to use this software for any purpose, 9 including commercial applications, and to alter it and redistribute it 10 freely. 11 */ 12 #include "SDL.h" 13 14 int main(int argc, char **argv) 15 { 16 int i; 17 if (SDL_Init(SDL_INIT_VIDEO) == -1) { 18 SDL_Log("SDL_Init failed: %s\n", SDL_GetError()); 19 return 1; 20 } 21 22 for (i = 1; i < argc; i++) { 23 const char *url = argv[i]; 24 SDL_Log("Opening '%s' ...", url); 25 if (SDL_OpenURL(url) == 0) { 26 SDL_Log(" success!"); 27 } else { 28 SDL_Log(" failed! %s", SDL_GetError()); 29 } 30 } 31 32 SDL_Quit(); 33 return 0; 34 } 35 36 /* vi: set ts=4 sw=4 expandtab: */