Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

configuration.h

00001 /*****************************************************************************
00002  * configuration.h : configuration management module
00003  * This file describes the programming interface for the configuration module.
00004  * It includes functions allowing to declare, get or set configuration options.
00005  *****************************************************************************
00006  * Copyright (C) 1999, 2000 the VideoLAN team
00007  * $Id: configuration.h 12871 2005-10-17 20:15:10Z hartman $
00008  *
00009  * Authors: Gildas Bazin <[email protected]>
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00024  *****************************************************************************/
00025 
00026 /*****************************************************************************
00027  * Macros used to build the configuration structure.
00028  *****************************************************************************/
00029 
00030 /* Configuration hint types */
00031 
00032 
00033 #define CONFIG_HINT_END                     0x0001  /* End of config */
00034 #define CONFIG_HINT_CATEGORY                0x0002  /* Start of new category */
00035 #define CONFIG_HINT_SUBCATEGORY             0x0003  /* Start of sub-category */
00036 #define CONFIG_HINT_SUBCATEGORY_END         0x0004  /* End of sub-category */
00037 #define CONFIG_HINT_USAGE                   0x0005  /* Usage information */
00038 
00039 #define CONFIG_CATEGORY                     0x0006 /* Set category */
00040 #define CONFIG_SUBCATEGORY                  0x0007 /* Set subcategory */
00041 #define CONFIG_SECTION                      0x0008 /* Start of new section */
00042 
00043 #define CONFIG_HINT                         0x000F
00044 
00045 /* Configuration item types */
00046 #define CONFIG_ITEM_STRING                  0x0010  /* String option */
00047 #define CONFIG_ITEM_FILE                    0x0020  /* File option */
00048 #define CONFIG_ITEM_MODULE                  0x0030  /* Module option */
00049 #define CONFIG_ITEM_INTEGER                 0x0040  /* Integer option */
00050 #define CONFIG_ITEM_BOOL                    0x0050  /* Bool option */
00051 #define CONFIG_ITEM_FLOAT                   0x0060  /* Float option */
00052 #define CONFIG_ITEM_DIRECTORY               0x0070  /* Directory option */
00053 #define CONFIG_ITEM_KEY                     0x0080  /* Hot key option */
00054 #define CONFIG_ITEM_MODULE_CAT              0x0090  /* Module option */
00055 #define CONFIG_ITEM_MODULE_LIST             0x00A0  /* Module option */
00056 #define CONFIG_ITEM_MODULE_LIST_CAT         0x00B0  /* Module option */
00057 
00058 #define CONFIG_ITEM                         0x00F0
00059 
00060 /*******************************************************************
00061  * All predefined categories and subcategories
00062  *******************************************************************/
00063 #define CAT_INTERFACE 1
00064    #define SUBCAT_INTERFACE_GENERAL 101
00065    #define SUBCAT_INTERFACE_CONTROL 102
00066    #define SUBCAT_INTERFACE_HOTKEYS 103
00067 
00068 #define CAT_AUDIO 2
00069    #define SUBCAT_AUDIO_GENERAL 201
00070    #define SUBCAT_AUDIO_AOUT 202
00071    #define SUBCAT_AUDIO_AFILTER 203
00072    #define SUBCAT_AUDIO_VISUAL 204
00073    #define SUBCAT_AUDIO_MISC 205
00074 
00075 #define CAT_VIDEO 3
00076    #define SUBCAT_VIDEO_GENERAL 301
00077    #define SUBCAT_VIDEO_VOUT 302
00078    #define SUBCAT_VIDEO_VFILTER 303
00079    #define SUBCAT_VIDEO_TEXT 304
00080    #define SUBCAT_VIDEO_SUBPIC 305
00081 
00082 #define CAT_INPUT 4
00083    #define SUBCAT_INPUT_GENERAL 401
00084    #define SUBCAT_INPUT_ACCESS 402
00085    #define SUBCAT_INPUT_ACCESS_FILTER 403
00086    #define SUBCAT_INPUT_DEMUX 404
00087    #define SUBCAT_INPUT_VCODEC 405
00088    #define SUBCAT_INPUT_ACODEC 406
00089    #define SUBCAT_INPUT_SCODEC 407
00090 
00091 #define CAT_SOUT 5
00092    #define SUBCAT_SOUT_GENERAL 501
00093    #define SUBCAT_SOUT_STREAM 502
00094    #define SUBCAT_SOUT_MUX 503
00095    #define SUBCAT_SOUT_ACO 504
00096    #define SUBCAT_SOUT_PACKETIZER 505
00097    #define SUBCAT_SOUT_SAP 506
00098    #define SUBCAT_SOUT_VOD 507
00099 
00100 #define CAT_ADVANCED 6
00101    #define SUBCAT_ADVANCED_CPU 601
00102    #define SUBCAT_ADVANCED_MISC 602
00103    #define SUBCAT_ADVANCED_NETWORK 603
00104    #define SUBCAT_ADVANCED_XML 604
00105 
00106 #define CAT_PLAYLIST 7
00107    #define SUBCAT_PLAYLIST_GENERAL 701
00108    #define SUBCAT_PLAYLIST_SD 702
00109    #define SUBCAT_PLAYLIST_EXPORT 703
00110 
00111 struct config_category_t
00112 {
00113     int         i_id;
00114     char       *psz_name;
00115     char       *psz_help;
00116 };
00117 
00118 struct module_config_t
00119 {
00120     int          i_type;                               /* Configuration type */
00121     char        *psz_type;                          /* Configuration subtype */
00122     char        *psz_name;                                    /* Option name */
00123     char         i_short;                      /* Optional short option name */
00124     char        *psz_text;      /* Short comment on the configuration option */
00125     char        *psz_longtext;   /* Long comment on the configuration option */
00126     char        *psz_value;                                  /* Option value */
00127     int          i_value;                                    /* Option value */
00128     float        f_value;                                    /* Option value */
00129     int         i_min;                               /* Option minimum value */
00130     int         i_max;                               /* Option maximum value */
00131     float       f_min;                               /* Option minimum value */
00132     float       f_max;                               /* Option maximum value */
00133 
00134     /* Function to call when commiting a change */
00135     vlc_callback_t pf_callback;
00136     void          *p_callback_data;
00137 
00138     /* Values list */
00139     char       **ppsz_list;        /* List of possible values for the option */
00140     int         *pi_list;          /* Idem for integers */
00141     char       **ppsz_list_text;   /* Friendly names for list values */
00142     int          i_list;           /* Options list size */
00143 
00144     /* Actions list */
00145     vlc_callback_t *ppf_action;    /* List of possible actions for a config */
00146     char           **ppsz_action_text;         /* Friendly names for actions */
00147     int            i_action;                            /* actions list size */
00148 
00149     /* Deprecated */
00150     char           *psz_current;   /* Good option name */
00151     vlc_bool_t     b_strict;      /* Transitionnal or strict */
00152     /* Misc */
00153     vlc_mutex_t *p_lock;            /* Lock to use when modifying the config */
00154     vlc_bool_t   b_dirty;          /* Dirty flag to indicate a config change */
00155     vlc_bool_t   b_advanced;          /* Flag to indicate an advanced option */
00156 
00157     /* Original option values */
00158     char        *psz_value_orig;
00159     int          i_value_orig;
00160     float        f_value_orig;
00161 
00162     /* Option values loaded from config file */
00163     char        *psz_value_saved;
00164     int          i_value_saved;
00165     float        f_value_saved;
00166     vlc_bool_t   b_autosave;       /* Config will be auto-saved at exit time */
00167 };
00168 
00169 /*****************************************************************************
00170  * Prototypes - these methods are used to get, set or manipulate configuration
00171  * data.
00172  *****************************************************************************/
00173 VLC_EXPORT( int,    __config_GetType,  (vlc_object_t *, const char *) );
00174 VLC_EXPORT( int,    __config_GetInt,   (vlc_object_t *, const char *) );
00175 VLC_EXPORT( void,   __config_PutInt,   (vlc_object_t *, const char *, int) );
00176 VLC_EXPORT( float,  __config_GetFloat, (vlc_object_t *, const char *) );
00177 VLC_EXPORT( void,   __config_PutFloat, (vlc_object_t *, const char *, float) );
00178 VLC_EXPORT( char *, __config_GetPsz,   (vlc_object_t *, const char *) );
00179 VLC_EXPORT( void,   __config_PutPsz,   (vlc_object_t *, const char *, const char *) );
00180 
00181 VLC_EXPORT( int,    __config_LoadCmdLine,  ( vlc_object_t *, int *, char *[], vlc_bool_t ) );
00182 VLC_EXPORT( char *,   config_GetHomeDir,     ( void ) );
00183 VLC_EXPORT( char *,   config_GetUserDir,     ( void ) );
00184 VLC_EXPORT( int,    __config_LoadConfigFile, ( vlc_object_t *, const char * ) );
00185 VLC_EXPORT( int,    __config_SaveConfigFile, ( vlc_object_t *, const char * ) );
00186 VLC_EXPORT( void,   __config_ResetAll, ( vlc_object_t * ) );
00187 
00188 VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char * ) );
00189 VLC_EXPORT( module_t *, config_FindModule,( vlc_object_t *, const char * ) );
00190 
00191 VLC_EXPORT( void, config_Duplicate, ( module_t *, module_config_t * ) );
00192             void  config_Free       ( module_t * );
00193 
00194 VLC_EXPORT( void, config_SetCallbacks, ( module_config_t *, module_config_t * ) );
00195 VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) );
00196 
00197 #define config_GetType(a,b) __config_GetType(VLC_OBJECT(a),b)
00198 #define config_GetInt(a,b) __config_GetInt(VLC_OBJECT(a),b)
00199 #define config_PutInt(a,b,c) __config_PutInt(VLC_OBJECT(a),b,c)
00200 #define config_GetFloat(a,b) __config_GetFloat(VLC_OBJECT(a),b)
00201 #define config_PutFloat(a,b,c) __config_PutFloat(VLC_OBJECT(a),b,c)
00202 #define config_GetPsz(a,b) __config_GetPsz(VLC_OBJECT(a),b)
00203 #define config_PutPsz(a,b,c) __config_PutPsz(VLC_OBJECT(a),b,c)
00204 
00205 #define config_LoadCmdLine(a,b,c,d) __config_LoadCmdLine(VLC_OBJECT(a),b,c,d)
00206 #define config_LoadConfigFile(a,b) __config_LoadConfigFile(VLC_OBJECT(a),b)
00207 #define config_SaveConfigFile(a,b) __config_SaveConfigFile(VLC_OBJECT(a),b)
00208 #define config_ResetAll(a) __config_ResetAll(VLC_OBJECT(a))
00209 
00210 /* internal only */
00211 int config_CreateDir( vlc_object_t *, char * );
00212 int config_AutoSaveConfigFile( vlc_object_t * );
00213 
00214 /*****************************************************************************
00215  * Macros used to build the configuration structure.
00216  *
00217  * Note that internally we support only 3 types of config data: int , float
00218  *   and string.
00219  *   The other types declared here just map to one of these 3 basic types but
00220  *   have the advantage of also providing very good hints to a configuration
00221  *   interface so as to make it more user friendly.
00222  * The configuration structure also includes category hints. These hints can
00223  *   provide a configuration interface with some very useful data and again
00224  *   allow for a more user friendly interface.
00225  *****************************************************************************/
00226 
00227 #define set_category( i_id ) \
00228     i_config++; \
00229     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00230         (i_config+11) * sizeof(module_config_t)); \
00231     { static module_config_t tmp = { CONFIG_CATEGORY, NULL, NULL , '\0', NULL, NULL, NULL, i_id }; p_config[ i_config ] = tmp;  }
00232 
00233 #define set_subcategory( i_id ) \
00234     i_config++; \
00235     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00236         (i_config+11) * sizeof(module_config_t)); \
00237     { static module_config_t tmp = { CONFIG_SUBCATEGORY, NULL, NULL , '\0', NULL, NULL, NULL, i_id }; p_config[ i_config ] = tmp;  }
00238 
00239 #define set_section( text, longtext) \
00240     i_config++; \
00241     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00242         (i_config+11) * sizeof(module_config_t)); \
00243     { static module_config_t tmp = { CONFIG_SECTION, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp;  }
00244 
00245 #define add_category_hint( text, longtext, advc ) \
00246             i_config++; \
00247     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00248                             (i_config+11) * sizeof(module_config_t)); \
00249     { static module_config_t tmp = { CONFIG_HINT_CATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; p_config[i_config].b_advanced = advc; }
00250 
00251 #define add_subcategory_hint( text, longtext ) \
00252             i_config++; \
00253     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00254                             (i_config+11) * sizeof(module_config_t)); \
00255     { static module_config_t tmp = { CONFIG_HINT_SUBCATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; }
00256 
00257 
00258 #define end_subcategory_hint \
00259     i_config++; \
00260     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00261         (i_config+11) * sizeof(module_config_t)); \
00262     { static module_config_t tmp = { CONFIG_HINT_SUBCATEGORY_END, NULL, NULL, '\0' }; p_config[ i_config ] = tmp; }
00263 #define add_usage_hint( text ) \
00264     i_config++; \
00265     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00266         (i_config+11) * sizeof(module_config_t)); \
00267     { static module_config_t tmp = { CONFIG_HINT_USAGE, NULL, NULL, '\0', text }; p_config[ i_config ] = tmp; }
00268 
00269 
00270 #define add_string( name, psz_value, p_callback, text, longtext, advc ) \
00271     i_config++; \
00272     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00273         (i_config+11) * sizeof(module_config_t)); \
00274     { static module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value }; tmp.b_advanced = advc; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; }
00275 #define add_file( name, psz_value, p_callback, text, longtext, advc ) \
00276     i_config++; \
00277     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00278         (i_config+11) * sizeof(module_config_t)); \
00279     { static module_config_t tmp = { CONFIG_ITEM_FILE, NULL, name, '\0', text, longtext, psz_value, 0, 0 }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00280 #define add_directory( name, psz_value, p_callback, text, longtext, advc ) \
00281     i_config++; \
00282     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00283         (i_config+11) * sizeof(module_config_t)); \
00284     { static module_config_t tmp = { CONFIG_ITEM_DIRECTORY, NULL, name, '\0', text, longtext, psz_value, 0, 0 }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00285 
00286 #define add_module( name, psz_caps, psz_value, p_callback, text, longtext, advc ) \
00287     i_config++; \
00288     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00289         (i_config+11) * sizeof(module_config_t)); \
00290     { static module_config_t tmp = { CONFIG_ITEM_MODULE, psz_caps, name, '\0', text, longtext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00291 
00292 #define add_module_cat( name, i_subcategory, psz_value, p_callback, text, longtext, advc ) \
00293     i_config++; \
00294     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00295         (i_config+11) * sizeof(module_config_t)); \
00296     { static module_config_t tmp = { CONFIG_ITEM_MODULE_CAT, NULL, name, '\0', text, longtext, psz_value, 0, 0.0, i_subcategory }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00297 
00298 #define add_module_list( name, psz_caps, psz_value, p_callback, text, longtext, advc ) \
00299     i_config++; \
00300     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00301         (i_config+11) * sizeof(module_config_t)); \
00302     { static module_config_t tmp = { CONFIG_ITEM_MODULE_LIST, psz_caps, name, '\0', text, longtext, psz_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00303 
00304 
00305 #define add_module_list_cat( name, i_subcategory, psz_value, p_callback, text, longtext, advc ) \
00306     i_config++; \
00307     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00308         (i_config+11) * sizeof(module_config_t)); \
00309     { static module_config_t tmp = { CONFIG_ITEM_MODULE_LIST_CAT, NULL, name, '\0', text, longtext, psz_value, 0, 0.0, i_subcategory }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00310 
00311 #define add_integer( name, i_value, p_callback, text, longtext, advc ) \
00312     i_config++; \
00313     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00314         (i_config+11) * sizeof(module_config_t)); \
00315     { static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00316 
00317 #define add_key( name, i_value, p_callback, text, longtext, advc ) \
00318     i_config++; \
00319     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00320         (i_config+11) * sizeof(module_config_t)); \
00321     { static module_config_t tmp = { CONFIG_ITEM_KEY, NULL, name, '\0', text, longtext, NULL, i_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00322 
00323 #define add_integer_with_range( name, i_value, i_min, i_max, p_callback, text, longtext, advc ) \
00324     i_config++; \
00325     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00326         (i_config+11) * sizeof(module_config_t)); \
00327     { static module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value, 0, i_min, i_max }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00328 
00329 #define add_float( name, f_value, p_callback, text, longtext, advc ) \
00330     i_config++; \
00331     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00332         (i_config+11) * sizeof(module_config_t)); \
00333     { static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00334 
00335 #define add_float_with_range( name, f_value, f_min, f_max, p_callback, text, longtext, advc ) \
00336     i_config++; \
00337     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00338         (i_config+11) * sizeof(module_config_t)); \
00339     { static module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value, 0, 0, f_min, f_max }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00340 
00341 #define add_bool( name, b_value, p_callback, text, longtext, advc ) \
00342     i_config++; \
00343     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00344         (i_config+11) * sizeof(module_config_t)); \
00345     { static module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, '\0', text, longtext, NULL, b_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; }
00346 /* For option renamed */
00347 #define add_deprecated( name, strict ) \
00348         i_config++; \
00349     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00350         (i_config+11) * sizeof(module_config_t)); \
00351     {   static module_config_t tmp; \
00352         p_config[ i_config ] = tmp; \
00353         p_config[ i_config ].i_type = p_config[ i_config -1 ].i_type; \
00354         p_config[ i_config ].psz_name = name; \
00355         p_config[i_config].b_strict = strict; \
00356         p_config[ i_config ].psz_current = p_config[ i_config-1].psz_current?p_config[ i_config-1 ].psz_current:p_config[ i_config-1 ].psz_name; }
00357 /* For option suppressed*/
00358 #define add_suppressed_bool( name ) \
00359         i_config++; \
00360     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00361         (i_config+11) * sizeof(module_config_t)); \
00362     {   static module_config_t tmp; \
00363         p_config[ i_config ] = tmp; \
00364         p_config[ i_config ].i_type = CONFIG_ITEM_BOOL; \
00365         p_config[ i_config ].psz_name = name; \
00366         p_config[ i_config ].psz_current = "SUPPRESSED"; }
00367 
00368 #define add_suppressed_integer( name ) \
00369         i_config++; \
00370     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00371         (i_config+11) * sizeof(module_config_t)); \
00372     {   static module_config_t tmp; \
00373         p_config[ i_config ] = tmp; \
00374         p_config[ i_config ].i_type = CONFIG_ITEM_INTEGER; \
00375         p_config[ i_config ].psz_name = name; \
00376         p_config[ i_config ].psz_current = "SUPPRESSED"; }
00377 #define add_suppressed_float( name ) \
00378         i_config++; \
00379     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00380         (i_config+11) * sizeof(module_config_t)); \
00381     {   static module_config_t tmp; \
00382         p_config[ i_config ] = tmp; \
00383         p_config[ i_config ].i_type = CONFIG_ITEM_FLOAT; \
00384         p_config[ i_config ].psz_name = name; \
00385         p_config[ i_config ].psz_current = "SUPPRESSED"; }
00386 #define add_suppressed_string( name ) \
00387         i_config++; \
00388     if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \
00389         (i_config+11) * sizeof(module_config_t)); \
00390     {   static module_config_t tmp; \
00391         p_config[ i_config ] = tmp; \
00392         p_config[ i_config ].i_type = CONFIG_ITEM_STRING; \
00393         p_config[ i_config ].psz_name = name; \
00394         p_config[ i_config ].psz_current = "SUPPRESSED"; }
00395 /* Modifier macros for the config options (used for fine tuning) */
00396 #define change_short( ch ) \
00397     p_config[i_config].i_short = ch;
00398 
00399 #define change_string_list( list, list_text, list_update_func ) \
00400     p_config[i_config].i_list = sizeof(list)/sizeof(char *); \
00401     p_config[i_config].ppsz_list = list; \
00402     p_config[i_config].ppsz_list_text = list_text;
00403 
00404 #define change_integer_list( list, list_text, list_update_func ) \
00405     p_config[i_config].i_list = sizeof(list)/sizeof(int); \
00406     p_config[i_config].pi_list = list; \
00407     p_config[i_config].ppsz_list_text = list_text;
00408 
00409 #define change_integer_range( min, max ) \
00410     p_config[i_config].i_min = min; \
00411     p_config[i_config].i_max = max;
00412 
00413 #define change_float_range( min, max ) \
00414     p_config[i_config].f_min = min; \
00415     p_config[i_config].f_max = max;
00416 
00417 #define change_action_add( pf_action, action_text ) \
00418     if( !p_config[i_config].i_action ) \
00419     { p_config[i_config].ppsz_action_text = 0; \
00420       p_config[i_config].ppf_action = 0; } \
00421     p_config[i_config].ppf_action = (vlc_callback_t *) \
00422       realloc( p_config[i_config].ppf_action, \
00423       (p_config[i_config].i_action + 1) * sizeof(void *) ); \
00424     p_config[i_config].ppsz_action_text = (char **)\
00425       realloc( p_config[i_config].ppsz_action_text, \
00426       (p_config[i_config].i_action + 1) * sizeof(void *) ); \
00427     p_config[i_config].ppf_action[p_config[i_config].i_action] = pf_action; \
00428     p_config[i_config].ppsz_action_text[p_config[i_config].i_action] = \
00429       action_text; \
00430     p_config[i_config].i_action++;
00431 
00432 #define change_autosave() \
00433     p_config[i_config].b_autosave = VLC_TRUE;

Generated on Tue Dec 20 10:14:18 2005 for vlc-0.8.4a by  doxygen 1.4.2