Data Structures | |
struct | hs_stats |
Performance statistics from a libhsync encoding or decoding operation. More... | |
struct | hs_mdfour |
struct | hs_stream_s |
Stream through which the calling application feeds data to and from the library. More... | |
Defines | |
#define | HS_MD4_LENGTH 16 |
#define | HS_DEFAULT_STRONG_LEN 8 |
Default length of strong signatures, in bytes. More... | |
#define | HS_DEFAULT_BLOCK_LEN 2048 |
Default block length, if not determined by any other factors. More... | |
Typedefs | |
typedef void | hs_trace_fn_t (int level, char const *msg) |
Callback to write out log messages. More... | |
typedef struct hs_stats | hs_stats_t |
Performance statistics from a libhsync encoding or decoding operation. More... | |
typedef struct hs_mdfour | hs_mdfour_t |
MD4 message-digest accumulator. More... | |
typedef struct hs_signature | hs_signature_t |
typedef struct hs_stream_s | hs_stream_t |
Stream through which the calling application feeds data to and from the library. More... | |
typedef struct hs_job | hs_job_t |
Job of work to be done. More... | |
typedef hs_result | hs_copy_cb (void *opaque, size_t *len, void **result) |
Callback used to retrieve parts of the basis file. More... | |
Enumerations | |
enum | hs_loglevel { HS_LOG_EMERG = 0, HS_LOG_ALERT = 1, HS_LOG_CRIT = 2, HS_LOG_ERR = 3, HS_LOG_WARNING = 4, HS_LOG_NOTICE = 5, HS_LOG_INFO = 6, HS_LOG_DEBUG = 7 } |
Log severity levels. More... | |
enum | hs_result { HS_DONE = 0, HS_BLOCKED = 1, HS_RUNNING = 2, HS_TEST_SKIPPED = 77, HS_IO_ERROR = 100, HS_SYNTAX_ERROR = 101, HS_MEM_ERROR = 102, HS_INPUT_ENDED = 103, HS_BAD_MAGIC = 104, HS_UNIMPLEMENTED = 105, HS_CORRUPT = 106 } |
Return codes from nonblocking hsync operations. More... | |
Functions | |
void | hs_trace_set_level (hs_loglevel level) |
Set the least important message severity that will be output. More... | |
void | hs_trace_to (hs_trace_fn_t *) |
Set trace callback. More... | |
void | hs_trace_stderr (int level, char const *msg) |
Default trace callback that writes to stderr. More... | |
int | hs_supports_trace (void) |
Check whether the library was compiled with debugging trace suport. More... | |
void | hs_hexify (char *to_buf, void const *from_buf, int from_len) |
size_t | hs_unbase64 (char *s) |
Decode a base64 buffer in place. More... | |
void | hs_base64 (unsigned char const *buf, int n, char *out) |
Encode a buffer as base64. More... | |
char const* | hs_strerror (hs_result r) |
Return an English description of a hs_result value. More... | |
void | hs_mdfour (unsigned char *out, void const *in, int n) |
void | hs_mdfour_begin (hs_mdfour_t *md) |
void | hs_mdfour_update (hs_mdfour_t *md, void const *, size_t n) |
void | hs_mdfour_result (hs_mdfour_t *md, unsigned char *out) |
char* | hs_format_stats (hs_stats_t const *, char *, size_t) |
Return a human-readable representation of statistics. More... | |
int | hs_log_stats (hs_stats_t const *stats) |
void | hs_free_sumset (hs_signature_t *) |
Deep deallocation of checksums. More... | |
void | hs_sumset_dump (hs_signature_t const *) |
Dump signatures to the log. More... | |
void | hs_stream_init (hs_stream_t *) |
hs_job_t* | hs_accum_begin (hs_stream_t *) |
hs_result | hs_job_iter (hs_job_t *) |
Run a hs_job_t state machine until it blocks (HS_BLOCKED), returns an error, or completes (HS_COMPLETE). More... | |
hs_result | hs_job_free (hs_job_t *) |
int | hs_accum_value (hs_job_t *, char *sum, size_t sum_len) |
hs_job_t* | hs_sig_begin (hs_stream_t *stream, size_t new_block_len, size_t strong_sum_len) |
Set up a new encoding job. More... | |
hs_job_t* | hs_delta_begin (hs_stream_t *stream, hs_signature_t *) |
Prepare to compute a delta on a stream. More... | |
hs_job_t* | hs_loadsig_begin (hs_stream_t *, hs_signature_t **) |
Read a signature from a file into an hs_signature_t structure in memory. More... | |
hs_job_t* | hs_patch_begin (hs_stream_t *, hs_copy_cb *, void *copy_arg) |
Apply a delta to a basis to recreate the new file. More... | |
hs_result | hs_build_hash_table (hs_signature_t *sums) |
Variables | |
char const | hs_libhsync_version [] = (PACKAGE " " VERSION) |
Library version string. More... | |
char const | hs_licence_string [] |
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.
|
|
Callback to write out log messages.
|
|
Performance statistics from a libhsync 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 hs_sig_begin(), and then iterated over by hs_job_iter(). |
|
Callback used to retrieve parts of the basis file.
|
|
Log severity levels. These are the same as syslog, at least in glibc.
|
|
|
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 hs_trace_fn_t, and may be passed to hs_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 hs_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 hs_job_t state machine until it blocks (HS_BLOCKED), returns an error, or completes (HS_COMPLETE).
|
|
Set up a new encoding job.
|
|
Prepare to compute a delta on a stream.
|
|
Read a signature from a file into an hs_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 hs_job_t object, which can be cranked by calling hs_job_iter() and updating the stream pointers. When finished, call hs_job_finish() to dispose of it.
|
|
Library version string.
|