2 * This file is part of MPlayer.
4 * MPlayer is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * MPlayer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef MPLAYER_PLAYTREEPARSER_H
20 #define MPLAYER_PLAYTREEPARSER_H
24 /// \defgroup PlaytreeParser Playtree parser
27 /// The playtree parser allows to read various playlist formats. It reads from
28 /// a stream allowing to handle playlists from local files and the network.
35 typedef struct play_tree_parser
{
36 struct stream_st
* stream
;
37 char *buffer
,*iter
,*line
;
38 int buffer_size
, buffer_end
;
42 /// Create a new parser.
43 /** \param stream The stream to read from.
44 * \param deep Parser depth. Some formats allow including other files,
45 * this is used to track the inclusion depth.
46 * \return The new parser.
49 play_tree_parser_new(struct stream_st
* stream
,int deep
);
53 play_tree_parser_free(play_tree_parser_t
* p
);
55 /// Build a playtree from the playlist opened with the parser.
56 /** \param p The parser.
57 * \param forced If non-zero the playlist file was explicitly
58 * given by the user, allow falling back on
59 * one filename per line playlist.
60 * \return A new playtree or NULL on error.
63 play_tree_parser_get_play_tree(play_tree_parser_t
* p
, int forced
);
65 /// Wrapper for play_tree_add_basepath (add base path from file).
67 play_tree_add_bpf(play_tree_t
* pt
, char* filename
);
71 #endif /* MPLAYER_PLAYTREEPARSER_H */