Re: r1358110 - Promote two identical readline() helper functions to one
From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 19 Sep 2012 02:35:07 +0100 (BST)
> Author: stsp
> Date: Fri Jul 6 10:45:21 2012
Hi stefan.
+1 on combining two duplicate copies into one...
> Modified: subversion/trunk/subversion/include/svn_io.h
This is much like a variant of svn_io_read_length_line(). Can we move its declaration and definition adjacent to that function, and cross-reference their doc strings?
Can they share implementation? They look similar. svn_io_read_length_line() was optimized in r1381800, but this function was not.
This is also a bit like svn_stream_readline(). It has in common with svn_stream_readline() that the result is returned in a stringbuf. However, svn_io_read_length_line() writes into a plain memory area.
All three of these functions differ in how they handle EOLs.
The different combinations of output style and EOL handling tend to make the overall API get confusing. Can we do something to reduce that amount of difference?
One simple short-term solution to all the above would be to just make this new API private for the time being.
- Julian
> + * Allocate @a *stringbuf in @a result_pool, and read into it one line
Confusing that *eof can be set when it's not end-of-file. Can we set *eof only when it's end-of-file?
> + * The line-terminator is not stored in @a *stringbuf.
|
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.