]> git.sesse.net Git - vlc/blobdiff - src/config/chain.c
libvlccore: Make sure vlc_gc_* function correctly assert() on common errors, and...
[vlc] / src / config / chain.c
index 47061250181b319c6d81e98872be20ee966da31c..2606fc825530d84bde38531ae9f6e8d8ca42889b 100644 (file)
  * Preamble
  *****************************************************************************/
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include "libvlc.h"
 
+#include "vlc_interface.h"
+
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
@@ -125,7 +131,7 @@ char *config_ChainCreate( char **ppsz_name, config_chain_t **pp_cfg, const char
             if( *p == '=' || *p == '{' )
             {
                 const char *end;
-                vlc_bool_t b_keep_brackets = (*p == '{');
+                bool b_keep_brackets = (*p == '{');
 
                 if( *p == '=' ) p++;
 
@@ -246,8 +252,8 @@ void __config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
     for(; cfg; cfg = cfg->p_next )
     {
         vlc_value_t val;
-        vlc_bool_t b_yes = VLC_TRUE;
-        vlc_bool_t b_once = VLC_FALSE;
+        bool b_yes = true;
+        bool b_once = false;
         module_config_t *p_conf;
         int i_type;
         size_t i;
@@ -266,14 +272,14 @@ void __config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
                 ( !strncmp( cfg->psz_name, "no", 2 ) &&
                   !strcmp( ppsz_options[i], cfg->psz_name + 2 ) ) )
             {
-                b_yes = VLC_FALSE;
+                b_yes = false;
                 break;
             }
 
             if( *ppsz_options[i] == '*' &&
                 !strcmp( &ppsz_options[i][1], cfg->psz_name ) )
             {
-                b_once = VLC_TRUE;
+                b_once = true;
                 break;
             }
 
@@ -296,20 +302,24 @@ void __config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
 
         /* This is basically cut and paste from src/misc/configuration.c
          * with slight changes */
-        if( p_conf && p_conf->psz_current )
+        if( p_conf )
         {
-            if( p_conf->b_strict )
+            if( p_conf->b_removed )
             {
                 msg_Err( p_this, "Option %s is not supported anymore.",
-                         p_conf->psz_name );
+                         name );
                 /* TODO: this should return an error and end option parsing
                  * ... but doing this would change the VLC API and all the
                  * modules so i'll do it later */
                 continue;
             }
-            msg_Warn( p_this, "Option %s is obsolete. Use %s instead.",
-                      p_conf->psz_name, p_conf->psz_current );
-            psz_name = p_conf->psz_current;
+            if( p_conf->psz_oldname
+             && !strcmp( p_conf->psz_oldname, name ) )
+            {
+                 psz_name = p_conf->psz_name;
+                 msg_Warn( p_this, "Option %s is obsolete. Use %s instead.",
+                           name, psz_name );
+            }
         }
         /* </Check if the option is deprecated> */