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

[PATCH] Add svn_cmdline_printf and friends

From: Peter N. Lundblad <lundblad_at_softhome.net>
Date: 2004-05-08 22:34:28 CEST


Here is my first implementation of svn_cmdline_printf, svn_cmdline_fprintf
and svn_cmdline_fputs. The difference between the stdio ones and these is
that the svn_cmdline_* functions use APR's printf functinoality and they
expect their arguments to be in UTF-8 and converts to the output encoding.
I think this is better than having to remember to convert on every printf
call in the code.

There are about 250 places in the code that use printf/fprintf/fputs
today. I intend to do the replacement work for these *after* you think
this is a good idea. :-)

About error handling: The functions return an svn_error_t *, but currently
they will always return SVN_NO_ERROR. If the UTF-8 conversion fails, the
_fuzzy variant is used, and it can't fail. No error checking from the
actual output (fputs) call is done. This is consistent with what the code
does today. Also, what should a cmdline app do if it can't write to stdout
or stderr? For this reason, we could change the return value to void.


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Sat May 8 22:25:07 2004

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.