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
58typedef struct nfo_stream_video_s nfo_stream_video_t;
59typedef struct nfo_stream_audio_s nfo_stream_audio_t;
60typedef struct nfo_stream_sub_s nfo_stream_sub_t;
61typedef struct nfo_fileinfo_s nfo_fileinfo_t;
62typedef struct nfo_actor_s nfo_actor_t;
63typedef struct nfo_movie_s nfo_movie_t;
64typedef struct nfo_tvshow_s nfo_tvshow_t;
65typedef struct nfo_tvshow_episode_s nfo_tvshow_episode_t;
66typedef struct nfo_s nfo_t;
68typedef enum nfo_type_s
76typedef enum nfo_actor_field_s {
82typedef enum nfo_video_field_s {
86 NFO_VIDEO_FORMAT_INFO,
89 NFO_VIDEO_BITRATE_MODE,
90 NFO_VIDEO_BITRATE_MAX,
98typedef enum nfo_audio_field_s {
105typedef enum nfo_sub_field_s {
109typedef enum nfo_movie_field_s {
111 NFO_MOVIE_ORIGINAL_TITLE,
123 NFO_MOVIE_PLAY_COUNT,
133typedef 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,
152typedef 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;
169nfo_t *nfo_init (
const char *filename);
170void nfo_free (nfo_t *nfo);
173nfo_type_t nfo_get_type (nfo_t *nfo);
174nfo_movie_t *nfo_get_movie (nfo_t *nfo);
175nfo_tvshow_episode_t *nfo_get_tvshow_episode (nfo_t *nfo);
178char *nfo_movie_get (nfo_movie_t *movie, nfo_movie_field_t f);
180int nfo_movie_get_actors_count (nfo_movie_t *movie);
181nfo_actor_t *nfo_movie_get_actor (nfo_movie_t *movie,
int id);
183int nfo_movie_get_video_streams_count (nfo_movie_t *movie);
184nfo_stream_video_t *nfo_movie_get_video_stream (nfo_movie_t *movie,
int id);
186int nfo_movie_get_audio_streams_count (nfo_movie_t *movie);
187nfo_stream_audio_t *nfo_movie_get_audio_stream (nfo_movie_t *movie,
int id);
189int nfo_movie_get_sub_streams_count (nfo_movie_t *movie);
190nfo_stream_sub_t *nfo_movie_get_sub_stream (nfo_movie_t *movie,
int id);
193char *nfo_tvshow_episode_get (nfo_tvshow_episode_t *ep,
194 nfo_tvshow_episode_field_t f);
196int nfo_tvshow_episode_get_actors_count (nfo_tvshow_episode_t *ep);
197nfo_actor_t *nfo_tvshow_episode_get_actor (nfo_tvshow_episode_t *ep,
int id);
199int nfo_tvshow_episode_get_video_streams_count (nfo_tvshow_episode_t *ep);
200nfo_stream_video_t *nfo_tvshow_episode_get_video_stream
201 (nfo_tvshow_episode_t *ep,
int id);
203int nfo_tvshow_episode_get_audio_streams_count (nfo_tvshow_episode_t *ep);
204nfo_stream_audio_t *nfo_tvshow_episode_get_audio_stream
205 (nfo_tvshow_episode_t *ep,
int id);
207int nfo_tvshow_episode_get_sub_streams_count (nfo_tvshow_episode_t *ep);
208nfo_stream_sub_t *nfo_tvshow_episode_get_sub_stream
209 (nfo_tvshow_episode_t *ep,
int id);
211nfo_tvshow_t *nfo_tvshow_episode_get_show (nfo_tvshow_episode_t *ep);
212char *nfo_tvshow_get (nfo_tvshow_t *ep, nfo_tvshow_field_t f);
215char *nfo_actor_get (nfo_actor_t *actor, nfo_actor_field_t f);
218char *nfo_video_stream_get (nfo_stream_video_t *video, nfo_video_field_t f);
219char *nfo_audio_stream_get (nfo_stream_audio_t *audio, nfo_audio_field_t f);
220char *nfo_sub_stream_get (nfo_stream_sub_t *sub, nfo_sub_field_t f);