Here is what I hope to be the final version of the actual API change portion
of the keywords-as-hash patch.
I would appreciate any reviews, especially regarding whether there are any
missing "const"s in the new APIs.
I have removed the implemetation of a $UUID$ keyword from this patch,
because it is an unrelated feature, and I don't recall any discussion on
whether $UUID$ was a suitable keyword name. Might other things apart from
repositories have UUIDs one day?
Max.
[[[
Revise keywords API - represent keywords as a hash for better extensibility.
Implement internal printf-like format characters for keyword expansion.
A part of issue #890. Note that this only introduces the new APIs - making
the rest of the code make use of them will be a separate commit.
Based on a patch by John Peacock <jpeacock@rowman.com>.
* subversion/includes/svn_subst.h:
(svn_subst_keywords_t): Deprecated.
(svn_subst_build_keywords2): Interface change; hash instead of struct.
(svn_subst_build_keywords): Deprecated.
(svn_subst_keywords_differ2): Interface change.
A new argument apr_pool_t *pool and use hash instead of struct.
(svn_subst_keywords_differ): Deprecated.
(svn_subst_translate_stream2): Interface change; hash instead of struct.
(svn_subst_translate_stream): Deprecated.
(svn_subst_copy_and_translate3): Interface change; hash instead of
struct.
(svn_subst_copy_and_translate2): Deprecated.
(svn_subst_translate_cstring2): Interface change; hash instead of struct.
(svn_subst_translate_cstring): Deprecated.
* subversion/includes/svn_types.h: (SVN_KEYWORD_REVISION_FORMAT,
(SVN_KEYWORD_DATE_FORMAT, SVN_KEYWORD_AUTHOR_FORMAT)
(SVN_KEYWORD_URL_FORMAT, SVN_KEYWORD_ID_FORMAT):
New defines - format strings for keyword expansion.
* subversion/libsvn_subr/svn_subst.c:
(keyword_printf): New private function;
printf-style formatting of keywords based on format strings.
(kwstruct_to_kwhash): New private function;
convert keywords struct into keywords hash.
(svn_subst_build_keywords): Convert to API compatibility wrapper.
(svn_subst_build_keywords2): Build keywords using keyword_printf().
(translate_keyword): Interface changes. Also, look up the keyword in the
passed in buffer, instead of trying to translate all possibilities.
(svn_subst_keywords_differ): Retain unchanged for API compatibility.
(svn_subst_keywords_differ2): New function;
compare two hashes instead of comparing individual structure elements.
(svn_subst_translate_stream): Convert to API compatibility wrapper.
(svn_subst_translate_stream2): Change interface only.
(svn_subst_translate_cstring): Convert to API compatibility wrapper.
(svn_subst_translate_cstring2): Update function call to new API version.
(svn_subst_copy_and_translate2): Convert to API combatibility wrapper.
(svn_subst_copy_and_translate3): Update function call to new API version.
(svn_subst_translate_string): Update function call to new API version.
(svn_subst_detranslate_string): Update function call to new API version.
]]]
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
- application/octet-stream attachment: 1c.patch
Received on Sun Apr 24 16:45:14 2005