SDL  2.0
testurl.c
Go to the documentation of this file.
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: */
#define SDL_INIT_VIDEO
Definition: SDL.h:82
#define SDL_GetError
#define SDL_OpenURL
#define SDL_Quit
#define SDL_Init
#define SDL_Log
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
int main(int argc, char **argv)
Definition: testurl.c:14