Regarding to TheMovieDB.org, I finished the parsing of 1 result (ignoring data if...
[maevies] / src / tmdb_movie.h
1 /*
2  * tmdb_movie.h
3  *
4  * This file is part of maevies
5  * Copyright (C) 2009 Simón 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 #ifndef TMDB_MOVIE_H_
20 #define TMDB_MOVIE_H_
21
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <rest-0.6/rest/rest-proxy.h>
25 #include <rest-0.6/rest/rest-proxy-call.h>
26 #include <rest-0.6/rest/rest-xml-parser.h>
27
28 #define GET_MESSAGE(x)  ( (x) ? x : " - " )
29 #define TMDB_API_KEY "249e1a42df9bee09fac5e92d3a51396b"
30 #define TMDB_SERVICE_URL "http://api.themoviedb.org/2.1"
31 #define TMDB_LANGUAGE "en"
32 #define TMDB_FORMAT "xml"
33 #define TMDB_SEARCH_METHOD "Movie.search"
34
35 typedef struct _TMDBMovie TMDBMovie;
36
37 struct _TMDBMovie {
38
39         gint popularity;
40         gchar *name;
41         gchar *alternative_name;
42         gint id;
43         gchar *imdb_id;
44         gchar *url;
45         gchar *overview;
46         gfloat rating;
47         GDate *released;
48         gint runtime;
49 /* categories */
50 /* images */
51 };
52
53 TMDBMovie *tmdb_get_info(const gchar *name);
54
55 void tmdb_movie_unref(TMDBMovie *movie);
56
57 void tmdb_movie_print(const TMDBMovie *movie);
58
59 #endif /* TMDB_MOVIE_H_ */