1 /*****************************************************************************
2 * old.c : Old playlist format import/export
3 *****************************************************************************
4 * Copyright (C) 2004-2009 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
32 #include <vlc_common.h>
33 #include <vlc_playlist.h>
34 #include <vlc_input.h>
35 #include <vlc_charset.h>
38 #define PLAYLIST_FILE_HEADER "# vlc playlist file version 0.5"
40 /*****************************************************************************
42 *****************************************************************************/
43 int Export_Old ( vlc_object_t * );
45 /*****************************************************************************
46 * Export_Old : main export function
47 *****************************************************************************/
48 int Export_Old( vlc_object_t *p_this )
50 playlist_export_t *p_export = (playlist_export_t *)p_this;
53 msg_Dbg( p_export, "saving using old format");
56 fprintf( p_export->p_file , PLAYLIST_FILE_HEADER "\n" );
58 for ( i = 0 ; i < p_export->p_root->i_children ; i++ )
59 utf8_fprintf( p_export->p_file , "%s\n" ,
60 p_export->p_root->pp_children[i]->p_input->psz_name );