]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes to common source files not directly applicable to open-vm-tools.
authorJohn Wolfe <jwolfe@vmware.com>
Tue, 6 Oct 2020 21:30:56 +0000 (14:30 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Tue, 6 Oct 2020 21:30:56 +0000 (14:30 -0700)
open-vm-tools/lib/include/vmware/tools/plugin.h
open-vm-tools/services/vmtoolsd/mainLoop.c

index 1776a6260551d87731f89aae881ac4159b7933bf..e8e3d146c22c726364349705f40ec2695c6aeed9 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2008-2019,2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2020 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -264,6 +264,18 @@ typedef enum {
 } ToolsCoreAPI;
 
 
+struct ToolsServiceProperty;
+
+/**
+ * Type of the function that installs a new property in
+ * the application context service object.
+ *
+ * @param[in] obj    The application context service object.
+ * @param[in] prop   Property to install.
+ */
+typedef void (*RegisterServiceProperty)(gpointer obj,
+                                        struct ToolsServiceProperty *prop);
+
 /**
  * Defines the context of a tools application. This data is provided by the
  * core services to applications when they're loaded.
@@ -301,6 +313,13 @@ typedef struct ToolsAppCtx {
     * register and emit their own signals using this object.
     */
    gpointer          serviceObj;
+
+   /**
+    * Function pointer for plugins to register properties to
+    * the service object serviceObj.
+    * This allows a plugin to share data and services to others.
+    */
+   RegisterServiceProperty registerServiceProperty;
 } ToolsAppCtx;
 
 #if defined(G_PLATFORM_WIN32)
index 3c6313adfcdc1345d905e64f647db008b3068dcb..437f8ee7490300836894f15fde0420c61f0d9f3f 100644 (file)
@@ -1200,6 +1200,8 @@ ToolsCore_Setup(ToolsServiceState *state)
 
    g_type_init();
    state->ctx.serviceObj = g_object_new(TOOLSCORE_TYPE_SERVICE, NULL);
+   state->ctx.registerServiceProperty =
+      (RegisterServiceProperty)ToolsCoreService_RegisterProperty;
 
    /* Register the core properties. */
    ToolsCoreService_RegisterProperty(state->ctx.serviceObj,