From 6897c5d41f9944aeb0746eaba8dde2d37e7bad6a Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 4 Jun 2014 11:03:02 +0200 Subject: [PATCH] CSync: Always have statedb enabled --- csync/src/csync.c | 52 ----------------------------------------------- csync/src/csync.h | 36 -------------------------------- 2 files changed, 88 deletions(-) diff --git a/csync/src/csync.c b/csync/src/csync.c index 54d35e5b7..40ec1ef7b 100644 --- a/csync/src/csync.c +++ b/csync/src/csync.c @@ -204,7 +204,6 @@ int csync_update(CSYNC *ctx) { ctx->status_code = CSYNC_STATUS_OK; /* create/load statedb */ - if (! csync_is_statedb_disabled(ctx)) { rc = asprintf(&ctx->statedb.file, "%s/.csync_journal.db", ctx->local.uri); if (rc < 0) { @@ -218,7 +217,6 @@ int csync_update(CSYNC *ctx) { rc = -1; return rc; } - } ctx->status_code = CSYNC_STATUS_OK; @@ -681,47 +679,6 @@ void csync_clear_exclude_list(CSYNC *ctx) csync_exclude_clear(ctx); } -int csync_enable_statedb(CSYNC *ctx) { - if (ctx == NULL) { - return -1; - } - ctx->status_code = CSYNC_STATUS_OK; - - if (ctx->status & CSYNC_STATUS_INIT) { - fprintf(stderr, "This function must be called before initialization."); - ctx->status_code = CSYNC_STATUS_CSYNC_STATUS_ERROR; - return -1; - } - - ctx->statedb.disabled = 0; - - return 0; -} - -int csync_disable_statedb(CSYNC *ctx) { - if (ctx == NULL) { - return -1; - } - ctx->status_code = CSYNC_STATUS_OK; - - if (ctx->status & CSYNC_STATUS_INIT) { - fprintf(stderr, "This function must be called before initialization."); - ctx->status_code = CSYNC_STATUS_CSYNC_STATUS_ERROR; - return -1; - } - - ctx->statedb.disabled = 1; - - return 0; -} - -int csync_is_statedb_disabled(CSYNC *ctx) { - if (ctx == NULL) { - return -1; - } - return ctx->statedb.disabled; -} - int csync_set_auth_callback(CSYNC *ctx, csync_auth_callback cb) { if (ctx == NULL || cb == NULL) { return -1; @@ -737,15 +694,6 @@ int csync_set_auth_callback(CSYNC *ctx, csync_auth_callback cb) { return 0; } -const char *csync_get_statedb_file(CSYNC *ctx) { - if (ctx == NULL) { - return NULL; - } - ctx->status_code = CSYNC_STATUS_OK; - - return c_strdup(ctx->statedb.file); -} - void *csync_get_userdata(CSYNC *ctx) { if (ctx == NULL) { return NULL; diff --git a/csync/src/csync.h b/csync/src/csync.h index f4a18167f..4fd46f3d8 100644 --- a/csync/src/csync.h +++ b/csync/src/csync.h @@ -335,33 +335,6 @@ int csync_add_exclude_list(CSYNC *ctx, const char *path); */ void csync_clear_exclude_list(CSYNC *ctx); -/** - * @brief Enable the usage of the statedb. It is enabled by default. - * - * @param ctx The csync context. - * - * @return 0 on success, less than 0 if an error occured. - */ -int csync_enable_statedb(CSYNC *ctx); - -/** - * @brief Disable the usage of the statedb. It is enabled by default. - * - * @param ctx The csync context. - * - * @return 0 on success, less than 0 if an error occured. - */ -int csync_disable_statedb(CSYNC *ctx); - -/** - * @brief Check if the statedb usage is enabled. - * - * @param ctx The csync context. - * - * @return 1 if it is enabled, 0 if it is disabled. - */ -int csync_is_statedb_disabled(CSYNC *ctx); - /** * @brief Get the userdata saved in the context. * @@ -454,15 +427,6 @@ void *csync_get_log_userdata(void); */ int csync_set_log_userdata(void *data); -/** - * @brief Get the path of the statedb file used. - * - * @param ctx The csync context. - * - * @return The path to the statedb file, NULL if an error occured. - */ -const char *csync_get_statedb_file(CSYNC *ctx); - /* Used for special modes or debugging */ CSYNC_STATUS csync_get_status(CSYNC *ctx);