Changeset 5af4cc854bcc7ec083195b41e555dac5988feabb
- Timestamp:
- 27/05/08 21:31:06
(6 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1211916666 +0300
- git-parent:
[5e15258c9ef28558fe2abc941fc1527e02b04c21]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1211916666 +0300
- Message:
Do not require semi-colon after module macros
This leaves us more room to rework the macros later on
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rcf2f0f1 |
r5af4cc8 |
|
| 98 | 98 | goto error; \ |
|---|
| 99 | 99 | { \ |
|---|
| 100 | | module_t *p_submodule = p_module /* the ; gets added */ |
|---|
| | 100 | module_t *p_submodule = p_module; |
|---|
| 101 | 101 | |
|---|
| 102 | 102 | #define vlc_module_end( ) \ |
|---|
| … | … | |
| 107 | 107 | error: \ |
|---|
| 108 | 108 | return VLC_EGENERIC; \ |
|---|
| 109 | | } \ |
|---|
| 110 | | struct _u_n_u_s_e_d_ /* the ; gets added */ |
|---|
| 111 | | |
|---|
| | 109 | } |
|---|
| 112 | 110 | |
|---|
| 113 | 111 | #define add_submodule( ) \ |
|---|
| 114 | | p_submodule = vlc_submodule_create( p_module ) |
|---|
| | 112 | p_submodule = vlc_submodule_create( p_module ); |
|---|
| 115 | 113 | |
|---|
| 116 | 114 | #define add_requirement( cap ) \ |
|---|
| 117 | 115 | if (vlc_module_set (p_module, VLC_MODULE_CPU_REQUIREMENT, \ |
|---|
| 118 | 116 | (int)(CPU_CAPABILITY_##cap))) \ |
|---|
| 119 | | goto error |
|---|
| | 117 | goto error; |
|---|
| 120 | 118 | |
|---|
| 121 | 119 | #define add_shortcut( shortcut ) \ |
|---|
| 122 | 120 | if (vlc_module_set (p_submodule, VLC_MODULE_SHORTCUT, \ |
|---|
| 123 | 121 | (const char *)(shortcut))) \ |
|---|
| 124 | | goto error |
|---|
| | 122 | goto error; |
|---|
| 125 | 123 | |
|---|
| 126 | 124 | #define set_shortname( shortname ) \ |
|---|
| 127 | 125 | if (vlc_module_set (p_submodule, VLC_MODULE_SHORTNAME, \ |
|---|
| 128 | 126 | (const char *)(shortname))) \ |
|---|
| 129 | | goto error |
|---|
| | 127 | goto error; |
|---|
| 130 | 128 | |
|---|
| 131 | 129 | #define set_description( desc ) \ |
|---|
| 132 | 130 | if (vlc_module_set (p_submodule, VLC_MODULE_DESCRIPTION, \ |
|---|
| 133 | 131 | (const char *)(desc))) \ |
|---|
| 134 | | goto error |
|---|
| | 132 | goto error; |
|---|
| 135 | 133 | |
|---|
| 136 | 134 | #define set_help( help ) \ |
|---|
| 137 | 135 | if (vlc_module_set (p_submodule, VLC_MODULE_HELP, (const char *)(help))) \ |
|---|
| 138 | | goto error |
|---|
| | 136 | goto error; |
|---|
| 139 | 137 | |
|---|
| 140 | 138 | #define set_capability( cap, score ) \ |
|---|
| … | … | |
| 142 | 140 | (const char *)(cap)) \ |
|---|
| 143 | 141 | || vlc_module_set (p_submodule, VLC_MODULE_SCORE, (int)(score))) \ |
|---|
| 144 | | goto error |
|---|
| | 142 | goto error; |
|---|
| 145 | 143 | |
|---|
| 146 | 144 | #define set_callbacks( activate, deactivate ) \ |
|---|
| 147 | 145 | if (vlc_module_set (p_submodule, VLC_MODULE_CB_OPEN, activate) \ |
|---|
| 148 | 146 | || vlc_module_set (p_submodule, VLC_MODULE_CB_CLOSE, deactivate)) \ |
|---|
| 149 | | goto error |
|---|
| | 147 | goto error; |
|---|
| 150 | 148 | |
|---|
| 151 | 149 | #define linked_with_a_crap_library_which_uses_atexit( ) \ |
|---|
| 152 | 150 | if (vlc_module_set (p_submodule, VLC_MODULE_NO_UNLOAD)) \ |
|---|
| 153 | | goto error |
|---|
| | 151 | goto error; |
|---|
| 154 | 152 | |
|---|
| 155 | 153 | VLC_EXPORT( module_t *, vlc_module_create, ( vlc_object_t * ) ); |
|---|
| … | … | |
| 246 | 244 | |
|---|
| 247 | 245 | #define add_type_inner( type ) \ |
|---|
| 248 | | p_config = vlc_config_create (p_module, type) |
|---|
| | 246 | p_config = vlc_config_create (p_module, type); |
|---|
| 249 | 247 | |
|---|
| 250 | 248 | #define add_typedesc_inner( type, text, longtext ) \ |
|---|
| 251 | | add_type_inner( type ); \ |
|---|
| | 249 | add_type_inner( type ) \ |
|---|
| 252 | 250 | vlc_config_set (p_config, VLC_CONFIG_DESC, \ |
|---|
| 253 | | (const char *)(text), (const char *)(longtext)) |
|---|
| | 251 | (const char *)(text), (const char *)(longtext)); |
|---|
| 254 | 252 | |
|---|
| 255 | 253 | #define add_typeadv_inner( type, text, longtext, advc ) \ |
|---|
| 256 | | add_typedesc_inner( type, text, longtext ); \ |
|---|
| 257 | | if (advc) vlc_config_set (p_config, VLC_CONFIG_ADVANCED) |
|---|
| | 254 | add_typedesc_inner( type, text, longtext ) \ |
|---|
| | 255 | if (advc) vlc_config_set (p_config, VLC_CONFIG_ADVANCED); |
|---|
| 258 | 256 | |
|---|
| 259 | 257 | #define add_typename_inner( type, name, text, longtext, advc, cb ) \ |
|---|
| 260 | | add_typeadv_inner( type, text, longtext, advc ); \ |
|---|
| | 258 | add_typeadv_inner( type, text, longtext, advc ) \ |
|---|
| 261 | 259 | vlc_config_set (p_config, VLC_CONFIG_NAME, \ |
|---|
| 262 | | (const char *)(name), (vlc_callback_t)(cb)) |
|---|
| | 260 | (const char *)(name), (vlc_callback_t)(cb)); |
|---|
| 263 | 261 | |
|---|
| 264 | 262 | #define add_string_inner( type, name, text, longtext, advc, cb, v ) \ |
|---|
| 265 | | add_typename_inner( type, name, text, longtext, advc, cb ); \ |
|---|
| 266 | | vlc_config_set (p_config, VLC_CONFIG_VALUE, (const char *)(v)) |
|---|
| | 263 | add_typename_inner( type, name, text, longtext, advc, cb ) \ |
|---|
| | 264 | vlc_config_set (p_config, VLC_CONFIG_VALUE, (const char *)(v)); |
|---|
| 267 | 265 | |
|---|
| 268 | 266 | #define add_int_inner( type, name, text, longtext, advc, cb, v ) \ |
|---|
| 269 | | add_typename_inner( type, name, text, longtext, advc, cb ); \ |
|---|
| 270 | | vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)(v)) |
|---|
| | 267 | add_typename_inner( type, name, text, longtext, advc, cb ) \ |
|---|
| | 268 | vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)(v)); |
|---|
| 271 | 269 | |
|---|
| 272 | 270 | |
|---|
| 273 | 271 | #define set_category( i_id ) \ |
|---|
| 274 | | add_type_inner( CONFIG_CATEGORY ); \ |
|---|
| 275 | | vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)(i_id)) |
|---|
| | 272 | add_type_inner( CONFIG_CATEGORY ) \ |
|---|
| | 273 | vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)(i_id)); |
|---|
| 276 | 274 | |
|---|
| 277 | 275 | #define set_subcategory( i_id ) \ |
|---|
| 278 | | add_type_inner( CONFIG_SUBCATEGORY ); \ |
|---|
| 279 | | vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)(i_id)) |
|---|
| | 276 | add_type_inner( CONFIG_SUBCATEGORY ) \ |
|---|
| | 277 | vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)(i_id)); |
|---|
| 280 | 278 | |
|---|
| 281 | 279 | #define set_section( text, longtext ) \ |
|---|
| … | … | |
| 295 | 293 | |
|---|
| 296 | 294 | #define add_string( name, value, p_callback, text, longtext, advc ) \ |
|---|
| 297 | | add_string_inner( CONFIG_ITEM_STRING, name, text, longtext, advc, p_callback, value ) |
|---|
| | 295 | add_string_inner( CONFIG_ITEM_STRING, name, text, longtext, advc, \ |
|---|
| | 296 | p_callback, value ) |
|---|
| 298 | 297 | |
|---|
| 299 | 298 | #define add_password( name, value, p_callback, text, longtext, advc ) \ |
|---|
| 300 | | add_string_inner( CONFIG_ITEM_PASSWORD, name, text, longtext, advc, p_callback, value ) |
|---|
| | 299 | add_string_inner( CONFIG_ITEM_PASSWORD, name, text, longtext, advc, \ |
|---|
| | 300 | p_callback, value ) |
|---|
| 301 | 301 | |
|---|
| 302 | 302 | #define add_file( name, value, p_callback, text, longtext, advc ) \ |
|---|
| 303 | | add_string_inner( CONFIG_ITEM_FILE, name, text, longtext, advc, p_callback, value ) |
|---|
| | 303 | add_string_inner( CONFIG_ITEM_FILE, name, text, longtext, advc, \ |
|---|
| | 304 | p_callback, value ) |
|---|
| 304 | 305 | |
|---|
| 305 | 306 | #define add_directory( name, value, p_callback, text, longtext, advc ) \ |
|---|
| 306 | | add_string_inner( CONFIG_ITEM_DIRECTORY, name, text, longtext, advc, p_callback, value ) |
|---|
| | 307 | add_string_inner( CONFIG_ITEM_DIRECTORY, name, text, longtext, advc, \ |
|---|
| | 308 | p_callback, value ) |
|---|
| 307 | 309 | |
|---|
| 308 | 310 | #define add_module( name, psz_caps, value, p_callback, text, longtext, advc ) \ |
|---|
| 309 | | add_string_inner( CONFIG_ITEM_MODULE, name, text, longtext, advc, p_callback, value ); \ |
|---|
| 310 | | vlc_config_set (p_config, VLC_CONFIG_CAPABILITY, (const char *)(psz_caps)) |
|---|
| | 311 | add_string_inner( CONFIG_ITEM_MODULE, name, text, longtext, advc, \ |
|---|
| | 312 | p_callback, value ) \ |
|---|
| | 313 | vlc_config_set (p_config, VLC_CONFIG_CAPABILITY, (const char *)(psz_caps)); |
|---|
| 311 | 314 | |
|---|
| 312 | 315 | #define add_module_list( name, psz_caps, value, p_callback, text, longtext, advc ) \ |
|---|
| 313 | | add_string_inner( CONFIG_ITEM_MODULE_LIST, name, text, longtext, advc, p_callback, value ); \ |
|---|
| 314 | | vlc_config_set (p_config, VLC_CONFIG_CAPABILITY, (const char *)(psz_caps)) |
|---|
| | 316 | add_string_inner( CONFIG_ITEM_MODULE_LIST, name, text, longtext, advc, \ |
|---|
| | 317 | p_callback, value ) \ |
|---|
| | 318 | vlc_config_set (p_config, VLC_CONFIG_CAPABILITY, (const char *)(psz_caps)); |
|---|
| 315 | 319 | |
|---|
| 316 | 320 | #ifndef __PLUGIN__ |
|---|
| 317 | 321 | #define add_module_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \ |
|---|
| 318 | | add_string_inner( CONFIG_ITEM_MODULE_CAT, name, text, longtext, advc, p_callback, value ); \ |
|---|
| 319 | | p_config->min.i = i_subcategory /* gruik */ |
|---|
| | 322 | add_string_inner( CONFIG_ITEM_MODULE_CAT, name, text, longtext, advc, \ |
|---|
| | 323 | p_callback, value ) \ |
|---|
| | 324 | p_config->min.i = i_subcategory /* gruik */; |
|---|
| 320 | 325 | |
|---|
| 321 | 326 | #define add_module_list_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \ |
|---|
| 322 | | add_string_inner( CONFIG_ITEM_MODULE_LIST_CAT, name, text, longtext, advc, p_callback, value ); \ |
|---|
| 323 | | p_config->min.i = i_subcategory /* gruik */ |
|---|
| | 327 | add_string_inner( CONFIG_ITEM_MODULE_LIST_CAT, name, text, longtext, \ |
|---|
| | 328 | advc, p_callback, value ) \ |
|---|
| | 329 | p_config->min.i = i_subcategory /* gruik */; |
|---|
| 324 | 330 | #endif |
|---|
| 325 | 331 | |
|---|
| 326 | 332 | #define add_integer( name, value, p_callback, text, longtext, advc ) \ |
|---|
| 327 | | add_int_inner( CONFIG_ITEM_INTEGER, name, text, longtext, advc, p_callback, value ) |
|---|
| | 333 | add_int_inner( CONFIG_ITEM_INTEGER, name, text, longtext, advc, \ |
|---|
| | 334 | p_callback, value ) |
|---|
| 328 | 335 | |
|---|
| 329 | 336 | #define add_key( name, value, p_callback, text, longtext, advc ) \ |
|---|
| 330 | | add_int_inner( CONFIG_ITEM_KEY, name, text, longtext, advc, p_callback, value ) |
|---|
| | 337 | add_int_inner( CONFIG_ITEM_KEY, name, text, longtext, advc, p_callback, \ |
|---|
| | 338 | value ) |
|---|
| 331 | 339 | |
|---|
| 332 | 340 | #define add_integer_with_range( name, value, i_min, i_max, p_callback, text, longtext, advc ) \ |
|---|
| 333 | | add_integer( name, value, p_callback, text, longtext, advc ); \ |
|---|
| | 341 | add_integer( name, value, p_callback, text, longtext, advc ) \ |
|---|
| 334 | 342 | change_integer_range( i_min, i_max ) |
|---|
| 335 | 343 | |
|---|
| 336 | 344 | #define add_float( name, v, p_callback, text, longtext, advc ) \ |
|---|
| 337 | | add_typename_inner( CONFIG_ITEM_FLOAT, name, text, longtext, advc, p_callback ); \ |
|---|
| 338 | | vlc_config_set (p_config, VLC_CONFIG_VALUE, (double)(v)) |
|---|
| | 345 | add_typename_inner( CONFIG_ITEM_FLOAT, name, text, longtext, advc, p_callback ) \ |
|---|
| | 346 | vlc_config_set (p_config, VLC_CONFIG_VALUE, (double)(v)); |
|---|
| 339 | 347 | |
|---|
| 340 | 348 | #define add_float_with_range( name, value, f_min, f_max, p_callback, text, longtext, advc ) \ |
|---|
| 341 | | add_float( name, value, p_callback, text, longtext, advc ); \ |
|---|
| | 349 | add_float( name, value, p_callback, text, longtext, advc ) \ |
|---|
| 342 | 350 | change_float_range( f_min, f_max ) |
|---|
| 343 | 351 | |
|---|
| 344 | 352 | #define add_bool( name, v, p_callback, text, longtext, advc ) \ |
|---|
| 345 | | add_typename_inner( CONFIG_ITEM_BOOL, name, text, longtext, advc, p_callback ); \ |
|---|
| 346 | | if (v) vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)true) |
|---|
| | 353 | add_typename_inner( CONFIG_ITEM_BOOL, name, text, longtext, advc, \ |
|---|
| | 354 | p_callback ) \ |
|---|
| | 355 | if (v) vlc_config_set (p_config, VLC_CONFIG_VALUE, (int)true); |
|---|
| 347 | 356 | |
|---|
| 348 | 357 | /* For removed option */ |
|---|
| 349 | 358 | #define add_obsolete_inner( name, type ) \ |
|---|
| 350 | | add_type_inner( type ); \ |
|---|
| | 359 | add_type_inner( type ) \ |
|---|
| 351 | 360 | vlc_config_set (p_config, VLC_CONFIG_NAME, \ |
|---|
| 352 | 361 | (const char *)(name), (vlc_callback_t)NULL); \ |
|---|
| 353 | | vlc_config_set (p_config, VLC_CONFIG_REMOVED) |
|---|
| | 362 | vlc_config_set (p_config, VLC_CONFIG_REMOVED); |
|---|
| 354 | 363 | |
|---|
| 355 | 364 | #define add_obsolete_bool( name ) \ |
|---|
| … | … | |
| 371 | 380 | |
|---|
| 372 | 381 | #define change_short( ch ) \ |
|---|
| 373 | | vlc_config_set (p_config, VLC_CONFIG_SHORTCUT, (int)(ch)) |
|---|
| | 382 | vlc_config_set (p_config, VLC_CONFIG_SHORTCUT, (int)(ch)); |
|---|
| 374 | 383 | |
|---|
| 375 | 384 | #define change_string_list( list, list_text, list_update_func ) \ |
|---|
| … | … | |
| 378 | 387 | (const char *const *)(list), \ |
|---|
| 379 | 388 | (const char *const *)(list_text), \ |
|---|
| 380 | | list_update_func) |
|---|
| | 389 | list_update_func); |
|---|
| 381 | 390 | |
|---|
| 382 | 391 | #define change_integer_list( list, list_text, list_update_func ) \ |
|---|
| … | … | |
| 385 | 394 | (const int *)(list), \ |
|---|
| 386 | 395 | (const char *const *)(list_text), \ |
|---|
| 387 | | list_update_func) |
|---|
| | 396 | list_update_func); |
|---|
| 388 | 397 | |
|---|
| 389 | 398 | #define change_float_list( list, list_text, list_update_func ) \ |
|---|
| … | … | |
| 392 | 401 | (const float *)(list), \ |
|---|
| 393 | 402 | (const char *const *)(list_text), \ |
|---|
| 394 | | list_update_func) |
|---|
| | 403 | list_update_func); |
|---|
| 395 | 404 | |
|---|
| 396 | 405 | #define change_integer_range( minv, maxv ) \ |
|---|
| 397 | | vlc_config_set (p_config, VLC_CONFIG_RANGE, (int)(minv), (int)(maxv)) |
|---|
| | 406 | vlc_config_set (p_config, VLC_CONFIG_RANGE, (int)(minv), (int)(maxv)); |
|---|
| 398 | 407 | |
|---|
| 399 | 408 | #define change_float_range( minv, maxv ) \ |
|---|
| 400 | 409 | vlc_config_set (p_config, VLC_CONFIG_RANGE, \ |
|---|
| 401 | | (double)(minv), (double)(maxv)) |
|---|
| | 410 | (double)(minv), (double)(maxv)); |
|---|
| 402 | 411 | |
|---|
| 403 | 412 | #define change_action_add( pf_action, text ) \ |
|---|
| 404 | 413 | vlc_config_set (p_config, VLC_CONFIG_ADD_ACTION, \ |
|---|
| 405 | | (vlc_callback_t)(pf_action), (const char *)(text)) |
|---|
| | 414 | (vlc_callback_t)(pf_action), (const char *)(text)); |
|---|
| 406 | 415 | |
|---|
| 407 | 416 | #define change_internal() \ |
|---|
| 408 | | vlc_config_set (p_config, VLC_CONFIG_PRIVATE) |
|---|
| | 417 | vlc_config_set (p_config, VLC_CONFIG_PRIVATE); |
|---|
| 409 | 418 | |
|---|
| 410 | 419 | #define change_need_restart() \ |
|---|
| 411 | | vlc_config_set (p_config, VLC_CONFIG_RESTART) |
|---|
| | 420 | vlc_config_set (p_config, VLC_CONFIG_RESTART); |
|---|
| 412 | 421 | |
|---|
| 413 | 422 | #define change_autosave() \ |
|---|
| 414 | | vlc_config_set (p_config, VLC_CONFIG_PERSISTENT) |
|---|
| | 423 | vlc_config_set (p_config, VLC_CONFIG_PERSISTENT); |
|---|
| 415 | 424 | |
|---|
| 416 | 425 | #define change_unsaveable() \ |
|---|
| 417 | | vlc_config_set (p_config, VLC_CONFIG_VOLATILE) |
|---|
| 418 | | |
|---|
| 419 | | #define change_unsafe() (void)0 /* no-op */ |
|---|
| | 426 | vlc_config_set (p_config, VLC_CONFIG_VOLATILE); |
|---|
| | 427 | |
|---|
| | 428 | #define change_unsafe() (void)0; /* no-op */ |
|---|
| 420 | 429 | |
|---|
| 421 | 430 | #define change_safe() \ |
|---|
| 422 | | vlc_config_set (p_config, VLC_CONFIG_SAFE) |
|---|
| 423 | | |
|---|
| 424 | | #endif |
|---|
| | 431 | vlc_config_set (p_config, VLC_CONFIG_SAFE); |
|---|
| | 432 | |
|---|
| | 433 | #endif |
|---|