]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Cleanup and rearchitecture of HGFS server change notification part I
authorVMware, Inc <>
Mon, 21 May 2012 22:27:23 +0000 (15:27 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Tue, 22 May 2012 18:57:13 +0000 (11:57 -0700)
Server callback for receiving file system change events renaming and
type renamed.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
open-vm-tools/lib/hgfsServer/hgfsDirNotify.h
open-vm-tools/lib/hgfsServer/hgfsDirNotifyStub.c
open-vm-tools/lib/hgfsServer/hgfsServer.c

index cfbeb97e0021e54303cac0c1cdc774b5ff9ae197..b9d0cb20b2e585223050a7f664d85fe55943755a 100644 (file)
 
 struct HgfsSessionInfo;
 /* This is a callback that is implemented in hgfsServer.c */
-typedef void HgfsNotificationCallbackFunc(HgfsSharedFolderHandle sharedFolder,
-                                          HgfsSubscriberHandle subscriber,
-                                          char *name,
-                                          uint32 mask,
-                                          struct HgfsSessionInfo *session);
+typedef void HgfsNotifyEventReceiveCb(HgfsSharedFolderHandle sharedFolder,
+                                      HgfsSubscriberHandle subscriber,
+                                      char *name,
+                                      uint32 mask,
+                                      struct HgfsSessionInfo *session);
 HgfsInternalStatus HgfsNotify_Init(void);
 void HgfsNotify_Shutdown(void);
 void HgfsNotify_Suspend(void);
@@ -43,7 +43,7 @@ HgfsSubscriberHandle HgfsNotify_AddSubscriber(HgfsSharedFolderHandle sharedFolde
                                               const char *path,
                                               uint32 eventFilter,
                                               uint32 recursive,
-                                              HgfsNotificationCallbackFunc notify,
+                                              HgfsNotifyEventReceiveCb notify,
                                               struct HgfsSessionInfo *session);
 
 Bool HgfsNotify_RemoveSharedFolder(HgfsSharedFolderHandle sharedFolder);
index 94667ab68041a0ad6c8ca52da52ee602d293bb82..24d76ac7baa9e97013a2f4af9b10476a46e3aee8 100644 (file)
@@ -171,7 +171,7 @@ HgfsNotify_AddSubscriber(HgfsSharedFolderHandle sharedFolder, // IN: shared fold
                          const char *path,                    // IN: relative path
                          uint32 eventFilter,                  // IN: event filter
                          uint32 recursive,                    // IN: look in subfolders
-                         HgfsNotificationCallbackFunc notify, // IN notification callback
+                         HgfsNotifyEventReceiveCb eventCb,    // IN notification callback
                          struct HgfsSessionInfo *session)     // IN: server context
 {
    return HGFS_INVALID_SUBSCRIBER_HANDLE;
index 8238774857b7bca88ee61535e960d53092868fa8..9c53963a93978d5f3e74e02589d0b3371a7f3344 100644 (file)
@@ -287,11 +287,11 @@ static Bool HgfsHandle2NotifyInfo(HgfsHandle handle,
                                   char **fileName,
                                   size_t *fileNameSize,
                                   HgfsSharedFolderHandle *folderHandle);
-static void Hgfs_NotificationCallback(HgfsSharedFolderHandle sharedFolder,
-                                      HgfsSubscriberHandle subscriber,
-                                      char* fileName,
-                                      uint32 mask,
-                                      struct HgfsSessionInfo *session);
+static void HgfsServerDirWatchEvent(HgfsSharedFolderHandle sharedFolder,
+                                    HgfsSubscriberHandle subscriber,
+                                    char* fileName,
+                                    uint32 mask,
+                                    struct HgfsSessionInfo *session);
 static void HgfsFreeSearchDirents(HgfsSearch *search);
 
 
@@ -6889,7 +6889,7 @@ HgfsServerSetDirWatchByHandle(HgfsInputParam *input,         // IN: Input params
    if (HgfsHandle2NotifyInfo(dir, input->session, &fileName, &fileNameSize,
                              &sharedFolder)) {
       *watchId = HgfsNotify_AddSubscriber(sharedFolder, fileName, events, watchTree,
-                                          Hgfs_NotificationCallback, input->session);
+                                          HgfsServerDirWatchEvent, input->session);
       status = (HGFS_INVALID_SUBSCRIBER_HANDLE == *watchId) ? HGFS_ERROR_INTERNAL :
                                                               HGFS_ERROR_SUCCESS;
    } else {
@@ -6969,7 +6969,7 @@ HgfsServerSetDirWatchByName(HgfsInputParam *input,         // IN: Input params
                                             &tempSize, &tempPtr);
             if (HGFS_NAME_STATUS_COMPLETE == nameStatus) {
                *watchId = HgfsNotify_AddSubscriber(sharedFolder, tempBuf, events,
-                                                   watchTree, Hgfs_NotificationCallback,
+                                                   watchTree, HgfsServerDirWatchEvent,
                                                    input->session);
                 status = (HGFS_INVALID_SUBSCRIBER_HANDLE == *watchId) ?
                                               HGFS_ERROR_INTERNAL : HGFS_ERROR_SUCCESS;
@@ -6980,7 +6980,7 @@ HgfsServerSetDirWatchByName(HgfsInputParam *input,         // IN: Input params
             }
          } else {
             *watchId = HgfsNotify_AddSubscriber(sharedFolder, "", events, watchTree,
-                                                Hgfs_NotificationCallback,
+                                                HgfsServerDirWatchEvent,
                                                 input->session);
             status = (HGFS_INVALID_SUBSCRIBER_HANDLE == *watchId) ? HGFS_ERROR_INTERNAL :
                                                                     HGFS_ERROR_SUCCESS;
@@ -8368,7 +8368,7 @@ HgfsBuildRelativePath(const char* source,    // IN: source file name
 /*
  *-----------------------------------------------------------------------------
  *
- * Hgfs_NotificationCallback --
+ * HgfsServerDirWatchEvent --
  *
  *    Callback which is called by directory notification package when in response
  *    to a event.
@@ -8386,12 +8386,12 @@ HgfsBuildRelativePath(const char* source,    // IN: source file name
  *-----------------------------------------------------------------------------
  */
 
-void
-Hgfs_NotificationCallback(HgfsSharedFolderHandle sharedFolder, // IN: shared folder
-                          HgfsSubscriberHandle subscriber,     // IN: subsciber
-                          char* fileName,                      // IN: name of the file
-                          uint32 mask,                         // IN: event type
-                          struct HgfsSessionInfo *session)     // IN: session info
+static void
+HgfsServerDirWatchEvent(HgfsSharedFolderHandle sharedFolder, // IN: shared folder
+                        HgfsSubscriberHandle subscriber,     // IN: subsciber
+                        char* fileName,                      // IN: name of the file
+                        uint32 mask,                         // IN: event type
+                        struct HgfsSessionInfo *session)     // IN: session info
 {
    HgfsPacket *packet = NULL;
    HgfsHeader *packetHeader = NULL;