Skip to content

Commit b204502

Browse files
committed
Exclude the svn_xml_make_parse_stream() function from the public API by making
it private. - This function does not have any real usages (yet). That's why we don't want to include it into 1.15 public API. Let's keep it simple. - This change also renames svn_xml_make_parse_stream to svn_xml__make_parse_stream to match naming conventions. - The function has never been officially released, which justfies its removal from the public API. * subversion/include/private/svn_xml_private.h (): New header file. (svn_xml__make_parse_stream): New function. * subversion/include/svn_xml.h (svn_xml_make_parse_stream): Remove function. * subversion/libsvn_subr/xml_stream.c (includes): Add private/svn_xml_private.h (svn_xml_make_parse_stream): Adjust name. * subversion/tests/libsvn_subr/xml-test.c (includes): Add private/svn_xml_private.h (...): Adjust usages. git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1930607 13f79535-47bb-0310-9956-ffa450edef68
1 parent ee85a97 commit b204502

File tree

4 files changed

+51
-20
lines changed

4 files changed

+51
-20
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* @copyright
3+
* ====================================================================
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
* ====================================================================
21+
* @endcopyright
22+
*
23+
* @file svn_xml_private.h
24+
* @brief Private XML API.
25+
*/
26+
27+
#include <apr.h>
28+
#include <apr_pools.h>
29+
30+
#include "svn_io.h" /* for svn_stream_t */
31+
#include "svn_xml.h"
32+
33+
/** Create a stream that wraps the XML parser described at @a parser.
34+
*
35+
* The stream produced will implement 'write' and 'close' methods. It
36+
* will push the data to the parser on write operation, and flush it on
37+
* close.
38+
*
39+
* This stream can be used as a generic writable stream, so the callers
40+
* may pipe any data there, for example, using the svn_stream_copy3
41+
* function, in case of a file source.
42+
*/
43+
svn_stream_t *
44+
svn_xml__make_parse_stream(svn_xml_parser_t *parser,
45+
apr_pool_t *result_pool);
46+

subversion/include/svn_xml.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
#include "svn_types.h"
3535
#include "svn_string.h"
36-
#include "svn_io.h" /* for svn_stream_t */
3736

3837
#ifdef __cplusplus
3938
extern "C" {
@@ -192,22 +191,6 @@ void
192191
svn_xml_free_parser(svn_xml_parser_t *svn_parser);
193192

194193

195-
/** Create a stream that wraps the XML parser described at @a parser.
196-
*
197-
* The stream produced will implement 'write' and 'close' methods. It
198-
* will push the data to the parser on write operation, and flush it on
199-
* close.
200-
*
201-
* This stream can be used as a generic writable stream, so the callers
202-
* may pipe any data there, for example, using the svn_stream_copy3
203-
* function, in case of a file source.
204-
*
205-
* @since New in 1.15.
206-
*/
207-
svn_stream_t *
208-
svn_xml_make_parse_stream(svn_xml_parser_t *parser,
209-
apr_pool_t *result_pool);
210-
211194

212195
/** Push @a len bytes of xml data in @a buf at @a svn_parser.
213196
*

subversion/libsvn_subr/xml_stream.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
/*** Includes. ***/
2727

28+
#include "private/svn_xml_private.h"
2829
#include "svn_error.h"
2930
#include "svn_io.h"
3031
#include "svn_xml.h"
@@ -94,7 +95,7 @@ xml_stream_close(void *baton)
9495
/* Public Interface */
9596

9697
svn_stream_t *
97-
svn_xml_make_parse_stream(svn_xml_parser_t *parser,
98+
svn_xml__make_parse_stream(svn_xml_parser_t *parser,
9899
apr_pool_t *result_pool)
99100
{
100101
svn_stream_t *result;

subversion/tests/libsvn_subr/xml-test.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include <apr.h>
2424

25+
#include "private/svn_xml_private.h"
2526
#include "svn_pools.h"
2627
#include "svn_string.h"
2728
#include "svn_xml.h"
@@ -343,7 +344,7 @@ test_xml_parse_stream(apr_pool_t *pool)
343344
b.buf = svn_stringbuf_create_empty(pool);
344345
b.parser = svn_xml_make_parser(&b, strbuf_start_elem, strbuf_end_elem,
345346
strbuf_cdata, pool);
346-
stream = svn_xml_make_parse_stream(b.parser, pool);
347+
stream = svn_xml__make_parse_stream(b.parser, pool);
347348

348349
SVN_ERR(svn_stream_puts(stream, xml));
349350
SVN_ERR(svn_stream_close(stream));
@@ -366,7 +367,7 @@ test_xml_parse_stream_invalid_xml(apr_pool_t *pool)
366367
b.buf = svn_stringbuf_create_empty(pool);
367368
b.parser = svn_xml_make_parser(&b, strbuf_start_elem, strbuf_end_elem,
368369
strbuf_cdata, pool);
369-
stream = svn_xml_make_parse_stream(b.parser, pool);
370+
stream = svn_xml__make_parse_stream(b.parser, pool);
370371

371372
err = svn_error_compose_create(svn_stream_puts(stream, xml),
372373
svn_stream_close(stream));

0 commit comments

Comments
 (0)