manipulating configuration file

This forum is about all development around libVLC.
theedge123
New Cone
New Cone
Posts: 3
Joined: 13 Aug 2010 17:43

manipulating configuration file

Postby theedge123 » 13 Aug 2010 18:05

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

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: manipulating configuration file

Postby Jean-Baptiste Kempf » 15 Aug 2010 10:37

obj is a vlc object, probably a module or the core
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 40 guests