open-vm-tools 13.1.0: lib/include/vmware/tools/guestStore.h Source File

open-vm-tools 13.1.0

guestStore.h
Go to the documentation of this file.
1/*********************************************************
2 * Copyright (c) 2020,2023 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 _GUESTSTORE_H_
20#define _GUESTSTORE_H_
21
30
31/*
32 * glib-object.h should not be placed inside `extern "C"' blocks.
33 * However, this header is often placed inside such blocks.
34 * Here we change back into C++ for glib-object.h
35 */
36#ifdef __cplusplus
37extern "C++" {
38#endif
39#include <glib-object.h>
40#ifdef __cplusplus
41}
42#endif
43
44#include "vmware/tools/plugin.h"
45
53#define TOOLS_CORE_SIG_GUESTSTORE_STATE "tcs_gueststore_state"
54
55/*
56 * Property name of the guestStore plugin in the tools application context
57 * service object.
58 */
59#define TOOLS_PLUGIN_SVC_PROP_GUESTSTORE "tps_prop_gueststore"
60
67 typedef struct ToolsPluginSvcGuestStore {
68 void (*shutdown)(void);
69} ToolsPluginSvcGuestStore;
70
71
72/*
73 ******************************************************************************
74 * ToolsPluginSvcGuestStore_Shutdown -- */
87
88static inline void
89ToolsPluginSvcGuestStore_Shutdown(ToolsAppCtx *ctx) // IN
90{
91 ToolsPluginSvcGuestStore *svcGuestStore = NULL;
92 g_object_get(ctx->serviceObj, TOOLS_PLUGIN_SVC_PROP_GUESTSTORE,
93 &svcGuestStore, NULL);
94 if (svcGuestStore != NULL && svcGuestStore->shutdown != NULL) {
95 svcGuestStore->shutdown();
96 }
97}
98
100
101#endif /* _GUESTSTORE_H_ */
plugin.h
ToolsAppCtx
Definition plugin.h:307
ToolsPluginSvcGuestStore
Type of the public interface of the guestStore plugin.
Definition guestStore.h:67