]> git.sesse.net Git - vlc/blob - include/vlc_update.h
Modify the update system : I will add more functionnality but this is the beginning
[vlc] / include / vlc_update.h
1 /*****************************************************************************
2  * vlc_update.h: VLC update and plugins download
3  *****************************************************************************
4  * Copyright (C) 2005 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
8  *
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 release 2 of the License, or
12  * (at your option) any later release.
13  *
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.
18  *
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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 #if !defined( __LIBVLC__ )
25   #error You are not libvlc or one of its plugins. You cannot include this file
26 #endif
27
28 #ifndef _VLC_UPDATE_H
29 #define _VLC_UPDATE_H
30
31 #include <vlc/vlc.h>
32
33 /**
34  * \defgroup update Update
35  *
36  * @{
37  */
38
39 enum
40 {
41     UpdateReleaseStatusOlder,
42     UpdateReleaseStatusEqual,
43     UpdateReleaseStatusNewer
44 };
45
46 /**
47  * Describes an update VLC release number
48  */
49 struct update_release_t
50 {
51     int i_major;        ///< Version major
52     int i_minor;        ///< Version minor
53     int i_revision;     ///< Version revision
54     char* psz_svnrev;   ///< SVN revision
55     char* psz_extra;    ///< Version extra
56     char* psz_url;      ///< Download URL
57     char* psz_desc;     ///< Release description
58 };
59
60 /**
61  * The update object. Stores (and caches) all information relative to updates
62  */
63 struct update_t
64 {
65     libvlc_int_t *p_libvlc;
66     vlc_mutex_t lock;
67     struct update_release_t release;    ///< Release (version)
68 };
69
70
71 #define update_New( a ) __update_New( VLC_OBJECT( a ) )
72
73 VLC_EXPORT( update_t *, __update_New, ( vlc_object_t * ) );
74 VLC_EXPORT( void, update_Delete, ( update_t * ) );
75 VLC_EXPORT( void, update_Check, ( update_t * ) );
76 VLC_EXPORT( int, update_CompareReleaseToCurrent, ( update_t * ) );
77
78 /**
79  * @}
80  */
81
82 #endif