~n-muench/ubuntu/precise/open-vm-tools/open-vm-tools-precise.sid-merge1

« back to all changes in this revision

Viewing changes to lib/include/vmtools.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-12-06 07:45:05 UTC
  • mfrom: (1.1.8 upstream) (2.4.10 sid)
  • Revision ID: james.westby@ubuntu.com-20091206074505-43rp7oejjgp0y2re
Tags: 2009.11.16-210370-1
* Merging upstream version 2009.11.16-210370.
* Moving vmusr plugins from open-vm-tools to open-vm-toolbox (Closes:
  #539282, #557215).
* Correcting plugin location (Closes: #545222, #549044).
* Dropping la files (Closes: #551626).
* Adding open-vm-toolbox lintian overrides.
* Removing test plugin.
* Removing unused plugin symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*********************************************************
2
 
 * Copyright (C) 2008 VMware, Inc. All rights reserved.
3
 
 *
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.
7
 
 *
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.
12
 
 *
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.
16
 
 *
17
 
 *********************************************************/
18
 
 
19
 
#ifndef _VMTOOLS_H_
20
 
#define _VMTOOLS_H_
21
 
 
22
 
/**
23
 
 * @file vmtools.h
24
 
 *
25
 
 *    Public functions from the VMTools shared library.
26
 
 *
27
 
 * @addtogroup vmtools_utils
28
 
 * @{
29
 
 */
30
 
 
31
 
#if !defined(G_LOG_DOMAIN)
32
 
#  define G_LOG_DOMAIN VMTools_GetDefaultLogDomain()
33
 
#endif
34
 
 
35
 
#define  VMTOOLS_GUEST_SERVICE   "vmsvc"
36
 
#define  VMTOOLS_USER_SERVICE    "vmusr"
37
 
 
38
 
/* Needs to come before glib.h. */
39
 
const char *
40
 
VMTools_GetDefaultLogDomain(void);
41
 
 
42
 
#include <glib.h>
43
 
#if defined(G_PLATFORM_WIN32)
44
 
#  include <windows.h>
45
 
#else
46
 
#  include <signal.h>
47
 
#  include <sys/time.h>
48
 
#endif
49
 
 
50
 
/**
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.
55
 
 *
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).
58
 
 *
59
 
 * @return The path in glib's filename encoding, or NULL on error.
60
 
 */
61
 
 
62
 
#if defined(G_PLATFORM_WIN32)
63
 
#  define VMTOOLS_GET_FILENAME_LOCAL(path, err) (gchar *) (path)
64
 
#else
65
 
#  define VMTOOLS_GET_FILENAME_LOCAL(path, err) g_filename_from_utf8((path),  \
66
 
                                                                     -1,      \
67
 
                                                                     NULL,    \
68
 
                                                                     NULL,    \
69
 
                                                                     (err))
70
 
#endif
71
 
 
72
 
/**
73
 
 * Frees a path allocated with VMTOOLS_GET_FILENAME_LOCAL. No-op on Windows.
74
 
 *
75
 
 * @param[in]  path  Path in UTF-8.
76
 
 */
77
 
 
78
 
#if defined(G_PLATFORM_WIN32)
79
 
#  define VMTOOLS_RELEASE_FILENAME_LOCAL(path)   (void) (path)
80
 
#else
81
 
#  define VMTOOLS_RELEASE_FILENAME_LOCAL(path)   g_free(path)
82
 
#endif
83
 
 
84
 
 
85
 
void
86
 
vm_free(void *ptr);
87
 
 
88
 
void
89
 
VMTools_SetDefaultLogDomain(const gchar *domain);
90
 
 
91
 
void
92
 
VMTools_ConfigLogging(GKeyFile *cfg);
93
 
 
94
 
void
95
 
VMTools_EnableLogging(gboolean enable);
96
 
 
97
 
gchar *
98
 
VMTools_GetToolsConfFile(void);
99
 
 
100
 
GKeyFile *
101
 
VMTools_LoadConfig(const gchar *path,
102
 
                   GKeyFileFlags flags,
103
 
                   gboolean autoUpgrade);
104
 
 
105
 
 
106
 
gboolean
107
 
VMTools_ReloadConfig(const gchar *path,
108
 
                     GKeyFileFlags flags,
109
 
                     GKeyFile **config,
110
 
                     time_t *mtime);
111
 
 
112
 
void
113
 
VMTools_ResetLogging(gboolean cleanDefault);
114
 
 
115
 
gboolean
116
 
VMTools_WriteConfig(const gchar *path,
117
 
                    GKeyFile *config,
118
 
                    GError **err);
119
 
 
120
 
#if defined(G_PLATFORM_WIN32)
121
 
 
122
 
GSource *
123
 
VMTools_NewHandleSource(HANDLE h);
124
 
 
125
 
#else
126
 
 
127
 
/** Type of callback used by the signal event source. */
128
 
typedef gboolean (*SignalSourceCb)(const siginfo_t *, gpointer);
129
 
 
130
 
GSource *
131
 
VMTools_NewSignalSource(int signum);
132
 
 
133
 
#endif
134
 
 
135
 
GArray *
136
 
VMTools_WrapArray(gconstpointer data,
137
 
                  guint elemSize,
138
 
                  guint count);
139
 
 
140
 
/** @} */
141
 
 
142
 
#endif /* _VMTOOLS_H_ */
143