]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/subversion/subversion/include/svn_base64.h
Update clang, llvm, lld, lldb, compiler-rt and libc++ version number to
[FreeBSD/FreeBSD.git] / contrib / subversion / subversion / include / svn_base64.h
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_base64.h
24  * @brief Base64 encoding and decoding functions
25  */
26
27 #ifndef SVN_BASE64_H
28 #define SVN_BASE64_H
29
30 #include <apr_pools.h>
31
32 #include "svn_types.h"
33 #include "svn_io.h"     /* for svn_stream_t */
34 #include "svn_string.h"
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif /* __cplusplus */
39
40 /**
41  *
42  *
43  * @defgroup base64 Base64 encoding/decoding functions
44  *
45  * @{
46  */
47
48 /** Return a writable generic stream which will encode binary data in
49  * base64 format and write the encoded data to @a output.  If @a break_lines
50  * is true, newlines will be inserted periodically; otherwise the output
51  * stream will only consist of base64 encoding characters. Be sure to close
52  * the stream when done writing in order to squeeze out the last bit of
53  * encoded data.  The stream is allocated in @a pool.
54  *
55  * @since New in 1.10.
56  */
57 svn_stream_t *
58 svn_base64_encode2(svn_stream_t *output,
59                    svn_boolean_t break_lines,
60                    apr_pool_t *pool);
61
62 /**
63  * Same as svn_base64_encode2, but with @a break_lines always TRUE.
64  *
65  * @deprecated Provided for backward compatibility with the 1.9 API.
66  */
67 SVN_DEPRECATED
68 svn_stream_t *
69 svn_base64_encode(svn_stream_t *output,
70                   apr_pool_t *pool);
71
72 /** Return a writable generic stream which will decode base64-encoded
73  * data and write the decoded data to @a output.  The stream is allocated
74  * in @a pool.
75  */
76 svn_stream_t *
77 svn_base64_decode(svn_stream_t *output,
78                   apr_pool_t *pool);
79
80
81 /** Encode an @c svn_stringbuf_t into base64.
82  *
83  * A simple interface for encoding base64 data assuming we have all of
84  * it present at once.  If @a break_lines is true, newlines will be
85  * inserted periodically; otherwise the string will only consist of
86  * base64 encoding characters.  The returned string will be allocated
87  * from @a pool.
88  *
89  * @since New in 1.6.
90  */
91 const svn_string_t *
92 svn_base64_encode_string2(const svn_string_t *str,
93                           svn_boolean_t break_lines,
94                           apr_pool_t *pool);
95
96 /**
97  * Same as svn_base64_encode_string2, but with @a break_lines always
98  * TRUE.
99  *
100  * @deprecated Provided for backward compatibility with the 1.5 API.
101  */
102 SVN_DEPRECATED
103 const svn_string_t *
104 svn_base64_encode_string(const svn_string_t *str,
105                          apr_pool_t *pool);
106
107 /** Decode an @c svn_stringbuf_t from base64.
108  *
109  * A simple interface for decoding base64 data assuming we have all of
110  * it present at once.  The returned string will be allocated from @c
111  * pool.
112  *
113  */
114 const svn_string_t *
115 svn_base64_decode_string(const svn_string_t *str,
116                          apr_pool_t *pool);
117
118
119 /** Return a base64-encoded checksum for finalized @a digest.
120  *
121  * @a digest contains @c APR_MD5_DIGESTSIZE bytes of finalized data.
122  * Allocate the returned checksum in @a pool.
123  *
124  * @deprecated Provided for backward compatibility with the 1.5 API.
125  */
126 SVN_DEPRECATED
127 svn_stringbuf_t *
128 svn_base64_from_md5(unsigned char digest[],
129                     apr_pool_t *pool);
130
131
132 /** @} end group: Base64 encoding/decoding functions */
133
134 #ifdef __cplusplus
135 }
136 #endif /* __cplusplus */
137
138 #endif /* SVN_BASE64_H */