Changeset 373d13227346958499653b8108354c68edb8b80e
- Timestamp:
- 11/20/07 20:55:37 (10 months ago)
- git-parent:
- Files:
-
- src/misc/update.c (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/misc/update.c
r0da9417 r373d132 39 39 40 40 #include <ctype.h> /* tolower() */ 41 #include <assert.h> 41 42 42 43 … … 86 87 *****************************************************************************/ 87 88 88 void FreeMirrorsList( update_t * ); 89 void FreeReleasesList( update_t * ); 90 void GetMirrorsList( update_t *, vlc_bool_t ); 91 void GetFilesList( update_t *, vlc_bool_t ); 92 93 int CompareReleases( struct update_release_t *, struct update_release_t * ); 94 int CompareReleaseToCurrent( struct update_release_t * ); 95 96 unsigned int update_iterator_Reset( update_iterator_t * ); 97 unsigned int update_iterator_NextFile( update_iterator_t * ); 98 unsigned int update_iterator_PrevFile( update_iterator_t * ); 99 unsigned int update_iterator_NextMirror( update_iterator_t * ); 100 unsigned int update_iterator_PrevMirror( update_iterator_t * ); 101 102 void update_iterator_GetData( update_iterator_t * ); 103 void update_iterator_ClearData( update_iterator_t * ); 89 static void FreeMirrorsList( update_t * ); 90 static void FreeReleasesList( update_t * ); 91 static void GetMirrorsList( update_t *, vlc_bool_t ); 92 static void GetFilesList( update_t *, vlc_bool_t ); 93 94 static int CompareReleases( const struct update_release_t *, 95 const struct update_release_t * ); 96 static int CompareReleaseToCurrent( const struct update_release_t * ); 97 98 static unsigned int update_iterator_Reset( update_iterator_t * ); 99 static unsigned int update_iterator_NextFile( update_iterator_t * ); 100 static unsigned int update_iterator_PrevFile( update_iterator_t * ); 101 static unsigned int update_iterator_NextMirror( update_iterator_t * ); 102 static unsigned int update_iterator_PrevMirror( update_iterator_t * ); 103 104 static void update_iterator_GetData( update_iterator_t * ); 105 static void update_iterator_ClearData( update_iterator_t * ); 104 106 105 107 /***************************************************************************** … … 152 154 void update_Delete( update_t *p_update ) 153 155 { 156 assert( p_update ); 157 154 158 vlc_mutex_destroy( &p_update->lock ); 155 159 FreeMirrorsList( p_update ); … … 165 169 * \return nothing 166 170 */ 167 void FreeMirrorsList( update_t *p_update )171 static void FreeMirrorsList( update_t *p_update ) 168 172 { 169 173 int i; … … 188 192 * \return nothing 189 193 */ 190 void FreeReleasesList( update_t *p_update )194 static void FreeReleasesList( update_t *p_update ) 191 195 { 192 196 int i; … … 222 226 * \return nothing 223 227 */ 224 void GetMirrorsList( update_t *p_update, vlc_bool_t b_force )228 static void GetMirrorsList( update_t *p_update, vlc_bool_t b_force ) 225 229 { 226 230 stream_t *p_stream = NULL; … … 393 397 * \return nothing 394 398 */ 395 void GetFilesList( update_t *p_update, vlc_bool_t b_force )399 static void GetFilesList( update_t *p_update, vlc_bool_t b_force ) 396 400 { 397 401 stream_t *p_stream = NULL; … … 685 689 void update_Check( update_t *p_update, vlc_bool_t b_force ) 686 690 { 687 if( p_update == NULL ) return; 691 assert( p_update ); 692 688 693 GetMirrorsList( p_update, b_force ); 689 694 GetFilesList( p_update, b_force ); … … 700 705 * \return like strcmp 701 706 */ 702 int CompareReleases( struct update_release_t *p1, struct update_release_t *p2 ) 707 static int CompareReleases( const struct update_release_t *p1, 708 const struct update_release_t *p2 ) 703 709 { 704 710 int d; … … 738 744 * \return >0 if newer, 0 if equal and <0 if older 739 745 */ 740 int CompareReleaseToCurrent(struct update_release_t *p )746 static int CompareReleaseToCurrent( const struct update_release_t *p ) 741 747 { 742 748 struct update_release_t c; … … 773 779 update_iterator_t *p_uit = NULL; 774 780 775 if( p_u == NULL ) 776 return NULL; 781 assert( p_u ); 777 782 778 783 p_uit = (update_iterator_t *)malloc( sizeof( update_iterator_t ) ); … … 815 820 void update_iterator_Delete( update_iterator_t *p_uit ) 816 821 { 817 if( !p_uit ) return; 822 assert( p_uit ); 823 818 824 update_iterator_ClearData( p_uit ); 819 825 free( p_uit ); … … 828 834 unsigned int update_iterator_Reset( update_iterator_t *p_uit ) 829 835 { 830 if( !p_uit ) return UPDATE_FAIL;836 assert( p_uit ); 831 837 832 838 p_uit->i_r = -1; … … 845 851 * \return UPDATE_FAIL if we can't find the next file, UPDATE_SUCCESS|UPDATE_FILE if we stay in the same release, UPDATE_SUCCESS|UPDATE_RELEASE|UPDATE_FILE if we change the release index 846 852 */ 847 unsigned int update_iterator_NextFile( update_iterator_t *p_uit )853 static unsigned int update_iterator_NextFile( update_iterator_t *p_uit ) 848 854 { 849 855 int r,f=-1,old_r; 850 856 851 if( !p_uit ) return UPDATE_FAIL; 852 857 assert( p_uit ); 853 858 old_r=p_uit->i_r; 854 859 … … 907 912 */ 908 913 //TODO: test 909 unsigned int update_iterator_PrevFile( update_iterator_t *p_uit )914 static unsigned int update_iterator_PrevFile( update_iterator_t *p_uit ) 910 915 { 911 916 int r,f=-1,old_r; … … 968 973 * \return UPDATE_FAIL if we can't find the next mirror, UPDATE_SUCCESS|UPDATE_MIRROR otherwise 969 974 */ 970 unsigned int update_iterator_NextMirror( update_iterator_t *p_uit )975 static unsigned int update_iterator_NextMirror( update_iterator_t *p_uit ) 971 976 { 972 977 if( !p_uit ) return UPDATE_FAIL; … … 985 990 * \return UPDATE_FAIL if we can't find a previous mirror, UPDATE_SUCCESS|UPDATE_MIRROR otherwise 986 991 */ 987 unsigned int update_iterator_PrevMirror( update_iterator_t *p_uit )992 static unsigned int update_iterator_PrevMirror( update_iterator_t *p_uit ) 988 993 { 989 994 if( !p_uit ) return UPDATE_FAIL; … … 1070 1075 * \return nothing 1071 1076 */ 1072 void update_iterator_GetData( update_iterator_t *p_uit )1077 static void update_iterator_GetData( update_iterator_t *p_uit ) 1073 1078 { 1074 1079 struct update_release_t *p_r = NULL; … … 1126 1131 * \return nothing 1127 1132 */ 1128 void update_iterator_ClearData( update_iterator_t *p_uit )1133 static void update_iterator_ClearData( update_iterator_t *p_uit ) 1129 1134 { 1130 1135 p_uit->file.i_type = UPDATE_FILE_TYPE_NONE;
