00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef VLC_CONFIGURATION_H
00027 #define VLC_CONFIGURATION_H 1
00028
00029
00030
00031
00032
00033
00034
00035 # ifdef __cplusplus
00036 extern "C" {
00037 # endif
00038
00039 struct config_category_t
00040 {
00041 int i_id;
00042 const char *psz_name;
00043 const char *psz_help;
00044 };
00045
00046 typedef union
00047 {
00048 char *psz;
00049 int64_t i;
00050 float f;
00051 } module_value_t;
00052
00053 struct module_config_t
00054 {
00055 char *psz_type;
00056 char *psz_name;
00057 char *psz_text;
00058 char *psz_longtext;
00059 module_value_t value;
00060 module_value_t orig;
00061 module_value_t min;
00062 module_value_t max;
00063
00064
00065 char ** ppsz_list;
00066 int *pi_list;
00067 char **ppsz_list_text;
00068 int i_list;
00069 vlc_callback_t pf_update_list;
00070 uint8_t i_type;
00071 char i_short;
00072
00073
00074 unsigned b_advanced:1;
00075 unsigned b_internal:1;
00076 unsigned b_unsaveable:1;
00077 unsigned b_safe:1;
00078
00079
00080 int i_action;
00081 vlc_callback_t *ppf_action;
00082 char **ppsz_action_text;
00083
00084
00085 bool b_removed;
00086 };
00087
00088
00089
00090
00091
00092 VLC_API int config_GetType(vlc_object_t *, const char *) VLC_USED;
00093 VLC_API int64_t config_GetInt(vlc_object_t *, const char *) VLC_USED;
00094 VLC_API void config_PutInt(vlc_object_t *, const char *, int64_t);
00095 VLC_API float config_GetFloat(vlc_object_t *, const char *) VLC_USED;
00096 VLC_API void config_PutFloat(vlc_object_t *, const char *, float);
00097 VLC_API char * config_GetPsz(vlc_object_t *, const char *) VLC_USED VLC_MALLOC;
00098 VLC_API void config_PutPsz(vlc_object_t *, const char *, const char *);
00099
00100 VLC_API int config_SaveConfigFile( vlc_object_t * );
00101 #define config_SaveConfigFile(a) config_SaveConfigFile(VLC_OBJECT(a))
00102
00103 VLC_API void config_ResetAll( vlc_object_t * );
00104 #define config_ResetAll(a) config_ResetAll(VLC_OBJECT(a))
00105
00106 VLC_API module_config_t * config_FindConfig( vlc_object_t *, const char * ) VLC_USED;
00107 VLC_API char * config_GetDataDir(void) VLC_USED VLC_MALLOC;
00108 VLC_API char *config_GetLibDir(void) VLC_USED;
00109 VLC_API const char * config_GetConfDir( void ) VLC_USED;
00110
00111 typedef enum vlc_userdir
00112 {
00113 VLC_HOME_DIR,
00114 VLC_CONFIG_DIR,
00115 VLC_DATA_DIR,
00116 VLC_CACHE_DIR,
00117
00118 VLC_DESKTOP_DIR=0x80,
00119 VLC_DOWNLOAD_DIR,
00120 VLC_TEMPLATES_DIR,
00121 VLC_PUBLICSHARE_DIR,
00122 VLC_DOCUMENTS_DIR,
00123 VLC_MUSIC_DIR,
00124 VLC_PICTURES_DIR,
00125 VLC_VIDEOS_DIR,
00126 } vlc_userdir_t;
00127
00128 VLC_API char * config_GetUserDir( vlc_userdir_t ) VLC_USED VLC_MALLOC;
00129
00130 VLC_API void config_AddIntf( vlc_object_t *, const char * );
00131 VLC_API void config_RemoveIntf( vlc_object_t *, const char * );
00132 VLC_API bool config_ExistIntf( vlc_object_t *, const char * ) VLC_USED;
00133
00134 #define config_GetType(a,b) config_GetType(VLC_OBJECT(a),b)
00135 #define config_GetInt(a,b) config_GetInt(VLC_OBJECT(a),b)
00136 #define config_PutInt(a,b,c) config_PutInt(VLC_OBJECT(a),b,c)
00137 #define config_GetFloat(a,b) config_GetFloat(VLC_OBJECT(a),b)
00138 #define config_PutFloat(a,b,c) config_PutFloat(VLC_OBJECT(a),b,c)
00139 #define config_GetPsz(a,b) config_GetPsz(VLC_OBJECT(a),b)
00140 #define config_PutPsz(a,b,c) config_PutPsz(VLC_OBJECT(a),b,c)
00141
00142 #define config_AddIntf(a,b) config_AddIntf(VLC_OBJECT(a),b)
00143 #define config_RemoveIntf(a,b) config_RemoveIntf(VLC_OBJECT(a),b)
00144 #define config_ExistIntf(a,b) config_ExistIntf(VLC_OBJECT(a),b)
00145
00146
00147
00148
00149 struct config_chain_t
00150 {
00151 config_chain_t *p_next;
00152
00153 char *psz_name;
00154 char *psz_value;
00155 };
00156
00157
00158
00159
00160
00161
00162
00163
00164 VLC_API void config_ChainParse( vlc_object_t *, const char *psz_prefix, const char *const *ppsz_options, config_chain_t * );
00165 #define config_ChainParse( a, b, c, d ) config_ChainParse( VLC_OBJECT(a), b, c, d )
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177 VLC_API const char *config_ChainParseOptions( config_chain_t **pp_cfg, const char *ppsz_opts );
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190 VLC_API char *config_ChainCreate( char **ppsz_name, config_chain_t **pp_cfg, const char *psz_string ) VLC_USED VLC_MALLOC;
00191
00192
00193
00194
00195
00196 VLC_API void config_ChainDestroy( config_chain_t * );
00197
00198
00199
00200
00201 VLC_API config_chain_t * config_ChainDuplicate( const config_chain_t * ) VLC_USED VLC_MALLOC;
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212 VLC_API char * config_StringUnescape( char *psz_string );
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223 VLC_API char * config_StringEscape( const char *psz_string ) VLC_USED VLC_MALLOC;
00224
00225 # ifdef __cplusplus
00226 }
00227 # endif
00228
00229 #endif