]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/subversion/subversion/svnrdump/util.c
Merge llvm trunk r366426, resolve conflicts, and update FREEBSD-Xlist.
[FreeBSD/FreeBSD.git] / contrib / subversion / subversion / svnrdump / util.c
1 /*
2  *  util.c: A few utility functions.
3  *
4  * ====================================================================
5  *    Licensed to the Apache Software Foundation (ASF) under one
6  *    or more contributor license agreements.  See the NOTICE file
7  *    distributed with this work for additional information
8  *    regarding copyright ownership.  The ASF licenses this file
9  *    to you under the Apache License, Version 2.0 (the
10  *    "License"); you may not use this file except in compliance
11  *    with the License.  You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  *    Unless required by applicable law or agreed to in writing,
16  *    software distributed under the License is distributed on an
17  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18  *    KIND, either express or implied.  See the License for the
19  *    specific language governing permissions and limitations
20  *    under the License.
21  * ====================================================================
22  */
23
24 #include "private/svn_repos_private.h"
25
26 #include "svnrdump.h"
27
28 \f
29 svn_error_t *
30 svn_rdump__normalize_props(apr_hash_t **normal_props,
31                            apr_hash_t *props,
32                            apr_pool_t *result_pool)
33 {
34   apr_hash_index_t *hi;
35   apr_pool_t *iterpool;
36
37   *normal_props = apr_hash_make(result_pool);
38
39   iterpool = svn_pool_create(result_pool);
40   for (hi = apr_hash_first(result_pool, props); hi;
41         hi = apr_hash_next(hi))
42     {
43       const char *key = apr_hash_this_key(hi);
44       const svn_string_t *value = apr_hash_this_val(hi);
45
46       svn_pool_clear(iterpool);
47
48       SVN_ERR(svn_repos__normalize_prop(&value, NULL, key, value,
49                                         result_pool, iterpool));
50       svn_hash_sets(*normal_props, key, value);
51     }
52   svn_pool_destroy(iterpool);
53
54   return SVN_NO_ERROR;
55 }