Page 1 of 1

manipulating configuration file

Posted: 13 Aug 2010 18:05
by theedge123
Hello,

I'm working on C++/Linux.
I'm looking for a code example to load an user configuration file.
I found this code in src/config/file.c but I have questions:

Code: Select all

/** * Get the user's configuration file */ static char *config_GetConfigFile( vlc_object_t *obj ) { char *psz_file = var_CreateGetNonEmptyString( obj, "config" ); var_Destroy( obj, "config" ); if( psz_file == NULL ) { char *psz_dir = config_GetUserDir( VLC_CONFIG_DIR ); if( asprintf( &psz_file, "%s" DIR_SEP CONFIG_FILE, psz_dir ) == -1 ) psz_file = NULL; free( psz_dir ); } return psz_file; }
1) what does "obj" represent ?
2) is there a simple method taking a file name as input and giving a kind of config object as output ?

Thanks in advance,
Fabien

Re: manipulating configuration file

Posted: 15 Aug 2010 10:37
by Jean-Baptiste Kempf
obj is a vlc object, probably a module or the core