Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

rsync.h File Reference

Main public interface to librsync. More...

#include <sys/types.h>

Include dependency graph for rsync.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define RS_MD4_LENGTH   16
#define RS_DEFAULT_STRONG_LEN   8
#define RS_DEFAULT_BLOCK_LEN   2048

Typedefs

typedef long rs_long_t
 A long integer type that can handle the largest file offsets.
typedef void rs_trace_fn_t (int level, char const *msg)
 Callback to write out log messages.
typedef rs_stats rs_stats_t
 Performance statistics from a librsync encoding or decoding operation.
typedef rs_mdfour rs_mdfour_t
 MD4 message-digest accumulator.
typedef unsigned int rs_weak_sum_t
typedef unsigned char rs_strong_sum_t [RS_MD4_LENGTH]
typedef rs_signature rs_signature_t
typedef rs_buffers_s rs_buffers_t
typedef rs_job rs_job_t
 Job of work to be done.
typedef enum rs_work_options rs_work_options
typedef rs_result rs_driven_cb (rs_job_t *job, rs_buffers_t *buf, void *opaque)
typedef rs_result rs_copy_cb (void *opaque, off_t pos, size_t *len, void **buf)
 Callback used to retrieve parts of the basis file.

Enumerations

enum  rs_loglevel {
  RS_LOG_EMERG = 0, RS_LOG_ALERT = 1, RS_LOG_CRIT = 2, RS_LOG_ERR = 3,
  RS_LOG_WARNING = 4, RS_LOG_NOTICE = 5, RS_LOG_INFO = 6, RS_LOG_DEBUG = 7
}
 Log severity levels. More...
enum  rs_result {
  RS_DONE = 0, RS_BLOCKED = 1, RS_RUNNING = 2, RS_TEST_SKIPPED = 77,
  RS_IO_ERROR = 100, RS_SYNTAX_ERROR = 101, RS_MEM_ERROR = 102, RS_INPUT_ENDED = 103,
  RS_BAD_MAGIC = 104, RS_UNIMPLEMENTED = 105, RS_CORRUPT = 106, RS_INTERNAL_ERROR = 107,
  RS_PARAM_ERROR = 108
}
 Return codes from nonblocking rsync operations. More...
enum  rs_work_options { RS_END = 0x01 }

Functions

void rs_trace_set_level (rs_loglevel level)
void rs_trace_to (rs_trace_fn_t *)
void rs_trace_stderr (int level, char const *msg)
int rs_supports_trace (void)
void rs_hexify (char *to_buf, void const *from_buf, int from_len)
size_t rs_unbase64 (char *s)
void rs_base64 (unsigned char const *buf, int n, char *out)
char const * rs_strerror (rs_result r)
void rs_mdfour (unsigned char *out, void const *in, size_t)
void rs_mdfour_begin (rs_mdfour_t *md)
void rs_mdfour_update (rs_mdfour_t *md, void const *, size_t n)
void rs_mdfour_result (rs_mdfour_t *md, unsigned char *out)
char * rs_format_stats (rs_stats_t const *, char *, size_t)
int rs_log_stats (rs_stats_t const *stats)
void rs_free_sumset (rs_signature_t *)
void rs_sumset_dump (rs_signature_t const *)
rs_result rs_job_iter (rs_job_t *, rs_buffers_t *)
rs_result rs_job_drive (rs_job_t *job, rs_buffers_t *buf, rs_driven_cb in_cb, void *in_opaque, rs_driven_cb out_cb, void *out_opaque)
rs_result rs_job_free (rs_job_t *)
int rs_accum_value (rs_job_t *, char *sum, size_t sum_len)
rs_job_trs_sig_begin (size_t new_block_len, size_t strong_sum_len)
rs_job_trs_delta_begin (rs_signature_t *)
rs_job_trs_loadsig_begin (rs_signature_t **)
rs_job_trs_patch_begin (rs_copy_cb *, void *copy_arg)
rs_result rs_build_hash_table (rs_signature_t *sums)
void rs_mdfour_file (FILE *in_file, char *result)
rs_result rs_sig_file (FILE *old_file, FILE *sig_file, size_t block_len, size_t strong_len, rs_stats_t *)
rs_result rs_loadsig_file (FILE *, rs_signature_t **, rs_stats_t *)
rs_result rs_file_copy_cb (void *arg, off_t pos, size_t *len, void **buf)
rs_result rs_delta_file (rs_signature_t *, FILE *new_file, FILE *delta_file, rs_stats_t *)
rs_result rs_patch_file (FILE *basis_file, FILE *delta_file, FILE *new_file, rs_stats_t *)

Variables

char const rs_librsync_version []
char const rs_licence_string []
int rs_inbuflen
int rs_outbuflen


Detailed Description

Main public interface to librsync.

Author:
Martin Pool <mbp@samba.org>
Version:
librsync-0.9.1
Id
rsync.h,v 1.1.1.1 2002/01/25 22:15:09 kergoth Exp

See intro for an introduction to use of this library.

Definition in file rsync.h.


Define Documentation

#define RS_DEFAULT_BLOCK_LEN   2048
 

Default block length, if not determined by any other factors.

Definition at line 297 of file rsync.h.

#define RS_DEFAULT_STRONG_LEN   8
 

Default length of strong signatures, in bytes. The MD4 checksum is truncated to this size.

Definition at line 294 of file rsync.h.

#define RS_MD4_LENGTH   16
 

Definition at line 204 of file rsync.h.


Typedef Documentation

typedef struct rs_buffers_s rs_buffers_t
 

Stream through which the calling application feeds data to and from the library.

See also:
struct rs_buffers_s

api_buffers

Definition at line 290 of file rsync.h.

typedef rs_result rs_copy_cb(void *opaque, off_t pos, size_t *len, void **buf)
 

Callback used to retrieve parts of the basis file.

Parameters:
pos Position where copying should begin.
len On input, the amount of data that should be retrieved. Updated to show how much is actually available.
buf On input, a buffer of at least *len bytes. May be updated to point to a buffer allocated by the callback if it prefers.

Definition at line 349 of file rsync.h.

typedef rs_result rs_driven_cb(rs_job_t *job, rs_buffers_t *buf, void *opaque)
 

Definition at line 320 of file rsync.h.

struct rs_job rs_job_t
 

Job of work to be done.

Created by functions such as rs_sig_begin(), and then iterated over by rs_job_iter().

Definition at line 306 of file rsync.h.

typedef long rs_long_t
 

A long integer type that can handle the largest file offsets.

Perhaps this might have to be configured to be 'long long', 'long', or something else depending on the platform.

Definition at line 58 of file rsync.h.

struct rs_mdfour rs_mdfour_t
 

MD4 message-digest accumulator.

See also:
rs_mdfour(), rs_mdfour_begin(), rs_mdfour_update(), rs_mdfour_result()

typedef struct rs_signature rs_signature_t
 

Definition at line 220 of file rsync.h.

typedef struct rs_stats rs_stats_t
 

Performance statistics from a librsync encoding or decoding operation.

See also:
rs_format_stats(), rs_log_stats()

typedef unsigned char rs_strong_sum_t[RS_MD4_LENGTH]
 

Definition at line 207 of file rsync.h.

rs_trace_fn_t
 

Callback to write out log messages.

Parameters:
level a syslog level.
msg message to be logged.

Definition at line 88 of file rsync.h.

typedef unsigned int rs_weak_sum_t
 

Definition at line 206 of file rsync.h.

typedef enum rs_work_options rs_work_options
 

Bitmask values that may be passed to the options parameter of rs_work().


Enumeration Type Documentation

enum rs_loglevel
 

Log severity levels.

These are the same as syslog, at least in glibc.

See also:
rs_trace_set_level()
Enumeration values:
RS_LOG_EMERG  System is unusable
RS_LOG_ALERT  Action must be taken immediately
RS_LOG_CRIT  Critical conditions
RS_LOG_ERR  Error conditions
RS_LOG_WARNING  Warning conditions
RS_LOG_NOTICE  Normal but significant condition
RS_LOG_INFO  Informational
RS_LOG_DEBUG  Debug-level messages

Definition at line 69 of file rsync.h.

enum rs_result
 

Return codes from nonblocking rsync operations.

Enumeration values:
RS_DONE  Completed successfully.
RS_BLOCKED  Blocked waiting for more data.
RS_RUNNING  Not yet finished or blocked. This value should never be returned to the caller.
RS_TEST_SKIPPED  Test neither passed or failed.
RS_IO_ERROR  Error in file or network IO.
RS_SYNTAX_ERROR  Command line syntax error.
RS_MEM_ERROR  Out of memory.
RS_INPUT_ENDED  End of input file, possibly unexpected.
RS_BAD_MAGIC  Bad magic number at start of stream. Probably not a librsync file, or possibly the wrong kind of file or from an incompatible library version.
RS_UNIMPLEMENTED  Author is lazy.
RS_CORRUPT  Unbelievable value in stream.
RS_INTERNAL_ERROR  Probably a library bug.
RS_PARAM_ERROR  Bad value passed in to library, probably an application bug.

Definition at line 128 of file rsync.h.

enum rs_work_options
 

Bitmask values that may be passed to the options parameter of rs_work().

Enumeration values:
RS_END  End of input file; please finish up.

Definition at line 312 of file rsync.h.


Function Documentation

int rs_accum_value rs_job_t ,
char *  sum,
size_t  sum_len
 

void rs_base64 unsigned char const *  buf,
int  n,
char *  out
 

Encode a buffer as base64.

rs_result rs_build_hash_table rs_signature_t sums  ) 
 

Referenced by QRsync::generateDiff().

rs_job_t* rs_delta_begin rs_signature_t  ) 
 

rs_result rs_delta_file rs_signature_t ,
FILE *  new_file,
FILE *  delta_file,
rs_stats_t
 

Referenced by QRsync::generateDiff().

rs_result rs_file_copy_cb void *  arg,
off_t  pos,
size_t *  len,
void **  buf
 

char* rs_format_stats rs_stats_t const *  ,
char *  ,
size_t 
 

void rs_free_sumset rs_signature_t  ) 
 

Referenced by QRsync::generateDiff().

void rs_hexify char *  to_buf,
void const *  from_buf,
int  from_len
 

Convert FROM_LEN bytes at FROM_BUF into a hex representation in TO_BUF, which must be twice as long plus one byte for the null terminator.

rs_result rs_job_drive rs_job_t job,
rs_buffers_t buf,
rs_driven_cb  in_cb,
void *  in_opaque,
rs_driven_cb  out_cb,
void *  out_opaque
 

rs_result rs_job_free rs_job_t  ) 
 

rs_result rs_job_iter rs_job_t ,
rs_buffers_t
 

rs_job_t* rs_loadsig_begin rs_signature_t **   ) 
 

rs_result rs_loadsig_file FILE *  ,
rs_signature_t **  ,
rs_stats_t
 

Referenced by QRsync::generateDiff().

int rs_log_stats rs_stats_t const *  stats  ) 
 

void rs_mdfour unsigned char *  out,
void const *  in,
size_t 
 

void rs_mdfour_begin rs_mdfour_t md  ) 
 

void rs_mdfour_file FILE *  in_file,
char *  result
 

Calculate the MD4 sum of a file.

Parameters:
result Binary (not hex) MD4 of the whole contents of the file.

void rs_mdfour_result rs_mdfour_t md,
unsigned char *  out
 

void rs_mdfour_update rs_mdfour_t md,
void const *  ,
size_t  n
 

rs_job_t* rs_patch_begin rs_copy_cb ,
void *  copy_arg
 

rs_result rs_patch_file FILE *  basis_file,
FILE *  delta_file,
FILE *  new_file,
rs_stats_t
 

Referenced by QRsync::applyDiff().

rs_job_t* rs_sig_begin size_t  new_block_len,
size_t  strong_sum_len
 

rs_result rs_sig_file FILE *  old_file,
FILE *  sig_file,
size_t  block_len,
size_t  strong_len,
rs_stats_t
 

Referenced by QRsync::generateSignature().

char const* rs_strerror rs_result  r  ) 
 

Return an English description of a rs_result value.

void rs_sumset_dump rs_signature_t const *   ) 
 

int rs_supports_trace void   ) 
 

Check whether the library was compiled with debugging trace suport.

void rs_trace_set_level rs_loglevel  level  ) 
 

void rs_trace_stderr int  level,
char const *  msg
 

Default trace callback that writes to stderr. Implements rs_trace_fn_t, and may be passed to rs_trace_to().

void rs_trace_to rs_trace_fn_t  ) 
 

Set trace callback.

size_t rs_unbase64 char *  s  ) 
 

Decode a base64 buffer in place.

Returns:
the number of binary bytes.


Variable Documentation

int rs_inbuflen
 

Buffer sizes for file IO.

You probably only need to change these in testing.

char const rs_librsync_version[]
 

char const rs_licence_string[]
 

int rs_outbuflen
 

Buffer sizes for file IO.

You probably only need to change these in testing.


Generated on Sat Nov 5 17:25:02 2005 for OPIE by  doxygen 1.4.2