subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1509577 - in /subversion/trunk/subversion: include/private/svn_subr_private.h libsvn_subr/spillbuf.c tests/libsvn_subr/spillbuf-test.c
Date Fri, 02 Aug 2013 07:59:56 GMT
Author: brane
Date: Fri Aug  2 07:59:55 2013
New Revision: 1509577

URL: http://svn.apache.org/r1509577
Log:
Revert part of r1509137: Remove extended constructors for spillbuf reader
and the spillbuf stream wrapper.

* subversion/include/private/svn_subr_private.h
  (svn_spillbuf__reader_create_extended,
   svn_stream__from_spillbuf_extended): Removed.
* subversion/libsvn_subr/spillbuf.c
  (svn_spillbuf__reader_create_extended,
   svn_stream__from_spillbuf,
   svn_stream__from_spillbuf_extended): Removed.
  (stream_from_reader): Renamed to svn_stream__from_spillbuf.
* subversion/tests/libsvn_subr/spillbuf-test.c
  (test_spillbuf_reader): Renamed from test_spillbuf__reader.
  (test_spillbuf_stream): Renamed from test_spillbuf__stream.
  (test_spillbuf_reader_spill_all,
   test_spillbuf_stream_spill_all): Removed.
  (test_funcs): Deleted obsolete tests.

Modified:
    subversion/trunk/subversion/include/private/svn_subr_private.h
    subversion/trunk/subversion/libsvn_subr/spillbuf.c
    subversion/trunk/subversion/tests/libsvn_subr/spillbuf-test.c

Modified: subversion/trunk/subversion/include/private/svn_subr_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_subr_private.h?rev=1509577&r1=1509576&r2=1509577&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_subr_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_subr_private.h Fri Aug  2 07:59:55 2013
@@ -179,15 +179,6 @@ svn_spillbuf__reader_create(apr_size_t b
                             apr_size_t maxsize,
                             apr_pool_t *result_pool);
 
-/* Create a spill-buffer with extra parameters, and a reader for it. */
-svn_spillbuf_reader_t *
-svn_spillbuf__reader_create_extended(apr_size_t blocksize,
-                                     apr_size_t maxsize,
-                                     svn_boolean_t delete_on_close,
-                                     svn_boolean_t spill_all_contents,
-                                     const char *dirpath,
-                                     apr_pool_t *result_pool);
-
 /* Read @a len bytes from @a reader into @a data. The number of bytes
    actually read is stored in @a amt. If the content is exhausted, then
    @a amt is set to zero. It will always be non-zero if the spill-buffer
@@ -227,16 +218,6 @@ svn_stream_t *
 svn_stream__from_spillbuf(apr_size_t blocksize,
                           apr_size_t maxsize,
                           apr_pool_t *result_pool);
-/* Return a stream built on top of a spillbuf, using the same arguments as
-   svn_spillbuf__create_extended(). */
-svn_stream_t *
-svn_stream__from_spillbuf_extended(apr_size_t blocksize,
-                                   apr_size_t maxsize,
-                                   svn_boolean_t delete_on_close,
-                                   svn_boolean_t spill_all_contents,
-                                   const char *dirpath,
-                                   apr_pool_t *result_pool);
-
 
 /** @} */
 

Modified: subversion/trunk/subversion/libsvn_subr/spillbuf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/spillbuf.c?rev=1509577&r1=1509576&r2=1509577&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/spillbuf.c (original)
+++ subversion/trunk/subversion/libsvn_subr/spillbuf.c Fri Aug  2 07:59:55 2013
@@ -531,22 +531,6 @@ svn_spillbuf__reader_create(apr_size_t b
   return sbr;
 }
 
-svn_spillbuf_reader_t *
-svn_spillbuf__reader_create_extended(apr_size_t blocksize,
-                                     apr_size_t maxsize,
-                                     svn_boolean_t delete_on_close,
-                                     svn_boolean_t spill_all_contents,
-                                     const char *dirpath,
-                                     apr_pool_t *result_pool)
-{
-  svn_spillbuf_reader_t *sbr = apr_pcalloc(result_pool, sizeof(*sbr));
-  init_spillbuf_extended(&sbr->buf, blocksize, maxsize,
-                         delete_on_close, spill_all_contents, dirpath,
-                         result_pool);
-  return sbr;
-}
-
-
 svn_error_t *
 svn_spillbuf__reader_read(apr_size_t *amt,
                           svn_spillbuf_reader_t *reader,
@@ -692,14 +676,15 @@ write_handler_spillbuf(void *baton, cons
 }
 
 
-/* Wrap a spillbuf reader into a stream. */
-static svn_stream_t *
-stream_from_reader(svn_spillbuf_reader_t *reader, apr_pool_t *result_pool)
+svn_stream_t *
+svn_stream__from_spillbuf(apr_size_t blocksize,
+                          apr_size_t maxsize,
+                          apr_pool_t *result_pool)
 {
   svn_stream_t *stream;
   struct spillbuf_baton *sb = apr_palloc(result_pool, sizeof(*sb));
 
-  sb->reader = reader;
+  sb->reader = svn_spillbuf__reader_create(blocksize, maxsize, result_pool);
   sb->scratch_pool = svn_pool_create(result_pool);
 
   stream = svn_stream_create(sb, result_pool);
@@ -709,28 +694,3 @@ stream_from_reader(svn_spillbuf_reader_t
 
   return stream;
 }
-
-svn_stream_t *
-svn_stream__from_spillbuf(apr_size_t blocksize,
-                          apr_size_t maxsize,
-                          apr_pool_t *result_pool)
-{
-  return stream_from_reader(
-      svn_spillbuf__reader_create(blocksize, maxsize, result_pool),
-      result_pool);
-}
-
-svn_stream_t *
-svn_stream__from_spillbuf_extended(apr_size_t blocksize,
-                                   apr_size_t maxsize,
-                                   svn_boolean_t delete_on_close,
-                                   svn_boolean_t spill_all_contents,
-                                   const char *dirpath,
-                                   apr_pool_t *result_pool)
-{
-  return stream_from_reader(
-      svn_spillbuf__reader_create_extended(
-          blocksize, maxsize, delete_on_close,
-          spill_all_contents, dirpath, result_pool),
-      result_pool);
-}

Modified: subversion/trunk/subversion/tests/libsvn_subr/spillbuf-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/spillbuf-test.c?rev=1509577&r1=1509576&r2=1509577&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/spillbuf-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/spillbuf-test.c Fri Aug  2 07:59:55 2013
@@ -305,8 +305,11 @@ test_spillbuf_interleaving_spill_all(apr
 }
 
 static svn_error_t *
-test_spillbuf__reader(apr_pool_t *pool, svn_spillbuf_reader_t *sbr)
+test_spillbuf_reader(apr_pool_t *pool)
 {
+  svn_spillbuf_reader_t *sbr = svn_spillbuf__reader_create(4 /* blocksize */,
+                                                           100 /* maxsize */,
+                                                           pool);
   apr_size_t amt;
   char buf[10];
 
@@ -331,29 +334,11 @@ test_spillbuf__reader(apr_pool_t *pool, 
 }
 
 static svn_error_t *
-test_spillbuf_reader(apr_pool_t *pool)
-{
-  svn_spillbuf_reader_t *sbr = svn_spillbuf__reader_create(4 /* blocksize */,
-                                                           100 /* maxsize */,
-                                                           pool);
-  return test_spillbuf__reader(pool, sbr);
-}
-
-static svn_error_t *
-test_spillbuf_reader_spill_all(apr_pool_t *pool)
-{
-  svn_spillbuf_reader_t *sbr = svn_spillbuf__reader_create_extended(
-                          4 /* blocksize */,
-                          100 /* maxsize */,
-                          TRUE /* delte on close */,
-                          TRUE /* spill all data */,
-                          NULL, pool);
-  return test_spillbuf__reader(pool, sbr);
-}
-
-static svn_error_t *
-test_spillbuf__stream(apr_pool_t *pool, svn_stream_t *stream)
+test_spillbuf_stream(apr_pool_t *pool)
 {
+  svn_stream_t *stream = svn_stream__from_spillbuf(8 /* blocksize */,
+                                                   15 /* maxsize */,
+                                                   pool);
   char readbuf[256];
   apr_size_t readlen;
   apr_size_t writelen;
@@ -397,27 +382,6 @@ test_spillbuf__stream(apr_pool_t *pool, 
 }
 
 static svn_error_t *
-test_spillbuf_stream(apr_pool_t *pool)
-{
-  svn_stream_t *stream = svn_stream__from_spillbuf(8 /* blocksize */,
-                                                   15 /* maxsize */,
-                                                   pool);
-  return test_spillbuf__stream(pool, stream);
-}
-
-static svn_error_t *
-test_spillbuf_stream_spill_all(apr_pool_t *pool)
-{
-  svn_stream_t *stream = svn_stream__from_spillbuf_extended(
-                          8 /* blocksize */,
-                          15 /* maxsize */,
-                          TRUE /* delte on close */,
-                          TRUE /* spill all data */,
-                          NULL, pool);
-  return test_spillbuf__stream(pool, stream);
-}
-
-static svn_error_t *
 test_spillbuf__rwfile(apr_pool_t *pool, svn_spillbuf_t *buf)
 {
   SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
@@ -612,11 +576,7 @@ struct svn_test_descriptor_t test_funcs[
     SVN_TEST_PASS2(test_spillbuf_interleaving_spill_all,
                    "interleaving reads and writes (spill-all-data)"),
     SVN_TEST_PASS2(test_spillbuf_reader, "spill buffer reader test"),
-    SVN_TEST_PASS2(test_spillbuf_reader_spill_all,
-                   "spill buffer reader test (spill-all-data)"),
     SVN_TEST_PASS2(test_spillbuf_stream, "spill buffer stream test"),
-    SVN_TEST_PASS2(test_spillbuf_stream_spill_all,
-                   "spill buffer stream test (spill-all-data)"),
     SVN_TEST_PASS2(test_spillbuf_rwfile, "read/write spill file"),
     SVN_TEST_PASS2(test_spillbuf_rwfile_spill_all,
                    "read/write spill file (spill-all-data)"),



Mime
View raw message