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

[PATCH] Rename svn_io_file_printf

From: Erik Hülsmann <e.huelsmann_at_gmx.net>
Date: 2003-12-16 20:46:46 CET
('binary' encoding is not supported, stored as-is) Ok, since we seem to be finalizing our API for 1.0, I propose the following patch.

There are no functional changes in this patch. It only renames svn_io_file_printf
to svn_io_file_printf_from_utf8.

In the current svn_io_file_* API most functions are only wrappers around
apr_file_* functions which use a wrapper function to convert the APR error to
a SVN error. The exception is svn_io_file_printf which also converts its input
from UTF-8 to generate output in the current locale. Functions in the utf8 module
which behave similarly use a _from_utf8 suffix. This patch applies the same suffix
to svn_io_file_printf.

Nice side-effect is that it should be really easy to implement the svn_io_file_printf
wrapper around its APR counterpart once this is out of the way. The svn_io_file_printf
enables some code cleanups in (at least) libsvn_client.

Log:
[[[
Rename svn_io_file_printf to svn_io_file_printf_from_utf8
cf. the svn_utf8_* api. This allows for writing a true wrapper
for apr_file_printf: svn_io_file_printf.

* subversion/include/svn_io.h
* subversion/libsvn_diff/diff_file.c
* subversion/libsvn_subr/io.c
* subversion/libsvn_client/diff.c
  Rename svn_io_file_printf
]]]

Index: subversion/include/svn_io.h
===================================================================
--- subversion/include/svn_io.h (revision 8016)
+++ subversion/include/svn_io.h (working copy)
@@ -742,7 +742,7 @@
  * native encoding before printing.
  */
 svn_error_t *
-svn_io_file_printf (apr_file_t *fptr, const char *format, ...);
+svn_io_file_printf_from_utf8 (apr_file_t *fptr, const char *format, ...);
 
 
 
Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c (revision 8016)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -1994,7 +1994,7 @@
 
 
 svn_error_t *
-svn_io_file_printf (apr_file_t *fptr, const char *format, ...)
+svn_io_file_printf_from_utf8 (apr_file_t *fptr, const char *format, ...)
 {
   va_list ap;
   const char *buf, *buf_apr;
Index: subversion/libsvn_client/diff.c
===================================================================
--- subversion/libsvn_client/diff.c (revision 8016)
+++ subversion/libsvn_client/diff.c (working copy)
@@ -66,11 +66,11 @@
 {
   int i;
 
- SVN_ERR (svn_io_file_printf (file,
- APR_EOL_STR "Property changes on: %s"
- APR_EOL_STR, path));
+ SVN_ERR (svn_io_file_printf_from_utf8 (file,
+ APR_EOL_STR "Property changes on: %s"
+ APR_EOL_STR, path));
 
- /* ### todo [issue #1533]: Use svn_io_file_printf() to convert this
+ /* ### todo [issue #1533]: Use svn_io_file_printf_from_utf8() to convert this
      line of dashes to native encoding, at least conditionally? Or is
      it better to have under_string always output the same, so
      programs can find it? Also, what about checking for error? */
@@ -89,8 +89,8 @@
       else
         original_value = NULL;
       
- SVN_ERR (svn_io_file_printf (file, "Name: %s" APR_EOL_STR,
- propchange->name));
+ SVN_ERR (svn_io_file_printf_from_utf8 (file, "Name: %s" APR_EOL_STR,
+ propchange->name));
 
       /* For now, we have a rather simple heuristic: if this is an
          "svn:" property, then assume the value is UTF-8 and must
@@ -103,7 +103,7 @@
           {
             if (val_is_utf8)
               {
- SVN_ERR (svn_io_file_printf
+ SVN_ERR (svn_io_file_printf_from_utf8
                          (file, " - %s" APR_EOL_STR, original_value->data));
               }
             else
@@ -118,7 +118,7 @@
           {
             if (val_is_utf8)
               {
- SVN_ERR (svn_io_file_printf
+ SVN_ERR (svn_io_file_printf_from_utf8
                          (file, " + %s" APR_EOL_STR,
                           propchange->value->data));
               }
@@ -132,7 +132,7 @@
       }
     }
 
- /* ### todo [issue #1533]: Use svn_io_file_printf() to convert this
+ /* ### todo [issue #1533]: Use svn_io_file_printf_from_utf8() to convert this
      to native encoding, at least conditionally? Or is it better to
      have under_string always output the same eol, so programs can
      find it consistently? Also, what about checking for error? */
@@ -533,7 +533,7 @@
   if (state)
     *state = svn_wc_notify_state_unknown;
 
- SVN_ERR (svn_io_file_printf
+ SVN_ERR (svn_io_file_printf_from_utf8
            (diff_cmd_baton->outfile,
             "Index: %s (deleted)" APR_EOL_STR "%s" APR_EOL_STR,
             path, equal_string));

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Dec 16 20:47:19 2003

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.