[Pkg-owncloud-commits] [owncloud-client] 89/333: csync: Remove more vio abstraction

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:16:38 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 1c8f2792148e85ec4d9ba3d7c1bbb6c11a94b1ef
Author: Markus Goetz <markus at woboq.com>
Date:   Fri Feb 28 08:49:57 2014 +0100

    csync: Remove more vio abstraction
---
 csync/src/CMakeLists.txt                 |   1 -
 csync/src/csync.c                        |  44 +++---------
 csync/src/csync_owncloud.c               |  44 ++++--------
 csync/src/csync_owncloud.h               |  11 ++-
 csync/src/csync_private.h                |   7 +-
 csync/src/vio/csync_vio.c                | 119 +++++--------------------------
 csync/src/vio/csync_vio.h                |   3 -
 csync/src/vio/csync_vio_handle.c         |  50 -------------
 csync/src/vio/csync_vio_handle.h         |   3 +-
 csync/src/vio/csync_vio_handle_private.h |   9 ---
 csync/src/vio/csync_vio_local.c          |   8 +--
 csync/src/vio/csync_vio_local.h          |   7 +-
 csync/src/vio/csync_vio_method.h         |  88 -----------------------
 csync/src/vio/csync_vio_module.h         |  33 ---------
 14 files changed, 59 insertions(+), 368 deletions(-)

diff --git a/csync/src/CMakeLists.txt b/csync/src/CMakeLists.txt
index 2cb754f..c93dcc6 100644
--- a/csync/src/CMakeLists.txt
+++ b/csync/src/CMakeLists.txt
@@ -67,7 +67,6 @@ set(csync_SRCS
   csync_rename.cc
 
   vio/csync_vio.c
-  vio/csync_vio_handle.c
   vio/csync_vio_file_stat.c
   vio/csync_vio_local.c
 
diff --git a/csync/src/csync.c b/csync/src/csync.c
index 32363fd..04ac8f8 100644
--- a/csync/src/csync.c
+++ b/csync/src/csync.c
@@ -179,42 +179,18 @@ int csync_init(CSYNC *ctx) {
     return 1;
   }
 
+  /* check for uri */
+  if (csync_fnmatch("owncloud://*", ctx->remote.uri, 0) == 0 && csync_fnmatch("ownclouds://*", ctx->remote.uri, 0) == 0) {
+      ctx->status_code = CSYNC_STATUS_NO_MODULE;
+      rc = -1;
+      goto out;
+  }
+
   ctx->local.type = LOCAL_REPLICA;
 
-  /* check for uri */
-  if ( !ctx->options.local_only_mode && csync_fnmatch("*://*", ctx->remote.uri, 0) == 0) {
-    size_t len;
-    len = strstr(ctx->remote.uri, "://") - ctx->remote.uri;
-    /* get protocol */
-    if (len > 0) {
-      char *module = NULL;
-      /* module name */
-      module = c_strndup(ctx->remote.uri, len);
-      if (module == NULL) {
-        rc = -1;
-        ctx->status_code = CSYNC_STATUS_MEMORY_ERROR;
-        goto out;
-      }
-      /* load module */
-retry_vio_init:
-      rc = csync_vio_init(ctx, module, NULL);
-      if (rc < 0) {
-        len = strlen(module);
-
-        if (len > 0 && module[len-1] == 's') {
-          module[len-1] = '\0';
-          goto retry_vio_init;
-        }
-        /* Now vio init finally failed which means a module could not be found. */
-	CSYNC_LOG(CSYNC_LOG_PRIORITY_FATAL,
-		  "The csync module %s could not be loaded.", module);
-        SAFE_FREE(module);
-        ctx->status_code = CSYNC_STATUS_NO_MODULE;
-        goto out;
-      }
-      SAFE_FREE(module);
+  if ( !ctx->options.local_only_mode) {
+      owncloud_init(csync_get_auth_callback(ctx), csync_get_userdata(ctx));
       ctx->remote.type = REMOTE_REPLICA;
-    }
   } else {
     ctx->remote.type = LOCAL_REPLICA;
   }
@@ -648,8 +624,6 @@ int csync_destroy(CSYNC *ctx) {
   }
   ctx->statedb.db = NULL;
 
-  csync_vio_shutdown(ctx);
-
   /* destroy exclude list */
   csync_exclude_destroy(ctx);
 
diff --git a/csync/src/csync_owncloud.c b/csync/src/csync_owncloud.c
index 483d048..b3504b4 100644
--- a/csync/src/csync_owncloud.c
+++ b/csync/src/csync_owncloud.c
@@ -786,7 +786,7 @@ static void fill_stat_cache( csync_vio_file_stat_t *lfs ) {
 /*
  * file functions
  */
-static int owncloud_stat(const char *uri, csync_vio_file_stat_t *buf) {
+int owncloud_stat(const char *uri, csync_vio_file_stat_t *buf) {
     /* get props:
      *   modtime
      *   creattime
@@ -894,7 +894,7 @@ static int owncloud_stat(const char *uri, csync_vio_file_stat_t *buf) {
 /*
  * directory functions
  */
-static csync_vio_method_handle_t *owncloud_opendir(const char *uri) {
+csync_vio_handle_t *owncloud_opendir(const char *uri) {
     struct listdir_context *fetchCtx = NULL;
     char *curi = NULL;
 
@@ -932,7 +932,7 @@ static csync_vio_method_handle_t *owncloud_opendir(const char *uri) {
     /* no freeing of curi because its part of the fetchCtx and gets freed later */
 }
 
-static int owncloud_closedir(csync_vio_method_handle_t *dhandle) {
+int owncloud_closedir(csync_vio_handle_t *dhandle) {
 
     struct listdir_context *fetchCtx = dhandle;
 
@@ -943,10 +943,14 @@ static int owncloud_closedir(csync_vio_method_handle_t *dhandle) {
     return 0;
 }
 
-static csync_vio_file_stat_t *owncloud_readdir(csync_vio_method_handle_t *dhandle) {
-
+csync_vio_file_stat_t *owncloud_readdir(csync_vio_handle_t *dhandle) {
     struct listdir_context *fetchCtx = dhandle;
 
+//    DEBUG_WEBDAV("owncloud_readdir" );
+//    DEBUG_WEBDAV("owncloud_readdir %s ", fetchCtx->target);
+//    DEBUG_WEBDAV("owncloud_readdir %d", fetchCtx->result_count );
+//    DEBUG_WEBDAV("owncloud_readdir %p %p", fetchCtx->currResource, fetchCtx->list );
+
     if( fetchCtx == NULL) {
         /* DEBUG_WEBDAV("An empty dir or at end"); */
         return NULL;
@@ -979,12 +983,12 @@ static csync_vio_file_stat_t *owncloud_readdir(csync_vio_method_handle_t *dhandl
     return NULL;
 }
 
-static char *owncloud_error_string()
+char *owncloud_error_string(void)
 {
     return dav_session.error_string;
 }
 
-static int owncloud_commit() {
+int owncloud_commit(void) {
 
   clean_caches();
 
@@ -1010,7 +1014,7 @@ static int owncloud_commit() {
   return 0;
 }
 
-static int owncloud_set_property(const char *key, void *data) {
+int owncloud_set_property(const char *key, void *data) {
 #define READ_STRING_PROPERTY(P) \
     if (c_streq(key, #P)) { \
         SAFE_FREE(dav_session.P); \
@@ -1081,21 +1085,7 @@ static int owncloud_set_property(const char *key, void *data) {
     return -1;
 }
 
-csync_vio_method_t _method = {
-    .method_table_size = sizeof(csync_vio_method_t),
-    .opendir = owncloud_opendir,
-    .closedir = owncloud_closedir,
-    .readdir = owncloud_readdir,
-    .stat = owncloud_stat,
-    .set_property = owncloud_set_property,
-    .get_error_string = owncloud_error_string,
-    .commit = owncloud_commit,
-};
-
-csync_vio_method_t *vio_module_init(const char *method_name, const char *args,
-                                    csync_auth_callback cb, void *userdata) {
-    (void) method_name;
-    (void) args;
+void owncloud_init(csync_auth_callback cb, void *userdata) {
     (void) userdata;
 
     _authcb = cb;
@@ -1105,14 +1095,6 @@ csync_vio_method_t *vio_module_init(const char *method_name, const char *args,
 
     /* Disable it, Mirall can enable it for the first sync (= no DB)*/
     dav_session.no_recursive_propfind = true;
-
-    return &_method;
-}
-
-void vio_module_shutdown(csync_vio_method_t *method) {
-    (void) method;
-
-    /* DEBUG_WEBDAV( "********** vio_module_shutdown" ); */
 }
 
 /* vim: set ts=4 sw=4 et cindent: */
diff --git a/csync/src/csync_owncloud.h b/csync/src/csync_owncloud.h
index 5541ac8..d051ff7 100644
--- a/csync/src/csync_owncloud.h
+++ b/csync/src/csync_owncloud.h
@@ -56,7 +56,6 @@
 #include "c_private.h"
 #include "httpbf.h"
 
-#include "vio/csync_vio_module.h"
 #include "vio/csync_vio_file_stat.h"
 #include "vio/csync_vio.h"
 
@@ -178,4 +177,14 @@ csync_vio_file_stat_t *resourceToFileStat( struct resource *res );
 
 void oc_notify_progress(const char *file, enum csync_notify_type_e kind, int64_t current_size, int64_t full_size);
 
+// Public API from vio
+csync_vio_handle_t *owncloud_opendir(const char *uri);
+csync_vio_file_stat_t *owncloud_readdir(csync_vio_handle_t *dhandle);
+int owncloud_closedir(csync_vio_handle_t *dhandle);
+int owncloud_stat(const char *uri, csync_vio_file_stat_t *buf);
+int owncloud_commit(void);
+char *owncloud_error_string(void);
+void owncloud_init(csync_auth_callback cb, void *userdata);
+int owncloud_set_property(const char *key, void *data);
+
 #endif /* CSYNC_OWNCLOUD_H */
diff --git a/csync/src/csync_private.h b/csync/src/csync_private.h
index f8a779d..388ff2e 100644
--- a/csync/src/csync_private.h
+++ b/csync/src/csync_private.h
@@ -54,7 +54,6 @@
 #include <sys/iconv.h>
 #endif
 
-#include "vio/csync_vio_method.h"
 #include "csync_macros.h"
 
 /**
@@ -127,11 +126,6 @@ struct csync_s {
   } remote;
 
   struct {
-    csync_vio_method_t *method;
-    csync_vio_method_finish_fn finish_fn;
-  } module;
-
-  struct {
     int sync_symbolic_links;
     char *config_dir;
     bool local_only_mode;
@@ -217,6 +211,7 @@ struct _csync_treewalk_context_s
 };
 typedef struct _csync_treewalk_context_s _csync_treewalk_context;
 
+
 /**
  * }@
  */
diff --git a/csync/src/vio/csync_vio.c b/csync/src/vio/csync_vio.c
index 4617cfd..7a4f42a 100644
--- a/csync/src/vio/csync_vio.c
+++ b/csync/src/vio/csync_vio.c
@@ -33,94 +33,27 @@
 #include "csync_statedb.h"
 #include "std/c_jhash.h"
 
-#ifdef __APPLE__
-#include <mach-o/dyld.h>
-#endif
-
 #define CSYNC_LOG_CATEGORY_NAME "csync.vio.main"
 
-#ifdef _WIN32
-#include <wchar.h>
-#define MODULE_EXTENSION "dll"
-#else
-#define MODULE_EXTENSION "so"
-#endif
-
-#ifdef __APPLE__
-#include <mach-o/dyld.h>
-#endif
-
 #include "csync_log.h"
-
-int csync_vio_init(CSYNC *ctx, const char *module, const char *args) {
-
-  csync_vio_method_t *m = NULL;
-  csync_vio_method_init_fn init_fn;
-
-  /* The owncloud module used to be dynamically loaded, but now it's just statically linked */
-  extern csync_vio_method_t *vio_module_init(const char *method_name, const char *config_args, csync_auth_callback cb, void *userdata);
-  extern void vio_module_shutdown(csync_vio_method_t *);
-  init_fn = vio_module_init;
-  ctx->module.finish_fn = vio_module_shutdown;
-
-  /* get the method struct */
-  m = init_fn(module, args, csync_get_auth_callback(ctx), csync_get_userdata(ctx));
-  if (m == NULL) {
-    CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "module %s returned a NULL method", module);
-    return -1;
-  }
-
-  /* Some basic checks */
-  if (m->method_table_size == 0) {
-    CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "module %s method table size is 0", module);
-    return -1;
-  }
-
-  if (! VIO_METHOD_HAS_FUNC(m, opendir)) {
-    CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "module %s has no opendir fn", module);
-    return -1;
-  }
-
-  ctx->module.method = m;
-
-  return 0;
-}
-
-void csync_vio_shutdown(CSYNC *ctx) {
-    /* shutdown the plugin */
-    if (ctx->module.finish_fn != NULL) {
-      (*ctx->module.finish_fn)(ctx->module.method);
-    }
-
-    ctx->module.method = NULL;
-    ctx->module.finish_fn = NULL;
-}
+#include "csync_owncloud.h"
 
 csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name) {
-  csync_vio_handle_t *h = NULL;
-  csync_vio_method_handle_t *mh = NULL;
-
   switch(ctx->replica) {
     case REMOTE_REPLICA:
       if(ctx->remote.read_from_db) {
           CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "Read from db flag is true, should not!" );
       }
-      mh = ctx->module.method->opendir(name);
+      return owncloud_opendir(name);
       break;
     case LOCAL_REPLICA:
-      mh = csync_vio_local_opendir(name);
+      return csync_vio_local_opendir(name);
       break;
     default:
       CSYNC_LOG(CSYNC_LOG_PRIORITY_ALERT, "Invalid replica (%d)", (int)ctx->replica);
       break;
   }
-
-  h = csync_vio_handle_new(name, mh);
-  if (h == NULL) {
-    return NULL;
-  }
-
-  return h;
+  return NULL;
 }
 
 int csync_vio_closedir(CSYNC *ctx, csync_vio_handle_t *dhandle) {
@@ -136,41 +69,35 @@ int csync_vio_closedir(CSYNC *ctx, csync_vio_handle_t *dhandle) {
       if( ctx->remote.read_from_db ) {
           CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "Remote ReadFromDb is true, should not!");
       }
-      rc = ctx->module.method->closedir(dhandle->method_handle);
+      rc = owncloud_closedir(dhandle);
       break;
   case LOCAL_REPLICA:
-      rc = csync_vio_local_closedir(dhandle->method_handle);
+      rc = csync_vio_local_closedir(dhandle);
       break;
   default:
       CSYNC_LOG(CSYNC_LOG_PRIORITY_ALERT, "Invalid replica (%d)", (int)ctx->replica);
       break;
   }
-
-  SAFE_FREE(dhandle->uri);
-  SAFE_FREE(dhandle);
-
   return rc;
 }
 
 csync_vio_file_stat_t *csync_vio_readdir(CSYNC *ctx, csync_vio_handle_t *dhandle) {
-  csync_vio_file_stat_t *fs = NULL;
-
   switch(ctx->replica) {
     case REMOTE_REPLICA:
       if( ctx->remote.read_from_db ) {
           CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "Remote readfromdb is true, should not!");
       }
-      fs = ctx->module.method->readdir(dhandle->method_handle);
+      return owncloud_readdir(dhandle);
       break;
     case LOCAL_REPLICA:
-      fs = csync_vio_local_readdir(dhandle->method_handle);
+      return csync_vio_local_readdir(dhandle);
       break;
     default:
       CSYNC_LOG(CSYNC_LOG_PRIORITY_ALERT, "Invalid replica (%d)", (int)ctx->replica);
       break;
   }
 
-  return fs;
+  return NULL;
 }
 
 
@@ -179,7 +106,7 @@ int csync_vio_stat(CSYNC *ctx, const char *uri, csync_vio_file_stat_t *buf) {
 
   switch(ctx->replica) {
     case REMOTE_REPLICA:
-      rc = ctx->module.method->stat(uri, buf);
+      rc = owncloud_stat(uri, buf);
       break;
     case LOCAL_REPLICA:
       rc = csync_vio_local_stat(uri, buf);
@@ -202,28 +129,18 @@ int csync_vio_stat(CSYNC *ctx, const char *uri, csync_vio_file_stat_t *buf) {
 
 
 char *csync_vio_get_status_string(CSYNC *ctx) {
-    if(ctx->error_string) {
-        return ctx->error_string;
-    }
-    if(VIO_METHOD_HAS_FUNC(ctx->module.method, get_error_string)) {
-        return ctx->module.method->get_error_string();
-    }
-    return NULL;
+  if(ctx->error_string) {
+    return ctx->error_string;
+  }
+  return owncloud_error_string();
 }
 
 int csync_vio_set_property(CSYNC* ctx, const char* key, void* data) {
-  int rc = -1;
-  if(VIO_METHOD_HAS_FUNC(ctx->module.method, set_property))
-    rc = ctx->module.method->set_property(key, data);
-  return rc;
+  (void) ctx;
+  return owncloud_set_property(key, data);
 }
 
 int csync_vio_commit(CSYNC *ctx) {
-  int rc = 0;
-
-  if (VIO_METHOD_HAS_FUNC(ctx->module.method, commit)) {
-      rc = ctx->module.method->commit();
-  }
-
-  return rc;
+  (void) ctx;
+  return owncloud_commit();
 }
diff --git a/csync/src/vio/csync_vio.h b/csync/src/vio/csync_vio.h
index 1356139..d08ab64 100644
--- a/csync/src/vio/csync_vio.h
+++ b/csync/src/vio/csync_vio.h
@@ -33,9 +33,6 @@ typedef struct fhandle_s {
   int fd;
 } fhandle_t;
 
-int csync_vio_init(CSYNC *ctx, const char *module, const char *args);
-void csync_vio_shutdown(CSYNC *ctx);
-
 csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name);
 int csync_vio_closedir(CSYNC *ctx, csync_vio_handle_t *dhandle);
 csync_vio_file_stat_t *csync_vio_readdir(CSYNC *ctx, csync_vio_handle_t *dhandle);
diff --git a/csync/src/vio/csync_vio_handle.c b/csync/src/vio/csync_vio_handle.c
deleted file mode 100644
index cd798e8..0000000
--- a/csync/src/vio/csync_vio_handle.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * libcsync -- a library to sync a directory with another
- *
- * Copyright (c) 2008-2013 by Andreas Schneider <asn at cryptomilk.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "c_lib.h"
-
-#include "vio/csync_vio_handle_private.h"
-
-csync_vio_handle_t *csync_vio_handle_new(const char *uri, csync_vio_method_handle_t *method_handle) {
-  csync_vio_handle_t *new = NULL;
-
-  if (uri == NULL || method_handle == NULL) {
-    return NULL;
-  }
-
-  new = c_malloc(sizeof(csync_vio_handle_t));
-  if (new == NULL) {
-    return NULL;
-  }
-
-  new->uri = c_strdup(uri);
-  new->method_handle = method_handle;
-
-  return new;
-}
-
-void csync_vio_handle_destroy(csync_vio_handle_t *handle) {
-  if (handle == NULL || handle->uri == NULL) {
-    return;
-  }
-
-  SAFE_FREE(handle->uri);
-  SAFE_FREE(handle);
-}
diff --git a/csync/src/vio/csync_vio_handle.h b/csync/src/vio/csync_vio_handle.h
index f06674e..32ae48b 100644
--- a/csync/src/vio/csync_vio_handle.h
+++ b/csync/src/vio/csync_vio_handle.h
@@ -21,7 +21,6 @@
 #ifndef _CSYNC_VIO_HANDLE_H
 #define _CSYNC_VIO_HANDLE_H
 
-typedef void csync_vio_method_handle_t;
-typedef struct csync_vio_handle_s csync_vio_handle_t;
+typedef void csync_vio_handle_t;
 
 #endif /* _CSYNC_VIO_HANDLE_H */
diff --git a/csync/src/vio/csync_vio_handle_private.h b/csync/src/vio/csync_vio_handle_private.h
index 83c6498..b42a19f 100644
--- a/csync/src/vio/csync_vio_handle_private.h
+++ b/csync/src/vio/csync_vio_handle_private.h
@@ -23,13 +23,4 @@
 
 #include "vio/csync_vio_handle.h"
 
-struct csync_vio_handle_s {
-  char *uri;
-
-  csync_vio_method_handle_t *method_handle;
-};
-
-csync_vio_handle_t *csync_vio_handle_new(const char *uri, csync_vio_method_handle_t *method_handle);
-void csync_vio_handle_destroy(csync_vio_handle_t *handle);
-
 #endif /* _CSYNC_VIO_HANDLE_PRIVATE_H */
diff --git a/csync/src/vio/csync_vio_local.c b/csync/src/vio/csync_vio_local.c
index 2fb59b8..bf8f622 100644
--- a/csync/src/vio/csync_vio_local.c
+++ b/csync/src/vio/csync_vio_local.c
@@ -50,7 +50,7 @@ typedef struct dhandle_s {
   char *path;
 } dhandle_t;
 
-csync_vio_method_handle_t *csync_vio_local_opendir(const char *name) {
+csync_vio_handle_t *csync_vio_local_opendir(const char *name) {
   dhandle_t *handle = NULL;
   mbchar_t *dirname = c_utf8_to_locale(name);
 
@@ -70,10 +70,10 @@ csync_vio_method_handle_t *csync_vio_local_opendir(const char *name) {
   handle->path = c_strdup(name);
   c_free_locale_string(dirname);
 
-  return (csync_vio_method_handle_t *) handle;
+  return (csync_vio_handle_t *) handle;
 }
 
-int csync_vio_local_closedir(csync_vio_method_handle_t *dhandle) {
+int csync_vio_local_closedir(csync_vio_handle_t *dhandle) {
   dhandle_t *handle = NULL;
   int rc = -1;
 
@@ -91,7 +91,7 @@ int csync_vio_local_closedir(csync_vio_method_handle_t *dhandle) {
   return rc;
 }
 
-csync_vio_file_stat_t *csync_vio_local_readdir(csync_vio_method_handle_t *dhandle) {
+csync_vio_file_stat_t *csync_vio_local_readdir(csync_vio_handle_t *dhandle) {
   struct _tdirent *dirent = NULL;
 
   dhandle_t *handle = NULL;
diff --git a/csync/src/vio/csync_vio_local.h b/csync/src/vio/csync_vio_local.h
index 68f87d8..dcd12ad 100644
--- a/csync/src/vio/csync_vio_local.h
+++ b/csync/src/vio/csync_vio_local.h
@@ -21,12 +21,11 @@
 #ifndef _CSYNC_VIO_LOCAL_H
 #define _CSYNC_VIO_LOCAL_H
 
-#include "vio/csync_vio_method.h"
 #include <sys/time.h>
 
-csync_vio_method_handle_t *csync_vio_local_opendir(const char *name);
-int csync_vio_local_closedir(csync_vio_method_handle_t *dhandle);
-csync_vio_file_stat_t *csync_vio_local_readdir(csync_vio_method_handle_t *dhandle);
+csync_vio_handle_t *csync_vio_local_opendir(const char *name);
+int csync_vio_local_closedir(csync_vio_handle_t *dhandle);
+csync_vio_file_stat_t *csync_vio_local_readdir(csync_vio_handle_t *dhandle);
 
 int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf);
 
diff --git a/csync/src/vio/csync_vio_method.h b/csync/src/vio/csync_vio_method.h
deleted file mode 100644
index 9aef7c1..0000000
--- a/csync/src/vio/csync_vio_method.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * cynapses libc functions
- *
- * Copyright (c) 2008-2013 by Andreas Schneider <asn at cryptomilk.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CSYNC_VIO_METHOD_H
-#define _CSYNC_VIO_METHOD_H
-
-#include <sys/time.h>
-
-#include "csync.h"
-#include "vio/csync_vio_file_stat.h"
-#include "vio/csync_vio_handle.h"
-
-#define VIO_METHOD_HAS_FUNC(method,func) \
-  (method != NULL && method->func != NULL \
-   && ((size_t)(((char *)&((method)->func)) - ((char *)(method))) < (method)->method_table_size))
-
-typedef struct csync_vio_method_s csync_vio_method_t;
-
-typedef csync_vio_method_t *(*csync_vio_method_init_fn)(const char *method_name,
-    const char *config_args, csync_auth_callback cb, void *userdata);
-typedef void (*csync_vio_method_finish_fn)(csync_vio_method_t *method);
-
-typedef csync_vio_method_handle_t *(*csync_method_open_fn)(const char *durl, int flags, mode_t mode);
-typedef csync_vio_method_handle_t *(*csync_method_creat_fn)(const char *durl, mode_t mode);
-typedef int (*csync_method_close_fn)(csync_vio_method_handle_t *fhandle);
-typedef ssize_t (*csync_method_read_fn)(csync_vio_method_handle_t *fhandle, void *buf, size_t count);
-typedef ssize_t (*csync_method_write_fn)(csync_vio_method_handle_t *fhandle, const void *buf, size_t count);
-typedef int (*csync_method_sendfile_fn)(csync_vio_method_handle_t *src, csync_vio_method_handle_t *dst);
-typedef int64_t (*csync_method_lseek_fn)(csync_vio_method_handle_t *fhandle, int64_t offset, int whence);
-
-typedef csync_vio_method_handle_t *(*csync_method_opendir_fn)(const char *name);
-typedef int (*csync_method_closedir_fn)(csync_vio_method_handle_t *dhandle);
-typedef csync_vio_file_stat_t *(*csync_method_readdir_fn)(csync_vio_method_handle_t *dhandle);
-
-typedef int (*csync_method_mkdir_fn)(const char *uri, mode_t mode);
-typedef int (*csync_method_rmdir_fn)(const char *uri);
-
-typedef int (*csync_method_stat_fn)(const char *uri, csync_vio_file_stat_t *buf);
-typedef int (*csync_method_rename_fn)(const char *olduri, const char *newuri);
-typedef int (*csync_method_unlink_fn)(const char *uri);
-
-typedef int (*csync_method_chmod_fn)(const char *uri, mode_t mode);
-typedef int (*csync_method_chown_fn)(const char *uri, uid_t owner, gid_t group);
-
-typedef int (*csync_method_utimes_fn)(const char *uri, const struct timeval times[2]);
-
-typedef int (*csync_method_set_property_fn)(const char *key, void *data);
-
-typedef char* (*csync_method_get_error_string_fn)();
-
-typedef int (*csync_method_commit_fn)();
-
-typedef int (*csync_method_get_fn)(csync_vio_method_handle_t *flocal,
-                                   csync_vio_method_handle_t *fremote,
-                                   csync_vio_file_stat_t *st);
-typedef int (*csync_method_put_fn)(csync_vio_method_handle_t *flocal,
-                                   csync_vio_method_handle_t *fremote,
-                                   csync_vio_file_stat_t *st);
-
-struct csync_vio_method_s {
-  size_t method_table_size;           /* Used for versioning */
-  csync_method_opendir_fn opendir;
-  csync_method_closedir_fn closedir;
-  csync_method_readdir_fn readdir;
-  csync_method_stat_fn stat;
-  csync_method_set_property_fn set_property;
-  csync_method_get_error_string_fn get_error_string;
-  csync_method_commit_fn commit;
-};
-
-#endif /* _CSYNC_VIO_H */
diff --git a/csync/src/vio/csync_vio_module.h b/csync/src/vio/csync_vio_module.h
deleted file mode 100644
index c8abcb4..0000000
--- a/csync/src/vio/csync_vio_module.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * cynapses libc functions
- *
- * Copyright (c) 2008-2013 by Andreas Schneider <asn at cryptomilk.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CSYNC_VIO_MODULE_H
-#define _CSYNC_VIO_MODULE_H
-
-#include "vio/csync_vio_method.h"
-
-extern csync_vio_method_t *vio_module_init(const char *method_name,
-    const char *args, csync_auth_callback cb, void *userdata);
-extern void vio_module_shutdown(csync_vio_method_t *method);
-
-extern int csync_vio_getfd(csync_vio_handle_t *hnd);
-
-
-#endif /* _CSYNC_VIO_MODULE_H */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list