s3: Fix examples/VFS build
[kai/samba.git] / examples / VFS / shadow_copy_test.c
index 86b61dc00ed0c4a2bda94a3d9ad524dd6d1f57c7..8e6fd69b1bd0061e9b274d3e09fc56e7fa672910 100644 (file)
@@ -2,6 +2,7 @@
  * TEST implementation of an Shadow Copy module
  *
  * Copyright (C) Stefan Metzmacher     2003
+ * Copyright (C) Jeremy Allison 2009.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -17,7 +18,9 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "includes.h"
+#include "../source3/include/includes.h"
+#include "ntioctl.h"
+#include "smbd/proto.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
          Directories are always displayed...    
 */
 
-static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels)
+static int test_get_shadow_copy_data(vfs_handle_struct *handle,
+                                   files_struct *fsp,
+                                   struct shadow_copy_data *shadow_copy_data,
+                                   bool labels)
 {
        uint32 num = 3;
        uint32 i;
@@ -58,7 +64,7 @@ static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs
        
        if (labels) {   
                if (num) {
-                       shadow_copy_data->labels = TALLOC_ZERO_ARRAY(shadow_copy_data->mem_ctx,SHADOW_COPY_LABEL,num);
+                       shadow_copy_data->labels = talloc_zero_array(shadow_copy_data,SHADOW_COPY_LABEL,num);
                } else {
                        shadow_copy_data->labels = NULL;
                }
@@ -74,13 +80,13 @@ static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs
 
 /* VFS operations structure */
 
-static vfs_op_tuple shadow_copy_test_ops[] = { 
-       {SMB_VFS_OP(test_get_shadow_copy_data), SMB_VFS_OP_GET_SHADOW_COPY_DATA,SMB_VFS_LAYER_OPAQUE},
-
-       {SMB_VFS_OP(NULL),                      SMB_VFS_OP_NOOP,                SMB_VFS_LAYER_NOOP}
+static struct vfs_fn_pointers vfs_test_shadow_copy_fns = {
+       .get_shadow_copy_data_fn = test_get_shadow_copy_data
 };
 
-NTSTATUS init_module(void)
+NTSTATUS vfs_shadow_copy_test_init(void)
 {
-       return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "shadow_copy_test", shadow_copy_test_ops);
+       return smb_register_vfs(SMB_VFS_INTERFACE_VERSION,
+                               "shadow_copy_test",
+                               &vfs_test_shadow_copy_fns);
 }