Changeset 1f9d8d6cc17156bbf51e76f71cbb8367594d6c8a

Show
Ignore:
Timestamp:
16/12/07 15:34:29 (10 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1197815669 +0000
git-parent:

[f756ebd7197ef940aead1ac78865c6bb58d0e502]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1197815669 +0000
Message:

Migrate module, module_list and obsolete_* to vlc_config_set

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_configuration.h

    reb2e4ad r1f9d8d6  
    236236    /* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI! 
    237237     * Append new items at the end ONLY. */ 
    238     VLC_CONFIG_NAME,     /* command line name (args=const char *, vlc_callback_t) */ 
    239     VLC_CONFIG_DESC,     /* description (args=const char *, const char *) */ 
    240     VLC_CONFIG_VALUE,    /* actual value (args=<type>) */ 
    241     VLC_CONFIG_RANGE,    /* minimum value (args=<type>, <type>) */ 
    242     VLC_CONFIG_ADVANCED, /* enable advanced flag (args=none) */ 
    243     VLC_CONFIG_VOLATILE, /* don't write variable to storage (args=none) */ 
    244     VLC_CONFIG_PERSISTENT, /* always write variable to storage (args=none) */ 
    245     VLC_CONFIG_RESTART,  /* restart required to apply value change (args=none) */ 
    246     VLC_CONFIG_PRIVATE,  /* hide from user (args=none) */ 
     238 
     239    VLC_CONFIG_NAME, 
     240    /* command line name (args=const char *, vlc_callback_t) */ 
     241 
     242    VLC_CONFIG_DESC, 
     243    /* description (args=const char *, const char *) */ 
     244 
     245    VLC_CONFIG_VALUE, 
     246    /* actual value (args=int/double/const char *) */ 
     247 
     248    VLC_CONFIG_RANGE, 
     249    /* minimum value (args=int/double/const char * twice) */ 
     250 
     251    VLC_CONFIG_ADVANCED, 
     252    /* enable advanced flag (args=none) */ 
     253 
     254    VLC_CONFIG_VOLATILE, 
     255    /* don't write variable to storage (args=none) */ 
     256 
     257    VLC_CONFIG_PERSISTENT, 
     258    /* always write variable to storage (args=none) */ 
     259 
     260    VLC_CONFIG_RESTART, 
     261    /* restart required to apply value change (args=none) */ 
     262 
     263    VLC_CONFIG_PRIVATE, 
     264    /* hide from user (args=none) */ 
     265 
     266    VLC_CONFIG_REMOVED, 
     267    /* tag as no longer supported (args=none) */ 
     268 
     269    VLC_CONFIG_CAPABILITY, 
     270    /* capability for a module or list thereof (args=const char*) */ 
    247271} vlc_config_t; 
    248272 
     
    335359#define add_module( name, psz_caps, value, p_callback, text, longtext, advc ) \ 
    336360    add_string_inner( CONFIG_ITEM_MODULE, name, text, longtext, advc, p_callback, value ); \ 
    337     p_config[i_config].psz_type = psz_caps 
     361    vlc_config_set (p_config + i_config, VLC_CONFIG_CAPABILITY, \ 
     362                    (const char *)(psz_caps)) 
    338363 
    339364#define add_module_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \ 
     
    343368#define add_module_list( name, psz_caps, value, p_callback, text, longtext, advc ) \ 
    344369    add_string_inner( CONFIG_ITEM_MODULE_LIST, name, text, longtext, advc, p_callback, value ); \ 
    345     p_config[i_config].psz_type = psz_caps 
     370    vlc_config_set (p_config + i_config, VLC_CONFIG_CAPABILITY, \ 
     371                    (const char *)(psz_caps)) 
    346372 
    347373#define add_module_list_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \ 
     
    387413    vlc_config_set (p_config + i_config, VLC_CONFIG_NAME, \ 
    388414                    (const char *)(name), (vlc_callback_t)NULL); \ 
    389     p_config[ i_config ].psz_current = "SUPPRESSED" 
     415    vlc_config_set (p_config + i_config, VLC_CONFIG_REMOVED) 
    390416 
    391417#define add_obsolete_bool( name ) \ 
  • src/config/core.c

    r850b333 r1f9d8d6  
    541541        } 
    542542 
    543         p_module->p_config[i].psz_type = strdupnull (p_orig[i].psz_type)
     543        p_module->p_config[i].psz_type = p_orig[i].psz_type
    544544        p_module->p_config[i].psz_name = p_orig[i].psz_name; 
    545         p_module->p_config[i].psz_current = strdupnull (p_orig[i].psz_current)
     545        p_module->p_config[i].psz_current = p_orig[i].psz_current
    546546        p_module->p_config[i].psz_text = p_orig[i].psz_text; 
    547547        p_module->p_config[i].psz_longtext = p_orig[i].psz_longtext; 
     
    629629        free( (char*) p_item->psz_type ); 
    630630        free( (char*) p_item->psz_name ); 
    631         free( (char*) p_item->psz_current ); 
    632631        free( (char*) p_item->psz_text ); 
    633632        free( (char*) p_item->psz_longtext ); 
  • src/modules/entry.c

    reb2e4ad r1f9d8d6  
    260260            ret = 0; 
    261261            break; 
     262 
     263        case VLC_CONFIG_REMOVED: 
     264            item->psz_current = "SUPPRESSED"; 
     265            ret = 0; 
     266            break; 
     267 
     268        case VLC_CONFIG_CAPABILITY: 
     269        { 
     270            const char *cap = va_arg (ap, const char *); 
     271            item->psz_type = cap ? strdup (cap) : NULL; 
     272            ret = 0; 
     273            break; 
     274        } 
    262275    } 
    263276