1 #ifndef MPLAYER_PLAYTREEPARSER_H
2 #define MPLAYER_PLAYTREEPARSER_H
6 /// \defgroup PlaytreeParser Playtree parser
9 /// The playtree parser allows to read various playlist formats. It reads from
10 /// a stream allowing to handle playlists from local files and the network.
17 typedef struct play_tree_parser
{
18 struct stream
* stream
;
19 struct m_config
*mconfig
;
20 char *buffer
,*iter
,*line
;
21 int buffer_size
, buffer_end
;
25 /// Create a new parser.
26 /** \param stream The stream to read from.
27 * \param deep Parser depth. Some formats allow including other files,
28 * this is used to track the inclusion depth.
29 * \return The new parser.
32 play_tree_parser_new(struct stream
* stream
, struct m_config
*mconfig
, int deep
);
36 play_tree_parser_free(play_tree_parser_t
* p
);
38 /// Build a playtree from the playlist opened with the parser.
39 /** \param p The parser.
40 * \param forced If non-zero the playlist file was explicitly
41 * given by the user, allow falling back on
42 * one filename per line playlist.
43 * \return A new playtree or NULL on error.
46 play_tree_parser_get_play_tree(play_tree_parser_t
* p
, int forced
);
48 /// Wrapper for play_tree_add_basepath (add base path from file).
50 play_tree_add_bpf(play_tree_t
* pt
, char* filename
);
54 #endif /* MPLAYER_PLAYTREEPARSER_H */