diff options
author | Martin Pool <mbp@sourcefrog.net> | 2001-02-26 11:02:36 +0000 |
---|---|---|
committer | Martin Pool <mbp@sourcefrog.net> | 2001-02-26 11:02:36 +0000 |
commit | ac2f6e6d08bbef565b68ab4f28aaf41022afd94d (patch) | |
tree | 9c773b51f9bd7199f7b1a6202160a6d30da195fc | |
parent | e0c2799ad517731615de7e557b14302c5dc5eaa9 (diff) | |
download | librsync-ac2f6e6d08bbef565b68ab4f28aaf41022afd94d.tar.gz |
Doc.
Consistency cleanups.
-rw-r--r-- | base64.c | 2 | ||||
-rw-r--r-- | buf.c | 4 | ||||
-rw-r--r-- | buf.h | 2 | ||||
-rw-r--r-- | checksum.c | 2 | ||||
-rw-r--r-- | checksum.h | 2 | ||||
-rw-r--r-- | codeheader.c | 2 | ||||
-rw-r--r-- | command.c | 2 | ||||
-rw-r--r-- | command.h | 2 | ||||
-rw-r--r-- | copyq.c | 2 | ||||
-rw-r--r-- | delta.c | 9 | ||||
-rw-r--r-- | doxy.mk | 3 | ||||
-rw-r--r-- | emit.c | 4 | ||||
-rw-r--r-- | emit.h | 2 | ||||
-rw-r--r-- | hex.c | 2 | ||||
-rw-r--r-- | job.c | 5 | ||||
-rw-r--r-- | job.h | 4 | ||||
-rw-r--r-- | mdfour.c | 2 | ||||
-rw-r--r-- | msg.c | 6 | ||||
-rw-r--r-- | netint.c | 6 | ||||
-rw-r--r-- | netint.h | 10 | ||||
-rw-r--r-- | patch.c | 83 | ||||
-rw-r--r-- | protocol.h | 2 | ||||
-rw-r--r-- | prototab.h | 2 | ||||
-rw-r--r-- | rollsum.c | 2 | ||||
-rw-r--r-- | rollsum.h | 2 | ||||
-rw-r--r-- | scoop.c | 8 | ||||
-rw-r--r-- | search.c | 2 | ||||
-rw-r--r-- | search.h | 2 | ||||
-rw-r--r-- | stats.c | 2 | ||||
-rw-r--r-- | stream.c | 2 | ||||
-rw-r--r-- | stream.h | 8 | ||||
-rw-r--r-- | sumset.c | 2 | ||||
-rw-r--r-- | sumset.h | 2 | ||||
-rw-r--r-- | trace.c | 13 | ||||
-rw-r--r-- | trace.h | 4 | ||||
-rw-r--r-- | tube.c | 2 | ||||
-rw-r--r-- | util.c | 2 | ||||
-rw-r--r-- | util.h | 2 |
38 files changed, 117 insertions, 98 deletions
@@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * rproxy -- dynamic caching and delta update in HTTP * $Id$ * @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- the library for network deltas * $Id$ @@ -160,7 +160,7 @@ hs_result hs_outfilebuf_drain(hs_filebuf_t *fb) } -/* +/** * Default copy implementation that retrieves a part of a stdio file. */ hs_result hs_file_copy_cb(void *arg, size_t *len, void **buf) @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- the library for network deltas * $Id$ @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * $Id$ * @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * $Id$ * diff --git a/codeheader.c b/codeheader.c index 2dcb310..6d31fa6 100644 --- a/codeheader.c +++ b/codeheader.c @@ -1,4 +1,4 @@ -/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- the library for network deltas * $Id$ @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- the library for network deltas * $Id$ @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- library for network deltas * $Id$ @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * rproxy -- dynamic caching and delta update in HTTP * $Id$ * @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- library for network deltas * $Id$ @@ -45,6 +45,10 @@ #include "job.h" +/** + * \brief State function that does a fake delta containing only + * literal data to recreate the input. + */ static hs_result hs_delta_s_fake(hs_job_t *job) { hs_stream_t * const stream = job->stream; @@ -60,6 +64,9 @@ static hs_result hs_delta_s_fake(hs_job_t *job) } +/** + * State function for writing out the header of the encoding job. + */ static hs_result hs_delta_s_header(hs_job_t *job) { hs_emit_delta_header(job->stream); @@ -4,7 +4,8 @@ sites=front.linuxcare.com.au:/var/www/projects/rproxy \ upload-doxy: latex/refman.ps.gz for i in $(sites); do \ - rsync --delete -avz html/ latex/refman.ps.gz ./rproxy-small-logo.png $$i/doxygen/libhsync; \ + rsync --delete -avz html/ latex/refman.pdf latex/refman.ps.gz \ + ./rproxy-small-logo.png $$i/doxygen/libhsync; \ done latex/refman.ps.gz: @@ -1,9 +1,9 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- dynamic caching and delta update in HTTP * $Id$ * - * Copyright (C) 2000 by Martin Pool <mbp@samba.org> + * Copyright (C) 2000,2001 by Martin Pool <mbp@samba.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- dynamic caching and delta update in HTTP * $Id$ @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * rproxy -- dynamic caching and delta update in HTTP * $Id$ * @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- the library for network deltas * $Id$ @@ -72,7 +72,8 @@ hs_result hs_job_free(hs_job_t *job) */ hs_result hs_job_iter(hs_job_t *job, int ending) { - enum hs_result result; + + hs_result result; if (ending) job->near_end = 1; @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- the library for network deltas * $Id$ @@ -25,7 +25,7 @@ struct hs_job { hs_stream_t *stream; /** Callback for each processing step. */ - enum hs_result (*statefn)(hs_job_t *); + hs_result (*statefn)(hs_job_t *); /* Generic storage fields. */ size_t block_len; @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- the library for network deltas * $Id$ @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- the library for network deltas * $Id$ @@ -25,8 +25,8 @@ #include "hsync.h" -/* TODO: Translate from enum hs_result to human-readable messages. */ -char const *hs_strerror(enum hs_result r) +/* TODO: Translate from hs_result to human-readable messages. */ +char const *hs_strerror(hs_result r) { switch (r) { case HS_OK: @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- library for network deltas * $Id$ @@ -97,7 +97,7 @@ hs_result hs_suck_n32(hs_stream_t *stream, int *v) } -enum hs_result hs_suck_n8(hs_stream_t *stream, int *v) +hs_result hs_suck_n8(hs_stream_t *stream, int *v) { void *p; int result; @@ -112,7 +112,7 @@ enum hs_result hs_suck_n8(hs_stream_t *stream, int *v) -enum hs_result hs_suck_netint(hs_stream_t *stream, int len, int *v) +hs_result hs_suck_netint(hs_stream_t *stream, int len, int *v) { switch (len) { case 1: @@ -1,9 +1,9 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- library for network deltas * $Id$ * - * Copyright (C) 1999, 2000 by Martin Pool <mbp@samba.org> + * Copyright (C) 1999, 2000, 2001 by Martin Pool <mbp@samba.org> * Copyright (C) 1999 by Andrew Tridgell <mbp@samba.org> * * This program is free software; you can redistribute it and/or modify @@ -24,9 +24,9 @@ void hs_squirt_n32(hs_stream_t *stream, int d); void hs_squirt_n8(hs_stream_t *stream, int d); -enum hs_result hs_suck_n32(hs_stream_t *stream, int *v); -enum hs_result hs_suck_n8(hs_stream_t *stream, int *v); -enum hs_result hs_suck_netint(hs_stream_t *stream, int len, int *v); +hs_result hs_suck_n32(hs_stream_t *stream, int *v); +hs_result hs_suck_n8(hs_stream_t *stream, int *v); +hs_result hs_suck_netint(hs_stream_t *stream, int len, int *v); int hs_fits_in_n8(size_t val); int hs_fits_in_n16(size_t val); @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- the library for network deltas * $Id$ @@ -28,14 +28,6 @@ #include <config.h> -/* - * 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. - */ - #include <assert.h> #include <stdlib.h> @@ -56,23 +48,22 @@ const int HS_PATCH_TAG = 201210; -/* Local prototypes for state functions. */ -static enum hs_result hs_patch_s_complete(hs_job_t *); -static enum hs_result hs_patch_s_cmdbyte(hs_job_t *); -static enum hs_result hs_patch_s_params(hs_job_t *); -static enum hs_result hs_patch_s_run(hs_job_t *); -static enum hs_result hs_patch_s_literal(hs_job_t *); +static hs_result hs_patch_s_complete(hs_job_t *); +static hs_result hs_patch_s_cmdbyte(hs_job_t *); +static hs_result hs_patch_s_params(hs_job_t *); +static hs_result hs_patch_s_run(hs_job_t *); +static hs_result hs_patch_s_literal(hs_job_t *); -/* - * Called when we're trying to read the first byte of a command. Once - * we've taken that in, we can know how much data to read to get the +/** + * State of trying to read the first byte of a command. Once we've + * taken that in, we can know how much data to read to get the * arguments. */ -static enum hs_result hs_patch_s_cmdbyte(hs_job_t *job) +static hs_result hs_patch_s_cmdbyte(hs_job_t *job) { - enum hs_result result; + hs_result result; if ((result = hs_suck_n8(job->stream, &job->op)) != HS_OK) return result; @@ -92,13 +83,13 @@ static enum hs_result hs_patch_s_cmdbyte(hs_job_t *job) } -/* +/** * Called after reading a command byte to pull in its parameters and * then setup to execute the command. */ -static enum hs_result hs_patch_s_params(hs_job_t *job) +static hs_result hs_patch_s_params(hs_job_t *job) { - enum hs_result result; + hs_result result; int len = job->cmd->len_1 + job->cmd->len_2; void *p; @@ -126,10 +117,10 @@ static enum hs_result hs_patch_s_params(hs_job_t *job) -/* +/** * Called when we've read in the whole command and we need to execute it. */ -static enum hs_result hs_patch_s_run(hs_job_t *job) +static hs_result hs_patch_s_run(hs_job_t *job) { hs_trace("running command 0x%x, kind %d", job->op, job->cmd->kind); @@ -148,10 +139,10 @@ static enum hs_result hs_patch_s_run(hs_job_t *job) } -/* +/** * Called when trying to copy through literal data. */ -static enum hs_result hs_patch_s_literal(hs_job_t *job) +static hs_result hs_patch_s_literal(hs_job_t *job) { int len; if (job->cmd->len_1) @@ -168,19 +159,19 @@ static enum hs_result hs_patch_s_literal(hs_job_t *job) } -/* +/** * Called after encountering EOF on the patch. */ -static enum hs_result hs_patch_s_complete(hs_job_t *UNUSED(job)) +static hs_result hs_patch_s_complete(hs_job_t *UNUSED(job)) { hs_fatal("the patch has already finished"); } -/* +/** * Called while we're trying to read the header of the patch. */ -static enum hs_result hs_patch_s_header(hs_job_t *job) +static hs_result hs_patch_s_header(hs_job_t *job) { int v; int result; @@ -200,11 +191,30 @@ static enum hs_result hs_patch_s_header(hs_job_t *job) -/* - * Begin the job of applying a patch. This gives you back a JOB - * object, which can be cranked by calling hs_patch_iter and updating - * the stream pointers. When finished, call hs_patch_finish to - * dispose of it. +/** + * \brief Apply a \ref gloss_delta to a \ref gloss_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. + * + * \param stream Contains pointers to input and output buffers, to be + * adjusted by caller on each iteration. + * + * \param copy_cb Callback used to retrieve content from the basis + * file. + * + * \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 Implement COPY commands. + * + * \sa hs_patch_file() */ hs_job_t *hs_patch_begin(hs_stream_t *stream, hs_copy_cb *copy_cb, void *copy_arg) @@ -221,4 +231,3 @@ hs_job_t *hs_patch_begin(hs_stream_t *stream, hs_copy_cb *copy_cb, return job; } - @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- library for network deltas * $Id$ @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- library for network deltas * $Id$ @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * rproxy -- dynamic caching and delta update in HTTP * $Id$ * @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * rproxy -- dynamic caching and delta update in HTTP * $Id$ * @@ -157,7 +157,7 @@ void hs_scoop_advance(hs_stream_t *stream, size_t len) * lets you do readahead. If you want to keep any of the data, you * should also call hs_scoop_advance to skip over it. */ -enum hs_result hs_scoop_readahead(hs_stream_t *stream, size_t len, void **ptr) +hs_result hs_scoop_readahead(hs_stream_t *stream, size_t len, void **ptr) { hs_simpl_t *impl = stream->impl; @@ -206,9 +206,9 @@ enum hs_result hs_scoop_readahead(hs_stream_t *stream, size_t len, void **ptr) * Read LEN bytes if possible, and remove them from the input scoop. * If there's not enough data yet, return HS_BLOCKED. */ -enum hs_result hs_scoop_read(hs_stream_t *stream, size_t len, void **ptr) +hs_result hs_scoop_read(hs_stream_t *stream, size_t len, void **ptr) { - enum hs_result result; + hs_result result; result = hs_scoop_readahead(stream, len, ptr); if (result == HS_OK) @@ -223,7 +223,7 @@ enum hs_result hs_scoop_read(hs_stream_t *stream, size_t len, void **ptr) * Read whatever remains in the input stream, assuming that it runs up * to the end of the file. Set LEN appropriately. */ -enum hs_result hs_scoop_read_rest(hs_stream_t *stream, size_t *len, void **ptr) +hs_result hs_scoop_read_rest(hs_stream_t *stream, size_t *len, void **ptr) { hs_simpl_t *impl = stream->impl; @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * rproxy -- dynamic caching and delta update in HTTP * $Id$ * @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * rproxy -- dynamic caching and delta update in HTTP * $Id$ * @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * $Id$ * @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- dynamic caching and delta update in HTTP * $Id$ @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- library for network deltas * $Id$ @@ -67,6 +67,6 @@ int hs_tube_is_idle(hs_stream_t const *); void hs_check_tube(hs_stream_t *); void hs_scoop_advance(hs_stream_t *stream, size_t len); -enum hs_result hs_scoop_readahead(hs_stream_t *stream, size_t len, void **ptr); -enum hs_result hs_scoop_read(hs_stream_t *stream, size_t len, void **ptr); -enum hs_result hs_scoop_read_rest(hs_stream_t *stream, size_t *len, void **ptr); +hs_result hs_scoop_readahead(hs_stream_t *stream, size_t len, void **ptr); +hs_result hs_scoop_read(hs_stream_t *stream, size_t len, void **ptr); +hs_result hs_scoop_read_rest(hs_stream_t *stream, size_t *len, void **ptr); @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- library for network deltas * $Id$ @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- the library for network deltas * $Id$ @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- library for network deltas * @@ -55,14 +55,15 @@ static int hs_trace_level = HS_LOG_INFO; static void hs_log_va(int level, char const *fn, char const *fmt, va_list va); -/** Called by the application to set the destination of trace information. +/** + * \brief Set the destination of trace information. * * 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. * - * \todo Perhaps don't depend on syslog, but instead just have yes/no - * tracing. Do we really need such fine-grained control? + * \todo Do we really need such fine-grained control, or just yes/no + * tracing? */ void hs_trace_to(hs_trace_fn_t * new_impl) @@ -72,10 +73,10 @@ hs_trace_to(hs_trace_fn_t * new_impl) /** - * Set the least import message severity that will be output. + * Set the least important message severity that will be output. */ void -hs_trace_set_level(enum hs_loglevel level) +hs_trace_set_level(hs_loglevel level) { hs_trace_level = level; } @@ -1,9 +1,9 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- generate and apply network deltas * $Id$ * - * Copyright (C) 2000 by Martin Pool <mbp@samba.org> + * Copyright (C) 2000, 2001 by Martin Pool <mbp@samba.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- dynamic caching and delta update in HTTP * $Id$ @@ -1,4 +1,4 @@ -/* -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * rproxy -- dynamic caching and delta update in HTTP * $Id$ * @@ -1,4 +1,4 @@ -/*= -*- c-file-style: "linux" -*- +/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * libhsync -- library for network deltas * $Id$ |