summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonovan Baarda <abo@minkirri.apana.org.au>2018-02-24 13:01:09 +1100
committerDonovan Baarda <abo@minkirri.apana.org.au>2018-02-24 13:01:09 +1100
commitc5715988085d06ed1b9631c37ff8a9a0a4d9468b (patch)
tree7cab92b7e9658837e0f8a95578585253ba6b0686
parent27d61626c46ed607f72e62260cb6c7191dab2144 (diff)
downloadlibrsync-c5715988085d06ed1b9631c37ff8a9a0a4d9468b.tar.gz
Ugh! The paragraph formatting indent does is not stable. Why?
Multiple runs of tidyc seem to have eventually stabilised to this.
-rw-r--r--src/checksum.c10
-rw-r--r--src/delta.c52
-rw-r--r--src/hashtable.h17
-rw-r--r--src/librsync.h19
-rw-r--r--src/mdfour.c4
-rw-r--r--src/scoop.c14
-rw-r--r--src/stream.c34
-rw-r--r--src/tube.c4
8 files changed, 74 insertions, 80 deletions
diff --git a/src/checksum.c b/src/checksum.c
index 0149ef4..bbcf298 100644
--- a/src/checksum.c
+++ b/src/checksum.c
@@ -45,11 +45,11 @@ rs_weak_sum_t rs_calc_weak_sum(void const *buf, size_t len)
/** Calculate and store into SUM a strong MD4 checksum of the file blocks seen
* so far.
*
- * In plain rsync, the checksum is perturbed by a seed value. This is used
- * when retrying a failed transmission: we've discovered that the hashes
- * collided at some point, so we're going to try again with different hashes to
- * see if we can get it right. (Check tridge's thesis for details and to see
- * if that's correct.)
+ * In plain rsync, the checksum is perturbed by a seed value. This is used when
+ * retrying a failed transmission: we've discovered that the hashes collided at
+ * some point, so we're going to try again with different hashes to see if we can
+ * get it right. (Check tridge's thesis for details and to see if that's
+ * correct.)
*
* Since we can't retry a web transaction I'm not sure if it's very useful in
* rproxy. */
diff --git a/src/delta.c b/src/delta.c
index 417c77d..aa74a3a 100644
--- a/src/delta.c
+++ b/src/delta.c
@@ -43,9 +43,9 @@
* it may be a short match. Short blocks in the signature don't include their
* length -- we just allow for the final short block of the file to match any
* block in the signature, and if they have the same checksum we assume they
- * must have the same length. Therefore, when we emit a COPY command, we have
- * to send it with a length that is the same as the block matched, and not the
- * block length from the signature.
+ * must have the same length. Therefore, when we emit a COPY command, we have to
+ * send it with a length that is the same as the block matched, and not the block
+ * length from the signature.
*
* Profiling results as of v1.26, 2001-03-18:
*
@@ -56,36 +56,32 @@
*
* 2002-06-26: Donovan Baarda
*
- * The following is based entirely on pysync. It is much cleaner than the
- * previous incarnation of this code. It is slightly complicated because in
- * this case the output can block, so the main delta loop needs to stop when
- * this happens.
+ * The following is based entirely on pysync. It is much cleaner than the previous
+ * incarnation of this code. It is slightly complicated because in this case the
+ * output can block, so the main delta loop needs to stop when this happens.
*
* In pysync a 'last' attribute is used to hold the last miss or match for
- * extending if possible. In this code, basis_len and scoop_pos are used
- * instead of 'last'. When basis_len > 0, last is a match. When basis_len = 0
- * and scoop_pos is > 0, last is a miss. When both are 0, last is None (ie,
- * nothing).
+ * extending if possible. In this code, basis_len and scoop_pos are used instead of
+ * 'last'. When basis_len > 0, last is a match. When basis_len = 0 and scoop_pos is
+ * > 0, last is a miss. When both are 0, last is None (ie, nothing).
*
- * Pysync is also slightly different in that a 'flush' method is available to
- * force output of accumulated data. This 'flush' is use to finalise delta
- * calculation. In librsync input is terminated with an eof flag on the input
- * stream. I have structured this code similar to pysync with a seperate flush
- * function that is used when eof is reached. This allows for a flush style API
- * if one is ever needed. Note that flush in pysync can be used for more than
- * just terminating delta calculation, so a flush based API can in some ways be
- * more flexible...
+ * Pysync is also slightly different in that a 'flush' method is available to force
+ * output of accumulated data. This 'flush' is use to finalise delta calculation. In
+ * librsync input is terminated with an eof flag on the input stream. I have
+ * structured this code similar to pysync with a seperate flush function that is used
+ * when eof is reached. This allows for a flush style API if one is ever needed. Note
+ * that flush in pysync can be used for more than just terminating delta calculation,
+ * so a flush based API can in some ways be more flexible...
*
- * The input data is first scanned, then processed. Scanning identifies input
- * data as misses or matches, and emits the instruction stream. Processing the
- * data consumes it off the input scoop and outputs the processed miss data
- * into the tube.
+ * The input data is first scanned, then processed. Scanning identifies input data as
+ * misses or matches, and emits the instruction stream. Processing the data consumes
+ * it off the input scoop and outputs the processed miss data into the tube.
*
- * The scoop contains all data yet to be processed. The scoop_pos is an index
- * into the scoop that indicates the point scanned to. As data is scanned,
- * scoop_pos is incremented. As data is processed, it is removed from the scoop
- * and scoop_pos adjusted. Everything gets complicated because the tube can
- * block. When the tube is blocked, no data can be processed. */
+ * The scoop contains all data yet to be processed. The scoop_pos is an index into the
+ * scoop that indicates the point scanned to. As data is scanned, scoop_pos is
+ * incremented. As data is processed, it is removed from the scoop and scoop_pos
+ * adjusted. Everything gets complicated because the tube can block. When the tube is
+ * blocked, no data can be processed. */
#include "config.h"
diff --git a/src/hashtable.h b/src/hashtable.h
index f1b0b27..1071042 100644
--- a/src/hashtable.h
+++ b/src/hashtable.h
@@ -38,15 +38,14 @@
* Multiple entries with the same key can be added, and you can use a fancy
* cmp() function to find particular entries by more than just their key. There
* is an iterator for iterating through all entries in the hashtable. There are
- * optional hashtable_find() find/match/hashcmp/entrycmp stats counters that
- * can be disabled by defining HASHTABLE_NSTATS.
- *
- * The types and methods of the hashtable and its contents are specified by
- * using \#define parameters set to their basenames (the prefixes for the *_t
- * type and *_func() methods) before doing \#include "hashtable.h". This
- * produces static inline type-safe methods that are either application
- * optimized for speed or wrappers around void* implementation methods for
- * compactness.
+ * optional hashtable_find() find/match/hashcmp/entrycmp stats counters that can
+ * be disabled by defining HASHTABLE_NSTATS.
+ *
+ * The types and methods of the hashtable and its contents are specified by using
+ * \#define parameters set to their basenames (the prefixes for the *_t type and
+ * *_func() methods) before doing \#include "hashtable.h". This produces static
+ * inline type-safe methods that are either application optimized for speed or
+ * wrappers around void* implementation methods for compactness.
*
* \param ENTRY - the entry type basename.
*
diff --git a/src/librsync.h b/src/librsync.h
index 933994b..34acce8 100644
--- a/src/librsync.h
+++ b/src/librsync.h
@@ -292,9 +292,9 @@ void rs_sumset_dump(rs_signature_t const *);
*
* Note also that if *#avail_in is nonzero on return, then not all of the input
* data has been consumed. The caller should either provide more output buffer
- * space and call ::rs_job_iter() again passing the same #next_in and
- * #avail_in, or put the remaining input data into some persistent buffer and
- * call rs_job_iter() with it again when there is more output space.
+ * space and call ::rs_job_iter() again passing the same #next_in and #avail_in,
+ * or put the remaining input data into some persistent buffer and call
+ * rs_job_iter() with it again when there is more output space.
*
* \sa rs_job_iter() */
struct rs_buffers_s {
@@ -308,8 +308,8 @@ struct rs_buffers_s {
/** Number of bytes available at next_in.
*
* References the length of available input. Updated to be the number of
- * unused data bytes, which will be zero if all the input was consumed.
- * May be zero if there is no new input, but the caller just wants to drain
+ * unused data bytes, which will be zero if all the input was consumed. May
+ * be zero if there is no new input, but the caller just wants to drain
* output. */
size_t avail_in;
@@ -422,8 +422,8 @@ rs_result rs_build_hash_table(rs_signature_t *sums);
* \param pos Position where copying should begin.
*
* \param len On input, the amount of data that should be retrieved. Updated to
- * show how much is actually available, but should not be greater than the
- * input value.
+ * show how much is actually available, but should not be greater than the input
+ * value.
*
* \param buf On input, a buffer of at least \p *len bytes. May be updated to
* point to a buffer allocated by the callback if it prefers. */
@@ -440,9 +440,8 @@ typedef rs_result rs_copy_cb(void *opaque, rs_long_t pos, size_t *len,
*
* \param copy_arg Opaque environment pointer passed through to the callback.
*
- * \todo As output is produced, accumulate the MD4 checksum of the output.
- * Then if we find a CHECKSUM command we can check it's contents against the
- * output.
+ * \todo As output is produced, accumulate the MD4 checksum of the output. Then
+ * if we find a CHECKSUM command we can check it's contents against the output.
*
* \todo Implement COPY commands.
*
diff --git a/src/mdfour.c b/src/mdfour.c
index 458d053..8b9406b 100644
--- a/src/mdfour.c
+++ b/src/mdfour.c
@@ -72,8 +72,8 @@ static void rs_mdfour_block(rs_mdfour_t *md, void const *p);
* contain the file length. rs_mdfour_tail() is used for that.
*
* \todo Recode to be fast, and to use system integer types. Perhaps if we can
- * find an mdfour implementation already on the system (e.g. in OpenSSL) then
- * we should use it instead of our own?
+ * find an mdfour implementation already on the system (e.g. in OpenSSL) then we
+ * should use it instead of our own?
*
* \param X A series of integer, read little-endian from the file. */
static void rs_mdfour64(rs_mdfour_t *m, const void *p)
diff --git a/src/scoop.c b/src/scoop.c
index 61bd7b7..2235701 100644
--- a/src/scoop.c
+++ b/src/scoop.c
@@ -49,8 +49,8 @@
* we could just avoid dynamic allocation. However that can't be fixed at
* compile time, because when generating a delta it needs to be large enough to
* hold one full block. Perhaps we can set it up when the job is allocated? It
- * would be kind of nice to not do any memory allocation after startup, as
- * bzlib does this. */
+ * would be kind of nice to not do any memory allocation after startup, as bzlib
+ * does this. */
#include "config.h"
@@ -140,12 +140,12 @@ void rs_scoop_advance(rs_job_t *job, size_t len)
/** Read from scoop without advancing.
*
* Ask for LEN bytes of input from the stream. If that much data is available,
- * then return a pointer to it in PTR, advance the stream input pointer over
- * the data, and return RS_DONE. If there's not enough data, then accept
- * whatever is there into a buffer, advance over it, and return RS_BLOCKED.
+ * then return a pointer to it in PTR, advance the stream input pointer over the
+ * data, and return RS_DONE. If there's not enough data, then accept whatever is
+ * there into a buffer, advance over it, and return RS_BLOCKED.
*
- * The data is not actually removed from the input, so this function lets you
- * do readahead. If you want to keep any of the data, you should also call
+ * The data is not actually removed from the input, so this function lets you do
+ * readahead. If you want to keep any of the data, you should also call
* rs_scoop_advance() to skip over it. */
rs_result rs_scoop_readahead(rs_job_t *job, size_t len, void **ptr)
{
diff --git a/src/stream.c b/src/stream.c
index 293b6c1..079c6d2 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -45,9 +45,9 @@
* partial completion. So there are functions which either complete, or queue
* whatever was not sent and return RS_BLOCKED.
*
- * The output buffer is a little more clever than simply a data buffer.
- * Instead it knows that we can send either literal data, or data copied
- * through from the input of the stream.
+ * The output buffer is a little more clever than simply a data buffer. Instead
+ * it knows that we can send either literal data, or data copied through from
+ * the input of the stream.
*
* In buf.c you will find functions that then map buffers onto stdio files.
*
@@ -55,26 +55,26 @@
* possibly both will have no more bytes available.
*
* librsync never does IO or memory allocation, but relies on the caller. This
- * is very nice for integration, but means that we have to be fairly flexible
- * as to when we can `read' or `write' stuff internally.
+ * is very nice for integration, but means that we have to be fairly flexible as
+ * to when we can `read' or `write' stuff internally.
*
- * librsync basically does two types of IO. It reads network integers of
- * various lengths which encode command and control information such as
- * versions and signatures. It also does bulk data transfer.
+ * librsync basically does two types of IO. It reads network integers of various
+ * lengths which encode command and control information such as versions and
+ * signatures. It also does bulk data transfer.
*
* IO of network integers is internally buffered, because higher levels of the
* code need to see them transmitted atomically: it's no good to read half of a
- * uint32. So there is a small and fixed length internal buffer which
- * accumulates these. Unlike previous versions of the library, we don't
- * require that the caller hold the start until the whole thing has arrived,
- * which guarantees that we can always make progress.
+ * uint32. So there is a small and fixed length internal buffer which accumulates
+ * these. Unlike previous versions of the library, we don't require that the
+ * caller hold the start until the whole thing has arrived, which guarantees that
+ * we can always make progress.
*
- * On each call into a stream iterator, it should begin by trying to flush
- * output. This may well use up all the remaining stream space, in which case
- * nothing else can be done.
+ * On each call into a stream iterator, it should begin by trying to flush output.
+ * This may well use up all the remaining stream space, in which case nothing else
+ * can be done.
*
- * \todo Kill this file and move the vestigial code remaining closer to where
- * it's used. */
+ * \todo Kill this file and move the vestigial code remaining closer to where it's
+ * used. */
#include "config.h"
diff --git a/src/tube.c b/src/tube.c
index 6ed4662..b2550c8 100644
--- a/src/tube.c
+++ b/src/tube.c
@@ -47,8 +47,8 @@
*
* \todo I think our current copy code will lock up if the application only
* ever calls us with either input or output buffers, and not both. So I guess
- * in that case we might need to copy into some temporary buffer space, and
- * then back out again later. */
+ * in that case we might need to copy into some temporary buffer space, and then
+ * back out again later. */
#include "config.h"