Data Structures | |
struct | rs_stats |
Performance statistics from a librsync encoding or decoding operation. More... | |
struct | rs_mdfour |
struct | rs_buffers_s |
Stream through which the calling application feeds data to and from the library. More... | |
Defines | |
#define | RS_MD4_LENGTH 16 |
#define | RS_DEFAULT_STRONG_LEN 8 |
Default length of strong signatures, in bytes. More... | |
#define | RS_DEFAULT_BLOCK_LEN 2048 |
Default block length, if not determined by any other factors. More... | |
Typedefs | |
typedef long | rs_long_t |
A long integer type that can handle the largest file offsets. More... | |
typedef void | rs_trace_fn_t (int level, char const *msg) |
Callback to write out log messages. More... | |
typedef struct rs_stats | rs_stats_t |
Performance statistics from a librsync encoding or decoding operation. More... | |
typedef struct rs_mdfour | rs_mdfour_t |
MD4 message-digest accumulator. More... | |
typedef unsigned int | rs_weak_sum_t |
typedef unsigned char | rs_strong_sum_t [RS_MD4_LENGTH] |
typedef struct rs_signature | rs_signature_t |
typedef struct rs_buffers_s | rs_buffers_t |
Stream through which the calling application feeds data to and from the library. More... | |
typedef struct rs_job | rs_job_t |
Job of work to be done. More... | |
typedef enum rs_work_options | rs_work_options |
Bitmask values that may be passed to the options parameter of rs_work(). More... | |
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. More... | |
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 } |
Bitmask values that may be passed to the options parameter of rs_work(). More... | |
Functions | |
void | rs_trace_set_level (rs_loglevel level) |
Set the least important message severity that will be output. More... | |
void | rs_trace_to (rs_trace_fn_t *) |
Set trace callback. More... | |
void | rs_trace_stderr (int level, char const *msg) |
Default trace callback that writes to stderr. More... | |
int | rs_supports_trace (void) |
Check whether the library was compiled with debugging trace suport. More... | |
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. More... | |
size_t | rs_unbase64 (char *s) |
Decode a base64 buffer in place. More... | |
void | rs_base64 (unsigned char const *buf, int n, char *out) |
Encode a buffer as base64. More... | |
char const* | rs_strerror (rs_result r) |
Return an English description of a rs_result value. More... | |
void | rs_mdfour (unsigned char *out, void const *in, int n) |
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) |
Return a human-readable representation of statistics. More... | |
int | rs_log_stats (rs_stats_t const *stats) |
void | rs_free_sumset (rs_signature_t *) |
Deep deallocation of checksums. More... | |
void | rs_sumset_dump (rs_signature_t const *) |
Dump signatures to the log. More... | |
rs_result | rs_job_iter (rs_job_t *, rs_buffers_t *) |
Run a rs_job_t state machine until it blocks (RS_BLOCKED), returns an error, or completes (RS_COMPLETE). More... | |
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) |
Actively process a job, by making callbacks to fill and empty the buffers until the job is done. More... | |
rs_result | rs_job_free (rs_job_t *) |
int | rs_accum_value (rs_job_t *, char *sum, size_t sum_len) |
rs_job_t* | rs_sig_begin (size_t new_block_len, size_t strong_sum_len) |
Set up a new encoding job. More... | |
rs_job_t* | rs_delta_begin (rs_signature_t *) |
Prepare to compute a streaming delta. More... | |
rs_job_t* | rs_loadsig_begin (rs_signature_t **) |
Read a signature from a file into an rs_signature_t structure in memory. More... | |
rs_job_t* | rs_patch_begin (rs_copy_cb *, void *copy_arg) |
Apply a delta to a basis to recreate the new file. More... | |
rs_result | rs_build_hash_table (rs_signature_t *sums) |
void | rs_mdfour_file (FILE *in_file, char *result) |
Calculate the MD4 sum of a file. More... | |
rs_result | rs_sig_file (FILE *old_file, FILE *sig_file, size_t, size_t) |
Generate the signature of a basis file, and write it out to another. More... | |
rs_result | rs_loadsig_file (FILE *sig_file, rs_signature_t **sumset) |
Load signatures from a signature file into memory. More... | |
rs_result | rs_file_copy_cb (void *arg, off_t pos, size_t *len, void **buf) |
Default copy implementation that retrieves a part of a stdio file. More... | |
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 [] = (PACKAGE " " VERSION) |
Library version string. More... | |
char const | rs_licence_string [] |
int | rs_inbuflen |
Buffer sizes for file IO. More... | |
int | rs_outbuflen |
Buffer sizes for file IO. More... |
See Introduction for an introduction to use of this library.
|
Default length of strong signatures, in bytes. The MD4 checksum is truncated to this size. |
|
Default block length, if not determined by any other factors.
|
|
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. |
|
Callback to write out log messages.
|
|
Performance statistics from a librsync encoding or decoding operation.
|
|
MD4 message-digest accumulator.
|
|
Stream through which the calling application feeds data to and from the library.
|
|
Job of work to be done. Created by functions such as rs_sig_begin(), and then iterated over by rs_job_iter(). |
|
Bitmask values that may be passed to the options parameter of rs_work().
|
|
Callback used to retrieve parts of the basis file.
|
|
Log severity levels. These are the same as syslog, at least in glibc.
|
|
|
Bitmask values that may be passed to the options parameter of rs_work().
|
|
Set the least important message severity that will be output.
|
|
Set trace callback. The callback scheme allows for use within applications that may have their own particular ways of reporting errors: log files for a web server, perhaps, and an error dialog for a browser.
|
|
Default trace callback that writes to stderr. Implements rs_trace_fn_t, and may be passed to rs_trace_to(). |
|
Check whether the library was compiled with debugging trace suport. If this returns false, then trying to turn trace on will achieve nothing. |
|
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.
|
|
Decode a base64 buffer in place.
|
|
Encode a buffer as base64.
|
|
Return an English description of a rs_result value.
|
|
Return a human-readable representation of statistics. The string is truncated if it does not fit. 100 characters should be sufficient space.
|
|
Deep deallocation of checksums.
|
|
Dump signatures to the log.
|
|
Run a rs_job_t state machine until it blocks (RS_BLOCKED), returns an error, or completes (RS_COMPLETE).
|
|
Actively process a job, by making callbacks to fill and empty the buffers until the job is done.
|
|
Set up a new encoding job.
|
|
Prepare to compute a streaming delta.
|
|
Read a signature from a file into an rs_signature_t structure in memory. Once there, it can be used to generate a delta to a newer version of the file.
|
|
Apply a delta to a basis to recreate the new file. This gives you back a rs_job_t object, which can be cranked by calling rs_job_iter() and updating the stream pointers. When finished, call rs_job_finish() to dispose of it.
|
|
Calculate the MD4 sum of a file.
|
|
Generate the signature of a basis file, and write it out to another.
|
|
Load signatures from a signature file into memory. Return a pointer to the newly allocated structure in SUMSET.
|
|
Default copy implementation that retrieves a part of a stdio file.
|
|
Library version string.
|
|
Buffer sizes for file IO.
|
|
Buffer sizes for file IO.
|