doc
Typedefs | Enumerations | Enumerator | Functions

csync update detection internals

csync internal API
Collaboration diagram for csync update detection internals:

Typedefs

typedef int(* csync_walker_fn )(CSYNC *ctx, const char *file, const csync_vio_file_stat_t *fs, enum csync_ftw_flags_e flag)

Enumerations

enum  csync_ftw_flags_e {
  CSYNC_FTW_FLAG_FILE, CSYNC_FTW_FLAG_DIR, CSYNC_FTW_FLAG_DNR, CSYNC_FTW_FLAG_NSTAT,
  CSYNC_FTW_FLAG_SLINK, CSYNC_FTW_FLAG_SPEC, CSYNC_FTW_FLAG_DP, CSYNC_FTW_FLAG_SLN
}

Functions

int csync_ftw (CSYNC *ctx, const char *uri, csync_walker_fn fn, unsigned int depth)
int csync_walker (CSYNC *ctx, const char *file, const csync_vio_file_stat_t *fs, enum csync_ftw_flags_e flag)

Typedef Documentation

typedef int(* csync_walker_fn)(CSYNC *ctx, const char *file, const csync_vio_file_stat_t *fs, enum csync_ftw_flags_e flag)

Definition at line 55 of file csync_update.h.


Enumeration Type Documentation

Types for files.

Enumerator:
CSYNC_FTW_FLAG_FILE 
CSYNC_FTW_FLAG_DIR 
CSYNC_FTW_FLAG_DNR 
CSYNC_FTW_FLAG_NSTAT 
CSYNC_FTW_FLAG_SLINK 
CSYNC_FTW_FLAG_SPEC 
CSYNC_FTW_FLAG_DP 
CSYNC_FTW_FLAG_SLN 

Definition at line 43 of file csync_update.h.


Function Documentation

int csync_ftw ( CSYNC ctx,
const char *  uri,
csync_walker_fn  fn,
unsigned int  depth 
)

The file tree walker.

This function walks through the directory tree that is located under the uri specified. It calls a walker function which is provided as a function pointer once for each entry in the tree. By default, directories are handled before the files and subdirectories they contain (pre-order traversal).

Parameters:
ctxThe csync context to use.
uriThe uri/path to the directory tree to walk.
fnThe walker function to call once for each entry.
depthThe max depth to walk down the tree.
Returns:
0 on success, < 0 on error. If fn() returns non-zero, then the tree walk is terminated and the value returned by fn() is returned as the result.
int csync_walker ( CSYNC ctx,
const char *  file,
const csync_vio_file_stat_t fs,
enum csync_ftw_flags_e  flag 
)

The walker function to use in the file tree walker.

Parameters:
ctxThe used csync context.
fileThe file we are researching.
fsThe stat information we got.
flagThe flag describing the type of the file.
Returns:
0 on success, < 0 on error.