Author: stsp
Date: Thu Jun 2 21:18:19 2011
New Revision: 1130818
URL: http://svn.apache.org/viewvc?rev=1130818&view=rev
Log:
Remove svn_stream_readline_detect_eol() because it has no callers left.
* subversion/libsvn_diff/parse-diff.c: Remove mention in a comment.
* subversion/include/svn_io.h
(svn_stream_readline_detect_eol): Remove declaration.
* subversion/libsvn_subr/stream.c:
(): Remove mention of svn_stream_readline_detect_eol in some comments.
(scan_eol, svn_stream_readline_detect_eol): Remove.
Modified:
subversion/trunk/subversion/include/svn_io.h
subversion/trunk/subversion/libsvn_diff/parse-diff.c
subversion/trunk/subversion/libsvn_subr/stream.c
Modified: subversion/trunk/subversion/include/svn_io.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_io.h?rev=1130818&r1=1130817&r2=1130818&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_io.h (original)
+++ subversion/trunk/subversion/include/svn_io.h Thu Jun 2 21:18:19 2011
@@ -1180,24 +1180,6 @@ svn_stream_readline(svn_stream_t *stream
apr_pool_t *pool);
/**
- * Similar to svn_stream_readline(). The line-terminator is detected
- * automatically. If @a eol is not NULL, the detected line-terminator
- * is returned in @a *eol. If EOF is reached and the stream does not
- * end with a newline character, @a *eol will be NULL.
- *
- * @note This function will fail if @a stream does not support mark
- * and seek (see @ref svn_stream_supports_mark).
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_stream_readline_detect_eol(svn_stream_t *stream,
- svn_stringbuf_t **stringbuf,
- const char **eol,
- svn_boolean_t *eof,
- apr_pool_t *pool);
-
-/**
* Read the contents of the readable stream @a from and write them to the
* writable stream @a to calling @a cancel_func before copying each chunk.
*
Modified: subversion/trunk/subversion/libsvn_diff/parse-diff.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/parse-diff.c?rev=1130818&r1=1130817&r2=1130818&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/trunk/subversion/libsvn_diff/parse-diff.c Thu Jun 2 21:18:19
2011
@@ -269,8 +269,7 @@ parse_hunk_header(const char *header, sv
return TRUE;
}
-/* A helper function similar to svn_stream_readline_detect_eol(),
- * suitable for reading a line of text from a range in the patch file.
+/* A helper for reading a line of text from a range in the patch file.
*
* Allocate *STRINGBUF in RESULT_POOL, and read into it one line from FILE.
* Reading stops either after a line-terminator was found or after MAX_LEN
Modified: subversion/trunk/subversion/libsvn_subr/stream.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/stream.c?rev=1130818&r1=1130817&r2=1130818&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/stream.c (original)
+++ subversion/trunk/subversion/libsvn_subr/stream.c Thu Jun 2 21:18:19 2011
@@ -252,57 +252,12 @@ svn_stream_printf_from_utf8(svn_stream_t
return svn_stream_write(stream, translated, &len);
}
-/* Scan STREAM for an end-of-line indicatior, and return it in *EOL.
- * Set *EOL to NULL if the stream runs out before an end-of-line indicator
- * is found. */
-static svn_error_t *
-scan_eol(const char **eol, svn_stream_t *stream, apr_pool_t *pool)
-{
- const char *eol_str;
- svn_stream_mark_t *mark;
-
- SVN_ERR(svn_stream_mark(stream, &mark, pool));
-
- eol_str = NULL;
- while (! eol_str)
- {
- char buf[512];
- char *eolp;
- apr_size_t len;
-
- len = sizeof(buf);
- SVN_ERR(svn_stream_read(stream, buf, &len));
- if (len == 0)
- break; /* EOF */
- eol_str = svn_eol__detect_eol(buf, len, &eolp);
-
- /* Detect the case where '\r' is the last character in the buffer
- * and '\n' would be the first character in the next buffer. */
- if (eol_str && eol_str[0] == '\r' && eol_str[1] == '\0' &&
- eolp == buf + len - 1)
- {
- len = 1;
- SVN_ERR(svn_stream_read(stream, buf, &len));
- if (len == 0)
- break; /* EOF */
- else if (*buf == '\n')
- eol_str = "\r\n";
- }
- }
-
- SVN_ERR(svn_stream_seek(stream, mark));
-
- *eol = eol_str;
-
- return SVN_NO_ERROR;
-}
-
/* Size that 90% of the lines we encounter will be not longer than.
used by stream_readline_bytewise() and stream_readline_chunky().
*/
#define LINE_CHUNK_SIZE 80
-/* Guts of svn_stream_readline() and svn_stream_readline_detect_eol().
+/* Guts of svn_stream_readline().
* Returns the line read from STREAM in *STRINGBUF, and indicates
* end-of-file in *EOF. If DETECT_EOL is TRUE, the end-of-line indicator
* is detected automatically and returned in *EOL.
@@ -457,7 +412,7 @@ stream_readline_chunky(svn_stringbuf_t *
return svn_stream_skip(stream, total_parsed);
}
-/* Guts of svn_stream_readline() and svn_stream_readline_detect_eol().
+/* Guts of svn_stream_readline().
* Returns the line read from STREAM in *STRINGBUF, and indicates
* end-of-file in *EOF. EOL must point to the desired end-of-line
* indicator. STRINGBUF is allocated in POOL. */
@@ -510,27 +465,6 @@ svn_stream_readline(svn_stream_t *stream
pool));
}
-svn_error_t *
-svn_stream_readline_detect_eol(svn_stream_t *stream,
- svn_stringbuf_t **stringbuf,
- const char **eol,
- svn_boolean_t *eof,
- apr_pool_t *pool)
-{
- const char *eol_str = NULL;
- SVN_ERR(scan_eol(&eol_str, stream, pool));
- if (eol)
- *eol = eol_str;
-
- /* If we encountered EOF before EOL, EOL_STR can be anything. */
- if (! eol_str)
- eol_str = APR_EOL_STR;
-
- return svn_error_return(stream_readline(stringbuf, eof, eol_str, stream,
- pool));
-}
-
-
svn_error_t *svn_stream_copy3(svn_stream_t *from, svn_stream_t *to,
svn_cancel_func_t cancel_func,
void *cancel_baton,