Movie Info Provider: Added format property
[maevies] / examples / test_watc.c
1 /*
2  * test_watc.c
3  *
4  * This file is part of maevies
5  * Copyright (C) 2009 Simon Pena <spenap@gmail.com>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License for more details.
16  *
17  */
18
19 #include <glib.h>
20 #include <stdio.h>
21 #include <unistd.h>
22 #include "watc_provider.h"
23
24 static void show_watc_info(gpointer info, gpointer data);
25
26 gint main(gint argc, gchar **argv) {
27
28         GSList *result_list = NULL;
29         const gchar *movie_name = NULL;
30
31         if (argc != 2) {
32                 movie_name = "Zombieland";
33         } else {
34                 movie_name = argv[1];
35         }
36
37         g_thread_init(NULL);
38         g_type_init();
39
40         result_list = watc_has_stingers(movie_name);
41
42         g_slist_foreach(result_list, (GFunc) show_watc_info, NULL);
43
44         watcinfo_list_unref(result_list);
45
46         return 1;
47 }
48
49 static void show_watc_info(gpointer info, gpointer data) {
50
51         WATCInfo *movie_info = (info);
52
53         watcinfo_print(movie_info);
54
55 }