[Pkg-owncloud-commits] [owncloud-client] 81/333: csync: Remove unused vio stuff

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:16:37 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 0d34a2bca5181d732f0f0e977b6b6a775c386ad2
Author: Markus Goetz <markus at woboq.com>
Date:   Thu Feb 27 13:24:06 2014 +0100

    csync: Remove unused vio stuff
---
 csync/src/vio/csync_vio.c       | 153 ----------------------------------------
 csync/src/vio/csync_vio.h       |   9 +--
 csync/src/vio/csync_vio_local.c | 122 --------------------------------
 csync/src/vio/csync_vio_local.h |   9 ---
 4 files changed, 1 insertion(+), 292 deletions(-)

diff --git a/csync/src/vio/csync_vio.c b/csync/src/vio/csync_vio.c
index c606a62..04d2b42 100644
--- a/csync/src/vio/csync_vio.c
+++ b/csync/src/vio/csync_vio.c
@@ -133,95 +133,6 @@ void csync_vio_shutdown(CSYNC *ctx) {
     ctx->module.finish_fn = NULL;
 }
 
-csync_vio_handle_t *csync_vio_open(CSYNC *ctx, const char *uri, int flags, mode_t mode) {
-  csync_vio_handle_t *h = NULL;
-  csync_vio_method_handle_t *mh = NULL;
-
-  switch(ctx->replica) {
-    case REMOTE_REPLICA:
-      mh = ctx->module.method->open(uri, flags, mode);
-      break;
-    case LOCAL_REPLICA:
-      mh = csync_vio_local_open(uri, flags, mode);
-      break;
-    default:
-      CSYNC_LOG(CSYNC_LOG_PRIORITY_ALERT, "Invalid replica (%d)", (int)ctx->replica);
-      break;
-  }
-
-  h = csync_vio_handle_new(uri, mh);
-  if (h == NULL) {
-    return NULL;
-  }
-
-  return h;
-}
-
-csync_vio_handle_t *csync_vio_creat(CSYNC *ctx, const char *uri, mode_t mode) {
-  csync_vio_handle_t *h = NULL;
-  csync_vio_method_handle_t *mh = NULL;
-
-  switch(ctx->replica) {
-    case REMOTE_REPLICA:
-      mh = ctx->module.method->creat(uri, mode);
-      break;
-    case LOCAL_REPLICA:
-      mh = csync_vio_local_creat(uri, mode);
-      break;
-    default:
-      CSYNC_LOG(CSYNC_LOG_PRIORITY_ALERT, "Invalid replica (%d)", (int)ctx->replica);
-      break;
-  }
-
-  h = csync_vio_handle_new(uri, mh);
-  if (h == NULL) {
-    return NULL;
-  }
-
-  return h;
-}
-
-int csync_vio_close(CSYNC *ctx, csync_vio_handle_t *fhandle) {
-  int rc = -1;
-
-  if (fhandle == NULL) {
-    errno = EBADF;
-    return -1;
-  }
-
-  switch(ctx->replica) {
-    case REMOTE_REPLICA:
-      rc = ctx->module.method->close(fhandle->method_handle);
-      break;
-    case LOCAL_REPLICA:
-      rc = csync_vio_local_close(fhandle->method_handle);
-      break;
-    default:
-      CSYNC_LOG(CSYNC_LOG_PRIORITY_ALERT, "Invalid replica (%d)", (int)ctx->replica);
-      break;
-  }
-
-  /* handle->method_handle is free'd by the above close */
-  SAFE_FREE(fhandle->uri);
-  SAFE_FREE(fhandle);
-
-  return rc;
-}
-
-int csync_vio_getfd(csync_vio_handle_t *fhandle) {
-  int fd = -1;
-
-  if (fhandle == NULL) {
-    errno = EBADF;
-    return -1;
-  }
-
-  fd = csync_vio_local_getfd( fhandle );
-  // Return the correct handle here.
-  return fd;
-
-}
-
 int csync_vio_put(CSYNC *ctx,
                   csync_vio_handle_t *flocal,
                   csync_vio_handle_t *fremote,
@@ -268,52 +179,6 @@ int csync_vio_get(CSYNC *ctx,
   return rc;
 }
 
-ssize_t csync_vio_read(CSYNC *ctx, csync_vio_handle_t *fhandle, void *buf, size_t count) {
-  ssize_t rs = 0;
-
-  if (fhandle == NULL) {
-    errno = EBADF;
-    return -1;
-  }
-
-  switch(ctx->replica) {
-    case REMOTE_REPLICA:
-      rs = ctx->module.method->read(fhandle->method_handle, buf, count);
-      break;
-    case LOCAL_REPLICA:
-      rs = csync_vio_local_read(fhandle->method_handle, buf, count);
-      break;
-    default:
-      CSYNC_LOG(CSYNC_LOG_PRIORITY_ALERT, "Invalid replica (%d)", (int)ctx->replica);
-      break;
-  }
-
-  return rs;
-}
-
-ssize_t csync_vio_write(CSYNC *ctx, csync_vio_handle_t *fhandle, const void *buf, size_t count) {
-  ssize_t rs = 0;
-
-  if (fhandle == NULL) {
-    errno = EBADF;
-    return -1;
-  }
-
-  switch(ctx->replica) {
-    case REMOTE_REPLICA:
-      rs = ctx->module.method->write(fhandle->method_handle, buf, count);
-      break;
-    case LOCAL_REPLICA:
-      rs = csync_vio_local_write(fhandle->method_handle, buf, count);
-      break;
-    default:
-      CSYNC_LOG(CSYNC_LOG_PRIORITY_ALERT, "Invalid replica (%d)", (int)ctx->replica);
-      break;
-  }
-
-  return rs;
-}
-
 int csync_vio_sendfile(CSYNC *ctx, csync_vio_handle_t *sfp, csync_vio_handle_t *dst) {
     int rc = 0;
 
@@ -332,24 +197,6 @@ int csync_vio_sendfile(CSYNC *ctx, csync_vio_handle_t *sfp, csync_vio_handle_t *
     return rc;
 }
 
-int64_t csync_vio_lseek(CSYNC *ctx, csync_vio_handle_t *fhandle, int64_t offset, int whence) {
-  int64_t ro = 0;
-
-  switch(ctx->replica) {
-    case REMOTE_REPLICA:
-      ro = ctx->module.method->lseek(fhandle->method_handle, offset, whence);
-      break;
-    case LOCAL_REPLICA:
-      ro = csync_vio_local_lseek(fhandle->method_handle, offset, whence);
-      break;
-    default:
-      CSYNC_LOG(CSYNC_LOG_PRIORITY_ALERT, "Invalid replica (%d)", (int)ctx->replica);
-      break;
-  }
-
-  return ro;
-}
-
 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;
diff --git a/csync/src/vio/csync_vio.h b/csync/src/vio/csync_vio.h
index 43d3fb2..159422a 100644
--- a/csync/src/vio/csync_vio.h
+++ b/csync/src/vio/csync_vio.h
@@ -35,13 +35,8 @@ typedef struct fhandle_s {
 
 int csync_vio_init(CSYNC *ctx, const char *module, const char *args);
 void csync_vio_shutdown(CSYNC *ctx);
-csync_vio_handle_t *csync_vio_open(CSYNC *ctx, const char *uri, int flags, mode_t mode);
-csync_vio_handle_t *csync_vio_creat(CSYNC *ctx, const char *uri, mode_t mode);
-int csync_vio_close(CSYNC *ctx, csync_vio_handle_t *handle);
-ssize_t csync_vio_read(CSYNC *ctx, csync_vio_handle_t *fhandle, void *buf, size_t count);
-ssize_t csync_vio_write(CSYNC *ctx, csync_vio_handle_t *fhandle, const void *buf, size_t count);
+
 int csync_vio_sendfile(CSYNC *ctx,  csync_vio_handle_t *sfp, csync_vio_handle_t *dst);
-int64_t csync_vio_lseek(CSYNC *ctx, csync_vio_handle_t *fhandle, int64_t offset, int whence);
 
 int csync_vio_put(CSYNC *ctx, csync_vio_handle_t *flocal, csync_vio_handle_t *fremote, csync_file_stat_t *st);
 int csync_vio_get(CSYNC *ctx, csync_vio_handle_t *flocal, csync_vio_handle_t *fremote, csync_file_stat_t *st);
@@ -70,6 +65,4 @@ char *csync_vio_get_status_string(CSYNC *ctx);
 
 int csync_vio_commit(CSYNC *ctx);
 
-int csync_vio_getfd(csync_vio_handle_t *fhandle);
-
 #endif /* _CSYNC_VIO_H */
diff --git a/csync/src/vio/csync_vio_local.c b/csync/src/vio/csync_vio_local.c
index 8289123..fe47bfa 100644
--- a/csync/src/vio/csync_vio_local.c
+++ b/csync/src/vio/csync_vio_local.c
@@ -41,128 +41,6 @@
 #include "vio/csync_vio_handle_private.h"
 
 
-int csync_vio_local_getfd(csync_vio_handle_t *hnd)
-{
-    fhandle_t *fh;
-
-    if (hnd == NULL) {
-        return -1;
-    }
-
-    fh = (struct fhandle_s*)(hnd);
-
-    return fh->fd;
-}
-
-/* the url comes in as utf-8 and in windows, it needs to be multibyte. */
-csync_vio_method_handle_t *csync_vio_local_open(const char *durl, int flags, mode_t mode) {
-  fhandle_t *handle = NULL;
-  int fd = -1;
-  mbchar_t *url = c_utf8_to_locale(durl);
-
-  if ((fd = _topen(url, flags, mode)) < 0) {
-    c_free_locale_string(url);
-    return NULL;
-  }
-
-  handle = c_malloc(sizeof(fhandle_t));
-  if (handle == NULL) {
-    c_free_locale_string(url);
-    close(fd);
-    return NULL;
-  }
-
-  handle->fd = fd;
-
-  c_free_locale_string(url);
-
-  return (csync_vio_method_handle_t *) handle;
-}
-
-csync_vio_method_handle_t *csync_vio_local_creat(const char *durl, mode_t mode) {
-  fhandle_t *handle = NULL;
-  int fd = -1;
-  mbchar_t *url = c_utf8_to_locale(durl);
-
-  if(( fd = _tcreat( url, mode)) < 0) {
-      c_free_locale_string(url);
-      return NULL;
-  }
-
-  handle = c_malloc(sizeof(fhandle_t));
-  if (handle == NULL) {
-    c_free_locale_string(url);
-    close(fd);
-    return NULL;
-  }
-
-  handle->fd = fd;
-  c_free_locale_string(url);
-  return (csync_vio_method_handle_t *) handle;
-}
-
-int csync_vio_local_close(csync_vio_method_handle_t *fhandle) {
-  int rc = -1;
-  fhandle_t *handle = NULL;
-
-  if (fhandle == NULL) {
-    errno = EBADF;
-    return -1;
-  }
-
-  handle = (fhandle_t *) fhandle;
-
-  rc = close(handle->fd);
-
-  SAFE_FREE(handle);
-
-  return rc;
-}
-
-ssize_t csync_vio_local_read(csync_vio_method_handle_t *fhandle, void *buf, size_t count) {
-  fhandle_t *handle = NULL;
-
-  if (fhandle == NULL) {
-    errno = EBADF;
-    return (ssize_t) -1;
-  }
-
-  handle = (fhandle_t *) fhandle;
-
-  return read(handle->fd, buf, count);
-}
-
-ssize_t csync_vio_local_write(csync_vio_method_handle_t *fhandle, const void *buf, size_t count) {
-  ssize_t n = 0;
-  fhandle_t *handle = NULL;
-
-  if (fhandle == NULL) {
-    errno = EBADF;
-    return (ssize_t) -1;
-  }
-
-  handle = (fhandle_t *) fhandle;
-
-  /* safe_write */
-  do {
-    n = write(handle->fd, buf, count);
-  } while (n < 0 && errno == EINTR);
-
-  return n;
-}
-
-int64_t csync_vio_local_lseek(csync_vio_method_handle_t *fhandle, int64_t offset, int whence) {
-  fhandle_t *handle = NULL;
-
-  if (fhandle == NULL) {
-    return (int64_t) -1;
-  }
-
-  handle = (fhandle_t *) fhandle;
-
-  return lseek(handle->fd, offset, whence);
-}
-
 /*
  * directory functions
  */
diff --git a/csync/src/vio/csync_vio_local.h b/csync/src/vio/csync_vio_local.h
index f838a02..3a4afa6 100644
--- a/csync/src/vio/csync_vio_local.h
+++ b/csync/src/vio/csync_vio_local.h
@@ -24,15 +24,6 @@
 #include "vio/csync_vio_method.h"
 #include <sys/time.h>
 
-int csync_vio_local_getfd(csync_vio_handle_t *hnd);
-
-csync_vio_method_handle_t *csync_vio_local_open(const char *durl, int flags, mode_t mode);
-csync_vio_method_handle_t *csync_vio_local_creat(const char *durl, mode_t mode);
-int csync_vio_local_close(csync_vio_method_handle_t *fhandle);
-ssize_t csync_vio_local_read(csync_vio_method_handle_t *fhandle, void *buf, size_t count);
-ssize_t csync_vio_local_write(csync_vio_method_handle_t *fhandle, const void *buf, size_t count);
-int64_t csync_vio_local_lseek(csync_vio_method_handle_t *fhandle, int64_t offset, int whence);
-
 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);

-- 
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