[[[ Adds a public API function, svn_subst_translate_string2(), an extension of svn_subst_translate_string(), that has two additional output parameters for determining whether re-encoding and/or line ending translation were performed. As discussed at: http://thread.gmane.org/gmane.comp.version-control.subversion.devel/122550 http://thread.gmane.org/gmane.comp.version-control.subversion.devel/123020 The essential changes are to the translate_newline() function, which now takes an svn_boolean_t pointer (through the translation_baton) which is set to TRUE if a different newline is written out. Most other changes are to pass the svn_boolean_t pointer through to translate_newline(). There were also concerns about the efficiency of the new translate_newline() given that it is called once per newline. The concern was that if TRANSLATED_EOL is NULL or already set to TRUE, then there would be a lot of wasted computation. The solution in this revision is to add a variant of translate_newline(), translate_newline_alt(), that has the same signature as translate_newline() except that it does not care about b->translated_eol. During newline normalization, a function pointer variable that was added to the translation baton is the address of either translate_newline() or translate_newline_alt(), allowing the variant that is used to be varied during normalization. This allows the code that sets TRANSLATED_EOL to run at most once per translation of a stream. And, if it's NULL, then translate_newline_alt() is always used. * subversion/include/svn_subst.h (svn_subst_translate_string2): New function. (svn_subst_translate_string): Deprecated in favor of svn_subst_translate_string2(). * subversion/libsvn_subr/subst.c (translate_newline): Now takes the pointer to the translation baton. If it writes out a different newline, then it sets b->translate_eol to TRUE. (translate_newline_alt): Copy of translate_newline() that does not care about the value of b->translated_eol. (translation_baton): Added the TRANSLATED_EOL and TRANSLATE_NEWLINE_FN fields. (create_translation_baton): Added a new parameter TRANSLATED_EOL that is passed to the resulting translation_baton. Sets TRANSLATE_NEWLINE_FN to either &translate_newline or &translate_newline_alt as appropriate. (translate_chunk): Replaced the three calls to translate_newline() with calls to TRANSLATE_NEWLINE_FN. (stream_translated): New static function. Its implementation is the old implementation of svn_subst_stream_translated(), but accepting another parameter, TRANSLATED_EOL, that is passed to the in/out translation batons that it creates. (svn_subst_stream_translated): Now a wrapper for stream_translated(). (translate_cstring): New static function. Its implementation is the old implementation of svn_subst_translate_cstring2(), but modified to accept another parameter, TRANSLATED_EOL, that is passed to stream_translated(). (svn_subst_translate_cstring2): Now a wrapper for translate_cstring(). (svn_subst_translate_string): Moved to deprecated.c. (svn_subst_translate_string2): New function. It takes a new parameter, TRANSLATED_EOL, and another pool parameter following the scratch pool & result pool pattern. The task of recording whether it translated a line ending is delegated to translate_cstring(). * subversion/libsvn_subr/deprecated.c Received the implementation of the deprecated wrapper function svn_subst_translate_string(). ]]]