Changeset 3368c030bf8785290a295ce632e678ca931c8a27

Show
Ignore:
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
  • modules/control/http.c

    r2851705 r3368c03  
    13671367    } 
    13681368 
    1369     if( *psz_dir == '~' ) 
     1369    if( psz_dir[0] == '~' && psz_dir[1] == '/' ) 
    13701370    { 
    13711371        /* This is incomplete : we should also support the ~cmassiot/ syntax. */ 
    13721372        snprintf( dir, sizeof(dir), "%s/%s", p_intf->p_vlc->psz_homedir, 
    1373                   psz_dir + 1 ); 
     1373                  psz_dir + 2 ); 
    13741374        psz_dir = dir; 
    13751375    } 
     
    40384038            free( psz_variable ); 
    40394039        } 
     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        } 
    40404060        /* 6. playlist functions */ 
    40414061        else if( !strcmp( s, "playlist_add" ) ) 
  • src/libvlc.c

    r2851705 r3368c03  
    367367    p_vlc->psz_homedir = config_GetHomeDir(); 
    368368    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    } 
    369380 
    370381    /* Check for plugins cache options */ 
  • src/misc/configuration.c

    rc31e9c3 r3368c03  
    10131013 * Really stupid no ? 
    10141014 *****************************************************************************/ 
    1015 int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name, 
    1016                     vlc_bool_t b_autosave ) 
     1015static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name, 
     1016                           vlc_bool_t b_autosave ) 
    10171017{ 
    10181018    module_t *p_parser;