1
/*********************************************************
2
* Copyright (C) 2008 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation version 2.1 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
11
* License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*********************************************************/
25
* Public functions from the VMTools shared library.
27
* @addtogroup vmtools_utils
31
#if !defined(G_LOG_DOMAIN)
32
# define G_LOG_DOMAIN VMTools_GetDefaultLogDomain()
35
#define VMTOOLS_GUEST_SERVICE "vmsvc"
36
#define VMTOOLS_USER_SERVICE "vmusr"
38
/* Needs to come before glib.h. */
40
VMTools_GetDefaultLogDomain(void);
43
#if defined(G_PLATFORM_WIN32)
47
# include <sys/time.h>
51
* Converts an UTF-8 path to the local (i.e., glib) file name encoding.
52
* This is a no-op on Windows, since the local encoding is always UTF-8
53
* in glib. The returned value should not be freed directly; instead,
54
* use VMTOOLS_FREE_FILENAME.
56
* @param[in] path Path in UTF-8 (should not be NULL).
57
* @param[out] err Where to store errors (type: GError **; may be NULL).
59
* @return The path in glib's filename encoding, or NULL on error.
62
#if defined(G_PLATFORM_WIN32)
63
# define VMTOOLS_GET_FILENAME_LOCAL(path, err) (gchar *) (path)
65
# define VMTOOLS_GET_FILENAME_LOCAL(path, err) g_filename_from_utf8((path), \
73
* Frees a path allocated with VMTOOLS_GET_FILENAME_LOCAL. No-op on Windows.
75
* @param[in] path Path in UTF-8.
78
#if defined(G_PLATFORM_WIN32)
79
# define VMTOOLS_RELEASE_FILENAME_LOCAL(path) (void) (path)
81
# define VMTOOLS_RELEASE_FILENAME_LOCAL(path) g_free(path)
89
VMTools_SetDefaultLogDomain(const gchar *domain);
92
VMTools_ConfigLogging(GKeyFile *cfg);
95
VMTools_EnableLogging(gboolean enable);
98
VMTools_GetToolsConfFile(void);
101
VMTools_LoadConfig(const gchar *path,
103
gboolean autoUpgrade);
107
VMTools_ReloadConfig(const gchar *path,
113
VMTools_ResetLogging(gboolean cleanDefault);
116
VMTools_WriteConfig(const gchar *path,
120
#if defined(G_PLATFORM_WIN32)
123
VMTools_NewHandleSource(HANDLE h);
127
/** Type of callback used by the signal event source. */
128
typedef gboolean (*SignalSourceCb)(const siginfo_t *, gpointer);
131
VMTools_NewSignalSource(int signum);
136
VMTools_WrapArray(gconstpointer data,
142
#endif /* _VMTOOLS_H_ */