+/* Playlist sorting */
+VLC_EXPORT( int, playlist_TreeMove, ( playlist_t *, playlist_item_t *, playlist_item_t *, int ) );
+VLC_EXPORT( int, playlist_RecursiveNodeSort, ( playlist_t *, playlist_item_t *,int, int ) );
+
+/**
+ * Export a node of the playlist to a certain type of playlistfile
+ * \param p_playlist the playlist to export
+ * \param psz_filename the location where the exported file will be saved
+ * \param p_export_root the root node to export
+ * \param psz_type the type of playlist file to create (m3u, pls, ..)
+ * \return VLC_SUCCESS on success
+ */
+VLC_EXPORT( int, playlist_Export, ( playlist_t *p_playlist, const char *psz_name, playlist_item_t *p_export_root, const char *psz_type ) );
+
+/********************************************************
+ * Item management
+ ********************************************************/
+
+/*************************** Item creation **************************/
+
+VLC_EXPORT( playlist_item_t* , playlist_ItemNewWithType, ( vlc_object_t *,const char *,const char *, int , const char *const *, int, int) );
+
+/** Create a new item, without adding it to the playlist
+ * \param p_obj a vlc object (anyone will do)
+ * \param psz_uri the mrl of the item
+ * \param psz_name a text giving a name or description of the item
+ * \return the new item or NULL on failure
+ */
+#define playlist_ItemNew( a , b, c ) \
+ playlist_ItemNewWithType( VLC_OBJECT(a) , b , c, 0, NULL, -1, 0 )
+
+#define playlist_ItemNewFromInput(a,b) __playlist_ItemNewFromInput(VLC_OBJECT(a),b)
+VLC_EXPORT( playlist_item_t *, __playlist_ItemNewFromInput, ( vlc_object_t *p_obj,input_item_t *p_input ) );
+
+/*************************** Item deletion **************************/
+VLC_EXPORT( int, playlist_DeleteFromInput, ( playlist_t *, int, vlc_bool_t ) );
+
+/*************************** Item fields accessors **************************/
+VLC_EXPORT( int, playlist_ItemSetName, (playlist_item_t *, const char * ) );
+
+/******************** Item addition ********************/
+VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, const char *, int, int, vlc_bool_t ) );
+VLC_EXPORT( int, playlist_AddExt, ( playlist_t *, const char *, const char *, int, int, mtime_t, const char *const *,int, vlc_bool_t ) );
+VLC_EXPORT( int, playlist_AddInput, ( playlist_t *, input_item_t *,int , int, vlc_bool_t ) );
+VLC_EXPORT( playlist_item_t *, playlist_NodeAddInput, ( playlist_t *, input_item_t *,playlist_item_t *,int , int ) );
+VLC_EXPORT( int, playlist_BothAddInput, ( playlist_t *, input_item_t *,playlist_item_t *,int , int, int*, int* ) );
+
+/********************** Misc item operations **********************/
+VLC_EXPORT( playlist_item_t*, playlist_ItemToNode, (playlist_t *,playlist_item_t *, vlc_bool_t) );
+
+playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
+ int i_input_id, playlist_item_t *p_root,
+ vlc_bool_t );
+
+/********************************** Item search *************************/
+VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int, vlc_bool_t) );
+VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInput, (playlist_t *,input_item_t *, vlc_bool_t ) );
+
+VLC_EXPORT( int, playlist_LiveSearchUpdate, (playlist_t *, playlist_item_t *, const char *) );
+
+/********************************************************
+ * Tree management
+ ********************************************************/
+VLC_EXPORT(void, playlist_NodeDump, ( playlist_t *p_playlist, playlist_item_t *p_item, int i_level ) );
+VLC_EXPORT( int, playlist_NodeChildrenCount, (playlist_t *,playlist_item_t* ) );
+
+/* Node management */
+VLC_EXPORT( playlist_item_t *, playlist_NodeCreate, ( playlist_t *, const char *, playlist_item_t * p_parent ) );
+VLC_EXPORT( int, playlist_NodeAppend, (playlist_t *,playlist_item_t*,playlist_item_t *) );
+VLC_EXPORT( int, playlist_NodeInsert, (playlist_t *,playlist_item_t*,playlist_item_t *, int) );
+VLC_EXPORT( int, playlist_NodeRemoveItem, (playlist_t *,playlist_item_t*,playlist_item_t *) );
+VLC_EXPORT( playlist_item_t *, playlist_ChildSearchName, (playlist_item_t*, const char* ) );
+VLC_EXPORT( int, playlist_NodeDelete, ( playlist_t *, playlist_item_t *, vlc_bool_t , vlc_bool_t ) );
+VLC_EXPORT( int, playlist_NodeEmpty, ( playlist_t *, playlist_item_t *, vlc_bool_t ) );
+VLC_EXPORT( void, playlist_NodesPairCreate, (playlist_t *, const char *, playlist_item_t **, playlist_item_t **, vlc_bool_t ) );
+VLC_EXPORT( playlist_item_t *, playlist_GetPreferredNode, ( playlist_t *p_playlist, playlist_item_t *p_node ) );
+
+/***********************************************************************
+ * Inline functions
+ ***********************************************************************/
+/** Open a playlist file, add its content to the current playlist */
+static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file){
+ char psz_uri[256+10];
+ input_item_t *p_input;
+ snprintf( psz_uri, 256+9, "file/://%s", psz_file );
+ p_input = input_ItemNewExt( p_playlist, psz_uri, psz_file, 0, NULL, -1 );
+ playlist_AddInput( p_playlist, p_input, PLAYLIST_APPEND, PLAYLIST_END,
+ VLC_TRUE );
+ input_Read( p_playlist, p_input, VLC_TRUE );
+ return VLC_SUCCESS;