sync with en/mplayer.1 rev. 30822
[mplayer.git] / playtreeparser.h
blob53744ac0a287584b9e2ba690adfc47bfb44af919
1 /*
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
22 #include "playtree.h"
24 /// \defgroup PlaytreeParser Playtree parser
25 /// \ingroup Playtree
26 ///
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.
29 ///@{
31 /// \file
33 struct stream_st;
35 typedef struct play_tree_parser {
36 struct stream_st* stream;
37 char *buffer,*iter,*line;
38 int buffer_size , buffer_end;
39 int deep,keep;
40 } play_tree_parser_t;
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.
48 play_tree_parser_t*
49 play_tree_parser_new(struct stream_st* stream,int deep);
51 /// Destroy a parser.
52 void
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.
62 play_tree_t*
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).
66 void
67 play_tree_add_bpf(play_tree_t* pt, char* filename);
69 ///@}
71 #endif /* MPLAYER_PLAYTREEPARSER_H */