+ vlc_mutex_lock( &p_vlm->lock );
+ i_result = ExecuteCommand( p_vlm, psz_command, pp_message );
+ vlc_mutex_unlock( &p_vlm->lock );
+
+ return i_result;
+}
+
+/*****************************************************************************
+ * vlm_Save:
+ *****************************************************************************/
+int vlm_Save( vlm_t *p_vlm, const char *psz_file )
+{
+ FILE *file;
+ char *psz_save;
+
+ if( !p_vlm || !psz_file ) return 1;
+
+ file = utf8_fopen( psz_file, "wt" );
+ if( file == NULL ) return 1;
+
+ psz_save = Save( p_vlm );
+ if( psz_save == NULL )
+ {
+ fclose( file );
+ return 1;
+ }
+ fwrite( psz_save, strlen( psz_save ), 1, file );
+ fclose( file );
+ free( psz_save );
+
+ return 0;
+}
+
+/*****************************************************************************
+ * vlm_Load:
+ *****************************************************************************/
+int vlm_Load( vlm_t *p_vlm, const char *psz_file )
+{
+ stream_t *p_stream;
+ int64_t i_size;
+ char *psz_buffer;
+
+ if( !p_vlm || !psz_file ) return 1;
+
+ p_stream = stream_UrlNew( p_vlm, psz_file );
+ if( p_stream == NULL ) return 1;
+
+ if( stream_Seek( p_stream, 0 ) != 0 )
+ {
+ stream_Delete( p_stream );
+ return 2;
+ }
+
+ i_size = stream_Size( p_stream );
+
+ psz_buffer = malloc( i_size + 1 );
+ if( !psz_buffer )
+ {
+ stream_Delete( p_stream );
+ return 2;
+ }
+
+ stream_Read( p_stream, psz_buffer, i_size );
+ psz_buffer[ i_size ] = '\0';
+
+ stream_Delete( p_stream );
+
+ if( Load( p_vlm, psz_buffer ) )
+ {
+ free( psz_buffer );
+ return 3;
+ }