Make the constructor "svn_checksum__from_digest()" public as well byrenaming it to "svn_checksum_from_digest()", because it is the logicalcomplement of the "get" accessors.

* subversion/include/s​vn_checksum.h,subversion/libsvn_su​br/checksum.c (svn_checksum_t): Move the definition from the header to the source file, leaving just a declaration in the header. Make the "digest" field non-const and remove all the type casts that were used to write to it throughout the rest of this source file. (svn_checksum_size): Rename to ... (svn_checksum_get_size): ... this and add "const" on the input parameter. (svn _checksum_get_kind, svn_checksum_get_digest): New functions. (svn_checksum__from_digest): Rename to ... (svn_checksum_from_digest): ... this.

* subversion/libsvn_cl​ient/commit.c,subversion/libsvn_cl​ient/commit_util.c,subversion/libsvn_cl​ient/export.c,subversion/libsvn_de​lta/text_delta.c,subversion/libsvn_fs​_base/bdb/checksum-r​eps-table.c,subversion/libsvn_fs​_base/bdb/dbt.c,subversion/libsvn_fs​_base/dag.c,subversion/libsvn_fs​_base/reps-strings.c​,subversion/libsvn_fs​_base/tree.c,subversion/libsvn_fs​_base/util/fs_skels.​c, subversion/libsvn_fs_fs/dag.c,subversion/libsvn_fs​_fs/fs_fs.c,subversion/libsvn_fs​/fs-loader.c,subversion/libsvn_fs​_fs/rep-cache.c, subversion/libsvn_fs_fs/tree.c, subversion/libsvn_subr/io.c,subversion/libsvn_su​br/stream.c,subversion/libsvn_wc​/adm_crawler.c, subversion/libsvn_wc/adm_ops.c,subversion/libsvn_wc​/update_editor.c Adjust for the renaming of svn_checksum__from_digest(). Use the accessor functions instead of direct access.

* subversion/libsvn_su​br/svn_base64.c (svn_base64_from_checksum): Use the accessor functions instead of direct access. (svn_base64_from_md5): Use svn_checksum__from_digest to simplify and avoid direct write access to a checksum.

* subversion/tests/lib​svn_delta/window-tes​t.c (stream_window_test): Use svn_checksum_from_digest() to simplify and avoid direct write access to a checksum.

/* We only allow SHA1 checksums in this table. */- if (checksum->kind != svn_checksum_sha1)+ if (svn_checksum_get_ki​nd(checksum) != svn_checksum_sha1) return svn_error_create(SVN​_ERR_BAD_CHECKSUM_KI​ND, NULL, _("Only SHA1 checksums can be used as keys in the " "checksum-reps table.\n"));

/* Until we finalize the node, its data_key points to the old contents, in other words, the base text. */- SVN_ERR(svn_fs_base_​_dag_file_checksum(​&checksum,- tb->base_checksum->kind,+ SVN_ERR(svn_fs_base_​_dag_file_checksum(​&checksum, svn_checksum_get_kind(+ tb->base_checksum), tb->node, trail, trail->pool)); /* TODO: This only compares checksums if they are the same kind, but we're calculating both SHA1 and MD5 checksums somewhere in reps-strings.c. Could we keep them both around somehow so this check could be more comprehensive? */- if (tb->base_checksum->kind == checksum->kind- && !svn_checksum_match(​tb->base_checksum​, checksum))+ if (svn_checksum_get_ki​nd(tb->base_check​sum)+ == svn_checksum_get_kind(checksum)+ && !svn_checksum_match(​tb->base_checksum​, checksum)) return svn_error_createf (SVN_ERR_CHECKSUM_MISMATCH, NULL,

/* We only allow SHA1 checksums in this table. */- if (checksum->kind != svn_checksum_sha1)+ if (svn_checksum_get_ki​nd(checksum) != svn_checksum_sha1) return svn_error_create(SVN​_ERR_BAD_CHECKSUM_KI​ND, NULL, _("Only SHA1 checksums can be used as keys in the " "rep_cache table.\n"));

+struct svn_checksum_t+{+ /** The bytes of the checksum digest. */+ unsigned char *digest;++ /** The type of the checksum. This should never be changed by consumers+ of the APIs. */+ svn_checksum_kind_t kind;+};+