open-vm-tools 12.4.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 
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
37 extern "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);
70 
71 
72 /*
73  ******************************************************************************
74  * ToolsPluginSvcGuestStore_Shutdown -- */
88 static inline void
89 ToolsPluginSvcGuestStore_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 
101 #endif /* _GUESTSTORE_H_ */
struct ToolsPluginSvcGuestStore ToolsPluginSvcGuestStore
Type of the public interface of the guestStore plugin.
Definition: plugin.h:294
gpointer serviceObj
Definition: plugin.h:326
Type of the public interface of the guestStore plugin.
Definition: guestStore.h:67