summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonovan Baarda <abo@minkirri.apana.org.au>2019-08-16 10:07:12 +1000
committerDonovan Baarda <abo@minkirri.apana.org.au>2019-08-16 10:07:12 +1000
commitc084f601023f1a52fb2a2b7f74b7e92268cd3d45 (patch)
tree24fb6639dd9f1dbd68d781800ae95a20486cd872
parent7c21b8800046c7cbe37a95ce9dfb511ad99d7542 (diff)
downloadlibrsync-c084f601023f1a52fb2a2b7f74b7e92268cd3d45.tar.gz
Fix #130 don't export private symbols.
In CMakeLists.txt use cmake's GenerateExportHeader support to generate src/librsync_export.h and add it as a header to install. Set "C_VISIBILITY_PRESET hidden" target property for rsync to hide all not-explicitly-exported symbols. Do some minor indent tidying. Add librsync_export.h to .gitignore and remove obsolete librsync-config.h. In librsync.h include librsync_export.h and explicitly export all functions. Ensure it is correctly formated using "make tidyc". In rdiff.c remove all includes and references to anything not explicitly exported by librsync. This included usage of not exported logging functions rs_error() and rs_log(). Update rdiff_usage() to support formatted args with nicer output and use it everywhere we report bad arguments instead of rs_error(). Always use exit() instead of return for syntax errors to give neater termination output. Remove PROGRAM define and just use "rdiff" instead. In fileutil.[hc] move declarations for rs_file_open() and rs_file_close() to librsync.h and explicitly export them. They are used by rdiff. In sumset.h move declaration of rs_signature_log_stats() to librsync.h, and explicitly export it. It is used by rdiff. In delta.c explicitly export rs_roll_paranoia and add it as an extern in librsync.h. This is used by rdiff. In sumset.c explicitly export RS_MD4_SUM_LENGTH and RS_BLAKE2_SUM_LENGTH which are extern consts in librsync.h. In whole.c explicitly export rs_inbuflen and rs_outbuflen which are extern vars in librsync.h. In version.c explicitly export rs_librsync_version which is an extern const in librsync.h.
-rw-r--r--.gitignore2
-rw-r--r--CMakeLists.txt22
-rw-r--r--src/delta.c2
-rw-r--r--src/fileutil.c7
-rw-r--r--src/fileutil.h2
-rw-r--r--src/librsync.h109
-rw-r--r--src/rdiff.c46
-rw-r--r--src/sumset.c4
-rw-r--r--src/sumset.h3
-rw-r--r--src/version.c3
-rw-r--r--src/whole.c2
11 files changed, 113 insertions, 89 deletions
diff --git a/.gitignore b/.gitignore
index 6c7ef2a..8b09f72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,7 +4,7 @@ CMakeCache.txt
CTestTestfile.cmake
config.h
*.cbp
-librsync-config.h
+librsync_export.h
librsync.so*
librsync.a
librsync*.dylib
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07ec763..cdb86a2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -340,6 +340,9 @@ set(rsync_LIB_SRCS
${blake2_SRCS})
add_library(rsync SHARED ${rsync_LIB_SRCS})
+include(GenerateExportHeader)
+generate_export_header(rsync BASE_NAME librsync
+ EXPORT_FILE_NAME ${CMAKE_SOURCE_DIR}/src/librsync_export.h)
target_link_libraries(rsync ${blake2_LIBS})
# Optionally link zlib and bzip2 if
@@ -353,8 +356,10 @@ if (ENABLE_COMPRESSION)
endif (ZLIB_FOUND AND BZIP2_FOUND)
endif (ENABLE_COMPRESSION)
-set_target_properties(rsync PROPERTIES VERSION ${LIBRSYNC_VERSION}
- SOVERSION ${LIBRSYNC_MAJOR_VERSION})
+set_target_properties(rsync PROPERTIES
+ VERSION ${LIBRSYNC_VERSION}
+ SOVERSION ${LIBRSYNC_MAJOR_VERSION}
+ C_VISIBILITY_PRESET hidden)
install(TARGETS rsync ${INSTALL_TARGETS_DEFAULT_ARGS} DESTINATION ${CMAKE_INSTALL_LIBDIR})
@@ -379,16 +384,17 @@ endif (BUILD_RDIFF)
########### install files ###############
install(FILES
- src/librsync.h
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ src/librsync.h
+ src/librsync_export.h
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
message (STATUS "CMAKE_C_FLAGS = ${CMAKE_C_FLAGS}")
install(FILES
- doc/librsync.3
- DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
+ doc/librsync.3
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
install(FILES
- doc/rdiff.1
- DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+ doc/rdiff.1
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# vim: shiftwidth=4 expandtab
diff --git a/src/delta.c b/src/delta.c
index 813461f..11228a8 100644
--- a/src/delta.c
+++ b/src/delta.c
@@ -104,7 +104,7 @@
#include "rollsum.h"
/* used by rdiff, but now redundant */
-int rs_roll_paranoia = 0;
+LIBRSYNC_EXPORT int rs_roll_paranoia = 0;
static rs_result rs_delta_s_scan(rs_job_t *job);
static rs_result rs_delta_s_flush(rs_job_t *job);
diff --git a/src/fileutil.c b/src/fileutil.c
index d394a46..8cf15aa 100644
--- a/src/fileutil.c
+++ b/src/fileutil.c
@@ -73,13 +73,6 @@
# define fileno(f) _fileno((f))
#endif
-/** Open a file with special handling for '-' or unspecified filenames.
- *
- * \param filename - The filename to open.
- *
- * \param mode - fopen style mode string.
- *
- * \param force - bool to force overwriting of existing files. */
FILE *rs_file_open(char const *filename, char const *mode, int force)
{
FILE *f;
diff --git a/src/fileutil.h b/src/fileutil.h
index e0beb03..4e47d76 100644
--- a/src/fileutil.h
+++ b/src/fileutil.h
@@ -19,6 +19,4 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-FILE *rs_file_open(char const *filename, char const *mode, int force);
-int rs_file_close(FILE *file);
void rs_get_filesize(FILE *f, rs_long_t *size);
diff --git a/src/librsync.h b/src/librsync.h
index 0e5a977..cb81f3a 100644
--- a/src/librsync.h
+++ b/src/librsync.h
@@ -36,6 +36,7 @@
# include <stdio.h>
# include <stdint.h>
# include <time.h>
+# include "librsync_export.h"
# ifdef __cplusplus
extern "C" {
@@ -49,6 +50,9 @@ extern char const rs_librsync_version[];
/** Summary of the licence for librsync. */
extern char const rs_licence_string[];
+/** Flag to turn on signature rollsum paranoia mode. */
+extern int rs_roll_paranoia;
+
typedef uint8_t rs_byte_t;
typedef intmax_t rs_long_t;
@@ -120,19 +124,19 @@ typedef void rs_trace_fn_t(rs_loglevel level, char const *msg);
/** Set the least important message severity that will be output.
*
* \sa \ref api_trace */
-void rs_trace_set_level(rs_loglevel level);
+LIBRSYNC_EXPORT void rs_trace_set_level(rs_loglevel level);
/** Set trace callback.
*
* \sa \ref api_trace */
-void rs_trace_to(rs_trace_fn_t *);
+LIBRSYNC_EXPORT void rs_trace_to(rs_trace_fn_t *);
/** Default trace callback that writes to stderr.
*
* Implements ::rs_trace_fn_t, and may be passed to rs_trace_to().
*
* \sa \ref api_trace */
-void rs_trace_stderr(rs_loglevel level, char const *msg);
+LIBRSYNC_EXPORT void rs_trace_stderr(rs_loglevel level, char const *msg);
/** Check whether the library was compiled with debugging trace.
*
@@ -141,19 +145,20 @@ void rs_trace_stderr(rs_loglevel level, char const *msg);
* If this returns false, then trying to turn trace on will achieve nothing.
*
* \sa \ref api_trace */
-int rs_supports_trace(void);
+LIBRSYNC_EXPORT int rs_supports_trace(void);
/** Convert \p from_len bytes at \p from_buf into a hex representation in \p
* to_buf, which must be twice as long plus one byte for the null terminator. */
-void rs_hexify(char *to_buf, void const *from_buf, int from_len);
+LIBRSYNC_EXPORT void rs_hexify(char *to_buf, void const *from_buf,
+ int from_len);
/** Decode a base64 buffer in place.
*
* \returns The number of binary bytes. */
-size_t rs_unbase64(char *s);
+LIBRSYNC_EXPORT size_t rs_unbase64(char *s);
/** Encode a buffer as base64. */
-void rs_base64(unsigned char const *buf, int n, char *out);
+LIBRSYNC_EXPORT void rs_base64(unsigned char const *buf, int n, char *out);
/** Return codes from nonblocking rsync operations.
*
@@ -183,7 +188,7 @@ typedef enum rs_result {
} rs_result;
/** Return an English description of a ::rs_result value. */
-char const *rs_strerror(rs_result r);
+LIBRSYNC_EXPORT char const *rs_strerror(rs_result r);
/** Performance statistics from a librsync encoding or decoding operation.
*
@@ -223,8 +228,8 @@ extern const int RS_MD4_SUM_LENGTH, RS_BLAKE2_SUM_LENGTH;
typedef uint32_t rs_weak_sum_t;
typedef unsigned char rs_strong_sum_t[RS_MAX_STRONG_SUM_LENGTH];
-void rs_mdfour(unsigned char *out, void const *in, size_t);
-void rs_mdfour_begin( /* @out@ */ rs_mdfour_t *md);
+LIBRSYNC_EXPORT void rs_mdfour(unsigned char *out, void const *in, size_t);
+LIBRSYNC_EXPORT void rs_mdfour_begin( /* @out@ */ rs_mdfour_t *md);
/** Feed some data into the MD4 accumulator.
*
@@ -233,8 +238,9 @@ void rs_mdfour_begin( /* @out@ */ rs_mdfour_t *md);
* \param in_void Data to add.
*
* \param n Number of bytes fed in. */
-void rs_mdfour_update(rs_mdfour_t *md, void const *in_void, size_t n);
-void rs_mdfour_result(rs_mdfour_t *md, unsigned char *out);
+LIBRSYNC_EXPORT void rs_mdfour_update(rs_mdfour_t *md, void const *in_void,
+ size_t n);
+LIBRSYNC_EXPORT void rs_mdfour_result(rs_mdfour_t *md, unsigned char *out);
/** Return a human-readable representation of statistics.
*
@@ -250,21 +256,25 @@ void rs_mdfour_result(rs_mdfour_t *md, unsigned char *out);
* \return \p buf.
*
* \sa \ref api_stats */
-char *rs_format_stats(rs_stats_t const *stats, char *buf, size_t size);
+LIBRSYNC_EXPORT char *rs_format_stats(rs_stats_t const *stats, char *buf,
+ size_t size);
/** Write statistics into the current log as text.
*
* \sa \ref api_stats \sa \ref api_trace */
-int rs_log_stats(rs_stats_t const *stats);
+LIBRSYNC_EXPORT int rs_log_stats(rs_stats_t const *stats);
/** The signature datastructure type. */
typedef struct rs_signature rs_signature_t;
+/** Log the rs_signature_delta match stats. */
+LIBRSYNC_EXPORT void rs_signature_log_stats(rs_signature_t const *sig);
+
/** Deep deallocation of checksums. */
-void rs_free_sumset(rs_signature_t *);
+LIBRSYNC_EXPORT void rs_free_sumset(rs_signature_t *);
/** Dump signatures to the log. */
-void rs_sumset_dump(rs_signature_t const *);
+LIBRSYNC_EXPORT void rs_sumset_dump(rs_signature_t const *);
/** Description of input and output buffers.
*
@@ -358,7 +368,7 @@ typedef struct rs_job rs_job_t;
* there, without trying to accumulate anything else.
*
* \sa \ref api_streaming */
-rs_result rs_job_iter(rs_job_t *job, rs_buffers_t *buffers);
+LIBRSYNC_EXPORT rs_result rs_job_iter(rs_job_t *job, rs_buffers_t *buffers);
/** Type of application-supplied function for rs_job_drive().
*
@@ -368,14 +378,15 @@ typedef rs_result rs_driven_cb(rs_job_t *job, rs_buffers_t *buf,
/** Actively process a job, by making callbacks to fill and empty the buffers
* until the job is done. */
-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);
+LIBRSYNC_EXPORT 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);
/** Return a pointer to the statistics in a job. */
-const rs_stats_t *rs_job_statistics(rs_job_t *job);
+LIBRSYNC_EXPORT const rs_stats_t *rs_job_statistics(rs_job_t *job);
/** Deallocate job state. */
-rs_result rs_job_free(rs_job_t *);
+LIBRSYNC_EXPORT rs_result rs_job_free(rs_job_t *);
/** Start generating a signature.
*
@@ -392,14 +403,15 @@ rs_result rs_job_free(rs_job_t *);
* at zero to get the full strength.
*
* \sa rs_sig_file() */
-rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len,
- rs_magic_number sig_magic);
+LIBRSYNC_EXPORT rs_job_t *rs_sig_begin(size_t new_block_len,
+ size_t strong_sum_len,
+ rs_magic_number sig_magic);
/** Prepare to compute a streaming delta.
*
* \todo Add a version of this that takes a ::rs_magic_number controlling the
* delta format. */
-rs_job_t *rs_delta_begin(rs_signature_t *);
+LIBRSYNC_EXPORT rs_job_t *rs_delta_begin(rs_signature_t *);
/** Read a signature from a file into an ::rs_signature structure in memory.
*
@@ -408,12 +420,12 @@ rs_job_t *rs_delta_begin(rs_signature_t *);
*
* \note After loading the signatures, you must call \ref rs_build_hash_table()
* before you can use them. */
-rs_job_t *rs_loadsig_begin(rs_signature_t **);
+LIBRSYNC_EXPORT rs_job_t *rs_loadsig_begin(rs_signature_t **);
/** Call this after loading a signature to index it.
*
* Use rs_free_sumset() to release it after use. */
-rs_result rs_build_hash_table(rs_signature_t *sums);
+LIBRSYNC_EXPORT rs_result rs_build_hash_table(rs_signature_t *sums);
/** Callback used to retrieve parts of the basis file.
*
@@ -444,11 +456,31 @@ typedef rs_result rs_copy_cb(void *opaque, rs_long_t pos, size_t *len,
* \todo Implement COPY commands.
*
* \sa rs_patch_file() \sa \ref api_streaming */
-rs_job_t *rs_patch_begin(rs_copy_cb * copy_cb, void *copy_arg);
+LIBRSYNC_EXPORT rs_job_t *rs_patch_begin(rs_copy_cb * copy_cb, void *copy_arg);
# ifndef RSYNC_NO_STDIO_INTERFACE
# include <stdio.h>
+/** Open a file with special handling for '-' or unspecified filenames.
+ *
+ * This provides a platform independent way to open large binary files. A
+ * filename "" or "-" means stdin for reading, or stdout for writing.
+ *
+ * \param filename - The filename to open.
+ *
+ * \param mode - fopen style mode string.
+ *
+ * \param force - bool to force overwriting of existing files. */
+LIBRSYNC_EXPORT FILE *rs_file_open(char const *filename, char const *mode,
+ int force);
+
+/** Close a file with special handling for stdin or stdout. */
+LIBRSYNC_EXPORT int rs_file_close(FILE *file);
+
+/** ::rs_copy_cb that reads from a stdio file. */
+LIBRSYNC_EXPORT rs_result rs_file_copy_cb(void *arg, rs_long_t pos, size_t *len,
+ void **buf);
+
/** Buffer sizes for file IO.
*
* The default 0 means use the recommended buffer size for the operation being
@@ -471,9 +503,10 @@ extern int rs_inbuflen, rs_outbuflen;
* \param stats Optional pointer to receive statistics.
*
* \sa \ref api_whole */
-rs_result rs_sig_file(FILE *old_file, FILE *sig_file, size_t block_len,
- size_t strong_len, rs_magic_number sig_magic,
- rs_stats_t *stats);
+LIBRSYNC_EXPORT rs_result rs_sig_file(FILE *old_file, FILE *sig_file,
+ size_t block_len, size_t strong_len,
+ rs_magic_number sig_magic,
+ rs_stats_t *stats);
/** Load signatures from a signature file into memory.
*
@@ -484,23 +517,21 @@ rs_result rs_sig_file(FILE *old_file, FILE *sig_file, size_t block_len,
* \param stats Optional pointer to receive statistics.
*
* \sa \ref api_whole */
-rs_result rs_loadsig_file(FILE *sig_file, rs_signature_t **sumset,
- rs_stats_t *stats);
-
-/** ::rs_copy_cb that reads from a stdio file. */
-rs_result rs_file_copy_cb(void *arg, rs_long_t pos, size_t *len, void **buf);
+LIBRSYNC_EXPORT rs_result rs_loadsig_file(FILE *sig_file,
+ rs_signature_t **sumset,
+ rs_stats_t *stats);
/** Generate a delta between a signature and a new file into a delta file.
*
* \sa \ref api_whole */
-rs_result rs_delta_file(rs_signature_t *, FILE *new_file, FILE *delta_file,
- rs_stats_t *);
+LIBRSYNC_EXPORT rs_result rs_delta_file(rs_signature_t *, FILE *new_file,
+ FILE *delta_file, rs_stats_t *);
/** Apply a patch, relative to a basis, into a new file.
*
* \sa \ref api_whole */
-rs_result rs_patch_file(FILE *basis_file, FILE *delta_file, FILE *new_file,
- rs_stats_t *);
+LIBRSYNC_EXPORT rs_result rs_patch_file(FILE *basis_file, FILE *delta_file,
+ FILE *new_file, rs_stats_t *);
# endif /* !RSYNC_NO_STDIO_INTERFACE */
# ifdef __cplusplus
diff --git a/src/rdiff.c b/src/rdiff.c
index 7c8be5f..36ddcb9 100644
--- a/src/rdiff.c
+++ b/src/rdiff.c
@@ -47,8 +47,8 @@
#include <stdlib.h>
#include <stdio.h>
+#include <stdarg.h>
#include <string.h>
-#include <fcntl.h>
#include <popt.h>
#ifdef HAVE_ZLIB_H
@@ -60,13 +60,7 @@
#endif
#include "librsync.h"
-#include "fileutil.h"
-#include "util.h"
-#include "trace.h"
#include "isprefix.h"
-#include "sumset.h"
-
-#define PROGRAM "rdiff"
static size_t block_len = RS_DEFAULT_BLOCK_LEN;
static size_t strong_len = 0;
@@ -81,7 +75,6 @@ enum {
OPT_GZIP = 1069, OPT_BZIP2
};
-extern int rs_roll_paranoia;
char *rs_hash_name;
const struct poptOption opts[] = {
@@ -103,24 +96,29 @@ const struct poptOption opts[] = {
{0}
};
-static void rdiff_usage(const char *error)
+static void rdiff_usage(const char *error, ...)
{
- fprintf(stderr, "%s\n" "Try `%s --help' for more information.\n", error,
- PROGRAM);
+ va_list va;
+ char buf[256];
+
+ va_start(va, error);
+ vsnprintf(buf, sizeof(buf), error, va);
+ va_end(va);
+ fprintf(stderr, "rdiff: %s\n\nTry `rdiff --help' for more information.\n",
+ buf);
}
static void rdiff_no_more_args(poptContext opcon)
{
if (poptGetArg(opcon)) {
- rdiff_usage("rdiff: too many arguments");
+ rdiff_usage("Too many arguments.");
exit(RS_SYNTAX_ERROR);
}
}
static void bad_option(poptContext opcon, int error)
{
- fprintf(stderr, "%s: %s: %s", PROGRAM, poptStrerror(error),
- poptBadOption(opcon, 0));
+ rdiff_usage("%s: %s", poptStrerror(error), poptBadOption(opcon, 0));
exit(RS_SYNTAX_ERROR);
}
@@ -192,7 +190,7 @@ static void rdiff_options(poptContext opcon)
exit(RS_DONE);
case 'v':
if (!rs_supports_trace()) {
- rs_error("library does not support trace");
+ fprintf(stderr, "rdiff: Library does not support trace.\n");
}
rs_trace_set_level(RS_LOG_DEBUG);
break;
@@ -211,7 +209,7 @@ static void rdiff_options(poptContext opcon)
else
bzip2_level = 9; /* demand the best */
}
- rs_error("sorry, compression is not really implemented yet");
+ rdiff_usage("Sorry, compression is not implemented yet.");
exit(RS_UNIMPLEMENTED);
default:
@@ -243,8 +241,8 @@ static rs_result rdiff_sig(poptContext opcon)
strong_len = 8;
sig_magic = RS_MD4_SIG_MAGIC;
} else {
- rs_error("unknown hash algorithm %s", rs_hash_name);
- return RS_PARAM_ERROR;
+ rdiff_usage("Unknown hash algorithm '%s'.", rs_hash_name);
+ exit(RS_SYNTAX_ERROR);
}
result =
@@ -273,7 +271,7 @@ static rs_result rdiff_delta(poptContext opcon)
if (!(sig_name = poptGetArg(opcon))) {
rdiff_usage("Usage for delta: "
"rdiff [OPTIONS] delta SIGNATURE [NEWFILE [DELTA]]");
- return RS_SYNTAX_ERROR;
+ exit(RS_SYNTAX_ERROR);
}
sig_file = rs_file_open(sig_name, "rb", file_force);
@@ -319,7 +317,7 @@ static rs_result rdiff_patch(poptContext opcon)
if (!(basis_name = poptGetArg(opcon))) {
rdiff_usage("Usage for patch: "
"rdiff [OPTIONS] patch BASIS [DELTA [NEW]]");
- return RS_SYNTAX_ERROR;
+ exit(RS_SYNTAX_ERROR);
}
basis_file = rs_file_open(basis_name, "rb", file_force);
@@ -354,8 +352,8 @@ static rs_result rdiff_action(poptContext opcon)
return rdiff_patch(opcon);
rdiff_usage
- ("rdiff: You must specify an action: `signature', `delta', or `patch'.");
- return RS_SYNTAX_ERROR;
+ ("You must specify an action: `signature', `delta', or `patch'.");
+ exit(RS_SYNTAX_ERROR);
}
int main(const int argc, const char *argv[])
@@ -363,12 +361,12 @@ int main(const int argc, const char *argv[])
poptContext opcon;
rs_result result;
- opcon = poptGetContext(PROGRAM, argc, argv, opts, 0);
+ opcon = poptGetContext("rdiff", argc, argv, opts, 0);
rdiff_options(opcon);
result = rdiff_action(opcon);
if (result != RS_DONE)
- rs_log(RS_LOG_ERR | RS_LOG_NONAME, "%s", rs_strerror(result));
+ fprintf(stderr, "rdiff: Failed, %s.\n", rs_strerror(result));
poptFreeContext(opcon);
return result;
diff --git a/src/sumset.c b/src/sumset.c
index e5f9d61..f541576 100644
--- a/src/sumset.c
+++ b/src/sumset.c
@@ -33,8 +33,8 @@
#include "util.h"
#include "trace.h"
-const int RS_MD4_SUM_LENGTH = 16;
-const int RS_BLAKE2_SUM_LENGTH = 32;
+LIBRSYNC_EXPORT const int RS_MD4_SUM_LENGTH = 16;
+LIBRSYNC_EXPORT const int RS_BLAKE2_SUM_LENGTH = 32;
static void rs_block_sig_init(rs_block_sig_t *sig, rs_weak_sum_t weak_sum,
rs_strong_sum_t *strong_sum, int strong_len)
diff --git a/src/sumset.h b/src/sumset.h
index 2000964..206fd25 100644
--- a/src/sumset.h
+++ b/src/sumset.h
@@ -77,9 +77,6 @@ rs_block_sig_t *rs_signature_add_block(rs_signature_t *sig,
rs_long_t rs_signature_find_match(rs_signature_t *sig, rs_weak_sum_t weak_sum,
void const *buf, size_t len);
-/** Log the rs_signature_find_match() stats. */
-void rs_signature_log_stats(rs_signature_t const *sig);
-
/** Assert that a signature is valid.
*
* We don't use a static inline function here so that assert failure output
diff --git a/src/version.c b/src/version.c
index ec6b8a9..801b06c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -20,5 +20,6 @@
*/
#include "config.h"
+#include "librsync_export.h"
-char const rs_librsync_version[] = (PACKAGE " " VERSION);
+LIBRSYNC_EXPORT char const rs_librsync_version[] = (PACKAGE " " VERSION);
diff --git a/src/whole.c b/src/whole.c
index 8e098ca..1039059 100644
--- a/src/whole.c
+++ b/src/whole.c
@@ -49,7 +49,7 @@
#include "util.h"
/** Whole file IO buffer sizes. */
-int rs_inbuflen = 0, rs_outbuflen = 0;
+LIBRSYNC_EXPORT int rs_inbuflen = 0, rs_outbuflen = 0;
/** Run a job continuously, with input to/from the two specified files.
*