* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
#include "../libvlc.h"
#include "vlc_keys.h"
#include "vlc_charset.h"
#include <errno.h> /* errno */
-
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
+#include <assert.h>
+#include <limits.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h> /* getuid() */
#include <tchar.h>
#endif
-#include "config.h"
+#include "configuration.h"
#include "modules/modules.h"
static inline char *strdupnull (const char *src)
return NULL;
}
-/*****************************************************************************
- * config_Duplicate: creates a duplicate of a module's configuration data.
- *****************************************************************************
- * Unfortunatly we cannot work directly with the module's config data as
- * this module might be unloaded from memory at any time (remember HideModule).
- * This is why we need to create an exact copy of the config data.
- *****************************************************************************/
-int config_Duplicate( module_t *p_module, const module_config_t *p_orig,
- size_t n )
-{
- const module_config_t *p_item, *p_end = p_orig + n;
-
- /* Calculate the structure length */
- p_module->i_config_items = 0;
- p_module->i_bool_items = 0;
-
- for( p_item = p_orig; p_item < p_end; p_item++ )
- {
- if( p_item->i_type & CONFIG_ITEM )
- {
- p_module->i_config_items++;
- }
-
- if( p_item->i_type == CONFIG_ITEM_BOOL )
- {
- p_module->i_bool_items++;
- }
- }
-
- /* Allocate memory */
- p_module->p_config = (module_config_t *)calloc( n, sizeof(*p_orig) );
- if( p_module->p_config == NULL )
- {
- msg_Err( p_module, "config error: can't duplicate p_config" );
- return VLC_ENOMEM;
- }
- p_module->confsize = n;
-
- /* Do the duplication job */
- for( size_t i = 0; i < n ; i++ )
- {
- p_module->p_config[i] = p_orig[i];
- p_module->p_config[i].p_lock = &p_module->object_lock;
- }
- return VLC_SUCCESS;
-}
-
-
/*****************************************************************************
* config_Free: frees a duplicated module's configuration data.
*****************************************************************************
* - on windows that's the App Data directory;
* - on other OSes it's the same as the home directory.
*/
-char *config_GetUserDir( void );
char *config_GetUserDir( void )
{
return GetDir( VLC_TRUE );