Changeset 3368c030bf8785290a295ce632e678ca931c8a27
- Timestamp:
- 08/17/05 17:12:51
(3 years ago)
- Author:
- Christophe Massiot <massiot@videolan.org>
- git-committer:
- Christophe Massiot <massiot@videolan.org> 1124291571 +0000
- git-parent:
[2851705c32f14a69dcf115859481f0e4267d9ac2]
- git-author:
- Christophe Massiot <massiot@videolan.org> 1124291571 +0000
- Message:
- src/libvlc.c: Expand ~/ in --config-file.
- modules/control/http.c: New RPN functions :
- 'module' vlc_config_save ('module' can be an empty string) returns status
- vlc_config_reset
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2851705 |
r3368c03 |
|
| 1367 | 1367 | } |
|---|
| 1368 | 1368 | |
|---|
| 1369 | | if( *psz_dir == '~' ) |
|---|
| | 1369 | if( psz_dir[0] == '~' && psz_dir[1] == '/' ) |
|---|
| 1370 | 1370 | { |
|---|
| 1371 | 1371 | /* This is incomplete : we should also support the ~cmassiot/ syntax. */ |
|---|
| 1372 | 1372 | snprintf( dir, sizeof(dir), "%s/%s", p_intf->p_vlc->psz_homedir, |
|---|
| 1373 | | psz_dir + 1 ); |
|---|
| | 1373 | psz_dir + 2 ); |
|---|
| 1374 | 1374 | psz_dir = dir; |
|---|
| 1375 | 1375 | } |
|---|
| … | … | |
| 4038 | 4038 | free( psz_variable ); |
|---|
| 4039 | 4039 | } |
|---|
| | 4040 | else if( !strcmp( s, "vlc_config_save" ) ) |
|---|
| | 4041 | { |
|---|
| | 4042 | char *psz_module = SSPop( st ); |
|---|
| | 4043 | int i_result; |
|---|
| | 4044 | |
|---|
| | 4045 | if( !*psz_module ) |
|---|
| | 4046 | { |
|---|
| | 4047 | free( psz_module ); |
|---|
| | 4048 | psz_module = NULL; |
|---|
| | 4049 | } |
|---|
| | 4050 | i_result = config_SaveConfigFile( p_intf, psz_module ); |
|---|
| | 4051 | |
|---|
| | 4052 | if( psz_module != NULL ) |
|---|
| | 4053 | free( psz_module ); |
|---|
| | 4054 | SSPushN( st, i_result ); |
|---|
| | 4055 | } |
|---|
| | 4056 | else if( !strcmp( s, "vlc_config_reset" ) ) |
|---|
| | 4057 | { |
|---|
| | 4058 | config_ResetAll( p_intf ); |
|---|
| | 4059 | } |
|---|
| 4040 | 4060 | /* 6. playlist functions */ |
|---|
| 4041 | 4061 | else if( !strcmp( s, "playlist_add" ) ) |
|---|
| r2851705 |
r3368c03 |
|
| 367 | 367 | p_vlc->psz_homedir = config_GetHomeDir(); |
|---|
| 368 | 368 | p_vlc->psz_configfile = config_GetPsz( p_vlc, "config" ); |
|---|
| | 369 | if( p_vlc->psz_configfile != NULL && p_vlc->psz_configfile[0] == '~' |
|---|
| | 370 | && p_vlc->psz_configfile[1] == '/' ) |
|---|
| | 371 | { |
|---|
| | 372 | char *psz = malloc( strlen(p_vlc->psz_homedir) |
|---|
| | 373 | + strlen(p_vlc->psz_configfile) ); |
|---|
| | 374 | /* This is incomplete : we should also support the ~cmassiot/ syntax. */ |
|---|
| | 375 | sprintf( psz, "%s/%s", p_vlc->psz_homedir, |
|---|
| | 376 | p_vlc->psz_configfile + 2 ); |
|---|
| | 377 | free( p_vlc->psz_configfile ); |
|---|
| | 378 | p_vlc->psz_configfile = psz; |
|---|
| | 379 | } |
|---|
| 369 | 380 | |
|---|
| 370 | 381 | /* Check for plugins cache options */ |
|---|
| rc31e9c3 |
r3368c03 |
|
| 1013 | 1013 | * Really stupid no ? |
|---|
| 1014 | 1014 | *****************************************************************************/ |
|---|
| 1015 | | int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name, |
|---|
| 1016 | | vlc_bool_t b_autosave ) |
|---|
| | 1015 | static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name, |
|---|
| | 1016 | vlc_bool_t b_autosave ) |
|---|
| 1017 | 1017 | { |
|---|
| 1018 | 1018 | module_t *p_parser; |
|---|