35 #define NFO_STRINGIFY(s) #s
36 #define NFO_TOSTRING(s) NFO_STRINGIFY(s)
38 #define NFO_VERSION_INT(a, b, c) (a << 16 | b << 8 | c)
39 #define NFO_VERSION_DOT(a, b, c) a ##.## b ##.## c
40 #define NFO_VERSION(a, b, c) NFO_VERSION_DOT(a, b, c)
42 #define LIBNFO_VERSION_MAJOR 1
43 #define LIBNFO_VERSION_MINOR 0
44 #define LIBNFO_VERSION_MICRO 1
46 #define LIBNFO_VERSION_INT NFO_VERSION_INT(LIBNFO_VERSION_MAJOR, \
47 LIBNFO_VERSION_MINOR, \
49 #define LIBNFO_VERSION NFO_VERSION(LIBNFO_VERSION_MAJOR, \
50 LIBNFO_VERSION_MINOR, \
52 #define LIBNFO_VERSION_STR NFO_TOSTRING(LIBNFO_VERSION)
53 #define LIBNFO_BUILD LIBNFO_VERSION_INT
58 typedef struct nfo_stream_video_s nfo_stream_video_t;
59 typedef struct nfo_stream_audio_s nfo_stream_audio_t;
60 typedef struct nfo_stream_sub_s nfo_stream_sub_t;
61 typedef struct nfo_fileinfo_s nfo_fileinfo_t;
62 typedef struct nfo_actor_s nfo_actor_t;
63 typedef struct nfo_movie_s nfo_movie_t;
64 typedef struct nfo_tvshow_s nfo_tvshow_t;
65 typedef struct nfo_tvshow_episode_s nfo_tvshow_episode_t;
66 typedef struct nfo_s nfo_t;
68 typedef enum nfo_type_s
76 typedef enum nfo_actor_field_s {
82 typedef enum nfo_video_field_s {
86 NFO_VIDEO_FORMAT_INFO,
89 NFO_VIDEO_BITRATE_MODE,
90 NFO_VIDEO_BITRATE_MAX,
98 typedef enum nfo_audio_field_s {
105 typedef enum nfo_sub_field_s {
109 typedef enum nfo_movie_field_s {
111 NFO_MOVIE_ORIGINAL_TITLE,
123 NFO_MOVIE_PLAY_COUNT,
133 typedef enum nfo_tvshow_field_s {
138 NFO_TVSHOW_DISPLAY_SEASON,
139 NFO_TVSHOW_DISPLAY_EPISODE,
140 NFO_TVSHOW_EPISODE_GUIDE_URL,
145 NFO_TVSHOW_PREMIERED,
148 NFO_TVSHOW_FANART_HEADER,
149 NFO_TVSHOW_FANART_COVER,
150 } nfo_tvshow_field_t;
152 typedef enum nfo_tvshow_episode_field_s {
153 NFO_TVSHOW_EPISODE_TITLE,
154 NFO_TVSHOW_EPISODE_RATING,
155 NFO_TVSHOW_EPISODE_SEASON,
156 NFO_TVSHOW_EPISODE_EPISODE,
157 NFO_TVSHOW_EPISODE_PLOT,
158 NFO_TVSHOW_EPISODE_THUMB,
159 NFO_TVSHOW_EPISODE_FANART,
160 NFO_TVSHOW_EPISODE_FANART_SEASON,
161 NFO_TVSHOW_EPISODE_PLAY_COUNT,
162 NFO_TVSHOW_EPISODE_CREDITS,
163 NFO_TVSHOW_EPISODE_DIRECTOR,
164 NFO_TVSHOW_EPISODE_AIRED,
165 NFO_TVSHOW_EPISODE_VOTES,
166 } nfo_tvshow_episode_field_t;
169 nfo_t *nfo_init (
const char *filename);
170 void nfo_free (nfo_t *nfo);
173 nfo_type_t nfo_get_type (nfo_t *nfo);
174 nfo_movie_t *nfo_get_movie (nfo_t *nfo);
175 nfo_tvshow_episode_t *nfo_get_tvshow_episode (nfo_t *nfo);
178 char *nfo_movie_get (nfo_movie_t *movie, nfo_movie_field_t f);
180 int nfo_movie_get_actors_count (nfo_movie_t *movie);
181 nfo_actor_t *nfo_movie_get_actor (nfo_movie_t *movie,
int id);
183 int nfo_movie_get_video_streams_count (nfo_movie_t *movie);
184 nfo_stream_video_t *nfo_movie_get_video_stream (nfo_movie_t *movie,
int id);
186 int nfo_movie_get_audio_streams_count (nfo_movie_t *movie);
187 nfo_stream_audio_t *nfo_movie_get_audio_stream (nfo_movie_t *movie,
int id);
189 int nfo_movie_get_sub_streams_count (nfo_movie_t *movie);
190 nfo_stream_sub_t *nfo_movie_get_sub_stream (nfo_movie_t *movie,
int id);
193 char *nfo_tvshow_episode_get (nfo_tvshow_episode_t *ep,
194 nfo_tvshow_episode_field_t f);
196 int nfo_tvshow_episode_get_actors_count (nfo_tvshow_episode_t *ep);
197 nfo_actor_t *nfo_tvshow_episode_get_actor (nfo_tvshow_episode_t *ep,
int id);
199 int nfo_tvshow_episode_get_video_streams_count (nfo_tvshow_episode_t *ep);
200 nfo_stream_video_t *nfo_tvshow_episode_get_video_stream
201 (nfo_tvshow_episode_t *ep,
int id);
203 int nfo_tvshow_episode_get_audio_streams_count (nfo_tvshow_episode_t *ep);
204 nfo_stream_audio_t *nfo_tvshow_episode_get_audio_stream
205 (nfo_tvshow_episode_t *ep,
int id);
207 int nfo_tvshow_episode_get_sub_streams_count (nfo_tvshow_episode_t *ep);
208 nfo_stream_sub_t *nfo_tvshow_episode_get_sub_stream
209 (nfo_tvshow_episode_t *ep,
int id);
211 nfo_tvshow_t *nfo_tvshow_episode_get_show (nfo_tvshow_episode_t *ep);
212 char *nfo_tvshow_get (nfo_tvshow_t *ep, nfo_tvshow_field_t f);
215 char *nfo_actor_get (nfo_actor_t *actor, nfo_actor_field_t f);
218 char *nfo_video_stream_get (nfo_stream_video_t *video, nfo_video_field_t f);
219 char *nfo_audio_stream_get (nfo_stream_audio_t *audio, nfo_audio_field_t f);
220 char *nfo_sub_stream_get (nfo_stream_sub_t *sub, nfo_sub_field_t f);