38 #include <sys/types.h> 45 #define CSYNC_STRINGIFY(s) CSYNC_TOSTRING(s) 46 #define CSYNC_TOSTRING(s) #s 49 #define CSYNC_VERSION_INT(a, b, c) ((a) << 16 | (b) << 8 | (c)) 50 #define CSYNC_VERSION_DOT(a, b, c) a ##.## b ##.## c 51 #define CSYNC_VERSION(a, b, c) CSYNC_VERSION_DOT(a, b, c) 54 #define LIBCSYNC_VERSION_MAJOR 0 55 #define LIBCSYNC_VERSION_MINOR 50 56 #define LIBCSYNC_VERSION_MICRO 0 58 #define LIBCSYNC_VERSION_INT CSYNC_VERSION_INT(LIBCSYNC_VERSION_MAJOR, \ 59 LIBCSYNC_VERSION_MINOR, \ 60 LIBCSYNC_VERSION_MICRO) 61 #define LIBCSYNC_VERSION CSYNC_VERSION(LIBCSYNC_VERSION_MAJOR, \ 62 LIBCSYNC_VERSION_MINOR, \ 63 LIBCSYNC_VERSION_MICRO) 68 #define CSYNC_CONF_DIR ".csync" 69 #define CSYNC_CONF_FILE "csync.conf" 70 #define CSYNC_EXCLUDE_FILE "csync_exclude.conf" 71 #define CSYNC_LOCK_FILE "lock" 125 # define likely(x) (x) 128 # define unlikely(x) (x) 131 #define CSYNC_STATUS_IS_OK(x) (likely((x) == CSYNC_STATUS_OK)) 132 #define CSYNC_STATUS_IS_ERR(x) (unlikely((x) >= CSYNC_STATUS_ERROR)) 133 #define CSYNC_STATUS_IS_EQUAL(x, y) ((x) == (y)) 186 int echo,
int verify,
void *
userdata);
189 const char *
function,
534 int csync_set_iconv_codec(
const char *from);
570 long long o1,
long long o2,
void *
userdata);
csync_auth_callback csync_get_auth_callback(CSYNC *ctx)
Get the authentication callback set.
int csync_get_status(CSYNC *ctx)
int csync_is_statedb_disabled(CSYNC *ctx)
Check if the statedb usage is enabled.
int csync_set_auth_callback(CSYNC *ctx, csync_auth_callback cb)
Set the authentication callback.
int csync_set_file_progress_callback(CSYNC *ctx, csync_file_progress_callback cb)
Set a progress callback for individual files.
int(* csync_auth_callback)(const char *prompt, char *buf, size_t len, int echo, int verify, void *userdata)
int csync_set_log_userdata(void *data)
Set the userdata passed to the logging callback.
const char * csync_get_statedb_file(CSYNC *ctx)
Get the path of the statedb file used.
void * csync_get_log_userdata(void)
get the userdata set for the logging callback.
CSync File Traversal structure.
int csync_set_status(CSYNC *ctx, int status)
int csync_treewalk_visit_func(TREE_WALK_FILE *, void *)
const char * csync_get_status_string(CSYNC *ctx)
Get the csync status string.
void(* csync_log_callback)(int verbosity, const char *function, const char *buffer, void *userdata)
bool csync_status_ok(CSYNC *ctx)
Check internal csync status.
int csync_propagate(CSYNC *ctx)
Propagation.
struct csync_s::@3 remote
enum csync_instructions_e instruction
int csync_reconcile(CSYNC *ctx)
Reconciliation.
int csync_set_local_only(CSYNC *ctx, bool local_only)
Flag to tell csync that only a local run is intended.
csync_status_codes_e
Instruction enum.
int csync_set_module_property(CSYNC *ctx, const char *key, void *value)
Set a property to module.
int csync_walk_local_tree(CSYNC *ctx, csync_treewalk_visit_func *visitor, int filter)
Walk the local file tree and call a visitor function for each file.
int csync_init(CSYNC *ctx)
Initialize the file synchronizer.
int csync_get_log_level(void)
Get the log verbosity.
int csync_set_overall_progress_callback(CSYNC *ctx, csync_overall_progress_callback cb)
Set a progress callback for the overall files.
bool csync_get_local_only(CSYNC *ctx)
Retrieve the flag to tell csync that only a local run is intended.
int csync_disable_statedb(CSYNC *ctx)
Disable the usage of the statedb.
int csync_set_userdata(CSYNC *ctx, void *userdata)
Save userdata to the context which is passed to the auth callback function.
int csync_update(CSYNC *ctx)
Update detection.
int csync_add_exclude_list(CSYNC *ctx, const char *path)
Add an additional exclude list.
int csync_create(CSYNC **csync, const char *local, const char *remote)
Allocate a csync context.
int csync_set_config_dir(CSYNC *ctx, const char *path)
Change the config directory.
enum csync_status_codes_e CSYNC_STATUS
int csync_walk_remote_tree(CSYNC *ctx, csync_treewalk_visit_func *visitor, int filter)
Walk the remote file tree and call a visitor function for each file.
int csync_enable_conflictcopys(CSYNC *ctx)
Enable the creation of backup copys if files are changed on both sides.
int csync_commit(CSYNC *ctx)
Commit the sync results to journal.
void * csync_get_userdata(CSYNC *ctx)
Get the userdata saved in the context.
csync_log_callback csync_get_log_callback(void)
Get the logging callback set.
int csync_set_log_level(int level)
Set the log level.
void(* csync_overall_progress_callback)(const char *file_name, int file_no, int file_cnt, long long o1, long long o2, void *userdata)
Callback definition for overall progress callback.
void(* csync_file_progress_callback)(const char *remote_url, enum csync_notify_type_e kind, long long o1, long long o2, void *userdata)
Callback definition for individual file progress callback.
int csync_destroy(CSYNC *ctx)
Destroy the csync context.
int csync_remove_config_dir(CSYNC *ctx)
Remove the complete config directory.
int csync_set_log_callback(csync_log_callback cb)
Set the logging callback.
int csync_enable_statedb(CSYNC *ctx)
Enable the usage of the statedb.
const char * csync_get_config_dir(CSYNC *ctx)
Get the config directory.
const char * csync_version(int req_version)
Check if csync is the required version or get the version string.