doc
csync.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/types.h>
#include <config.h>

Go to the source code of this file.

Data Structures

struct  csync_tree_walk_file_s
 

Macros

#define CSYNC_CONF_DIR   ".csync"
 
#define CSYNC_CONF_FILE   "csync.conf"
 
#define CSYNC_EXCLUDE_FILE   "csync_exclude.conf"
 
#define CSYNC_LOCK_FILE   "lock"
 
#define CSYNC_STATUS_IS_EQUAL(x, y)
 
#define CSYNC_STATUS_IS_ERR(x)
 
#define CSYNC_STATUS_IS_OK(x)
 
#define CSYNC_STRINGIFY(s)
 
#define CSYNC_TOSTRING(s)
 
#define CSYNC_VERSION(a, b, c)
 
#define CSYNC_VERSION_DOT(a, b, c)
 
#define CSYNC_VERSION_INT(a, b, c)
 
#define LIBCSYNC_VERSION
 
#define LIBCSYNC_VERSION_INT
 
#define LIBCSYNC_VERSION_MAJOR   0
 
#define LIBCSYNC_VERSION_MICRO   0
 
#define LIBCSYNC_VERSION_MINOR   50
 
#define likely(x)
 
#define unlikely(x)
 

Typedefs

typedef struct csync_s CSYNC
 
typedef int(* csync_auth_callback) (const char *prompt, char *buf, size_t len, int echo, int verify, void *userdata)
 
typedef void(* csync_file_progress_callback) (const char *remote_url, enum csync_notify_type_e kind, long long o1, long long o2, void *userdata)
 
typedef void(* csync_log_callback) (int verbosity, const char *function, const char *buffer, void *userdata)
 
typedef void(* csync_overall_progress_callback) (const char *file_name, int file_no, int file_cnt, long long o1, long long o2, void *userdata)
 
typedef enum csync_status_codes_e CSYNC_STATUS
 
typedef int csync_treewalk_visit_func(TREE_WALK_FILE *, void *)
 
typedef struct csync_tree_walk_file_s TREE_WALK_FILE
 

Enumerations

enum  csync_instructions_e {
  CSYNC_INSTRUCTION_NONE = 0x00000000 , CSYNC_INSTRUCTION_EVAL = 0x00000001 , CSYNC_INSTRUCTION_REMOVE = 0x00000002 , CSYNC_INSTRUCTION_RENAME = 0x00000004 ,
  CSYNC_INSTRUCTION_NEW = 0x00000008 , CSYNC_INSTRUCTION_CONFLICT = 0x00000010 , CSYNC_INSTRUCTION_IGNORE = 0x00000020 , CSYNC_INSTRUCTION_SYNC = 0x00000040 ,
  CSYNC_INSTRUCTION_STAT_ERROR = 0x00000080 , CSYNC_INSTRUCTION_ERROR = 0x00000100 , CSYNC_INSTRUCTION_DELETED = 0x00000200 , CSYNC_INSTRUCTION_UPDATED = 0x00000400
}
 
enum  csync_notify_type_e {
  CSYNC_NOTIFY_START_DOWNLOAD , CSYNC_NOTIFY_START_UPLOAD , CSYNC_NOTIFY_PROGRESS , CSYNC_NOTIFY_FINISHED_DOWNLOAD ,
  CSYNC_NOTIFY_FINISHED_UPLOAD
}
 
enum  csync_status_codes_e {
  CSYNC_STATUS_OK = 0 , CSYNC_STATUS_ERROR = 1024 , CSYNC_STATUS_UNSUCCESSFUL , CSYNC_STATUS_NO_LOCK ,
  CSYNC_STATUS_STATEDB_LOAD_ERROR , CSYNC_STATUS_STATEDB_WRITE_ERROR , CSYNC_STATUS_NO_MODULE , CSYNC_STATUS_TIMESKEW ,
  CSYNC_STATUS_FILESYSTEM_UNKNOWN , CSYNC_STATUS_TREE_ERROR , CSYNC_STATUS_MEMORY_ERROR , CSYNC_STATUS_PARAM_ERROR ,
  CSYNC_STATUS_UPDATE_ERROR , CSYNC_STATUS_RECONCILE_ERROR , CSYNC_STATUS_PROPAGATE_ERROR , CSYNC_STATUS_REMOTE_ACCESS_ERROR ,
  CSYNC_STATUS_REMOTE_CREATE_ERROR , CSYNC_STATUS_REMOTE_STAT_ERROR , CSYNC_STATUS_LOCAL_CREATE_ERROR , CSYNC_STATUS_LOCAL_STAT_ERROR ,
  CSYNC_STATUS_PROXY_ERROR , CSYNC_STATUS_LOOKUP_ERROR , CSYNC_STATUS_SERVER_AUTH_ERROR , CSYNC_STATUS_PROXY_AUTH_ERROR ,
  CSYNC_STATUS_CONNECT_ERROR , CSYNC_STATUS_TIMEOUT , CSYNC_STATUS_HTTP_ERROR , CSYNC_STATUS_PERMISSION_DENIED ,
  CSYNC_STATUS_NOT_FOUND , CSYNC_STATUS_FILE_EXISTS , CSYNC_STATUS_OUT_OF_SPACE , CSYNC_STATUS_QUOTA_EXCEEDED ,
  CSYNC_STATUS_SERVICE_UNAVAILABLE , CSYNC_STATUS_FILE_SIZE_ERROR , CSYNC_STATUS_CONTEXT_LOST , CSYNC_STATUS_MERGE_FILETREE_ERROR ,
  CSYNC_STATUS_CSYNC_STATUS_ERROR , CSYNC_STATUS_OPENDIR_ERROR , CSYNC_STATUS_READDIR_ERROR , CSYNC_STATUS_OPEN_ERROR
}
 

Functions

int csync_add_exclude_list (CSYNC *ctx, const char *path)
 
int csync_commit (CSYNC *ctx)
 
int csync_create (CSYNC **csync, const char *local, const char *remote)
 
int csync_destroy (CSYNC *ctx)
 
int csync_disable_statedb (CSYNC *ctx)
 
int csync_enable_conflictcopys (CSYNC *ctx)
 
int csync_enable_statedb (CSYNC *ctx)
 
csync_auth_callback csync_get_auth_callback (CSYNC *ctx)
 
const char * csync_get_config_dir (CSYNC *ctx)
 
bool csync_get_local_only (CSYNC *ctx)
 
csync_log_callback csync_get_log_callback (void)
 
int csync_get_log_level (void)
 
void * csync_get_log_userdata (void)
 
const char * csync_get_statedb_file (CSYNC *ctx)
 
int csync_get_status (CSYNC *ctx)
 
const char * csync_get_status_string (CSYNC *ctx)
 
void * csync_get_userdata (CSYNC *ctx)
 
int csync_init (CSYNC *ctx)
 
int csync_is_statedb_disabled (CSYNC *ctx)
 
int csync_propagate (CSYNC *ctx)
 
int csync_reconcile (CSYNC *ctx)
 
int csync_remove_config_dir (CSYNC *ctx)
 
int csync_set_auth_callback (CSYNC *ctx, csync_auth_callback cb)
 
int csync_set_config_dir (CSYNC *ctx, const char *path)
 
int csync_set_file_progress_callback (CSYNC *ctx, csync_file_progress_callback cb)
 
int csync_set_local_only (CSYNC *ctx, bool local_only)
 
int csync_set_log_callback (csync_log_callback cb)
 
int csync_set_log_level (int level)
 
int csync_set_log_userdata (void *data)
 
int csync_set_module_property (CSYNC *ctx, const char *key, void *value)
 
int csync_set_overall_progress_callback (CSYNC *ctx, csync_overall_progress_callback cb)
 
int csync_set_status (CSYNC *ctx, int status)
 
int csync_set_userdata (CSYNC *ctx, void *userdata)
 
bool csync_status_ok (CSYNC *ctx)
 
int csync_update (CSYNC *ctx)
 
const char * csync_version (int req_version)
 
int csync_walk_local_tree (CSYNC *ctx, csync_treewalk_visit_func *visitor, int filter)
 
int csync_walk_remote_tree (CSYNC *ctx, csync_treewalk_visit_func *visitor, int filter)
 

Detailed Description

Application developer interface for csync.

Definition in file csync.h.