]> git.sesse.net Git - vlc/commitdiff
Don't use enums. They are cool and all (the compiler even tells when one case is...
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 16 Dec 2007 15:12:51 +0000 (15:12 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 16 Dec 2007 15:12:51 +0000 (15:12 +0000)
include/vlc_configuration.h
include/vlc_modules.h
src/modules/entry.c

index dcb8a820e4ab8b3dbbd6fd1ac5139d83251932ea..53160a6fbc7dc0842deda9f50ab0d2b284a53c39 100644 (file)
@@ -231,7 +231,7 @@ VLC_EXPORT( vlc_bool_t, __config_ExistIntf,  ( vlc_object_t *, const char * ) );
 #define config_RemoveIntf(a,b) __config_RemoveIntf(VLC_OBJECT(a),b)
 #define config_ExistIntf(a,b) __config_ExistIntf(VLC_OBJECT(a),b)
 
-typedef enum vlc_config_properties
+enum vlc_config_properties
 {
     /* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI!
      * Append new items at the end ONLY. */
@@ -268,11 +268,11 @@ typedef enum vlc_config_properties
 
     VLC_CONFIG_CAPABILITY,
     /* capability for a module or list thereof (args=const char*) */
-} vlc_config_t;
+};
 
 
 VLC_EXPORT( module_config_t *, vlc_config_create, (module_t *, int type) );
-VLC_EXPORT( int, vlc_config_set, (module_config_t *, vlc_config_t, ...) );
+VLC_EXPORT( int, vlc_config_set, (module_config_t *, int, ...) );
 
 /*****************************************************************************
  * Macros used to build the configuration structure.
@@ -361,18 +361,20 @@ VLC_EXPORT( int, vlc_config_set, (module_config_t *, vlc_config_t, ...) );
     vlc_config_set (p_config + i_config, VLC_CONFIG_CAPABILITY, \
                     (const char *)(psz_caps))
 
-#define add_module_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \
-    add_string_inner( CONFIG_ITEM_MODULE_CAT, name, text, longtext, advc, p_callback, value ); \
-    p_config[i_config].min.i = i_subcategory /* gruik */
-
 #define add_module_list( name, psz_caps, value, p_callback, text, longtext, advc ) \
     add_string_inner( CONFIG_ITEM_MODULE_LIST, name, text, longtext, advc, p_callback, value ); \
     vlc_config_set (p_config + i_config, VLC_CONFIG_CAPABILITY, \
                     (const char *)(psz_caps))
 
+#ifndef __PLUGIN__
+#define add_module_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \
+    add_string_inner( CONFIG_ITEM_MODULE_CAT, name, text, longtext, advc, p_callback, value ); \
+    p_config[i_config].min.i = i_subcategory /* gruik */
+
 #define add_module_list_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \
     add_string_inner( CONFIG_ITEM_MODULE_LIST_CAT, name, text, longtext, advc, p_callback, value ); \
     p_config[i_config].min.i = i_subcategory /* gruik */
+#endif
 
 #define add_integer( name, value, p_callback, text, longtext, advc ) \
     add_int_inner( CONFIG_ITEM_INTEGER, name, text, longtext, advc, p_callback, value )
index fa8f7ec135490a70150104c8f251df9e1c50b1e3..f3de9ea81b6d9f68908d250c5e19f4c21f6604f1 100644 (file)
@@ -71,7 +71,7 @@ enum vlc_module_properties
     VLC_MODULE_CB_OPEN,
     VLC_MODULE_CB_CLOSE,
     VLC_MODULE_UNLOADABLE,
-    VLC_MODULE_NAME
+    VLC_MODULE_NAME,
 };
 
 VLC_EXPORT( vlc_bool_t, module_IsCapable, ( const module_t *m, const char *cap ) );
index ecfeff9db16dcf6851dcb7a6dbaeb372c3231e6a..3891646c607ccda9d0eb31106e71b38487e34e41 100644 (file)
@@ -132,7 +132,7 @@ int vlc_module_set (module_t *module, int propid, void *value)
 
         case VLC_MODULE_PROGRAM:
             msg_Warn (module, "deprecated module property %d", propid);
-            return 0;
+            break;
 
         default:
             msg_Err (module, "unknown module property %d", propid);
@@ -161,7 +161,7 @@ module_config_t *vlc_config_create (module_t *module, int type)
     return tab + confsize;
 }
 
-int vlc_config_set (module_config_t *restrict item, vlc_config_t id, ...)
+int vlc_config_set (module_config_t *restrict item, int id, ...)
 {
     int ret = -1;
     va_list ap;