~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to srclib/apr-util/include/apr_base64.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
 
2
 * applicable.
 
3
 *
 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
 
5
 * you may not use this file except in compliance with the License.
 
6
 * You may obtain a copy of the License at
 
7
 *
 
8
 *     http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 * Unless required by applicable law or agreed to in writing, software
 
11
 * distributed under the License is distributed on an "AS IS" BASIS,
 
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
 
15
 * The apr_vsnprintf/apr_snprintf functions are based on, and used with the
 
16
 * permission of, the  SIO stdio-replacement strx_* functions by Panos
 
17
 * Tsirigotis <panos@alumni.cs.colorado.edu> for xinetd.
 
18
 */
 
19
 
 
20
/**
 
21
 * @file apr_base64.h
 
22
 * @brief APR-UTIL Base64 Encoding
 
23
 */
 
24
#ifndef APR_BASE64_H
 
25
#define APR_BASE64_H
 
26
 
 
27
#include "apu.h"
 
28
#include "apr_general.h"
 
29
 
 
30
#ifdef __cplusplus
 
31
extern "C" {
 
32
#endif
 
33
 
 
34
/**
 
35
 * @defgroup APR_Util_Base64 Base64 Encoding
 
36
 * @ingroup APR_Util
 
37
 * @{
 
38
 */
 
39
 
 
40
/* Simple BASE64 encode/decode functions.
 
41
 * 
 
42
 * As we might encode binary strings, hence we require the length of
 
43
 * the incoming plain source. And return the length of what we decoded.
 
44
 *
 
45
 * The decoding function takes any non valid char (i.e. whitespace, \0
 
46
 * or anything non A-Z,0-9 etc as terminal.
 
47
 * 
 
48
 * plain strings/binary sequences are not assumed '\0' terminated. Encoded
 
49
 * strings are neither. But probably should.
 
50
 *
 
51
 */
 
52
 
 
53
/**
 
54
 * Given the length of an un-encrypted string, get the length of the 
 
55
 * encrypted string.
 
56
 * @param len the length of an unencrypted string.
 
57
 * @return the length of the string after it is encrypted
 
58
 */ 
 
59
APU_DECLARE(int) apr_base64_encode_len(int len);
 
60
 
 
61
/**
 
62
 * Encode a text string using base64encoding.
 
63
 * @param coded_dst The destination string for the encoded string.
 
64
 * @param plain_src The original string in plain text
 
65
 * @param len_plain_src The length of the plain text string
 
66
 * @return the length of the encoded string
 
67
 */ 
 
68
APU_DECLARE(int) apr_base64_encode(char * coded_dst, const char *plain_src, 
 
69
                                 int len_plain_src);
 
70
 
 
71
/**
 
72
 * Encode an EBCDIC string using base64encoding.
 
73
 * @param coded_dst The destination string for the encoded string.
 
74
 * @param plain_src The original string in plain text
 
75
 * @param len_plain_src The length of the plain text string
 
76
 * @return the length of the encoded string
 
77
 */ 
 
78
APU_DECLARE(int) apr_base64_encode_binary(char * coded_dst, 
 
79
                                        const unsigned char *plain_src,
 
80
                                        int len_plain_src);
 
81
 
 
82
/**
 
83
 * Determine the length of a plain text string given the encoded version
 
84
 * @param coded_src The encoded string
 
85
 * @return the length of the plain text string
 
86
 */ 
 
87
APU_DECLARE(int) apr_base64_decode_len(const char * coded_src);
 
88
 
 
89
/**
 
90
 * Decode a string to plain text
 
91
 * @param plain_dst The destination string for the plain text
 
92
 * @param coded_src The encoded string 
 
93
 * @return the length of the plain text string
 
94
 */ 
 
95
APU_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src);
 
96
 
 
97
/**
 
98
 * Decode an EBCDIC string to plain text
 
99
 * @param plain_dst The destination string for the plain text
 
100
 * @param coded_src The encoded string 
 
101
 * @return the length of the plain text string
 
102
 */ 
 
103
APU_DECLARE(int) apr_base64_decode_binary(unsigned char * plain_dst, 
 
104
                                        const char *coded_src);
 
105
 
 
106
/** @} */
 
107
#ifdef __cplusplus
 
108
}
 
109
#endif
 
110
 
 
111
#endif  /* !APR_BASE64_H */