1 /*****************************************************************************
2 * old.c : Old playlist format import/export
3 *****************************************************************************
4 * Copyright (C) 2004 the VideoLAN team
7 * Authors: Cl�ent 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 *****************************************************************************/
27 #include <stdlib.h> /* malloc(), free() */
33 #include <errno.h> /* ENOMEM */
35 #define PLAYLIST_FILE_HEADER "# vlc playlist file version 0.5"
37 /*****************************************************************************
39 *****************************************************************************/
40 int Export_Old ( vlc_object_t * );
42 /*****************************************************************************
43 * Export_Old : main export function
44 *****************************************************************************/
45 int Export_Old( vlc_object_t *p_this )
47 playlist_t *p_playlist = (playlist_t*)p_this;
48 playlist_export_t *p_export = (playlist_export_t *)p_playlist->p_private;
51 msg_Dbg(p_playlist, "Saving using old format");
54 fprintf( p_export->p_file , PLAYLIST_FILE_HEADER "\n" );
56 for ( i = 0 ; i < p_playlist->i_size ; i++ )
60 psz_uri = ToLocale( p_playlist->pp_items[i]->input.psz_uri );
61 fprintf( p_export->p_file , "%s\n" , psz_uri );
62 LocaleFree( psz_uri );