TortoiseGitMerge: Use shipped zlib1.dll instead of own copy
[TortoiseGit.git] / src / TortoiseMerge / libsvn_diff / svn_base64.h
blob64ed5306237f7171706af4f3e59d137c35afa8e8
1 /**
2 * @copyright
3 * ====================================================================
4 * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved.
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
12 * This software consists of voluntary contributions made by many
13 * individuals. For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
16 * @endcopyright
18 * @file svn_base64.h
19 * @brief Base64 encoding and decoding functions
22 #ifndef SVN_BASE64_H
23 #define SVN_BASE64_H
25 #include <apr_pools.h>
27 #include "svn_types.h"
28 #include "svn_io.h" /* for svn_stream_t */
29 #include "svn_string.h"
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
35 /**
38 * @defgroup base64 Base64 encoding/decoding functions
40 * @{
43 /** Return a writable generic stream which will encode binary data in
44 * base64 format and write the encoded data to @c output. Be sure to
45 * close the stream when done writing in order to squeeze out the last
46 * bit of encoded data. The stream is allocated in @c pool.
48 svn_stream_t *
49 svn_base64_encode(svn_stream_t *output,
50 apr_pool_t *pool);
52 /** Return a writable generic stream which will decode base64-encoded
53 * data and write the decoded data to @c output. The stream is allocated
54 * in @c pool.
56 svn_stream_t *
57 svn_base64_decode(svn_stream_t *output,
58 apr_pool_t *pool);
61 /** Encode an @c svn_stringbuf_t into base64.
63 * A simple interface for encoding base64 data assuming we have all of
64 * it present at once. If @a break_lines is true, newlines will be
65 * inserted periodically; otherwise the string will only consist of
66 * base64 encoding characters. The returned string will be allocated
67 * from @c pool.
69 * @since New in 1.6.
71 const svn_string_t *
72 svn_base64_encode_string2(const svn_string_t *str,
73 svn_boolean_t break_lines,
74 apr_pool_t *pool);
76 /**
77 * Same as svn_base64_encode_string2, but with @a break_lines always
78 * TRUE.
80 * @deprecated Provided for backward compatibility with the 1.5 API.
82 SVN_DEPRECATED
83 const svn_string_t *
84 svn_base64_encode_string(const svn_string_t *str,
85 apr_pool_t *pool);
87 /** Decode an @c svn_stringbuf_t from base64.
89 * A simple interface for decoding base64 data assuming we have all of
90 * it present at once. The returned string will be allocated from @c
91 * pool.
94 const svn_string_t *
95 svn_base64_decode_string(const svn_string_t *str,
96 apr_pool_t *pool);
99 /** Return a base64-encoded checksum for finalized @c digest.
101 * @c digest contains @c APR_MD5_DIGESTSIZE bytes of finalized data.
102 * Allocate the returned checksum in @c pool.
104 * @deprecated Provided for backward compatibility with the 1.5 API.
106 SVN_DEPRECATED
107 svn_stringbuf_t *
108 svn_base64_from_md5(unsigned char digest[],
109 apr_pool_t *pool);
112 /** @} end group: Base64 encoding/decoding functions */
114 #ifdef __cplusplus
116 #endif /* __cplusplus */
118 #endif /* SVN_BASE64_H */