[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Remove unused functions [was: Sharing libsvn_fs_* internals]

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-11-03 02:45:12 CET

Greg Hudson wrote:
> On Wed, 2005-11-02 at 13:33 +0000, Julian Foad wrote:
>
>>To recap, I'm talking about the two files subversion/libsvn_fs_{base,fs}/err.c
>>being almost identical.
>
> Note that most of the functions in libsvn_fs_fs/err.c are not used.

Good grief - so they're not. And a few in libsvn_fs_base/err.c too.

The attached patch removes them.

> Prior to the addition of lock.c, there were only four uses of the error
> helpers in all of FSFS.
>
> Also note that having error helper functions degrades the utility of
> file and line numbers in the --enable-maintainer-mode messages, and is
> not a practice we use widely outside the FS code.

Yes - I thought it was a bit odd, but I'm not going to be the one to change it.

>>It's not just those files. Presumably, if the two filesystems use the same set
>>of error messages, then there is much in common in their implementation. I
>>haven't looked further in detail.
>
> Although the FSFS code is based off the BDB code, I don't think there's
> much code to share (there's a path canonicalization function and some
> key generation functions, which shouldn't exist). Much of the shared

Good grief - stuff that "shouldn't exist"! The attached patch removes the
completely unused key-generation functions, but doesn't address those that are
still being used but shouldn't be.

> logic is at the higher levels ("how to open a path"), but calls out to
> different logic at the lower levels ("how to open a node-rev and read
> directory entries"). It's possible to share higher-level logic with
> lower-level differences, but it tends to be more awkward than sharing
> lower-level logic.
>
> Also, there's a fair amount of cleanup which could be done to the FSFS
> code which would render a lot of the BDB code vestigial. For instance,
> the dag layer doesn't really do much in FSFS, although eliminating it
> would take some doing.

Well, it would be worth cleaning up the FSFS code now that it's intended to be
widely used and supported. Any volunteers?

>>At the moment, while I'd be happy to go the clean, layered, potentially public
>>route, I don't think the amount of sharing is large enough to require that, and
>>so I'd be happy to put more shared stuff in libsvn_fs which is simpler in the
>>short term, as long as we keep our eyes open for the point when it starts to
>>get unreasonably complex and do the refactoring then.
>
> We actually did put small amounts of shared code into libsvn_fs
> initially, but ran into problems on OSX and Windows.

Thanks for these words of wisdom and experience, Greg.

- Julian

[[[
Delete some unused functions (and a string constant).

* subversion/libsvn_fs_base/err.c
* subversion/libsvn_fs_base/err.h
  (svn_fs_base__err_corrupt_node_revision, svn_fs_base__err_corrupt_clone,
   svn_fs_base__err_corrupt_id, svn_fs_base__err_corrupt_nodes_key,
   svn_fs_base__err_corrupt_next_id, svn_fs_base__err_path_syntax): Delete.
  (corrupt_id): Delete (from err.c).
  (svn_fs_base__err_corrupt_representation): Delete (from err.h).

* subversion/libsvn_fs_fs/err.c
* subversion/libsvn_fs_fs/err.h
  (svn_fs_fs__err_corrupt_node_revision, svn_fs_fs__err_corrupt_fs_revision,
   svn_fs_fs__err_corrupt_id, svn_fs_fs__err_corrupt_clone,
   svn_fs_fs__err_dangling_rev, svn_fs_fs__err_corrupt_nodes_key,
   svn_fs_fs__err_corrupt_next_id, svn_fs_fs__err_corrupt_txn,
   svn_fs_fs__err_corrupt_copy, svn_fs_fs__err_path_syntax,
   svn_fs_fs__err_no_such_txn, svn_fs_fs__err_no_such_copy,
   svn_fs_fs__err_bad_lock_token): Delete.
  (corrupt_id): Delete (from err.c).
  (svn_fs_fs__err_corrupt_representation): Delete (from err.h).

* subversion/libsvn_fs_fs/key-gen.c
* subversion/libsvn_fs_fs/key-gen.h
  (svn_fs_fs__getsize, svn_fs_fs__putsize, NEXT_KEY_KEY, svn_fs_fs__same_keys):
    Delete.
]]]

Index: subversion/libsvn_fs_base/err.c
===================================================================
--- subversion/libsvn_fs_base/err.c (revision 17146)
+++ subversion/libsvn_fs_base/err.c (working copy)
@@ -43,24 +43,6 @@ svn_fs_base__check_fs (svn_fs_t *fs)
 /* Building common error objects. */
 
 
-static svn_error_t *
-corrupt_id (const char *fmt, const svn_fs_id_t *id, svn_fs_t *fs)
-{
- svn_string_t *unparsed_id = svn_fs_base__id_unparse (id, fs->pool);
- return svn_error_createf (SVN_ERR_FS_CORRUPT, 0,
- fmt, unparsed_id->data, fs->path);
-}
-
-
-svn_error_t *
-svn_fs_base__err_corrupt_node_revision (svn_fs_t *fs, const svn_fs_id_t *id)
-{
- return
- corrupt_id (_("Corrupt node revision for node '%s' in filesystem '%s'"),
- id, fs);
-}
-
-
 svn_error_t *
 svn_fs_base__err_corrupt_fs_revision (svn_fs_t *fs, svn_revnum_t rev)
 {
@@ -72,28 +54,6 @@ svn_fs_base__err_corrupt_fs_revision (sv
 
 
 svn_error_t *
-svn_fs_base__err_corrupt_clone (svn_fs_t *fs,
- const char *svn_txn,
- const char *base_path)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_CORRUPT, 0,
- _("Corrupt clone record for '%s' in transaction '%s' in filesystem '%s'"),
- base_path, svn_txn, fs->path);
-}
-
-
-svn_error_t *
-svn_fs_base__err_corrupt_id (svn_fs_t *fs, const svn_fs_id_t *id)
-{
- return
- corrupt_id (_("Corrupt node revision id '%s' appears in filesystem '%s'"),
- id, fs);
-}
-
-
-svn_error_t *
 svn_fs_base__err_dangling_id (svn_fs_t *fs, const svn_fs_id_t *id)
 {
   svn_string_t *id_str = svn_fs_base__id_unparse (id, fs->pool);
@@ -115,27 +75,6 @@ svn_fs_base__err_dangling_rev (svn_fs_t
 
 
 svn_error_t *
-svn_fs_base__err_corrupt_nodes_key (svn_fs_t *fs)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_CORRUPT, 0,
- _("Malformed ID as key in 'nodes' table of filesystem '%s'"), fs->path);
-}
-
-
-svn_error_t *
-svn_fs_base__err_corrupt_next_id (svn_fs_t *fs, const char *table)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_CORRUPT, 0,
- _("Corrupt value for 'next-id' key in '%s' table of filesystem '%s'"),
- table, fs->path);
-}
-
-
-svn_error_t *
 svn_fs_base__err_corrupt_txn (svn_fs_t *fs,
                               const char *txn)
 {
@@ -170,17 +109,6 @@ svn_fs_base__err_not_mutable (svn_fs_t *
 
 
 svn_error_t *
-svn_fs_base__err_path_syntax (svn_fs_t *fs, const char *path)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_PATH_SYNTAX, 0,
- _("Search for malformed path '%s' in filesystem '%s'"),
- path, fs->path);
-}
-
-
-svn_error_t *
 svn_fs_base__err_no_such_txn (svn_fs_t *fs, const char *txn)
 {
   return
Index: subversion/libsvn_fs_base/err.h
===================================================================
--- subversion/libsvn_fs_base/err.h (revision 17146)
+++ subversion/libsvn_fs_base/err.h (working copy)
@@ -39,27 +39,10 @@ svn_error_t *svn_fs_base__check_fs (svn_
 /* Building common error objects. */
 
 
-/* SVN_ERR_FS_CORRUPT: the REPRESENTATION skel of node ID in FS is corrupt. */
-svn_error_t *svn_fs_base__err_corrupt_representation (svn_fs_t *fs,
- const svn_fs_id_t *id);
-
-/* SVN_ERR_FS_CORRUPT: the NODE-REVISION skel of node ID in FS is corrupt. */
-svn_error_t *svn_fs_base__err_corrupt_node_revision (svn_fs_t *fs,
- const svn_fs_id_t *id);
-
 /* SVN_ERR_FS_CORRUPT: the REVISION skel of revision REV in FS is corrupt. */
 svn_error_t *svn_fs_base__err_corrupt_fs_revision (svn_fs_t *fs,
                                                    svn_revnum_t rev);
 
-/* SVN_ERR_FS_CORRUPT: ID is a node ID, not a node revision ID. */
-svn_error_t *svn_fs_base__err_corrupt_id (svn_fs_t *fs, const svn_fs_id_t *id);
-
-/* SVN_ERR_FS_CORRUPT: the clone record for BASE_PATH in SVN_TXN in FS
- is corrupt. */
-svn_error_t *svn_fs_base__err_corrupt_clone (svn_fs_t *fs,
- const char *svn_txn,
- const char *base_path);
-
 /* SVN_ERR_FS_ID_NOT_FOUND: something in FS refers to node revision
    ID, but that node revision doesn't exist. */
 svn_error_t *svn_fs_base__err_dangling_id (svn_fs_t *fs,
@@ -69,13 +52,6 @@ svn_error_t *svn_fs_base__err_dangling_i
    but that filesystem revision doesn't exist. */
 svn_error_t *svn_fs_base__err_dangling_rev (svn_fs_t *fs, svn_revnum_t rev);
 
-/* SVN_ERR_FS_CORRUPT: a key in FS's `nodes' table is bogus. */
-svn_error_t *svn_fs_base__err_corrupt_nodes_key (svn_fs_t *fs);
-
-/* SVN_ERR_FS_CORRUPT: the `next-id' value in TABLE is bogus. */
-svn_error_t *svn_fs_base__err_corrupt_next_id (svn_fs_t *fs,
- const char *table);
-
 /* SVN_ERR_FS_CORRUPT: the entry for TXN in the `transactions' table
    is corrupt. */
 svn_error_t *svn_fs_base__err_corrupt_txn (svn_fs_t *fs, const char *txn);
@@ -89,9 +65,6 @@ svn_error_t *svn_fs_base__err_corrupt_co
 svn_error_t *svn_fs_base__err_not_mutable (svn_fs_t *fs, svn_revnum_t rev,
                                            const char *path);
 
-/* SVN_ERR_FS_PATH_SYNTAX: PATH is not a valid path name. */
-svn_error_t *svn_fs_base__err_path_syntax (svn_fs_t *fs, const char *path);
-
 /* SVN_ERR_FS_NO_SUCH_TRANSACTION: there is no transaction named TXN in FS. */
 svn_error_t *svn_fs_base__err_no_such_txn (svn_fs_t *fs, const char *txn);
 
Index: subversion/libsvn_fs_fs/err.c
===================================================================
--- subversion/libsvn_fs_fs/err.c (revision 17146)
+++ subversion/libsvn_fs_fs/err.c (working copy)
@@ -43,56 +43,6 @@ svn_fs_fs__check_fs (svn_fs_t *fs)
 /* Building common error objects. */
 
 
-static svn_error_t *
-corrupt_id (const char *fmt, const svn_fs_id_t *id, svn_fs_t *fs)
-{
- svn_string_t *unparsed_id = svn_fs_fs__id_unparse (id, fs->pool);
- return svn_error_createf (SVN_ERR_FS_CORRUPT, 0,
- fmt, unparsed_id->data, fs->path);
-}
-
-
-svn_error_t *
-svn_fs_fs__err_corrupt_node_revision (svn_fs_t *fs, const svn_fs_id_t *id)
-{
- return
- corrupt_id (_("Corrupt node revision for node '%s' in filesystem '%s'"),
- id, fs);
-}
-
-
-svn_error_t *
-svn_fs_fs__err_corrupt_fs_revision (svn_fs_t *fs, svn_revnum_t rev)
-{
- return svn_error_createf
- (SVN_ERR_FS_CORRUPT, 0,
- _("Corrupt filesystem revision %ld in filesystem '%s'"),
- rev, fs->path);
-}
-
-
-svn_error_t *
-svn_fs_fs__err_corrupt_clone (svn_fs_t *fs,
- const char *svn_txn,
- const char *base_path)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_CORRUPT, 0,
- _("Corrupt clone record for '%s' in transaction '%s' in filesystem '%s'"),
- base_path, svn_txn, fs->path);
-}
-
-
-svn_error_t *
-svn_fs_fs__err_corrupt_id (svn_fs_t *fs, const svn_fs_id_t *id)
-{
- return
- corrupt_id (_("Corrupt node revision id '%s' appears in filesystem '%s'"),
- id, fs);
-}
-
-
 svn_error_t *
 svn_fs_fs__err_dangling_id (svn_fs_t *fs, const svn_fs_id_t *id)
 {
@@ -105,60 +55,6 @@ svn_fs_fs__err_dangling_id (svn_fs_t *fs
 
 
 svn_error_t *
-svn_fs_fs__err_dangling_rev (svn_fs_t *fs, svn_revnum_t rev)
-{
- return svn_error_createf
- (SVN_ERR_FS_NO_SUCH_REVISION, 0,
- _("Reference to non-existent revision %ld in filesystem '%s'"),
- rev, fs->path);
-}
-
-
-svn_error_t *
-svn_fs_fs__err_corrupt_nodes_key (svn_fs_t *fs)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_CORRUPT, 0,
- _("Malformed ID as key in 'nodes' table of filesystem '%s'"), fs->path);
-}
-
-
-svn_error_t *
-svn_fs_fs__err_corrupt_next_id (svn_fs_t *fs, const char *table)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_CORRUPT, 0,
- _("Corrupt value for 'next-id' key in '%s' table of filesystem '%s'"),
- table, fs->path);
-}
-
-
-svn_error_t *
-svn_fs_fs__err_corrupt_txn (svn_fs_t *fs,
- const char *txn)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_CORRUPT, 0,
- _("Corrupt entry in 'transactions' table for '%s'"
- " in filesystem '%s'"), txn, fs->path);
-}
-
-
-svn_error_t *
-svn_fs_fs__err_corrupt_copy (svn_fs_t *fs, const char *copy_id)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_CORRUPT, 0,
- _("Corrupt entry in 'copies' table for '%s' in filesystem '%s'"),
- copy_id, fs->path);
-}
-
-
-svn_error_t *
 svn_fs_fs__err_not_mutable (svn_fs_t *fs, svn_revnum_t rev, const char *path)
 {
   return
@@ -170,28 +66,6 @@ svn_fs_fs__err_not_mutable (svn_fs_t *fs
 
 
 svn_error_t *
-svn_fs_fs__err_path_syntax (svn_fs_t *fs, const char *path)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_PATH_SYNTAX, 0,
- _("Search for malformed path '%s' in filesystem '%s'"),
- path, fs->path);
-}
-
-
-svn_error_t *
-svn_fs_fs__err_no_such_txn (svn_fs_t *fs, const char *txn)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_NO_SUCH_TRANSACTION, 0,
- _("No transaction named '%s' in filesystem '%s'"),
- txn, fs->path);
-}
-
-
-svn_error_t *
 svn_fs_fs__err_txn_not_mutable (svn_fs_t *fs, const char *txn)
 {
   return
@@ -203,16 +77,6 @@ svn_fs_fs__err_txn_not_mutable (svn_fs_t
 
 
 svn_error_t *
-svn_fs_fs__err_no_such_copy (svn_fs_t *fs, const char *copy_id)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_NO_SUCH_COPY, 0,
- _("No copy with id '%s' in filesystem '%s'"), copy_id, fs->path);
-}
-
-
-svn_error_t *
 svn_fs_fs__err_not_directory (svn_fs_t *fs, const char *path)
 {
   return
@@ -235,17 +99,6 @@ svn_fs_fs__err_not_file (svn_fs_t *fs, c
 
 
 svn_error_t *
-svn_fs_fs__err_bad_lock_token (svn_fs_t *fs, const char *lock_token)
-{
- return
- svn_error_createf
- (SVN_ERR_FS_BAD_LOCK_TOKEN, 0,
- _("Token '%s' does not point to any existing lock in filesystem '%s'"),
- lock_token, fs->path);
-}
-
-
-svn_error_t *
 svn_fs_fs__err_corrupt_lockfile (svn_fs_t *fs, const char *path)
 {
   return
Index: subversion/libsvn_fs_fs/err.h
===================================================================
--- subversion/libsvn_fs_fs/err.h (revision 17146)
+++ subversion/libsvn_fs_fs/err.h (working copy)
@@ -39,79 +39,26 @@ svn_error_t *svn_fs_fs__check_fs (svn_fs
 /* Building common error objects. */
 
 
-/* SVN_ERR_FS_CORRUPT: the REPRESENTATION skel of node ID in FS is corrupt. */
-svn_error_t *svn_fs_fs__err_corrupt_representation (svn_fs_t *fs,
- const svn_fs_id_t *id);
-
-/* SVN_ERR_FS_CORRUPT: the NODE-REVISION skel of node ID in FS is corrupt. */
-svn_error_t *svn_fs_fs__err_corrupt_node_revision (svn_fs_t *fs,
- const svn_fs_id_t *id);
-
-/* SVN_ERR_FS_CORRUPT: the REVISION skel of revision REV in FS is corrupt. */
-svn_error_t *svn_fs_fs__err_corrupt_fs_revision (svn_fs_t *fs,
- svn_revnum_t rev);
-
-/* SVN_ERR_FS_CORRUPT: ID is a node ID, not a node revision ID. */
-svn_error_t *svn_fs_fs__err_corrupt_id (svn_fs_t *fs, const svn_fs_id_t *id);
-
-/* SVN_ERR_FS_CORRUPT: the clone record for BASE_PATH in SVN_TXN in FS
- is corrupt. */
-svn_error_t *svn_fs_fs__err_corrupt_clone (svn_fs_t *fs,
- const char *svn_txn,
- const char *base_path);
-
 /* SVN_ERR_FS_ID_NOT_FOUND: something in FS refers to node revision
    ID, but that node revision doesn't exist. */
 svn_error_t *svn_fs_fs__err_dangling_id (svn_fs_t *fs,
                                          const svn_fs_id_t *id);
 
-/* SVN_ERR_FS_CORRUPT: something in FS refers to filesystem revision REV,
- but that filesystem revision doesn't exist. */
-svn_error_t *svn_fs_fs__err_dangling_rev (svn_fs_t *fs, svn_revnum_t rev);
-
-/* SVN_ERR_FS_CORRUPT: a key in FS's `nodes' table is bogus. */
-svn_error_t *svn_fs_fs__err_corrupt_nodes_key (svn_fs_t *fs);
-
-/* SVN_ERR_FS_CORRUPT: the `next-id' value in TABLE is bogus. */
-svn_error_t *svn_fs_fs__err_corrupt_next_id (svn_fs_t *fs,
- const char *table);
-
-/* SVN_ERR_FS_CORRUPT: the entry for TXN in the `transactions' table
- is corrupt. */
-svn_error_t *svn_fs_fs__err_corrupt_txn (svn_fs_t *fs, const char *txn);
-
-/* SVN_ERR_FS_CORRUPT: the entry for COPY_ID in the `copies' table
- is corrupt. */
-svn_error_t *svn_fs_fs__err_corrupt_copy (svn_fs_t *fs, const char *copy_id);
-
 /* SVN_ERR_FS_NOT_MUTABLE: the caller attempted to change a node
    outside of a transaction. */
 svn_error_t *svn_fs_fs__err_not_mutable (svn_fs_t *fs, svn_revnum_t rev,
                                          const char *path);
 
-/* SVN_ERR_FS_PATH_SYNTAX: PATH is not a valid path name. */
-svn_error_t *svn_fs_fs__err_path_syntax (svn_fs_t *fs, const char *path);
-
-/* SVN_ERR_FS_NO_SUCH_TRANSACTION: there is no transaction named TXN in FS. */
-svn_error_t *svn_fs_fs__err_no_such_txn (svn_fs_t *fs, const char *txn);
-
 /* SVN_ERR_FS_TRANSACTION_NOT_MUTABLE: trying to change the
    unchangeable transaction named TXN in FS. */
 svn_error_t *svn_fs_fs__err_txn_not_mutable (svn_fs_t *fs, const char *txn);
 
-/* SVN_ERR_FS_NO_SUCH_COPY: there is no copy with id COPY_ID in FS. */
-svn_error_t *svn_fs_fs__err_no_such_copy (svn_fs_t *fs, const char *copy_id);
-
 /* SVN_ERR_FS_NOT_DIRECTORY: PATH does not refer to a directory in FS. */
 svn_error_t *svn_fs_fs__err_not_directory (svn_fs_t *fs, const char *path);
 
 /* SVN_ERR_FS_NOT_FILE: PATH does not refer to a file in FS. */
 svn_error_t *svn_fs_fs__err_not_file (svn_fs_t *fs, const char *path);
 
-/* SVN_ERR_FS_BAD_LOCK_TOKEN: LOCK_TOKEN does not refer to a lock in FS. */
-svn_error_t *svn_fs_fs__err_bad_lock_token (svn_fs_t *fs,
- const char *lock_token);
-
 /* SVN_ERR_FS_CORRUPT: the lockfile for PATH in FS is corrupt. */
 svn_error_t *svn_fs_fs__err_corrupt_lockfile (svn_fs_t *fs,
                                               const char *path);
Index: subversion/libsvn_fs_fs/key-gen.c
===================================================================
--- subversion/libsvn_fs_fs/key-gen.c (revision 17146)
+++ subversion/libsvn_fs_fs/key-gen.c (working copy)
@@ -17,107 +17,11 @@
 
 #include <assert.h>
 #include <string.h>
-
-#define APR_WANT_STRFUNC
-#include <apr_want.h>
 #include <stdlib.h>
 #include <apr.h>
 #include "key-gen.h"
 
 
-/* Converting text to numbers. */
-
-apr_size_t
-svn_fs_fs__getsize (const char *data, apr_size_t len,
- const char **endptr,
- apr_size_t max)
-{
- /* We can't detect overflow by simply comparing value against max,
- since multiplying value by ten can overflow in strange ways if
- max is close to the limits of apr_size_t. For example, suppose
- that max is 54, and apr_size_t is six bits long; its range is
- 0..63. If we're parsing the number "502", then value will be 50
- after parsing the first two digits. 50 * 10 = 500. But 500
- doesn't fit in an apr_size_t, so it'll be truncated to 500 mod 64
- = 52, which is less than max, so we'd fail to recognize the
- overflow. Furthermore, it *is* greater than 50, so you can't
- detect overflow by checking whether value actually increased
- after each multiplication --- sometimes it does increase, but
- it's still wrong.
-
- So we do the check for overflow before we multiply value and add
- in the new digit. */
- apr_size_t max_prefix = max / 10;
- apr_size_t max_digit = max % 10;
- apr_size_t i;
- apr_size_t value = 0;
-
- for (i = 0; i < len && '0' <= data[i] && data[i] <= '9'; i++)
- {
- apr_size_t digit = data[i] - '0';
-
- /* Check for overflow. */
- if (value > max_prefix
- || (value == max_prefix && digit > max_digit))
- {
- *endptr = 0;
- return 0;
- }
-
- value = (value * 10) + digit;
- }
-
- /* There must be at least one digit there. */
- if (i == 0)
- {
- *endptr = 0;
- return 0;
- }
- else
- {
- *endptr = data + i;
- return value;
- }
-}
-
-
-
-/* Converting numbers to text. */
-
-int
-svn_fs_fs__putsize (char *data, apr_size_t len, apr_size_t value)
-{
- apr_size_t i = 0;
-
- /* Generate the digits, least-significant first. */
- do
- {
- if (i >= len)
- return 0;
-
- data[i] = (value % 10) + '0';
- value /= 10;
- i++;
- }
- while (value > 0);
-
- /* Put the digits in most-significant-first order. */
- {
- int left, right;
-
- for (left = 0, right = i-1; left < right; left++, right--)
- {
- char t = data[left];
- data[left] = data[right];
- data[right] = t;
- }
- }
-
- return i;
-}
-
-
-
 /*** Keys for reps and strings. ***/
 
 void
@@ -156,9 +60,6 @@ svn_fs_fs__add_keys (const char *key1, c
 
   result[i1] = '\0';
 }
-
-
-const char NEXT_KEY_KEY[] = "next-key";
 
 
 void
@@ -242,16 +143,3 @@ svn_fs_fs__key_compare (const char *a, c
   cmp = strcmp (a, b);
   return (cmp ? (cmp / abs (cmp)) : 0);
 }
-
-
-svn_boolean_t
-svn_fs_fs__same_keys (const char *a, const char *b)
-{
- if (! (a || b))
- return TRUE;
- if (a && (! b))
- return FALSE;
- if ((! a) && b)
- return FALSE;
- return (strcmp (a, b) == 0) ? TRUE : FALSE;
-}
Index: subversion/libsvn_fs_fs/key-gen.h
===================================================================
--- subversion/libsvn_fs_fs/key-gen.h (revision 17146)
+++ subversion/libsvn_fs_fs/key-gen.h (working copy)
@@ -47,31 +47,6 @@ extern "C" {
 #define MAX_KEY_SIZE 200
 
 
-/* Return the value of the string of digits at DATA as an ASCII
- decimal number. The string is at most LEN bytes long. The value
- of the number is at most MAX. Set *END to the address of the first
- byte after the number, or zero if an error occurred while
- converting the number (overflow, for example).
-
- We would like to use strtoul, but that family of functions is
- locale-dependent, whereas we're trying to parse data in a
- local-independent format. */
-
-apr_size_t svn_fs_fs__getsize (const char *data, apr_size_t len,
- const char **endptr, apr_size_t max);
-
-
-/* Store the ASCII decimal representation of VALUE at DATA. Return
- the length of the representation if all goes well; return zero if
- the result doesn't fit in LEN bytes. */
-int svn_fs_fs__putsize (char *data, apr_size_t len, apr_size_t value);
-
-
-/* In the `representations' and `strings', the value at this key is
- the key to use when storing a new rep or string. */
-extern const char NEXT_KEY_KEY[];
-
-
 /* Generate the next key after a given alphanumeric key.
  *
  * The first *LEN bytes of THIS are an ascii representation of a
@@ -100,13 +75,6 @@ void svn_fs_fs__next_key (const char *th
  */
 int svn_fs_fs__key_compare (const char *a, const char *b);
 
-/* Compare two strings A and B as base-36 alphanumber keys.
- *
- * Return TRUE iff both keys are NULL or both keys have the same
- * contents.
- */
-svn_boolean_t svn_fs_fs__same_keys (const char *a, const char *b);
-
 /* Add two base-36 alphanumeric keys to get a third, the result. */
 void svn_fs_fs__add_keys (const char *key1, const char *key2, char *result);
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 3 02:46:16 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.