]> git.sesse.net Git - vlc/blobdiff - src/control/core.c
Add some playlist api functions
[vlc] / src / control / core.c
index 25fa55f79494aaddffbf43ebe8422020c2bcb956..e4432e84b9ed932ab00941b11939022d3f9a4b31 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2005 the VideoLAN team
  * $Id$
  *
- * Authors: Clément Stenac <zorglub@videolan.org>
+ * Authors: Clent Stenac <zorglub@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #include <libvlc_internal.h>
@@ -26,8 +26,6 @@
 
 #include <vlc/intf.h>
 
-vlc_t * vlc_current_object( int );
-
 /*************************************************************************
  * Exceptions handling
  *************************************************************************/
@@ -37,6 +35,14 @@ inline void libvlc_exception_init( libvlc_exception_t *p_exception )
     p_exception->psz_message = NULL;
 }
 
+void libvlc_exception_clear( libvlc_exception_t *p_exception )
+{
+    if( p_exception->psz_message )
+        free( p_exception->psz_message );
+    p_exception->psz_message = NULL;
+    p_exception->b_raised = 0;
+}
+
 inline int libvlc_exception_raised( libvlc_exception_t *p_exception )
 {
     return p_exception->b_raised;
@@ -56,10 +62,10 @@ inline void libvlc_exception_raise( libvlc_exception_t *p_exception,
 {
     if( p_exception == NULL ) return;
     p_exception->b_raised = 1;
-    p_exception->psz_message = strdup( psz_message );
+    if( psz_message )
+        p_exception->psz_message = strdup( psz_message );
 }
 
-
 libvlc_instance_t * libvlc_new( int argc, char **argv,
                                 libvlc_exception_t *p_exception )
 {