#endif
#endif
+
+/* Sub-version number
+ * (only used to avoid breakage in dev version when cache structure changes) */
+#define CACHE_SUBVERSION_NUM 1
+
/*****************************************************************************
* module_InitBank: create the module bank.
*****************************************************************************
return;
}
+ /* Check Sub-version number */
+ i_read = fread( &i_marker, sizeof(char), sizeof(i_marker), file );
+ if( i_read != sizeof(i_marker) || i_marker != CACHE_SUBVERSION_NUM )
+ {
+ msg_Warn( p_this, "This doesn't look like a valid plugins cache "
+ "(corrupted header)" );
+ fclose( file );
+ return;
+ }
+
/* Check the language hasn't changed */
sprintf( p_lang, "%5.5s", _("C") ); i_size = 5;
i_read = fread( p_cachelang, sizeof(char), i_size, file );
/* Contains version number */
fprintf( file, "%s", PLUGINSCACHE_DIR COPYRIGHT_MESSAGE );
+ /* Sub-version number (to avoid breakage in the dev version when cache
+ * structure changes) */
+ i_file_size = CACHE_SUBVERSION_NUM;
+ fwrite( &i_file_size, sizeof(char), sizeof(i_file_size), file );
+
/* Language */
fprintf( file, "%5.5s", _("C") );