]> git.sesse.net Git - vlc/blobdiff - include/vlc_update.h
shine: avoid double free
[vlc] / include / vlc_update.h
index f36e4059e53c6b9c1a1938b7f26c847373153b61..f7592212e7c5cc768e13ab835ad8132f92559fa4 100644 (file)
@@ -1,34 +1,34 @@
 /*****************************************************************************
- * vlc_update.h: VLC update and plugins download
+ * vlc_update.h: VLC update download
  *****************************************************************************
- * Copyright (C) 2005 the VideoLAN team
+ * Copyright © 2005-2007 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
+ *          Rafaël Carré <funman@videolanorg>
  *
- * 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
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
  * the Free Software Foundation; either release 2 of the License, or
  * (at your option) any later release.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * 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.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#if !defined( __LIBVLC__ )
-  #error You are not libvlc or one of its plugins. You cannot include this file
-#endif
+#ifndef VLC_UPDATE_H
+#define VLC_UPDATE_H
 
-#ifndef _VLC_UPDATE_H
-#define _VLC_UPDATE_H
-
-#include <vlc/vlc.h>
+/**
+ * \file
+ * This file defines update API in vlc
+ */
 
 /**
  * \defgroup update Update
  * @{
  */
 
-enum
-{
-    UpdateReleaseStatusOlder,
-    UpdateReleaseStatusEqual,
-    UpdateReleaseStatusNewer
-};
+#ifdef UPDATE_CHECK
 
 /**
  * Describes an update VLC release number
@@ -51,32 +46,25 @@ struct update_release_t
     int i_major;        ///< Version major
     int i_minor;        ///< Version minor
     int i_revision;     ///< Version revision
-    char* psz_svnrev;   ///< SVN revision
-    char* psz_extra;    ///< Version extra
+    int i_extra;        ///< Version extra
     char* psz_url;      ///< Download URL
     char* psz_desc;     ///< Release description
 };
 
-/**
- * The update object. Stores (and caches) all information relative to updates
- */
-struct update_t
-{
-    libvlc_int_t *p_libvlc;
-    vlc_mutex_t lock;
-    struct update_release_t release;    ///< Release (version)
-};
-
+#endif /* UPDATE_CHECK */
 
-#define update_New( a ) __update_New( VLC_OBJECT( a ) )
+typedef struct update_release_t update_release_t;
 
-VLC_EXPORT( update_t *, __update_New, ( vlc_object_t * ) );
-VLC_EXPORT( void, update_Delete, ( update_t * ) );
-VLC_EXPORT( void, update_Check, ( update_t * ) );
-VLC_EXPORT( int, update_CompareReleaseToCurrent, ( update_t * ) );
+VLC_API update_t * update_New( vlc_object_t * );
+#define update_New( a ) update_New( VLC_OBJECT( a ) )
+VLC_API void update_Delete( update_t * );
+VLC_API void update_Check( update_t *, void (*callback)( void*, bool ), void * );
+VLC_API bool update_NeedUpgrade( update_t * );
+VLC_API void update_Download( update_t *, const char* );
+VLC_API update_release_t* update_GetRelease( update_t * );
 
 /**
  * @}
  */
 
-#endif
+#endif /* _VLC_UPDATE_H */