diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-07-31 11:59:10 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-07-31 11:59:10 +0000 |
commit | 596c9dff3806272f1f28b7a4105ca90a027df7d4 (patch) | |
tree | a6af17de4c6e3dae3828dbf27a0ee4f70aece520 /src/xine-engine/configfile.c | |
parent | 3e2741738a152d6504d05b8d1cb74d2d92f7e948 (diff) | |
download | xine-lib-596c9dff3806272f1f28b7a4105ca90a027df7d4.tar.gz xine-lib-596c9dff3806272f1f28b7a4105ca90a027df7d4.tar.bz2 |
introduce config file versioning
A new entry in the config file ".version:" stores the current version of the
config file. The '.' at the beginning of ".version" shows that this is a
somewhat hidden (read: internal) entry and it makes the line easy to spot and
prevents clashes with regular config entries.
The first use of this is to reset all decoder priorities to 0 (= use default)
so that we hopefully won't have problems like the qtv decoder clash any more.
CVS patchset: 5226
CVS date: 2003/07/31 11:59:10
Diffstat (limited to 'src/xine-engine/configfile.c')
-rw-r--r-- | src/xine-engine/configfile.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 0efc4d70c..28cc51257 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: configfile.c,v 1.49 2003/07/12 12:31:14 mroi Exp $ + * $Id: configfile.c,v 1.50 2003/07/31 11:59:10 mroi Exp $ * * config object (was: file) management - implementation * @@ -670,6 +670,16 @@ void xine_config_load (xine_t *xine, const char *filename) { if (line[0] == '#') continue; + + if (line[0] == '.') { + if (strncmp(line, ".version:", 9) == 0) { + sscanf(line + 9, "%d", &this->current_version); + if (this->current_version > CONFIG_FILE_VERSION) + xine_log(xine, XINE_LOG_MSG, + _("The current config file has been modified by a newer version of xine.")); + } + continue; + } if ((value = strchr (line, ':'))) { @@ -771,7 +781,8 @@ void xine_config_save (xine_t *xine, const char *filename) { cfg_entry_t *entry; - fprintf (f_config, "#\n# xine config file\n#\n\n"); + fprintf (f_config, "#\n# xine config file\n#\n"); + fprintf (f_config, ".version:%d\n\n", CONFIG_FILE_VERSION); pthread_mutex_lock(&this->config_lock); entry = this->first; @@ -926,6 +937,7 @@ config_values_t *xine_config_init () { this->first = NULL; this->last = NULL; + this->current_version = 0; pthread_mutex_init(&this->config_lock, NULL); |