glib/glib/gutilsprivate.h
Philip Withnall 91defdb34e gutils: Add internal API to override XDG directories
Add a new internal function, g_set_user_dirs(), which will safely
override the values returned by g_get_user_data_dir() and friends, and
the value returned by g_get_home_dir().

This is intended to be used by unit tests, and will be hooked up to them
in a following commit.

This can be called as many times as needed by the current process. It’s
thread-safe. It does not modify the environment, so none of the changes
are propagated to any subsequently spawned subprocesses.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/538
2018-12-17 17:16:03 +00:00

34 lines
1.0 KiB
C

/*
* Copyright © 2018 Endless Mobile, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Philip Withnall <withnall@endlessm.com>
*/
#ifndef __G_UTILS_PRIVATE_H__
#define __G_UTILS_PRIVATE_H__
#include "gtypes.h"
G_BEGIN_DECLS
GLIB_AVAILABLE_IN_2_60
void g_set_user_dirs (const gchar *first_dir_type,
...) G_GNUC_NULL_TERMINATED;
G_END_DECLS
#endif /* __G_UTILS_PRIVATE_H__ */